Loading rico1 and rico3 files
authorMatt Brown <dowdybrown@yahoo.com>
Wed, 31 Mar 2010 02:59:32 +0000 (02:59 +0000)
committerMatt Brown <dowdybrown@yahoo.com>
Wed, 31 Mar 2010 02:59:32 +0000 (02:59 +0000)
git-svn-id: svn://svn.code.sf.net/p/openrico/code/trunk/rico3@67 53df2df2-7ab5-4331-af62-ea79255fa4e2

329 files changed:
LICENSE [new file with mode: 0644]
asp_logo.jpg [new file with mode: 0644]
documentation.jpg [new file with mode: 0644]
documentation/GridStyles.html [new file with mode: 0644]
documentation/GridStyles_ja.html [new file with mode: 0644]
documentation/InstallNotes.html [new file with mode: 0644]
documentation/InstallNotes_ja.html [new file with mode: 0644]
documentation/LiveGrid.html [new file with mode: 0644]
documentation/LiveGridAjax.html [new file with mode: 0644]
documentation/LiveGridAjax_ja.html [new file with mode: 0644]
documentation/LiveGridForms.html [new file with mode: 0644]
documentation/LiveGridForms_ja.html [new file with mode: 0644]
documentation/LiveGrid_ja.html [new file with mode: 0644]
documentation/SimpleGrid.html [new file with mode: 0644]
documentation/SimpleGrid_ja.html [new file with mode: 0644]
documentation/browsers.html [new file with mode: 0644]
documentation/browsers_ja.html [new file with mode: 0644]
documentation/grids.html [new file with mode: 0644]
documentation/grids_ja.html [new file with mode: 0644]
documentation/images/asp-php-structure1.jpg [new file with mode: 0644]
documentation/images/asp-php-structure2.jpg [new file with mode: 0644]
documentation/images/checkmark.gif [new file with mode: 0644]
documentation/images/chinese.jpg [new file with mode: 0644]
documentation/images/japanese.gif [new file with mode: 0644]
documentation/images/ricologo.gif [new file with mode: 0644]
documentation/index.html [new file with mode: 0644]
documentation/menu.html [new file with mode: 0644]
documentation/ricoDocs.css [new file with mode: 0644]
documentation/ricologo.gif [new file with mode: 0644]
documentation/translations.html [new file with mode: 0644]
documentation/translations_ja.html [new file with mode: 0644]
documentation/welcome.html [new file with mode: 0644]
documentation/welcome_ja.html [new file with mode: 0644]
documentation/welcome_zh.html [new file with mode: 0644]
dotnet_logo.gif [new file with mode: 0644]
examples/ChangesSinceRico2.txt [new file with mode: 0644]
examples/asp/CustTree.asp [new file with mode: 0644]
examples/asp/LoadRicoClient.asp [new file with mode: 0644]
examples/asp/RicoDbViewer.asp [new file with mode: 0644]
examples/asp/RicoDbViewerDetail.asp [new file with mode: 0644]
examples/asp/ShipperEdit.asp [new file with mode: 0644]
examples/asp/dbConnect.asp [new file with mode: 0644]
examples/asp/ex1.asp [new file with mode: 0644]
examples/asp/ex2editfilter.asp [new file with mode: 0644]
examples/asp/ex2editfilterKW.asp [new file with mode: 0644]
examples/asp/ex2json.asp [new file with mode: 0644]
examples/asp/ex2nosession.asp [new file with mode: 0644]
examples/asp/ex2xml.asp [new file with mode: 0644]
examples/asp/index.html [new file with mode: 0644]
examples/asp/menu.html [new file with mode: 0644]
examples/asp/ricoQuery.asp [new file with mode: 0644]
examples/asp/simplegrid.asp [new file with mode: 0644]
examples/asp/tree1.asp [new file with mode: 0644]
examples/asp/widgets.asp [new file with mode: 0644]
examples/browserdetect.html [new file with mode: 0644]
examples/data/ORA-EXPDAT.DMP [new file with mode: 0644]
examples/data/Readme.txt [new file with mode: 0644]
examples/data/mysql-northwind-dblquote.sql [new file with mode: 0644]
examples/data/mysql-northwind.sql [new file with mode: 0644]
examples/data/northwind.mdb [new file with mode: 0644]
examples/demo.css [new file with mode: 0644]
examples/dotnet/CustTree.aspx [new file with mode: 0644]
examples/dotnet/LoadRicoClient.ascx [new file with mode: 0644]
examples/dotnet/RicoDbViewer.aspx [new file with mode: 0644]
examples/dotnet/RicoDbViewerDetail.aspx [new file with mode: 0644]
examples/dotnet/ShipperEdit.aspx [new file with mode: 0644]
examples/dotnet/dbConnect.ascx [new file with mode: 0644]
examples/dotnet/employees.aspx [new file with mode: 0644]
examples/dotnet/ex1.aspx [new file with mode: 0644]
examples/dotnet/ex2editfilter.aspx [new file with mode: 0644]
examples/dotnet/ex2json.aspx [new file with mode: 0644]
examples/dotnet/ex2nosession.aspx [new file with mode: 0644]
examples/dotnet/ex2xml.aspx [new file with mode: 0644]
examples/dotnet/flickrPhotos.ascx [new file with mode: 0644]
examples/dotnet/flickrPhotos.aspx [new file with mode: 0644]
examples/dotnet/index.html [new file with mode: 0644]
examples/dotnet/menu.html [new file with mode: 0644]
examples/dotnet/photos.aspx [new file with mode: 0644]
examples/dotnet/ricoQuery.aspx [new file with mode: 0644]
examples/dotnet/simplegrid.aspx [new file with mode: 0644]
examples/dotnet/tree1.aspx [new file with mode: 0644]
examples/dotnet/widgets.aspx [new file with mode: 0644]
examples/html/LoadRicoClient.js [new file with mode: 0644]
examples/html/accordion-grid.html [new file with mode: 0644]
examples/html/accordion0.html [new file with mode: 0644]
examples/html/accordion3.html [new file with mode: 0644]
examples/html/accordion4.html [new file with mode: 0644]
examples/html/animate-rico.html [new file with mode: 0644]
examples/html/animation-effects.html [new file with mode: 0644]
examples/html/classTest.html [new file with mode: 0644]
examples/html/controls.html [new file with mode: 0644]
examples/html/corners.html [new file with mode: 0644]
examples/html/corners2.html [new file with mode: 0644]
examples/html/cssSelect.html [new file with mode: 0644]
examples/html/down_arrow.png [new file with mode: 0644]
examples/html/drag-and-drop-dyn.html [new file with mode: 0644]
examples/html/drag-and-drop-grid.html [new file with mode: 0644]
examples/html/drag-and-drop-log.html [new file with mode: 0644]
examples/html/drag-and-drop-simple.html [new file with mode: 0644]
examples/html/drag-and-drop-zones.html [new file with mode: 0644]
examples/html/events.html [new file with mode: 0644]
examples/html/gradient.jpg [new file with mode: 0644]
examples/html/gridFromJSarray.html [new file with mode: 0644]
examples/html/gridFromTable.html [new file with mode: 0644]
examples/html/gridFromTableResize.html [new file with mode: 0644]
examples/html/gridJSbuffer.html [new file with mode: 0644]
examples/html/gridJSbuffer2.html [new file with mode: 0644]
examples/html/index.html [new file with mode: 0644]
examples/html/menu.html [new file with mode: 0644]
examples/html/panel1.html [new file with mode: 0644]
examples/html/panel2.html [new file with mode: 0644]
examples/html/popups.html [new file with mode: 0644]
examples/html/pull-down.html [new file with mode: 0644]
examples/html/shadow.html [new file with mode: 0644]
examples/images/themeroller/theme_30_black_matte.png [new file with mode: 0644]
examples/images/themeroller/theme_30_black_tie.png [new file with mode: 0644]
examples/images/themeroller/theme_30_blitzer.png [new file with mode: 0644]
examples/images/themeroller/theme_30_cupertino.png [new file with mode: 0644]
examples/images/themeroller/theme_30_dark_hive.png [new file with mode: 0644]
examples/images/themeroller/theme_30_dot_luv.png [new file with mode: 0644]
examples/images/themeroller/theme_30_eggplant.png [new file with mode: 0644]
examples/images/themeroller/theme_30_excite_bike.png [new file with mode: 0644]
examples/images/themeroller/theme_30_flick.png [new file with mode: 0644]
examples/images/themeroller/theme_30_hot_sneaks.png [new file with mode: 0644]
examples/images/themeroller/theme_30_humanity.png [new file with mode: 0644]
examples/images/themeroller/theme_30_le_frog.png [new file with mode: 0644]
examples/images/themeroller/theme_30_mint_choco.png [new file with mode: 0644]
examples/images/themeroller/theme_30_overcast.png [new file with mode: 0644]
examples/images/themeroller/theme_30_pepper_grinder.png [new file with mode: 0644]
examples/images/themeroller/theme_30_smoothness.png [new file with mode: 0644]
examples/images/themeroller/theme_30_south_street.png [new file with mode: 0644]
examples/images/themeroller/theme_30_start_menu.png [new file with mode: 0644]
examples/images/themeroller/theme_30_sunny.png [new file with mode: 0644]
examples/images/themeroller/theme_30_swanky_purse.png [new file with mode: 0644]
examples/images/themeroller/theme_30_trontastic.png [new file with mode: 0644]
examples/images/themeroller/theme_30_ui_dark.png [new file with mode: 0644]
examples/images/themeroller/theme_30_ui_light.png [new file with mode: 0644]
examples/images/themeroller/theme_30_windoze.png [new file with mode: 0644]
examples/menu.css [new file with mode: 0644]
examples/menu.js [new file with mode: 0644]
examples/php/CustTree.php [new file with mode: 0644]
examples/php/LoadRicoClient.php [new file with mode: 0644]
examples/php/RicoDbViewer.php [new file with mode: 0644]
examples/php/RicoDbViewerDetail.php [new file with mode: 0644]
examples/php/ShipperEdit.php [new file with mode: 0644]
examples/php/dbConnect.php [new file with mode: 0644]
examples/php/ex1.php [new file with mode: 0644]
examples/php/ex2editfilter.php [new file with mode: 0644]
examples/php/ex2json.php [new file with mode: 0644]
examples/php/ex2nosession.php [new file with mode: 0644]
examples/php/ex2xml.php [new file with mode: 0644]
examples/php/flickrPhotos.php [new file with mode: 0644]
examples/php/index.html [new file with mode: 0644]
examples/php/menu.html [new file with mode: 0644]
examples/php/photos.php [new file with mode: 0644]
examples/php/ricoQuery.php [new file with mode: 0644]
examples/php/simplegrid.php [new file with mode: 0644]
examples/php/tree1.php [new file with mode: 0644]
examples/php/widgets.php [new file with mode: 0644]
examples/ricologo.gif [new file with mode: 0644]
examples/welcome.html [new file with mode: 0644]
html_blk.gif [new file with mode: 0644]
index.html [new file with mode: 0644]
php_logo.jpg [new file with mode: 0644]
plugins/asp/SimpleGrid.vbs [new file with mode: 0644]
plugins/asp/dbClass3.vbs [new file with mode: 0644]
plugins/asp/excel.asp [new file with mode: 0644]
plugins/asp/ricoLiveGridForms.vbs [new file with mode: 0644]
plugins/asp/ricoResponse.vbs [new file with mode: 0644]
plugins/dotnet/AltTable.ascx [new file with mode: 0644]
plugins/dotnet/AltTable.ascx.vb [new file with mode: 0644]
plugins/dotnet/GridColumn.ascx [new file with mode: 0644]
plugins/dotnet/GridColumn.ascx.vb [new file with mode: 0644]
plugins/dotnet/GridPanel.ascx [new file with mode: 0644]
plugins/dotnet/GridPanel.ascx.vb [new file with mode: 0644]
plugins/dotnet/LiveGrid.ascx [new file with mode: 0644]
plugins/dotnet/LiveGrid.ascx.vb [new file with mode: 0644]
plugins/dotnet/SimpleGrid.ascx [new file with mode: 0644]
plugins/dotnet/SimpleGrid.ascx.vb [new file with mode: 0644]
plugins/dotnet/ricoResponse.ascx [new file with mode: 0644]
plugins/dotnet/sqlCompatibilty.ascx [new file with mode: 0644]
plugins/dotnet/sqlCompatibilty.ascx.vb [new file with mode: 0644]
plugins/dotnet/sqlParse.ascx [new file with mode: 0644]
plugins/dotnet/sqlParse.ascx.vb [new file with mode: 0644]
plugins/php/SimpleGrid.php [new file with mode: 0644]
plugins/php/class.xml.parser.php [new file with mode: 0644]
plugins/php/dbClass3.php [new file with mode: 0644]
plugins/php/excel.php [new file with mode: 0644]
plugins/php/ricoLiveGridForms.php [new file with mode: 0644]
plugins/php/ricoResponse.php [new file with mode: 0644]
readme.txt [new file with mode: 0644]
ricoClient/css/coffee-with-milk.css [new file with mode: 0644]
ricoClient/css/grayedout.css [new file with mode: 0644]
ricoClient/css/greenHdg.css [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_flat_0_aaaaaa_40x100.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_flat_75_ffffff_40x100.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_glass_55_fbf9ee_1x400.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_glass_65_ffffff_1x400.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_glass_75_dadada_1x400.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_glass_75_e6e6e6_1x400.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_glass_95_fef1ec_1x400.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-bg_highlight-soft_75_cccccc_1x100.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-icons_222222_256x240.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-icons_2e83ff_256x240.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-icons_454545_256x240.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-icons_888888_256x240.png [new file with mode: 0644]
ricoClient/css/jquery-base/images/ui-icons_cd0a0a_256x240.png [new file with mode: 0644]
ricoClient/css/jquery-base/ui.accordion.css [new file with mode: 0644]
ricoClient/css/jquery-base/ui.base.css [new file with mode: 0644]
ricoClient/css/jquery-base/ui.core.css [new file with mode: 0644]
ricoClient/css/jquery-base/ui.datepicker.css [new file with mode: 0644]
ricoClient/css/jquery-base/ui.dialog.css [new file with mode: 0644]
ricoClient/css/jquery-base/ui.tabs.css [new file with mode: 0644]
ricoClient/css/rico.css [new file with mode: 0644]
ricoClient/css/seaglass.css [new file with mode: 0644]
ricoClient/css/striping/black-tie.css [new file with mode: 0644]
ricoClient/css/striping/blitzer.css [new file with mode: 0644]
ricoClient/css/striping/coffee-with-milk.css [new file with mode: 0644]
ricoClient/css/striping/cupertino.css [new file with mode: 0644]
ricoClient/css/striping/dark-hive.css [new file with mode: 0644]
ricoClient/css/striping/dot-luv.css [new file with mode: 0644]
ricoClient/css/striping/eggplant.css [new file with mode: 0644]
ricoClient/css/striping/excite-bike.css [new file with mode: 0644]
ricoClient/css/striping/flick.css [new file with mode: 0644]
ricoClient/css/striping/grayedout.css [new file with mode: 0644]
ricoClient/css/striping/greenHdg.css [new file with mode: 0644]
ricoClient/css/striping/hot-sneaks.css [new file with mode: 0644]
ricoClient/css/striping/humanity.css [new file with mode: 0644]
ricoClient/css/striping/le-frog.css [new file with mode: 0644]
ricoClient/css/striping/mint-choc.css [new file with mode: 0644]
ricoClient/css/striping/overcast.css [new file with mode: 0644]
ricoClient/css/striping/pepper-grinder.css [new file with mode: 0644]
ricoClient/css/striping/redmond.css [new file with mode: 0644]
ricoClient/css/striping/seaglass.css [new file with mode: 0644]
ricoClient/css/striping/smoothness.css [new file with mode: 0644]
ricoClient/css/striping/south-street.css [new file with mode: 0644]
ricoClient/css/striping/start.css [new file with mode: 0644]
ricoClient/css/striping/sunny.css [new file with mode: 0644]
ricoClient/css/striping/ui-darkness.css [new file with mode: 0644]
ricoClient/css/striping/ui-lightness.css [new file with mode: 0644]
ricoClient/css/striping/vader.css [new file with mode: 0644]
ricoClient/css/striping/warmfall.css [new file with mode: 0644]
ricoClient/css/warmfall.css [new file with mode: 0644]
ricoClient/images/aline.gif [new file with mode: 0644]
ricoClient/images/calarrow.png [new file with mode: 0644]
ricoClient/images/calendaricon.gif [new file with mode: 0644]
ricoClient/images/checkmark.gif [new file with mode: 0644]
ricoClient/images/close_b.gif [new file with mode: 0644]
ricoClient/images/close_w.gif [new file with mode: 0644]
ricoClient/images/delete.gif [new file with mode: 0644]
ricoClient/images/delete_w.gif [new file with mode: 0644]
ricoClient/images/divider.gif [new file with mode: 0644]
ricoClient/images/doc.gif [new file with mode: 0644]
ricoClient/images/dotbutton.gif [new file with mode: 0644]
ricoClient/images/drop.gif [new file with mode: 0644]
ricoClient/images/filtercol.gif [new file with mode: 0644]
ricoClient/images/folderclosed.gif [new file with mode: 0644]
ricoClient/images/folderopen.gif [new file with mode: 0644]
ricoClient/images/grayedout.gif [new file with mode: 0644]
ricoClient/images/info_icon.gif [new file with mode: 0644]
ricoClient/images/left_b.gif [new file with mode: 0644]
ricoClient/images/left_w.gif [new file with mode: 0644]
ricoClient/images/link.gif [new file with mode: 0644]
ricoClient/images/m.gif [new file with mode: 0644]
ricoClient/images/node.gif [new file with mode: 0644]
ricoClient/images/nodeblank.gif [new file with mode: 0644]
ricoClient/images/nodelast.gif [new file with mode: 0644]
ricoClient/images/nodeline.gif [new file with mode: 0644]
ricoClient/images/nodem.gif [new file with mode: 0644]
ricoClient/images/nodemlast.gif [new file with mode: 0644]
ricoClient/images/nodep.gif [new file with mode: 0644]
ricoClient/images/nodeplast.gif [new file with mode: 0644]
ricoClient/images/p.gif [new file with mode: 0644]
ricoClient/images/removeFilter.gif [new file with mode: 0644]
ricoClient/images/resize.gif [new file with mode: 0644]
ricoClient/images/right_b.gif [new file with mode: 0644]
ricoClient/images/right_w.gif [new file with mode: 0644]
ricoClient/images/shadow_l.png [new file with mode: 0644]
ricoClient/images/shadow_ll.png [new file with mode: 0644]
ricoClient/images/shadow_lr.png [new file with mode: 0644]
ricoClient/images/shadow_r.png [new file with mode: 0644]
ricoClient/images/sort_asc.gif [new file with mode: 0644]
ricoClient/images/sort_desc.gif [new file with mode: 0644]
ricoClient/images/tableFilterCollapse.gif [new file with mode: 0644]
ricoClient/images/tableFilterExpand.gif [new file with mode: 0644]
ricoClient/js/baselibs/dojo.debug.js [new file with mode: 0644]
ricoClient/js/baselibs/dojo.js [new file with mode: 0644]
ricoClient/js/baselibs/ext-core.js [new file with mode: 0644]
ricoClient/js/baselibs/glow.core.debug.js [new file with mode: 0644]
ricoClient/js/baselibs/glow.core.js [new file with mode: 0644]
ricoClient/js/baselibs/jquery-1.3.js [new file with mode: 0644]
ricoClient/js/baselibs/jquery-1.4.js [new file with mode: 0644]
ricoClient/js/baselibs/jquery.js [new file with mode: 0644]
ricoClient/js/baselibs/mootools.js [new file with mode: 0644]
ricoClient/js/baselibs/prototype.js [new file with mode: 0644]
ricoClient/js/export-owc.html [new file with mode: 0644]
ricoClient/js/export-plain.html [new file with mode: 0644]
ricoClient/js/rico.js [new file with mode: 0644]
ricoClient/js/rico2Dojo.js [new file with mode: 0644]
ricoClient/js/rico2Ext.js [new file with mode: 0644]
ricoClient/js/rico2Glow.js [new file with mode: 0644]
ricoClient/js/rico2Moo.js [new file with mode: 0644]
ricoClient/js/rico2Proto.js [new file with mode: 0644]
ricoClient/js/rico2jQuery.js [new file with mode: 0644]
ricoClient/js/ricoCalendar.js [new file with mode: 0644]
ricoClient/js/ricoColorPicker.js [new file with mode: 0644]
ricoClient/js/ricoDragDrop.js [new file with mode: 0644]
ricoClient/js/ricoGridCommon.js [new file with mode: 0644]
ricoClient/js/ricoLiveGrid.js [new file with mode: 0644]
ricoClient/js/ricoLiveGridAjax.js [new file with mode: 0644]
ricoClient/js/ricoLiveGridControls.js [new file with mode: 0644]
ricoClient/js/ricoLiveGridForms.js [new file with mode: 0644]
ricoClient/js/ricoLiveGridMenu.js [new file with mode: 0644]
ricoClient/js/ricoSearch.js [new file with mode: 0644]
ricoClient/js/ricoSimpleGrid.js [new file with mode: 0644]
ricoClient/js/ricoThemeroller.js [new file with mode: 0644]
ricoClient/js/ricoTree.js [new file with mode: 0644]
ricoClient/js/ricoUI.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_de.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_en.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_es.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_fr.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_it.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_ja.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_ko.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_pt.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_ru.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_uk.js [new file with mode: 0644]
ricoClient/js/translations/ricoLocale_zh.js [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/asp_logo.jpg b/asp_logo.jpg
new file mode 100644 (file)
index 0000000..f472359
Binary files /dev/null and b/asp_logo.jpg differ
diff --git a/documentation.jpg b/documentation.jpg
new file mode 100644 (file)
index 0000000..9cc54df
Binary files /dev/null and b/documentation.jpg differ
diff --git a/documentation/GridStyles.html b/documentation/GridStyles.html
new file mode 100644 (file)
index 0000000..1afb233
--- /dev/null
@@ -0,0 +1,129 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico Grid Styles</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>\r
+\r
+<body>\r
+<h1>Grid Styles</h1>\r
+\r
+<p><a href='GridStyles_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='GridStyles_ja.html'>View this page in Japanese</a></p>\r
+\r
+<p>It is very easy to customize the style of Rico LiveGrids and SimpleGrids.\r
+In fact, LiveGrids and SimpleGrids share many of the same class names\r
+and DOM structures, so styles that apply to one can be applied to the other.\r
+\r
+<h2>Pre-configured Styles</h2>\r
+\r
+<p>Rico comes with a variety of stylesheets for LiveGrid.\r
+You can see how each of them looks by selecting the\r
+first LiveGrid example in the PHP, ASP, .net, or Perl section.\r
+At the top of the example page, try each of the "style" selections\r
+to find one you like. The actual stylesheets are located\r
+in the src/css directory.\r
+\r
+<p>Here are screen shots of each style, taken with "highlight" set to "Cursor Row".\r
+\r
+<p><strong>greenHdg.css</strong>\r
+<br><img src='images/gridsamples/greenHdg.png'>\r
+\r
+<p><strong>tanChisel.css</strong>\r
+<br><img src='images/gridsamples/tanChisel.png'>\r
+\r
+<p><strong>grayedout.css</strong>\r
+<br><img src='images/gridsamples/grayedout.png'>\r
+\r
+<p><strong>coffee-with-milk.css</strong>\r
+<br><img src='images/gridsamples/coffee-with-milk.png'>\r
+\r
+<p><strong>warmfall.css</strong>\r
+<br><img src='images/gridsamples/warmfall.png'>\r
+\r
+<p><strong>iegradient.css</strong> <em>(only works in Internet Explorer)</em>\r
+<br><img src='images/gridsamples/iegradient.png'>\r
+\r
+<p>Several of these styles are adapted from the\r
+<a href="http://icant.co.uk/csstablegallery/index.php">CSS Table Gallery</a>.\r
+The gallery can serve as an inspiration for styling LiveGrids, however,\r
+the CSS used in the gallery examples cannot be applied directly to a LiveGrid.\r
+\r
+<h2>Customizing a Style</h2>\r
+\r
+<p>Even with the variety of pre-configured styles available,\r
+inevitably some style declarations will need to be overridden\r
+to display your data the way you want it. What follows are some\r
+common situations that require a style to be overridden and \r
+the suggested CSS styling to solve the issue.\r
+\r
+<h3>Row height of column headings</h3>\r
+\r
+<p>When column headings get too long, you typically want to allow\r
+the words to wrap and to display the heading as 2 or 3 lines of text.\r
+\r
+<p>Shows headings with 2 lines of text:\r
+<pre>\r
+.ricoLG_top div.ricoLG_cell {\r
+  height:2.5em;\r
+}\r
+</pre>\r
+\r
+<p>Shows headings with 3 lines of text:\r
+<pre>\r
+.ricoLG_top div.ricoLG_cell {\r
+  height:3.5em;\r
+}\r
+</pre>\r
+\r
+<h3>Row height in grid body</h3>\r
+\r
+<p>Similarly you might need each row in the grid body\r
+to be taller in order to display long content.\r
+\r
+<p>Show body rows with 2 lines of text:\r
+<pre>\r
+.ricoLG_bottom div.ricoLG_cell {\r
+  height:2.5em;\r
+}\r
+</pre>\r
+\r
+<h3>Word Wrap</h3>\r
+\r
+<p>By default, word-wrapping is enabled in each grid cell.\r
+But sometimes it makes sense to turn word wrapping off.\r
+\r
+<p>Turn word-wrap off in headings and body:\r
+<pre>\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</pre>\r
+\r
+<p>Turn word-wrap off in body only:\r
+<pre>\r
+.ricoLG_bottom div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</pre>\r
+\r
+<h3>Referencing an entire grid</h3>\r
+\r
+<p>Sometimes you want to apply a style to an entire grid.\r
+Each grid is enclosed in a &lt;div&gt; with a class of\r
+"ricoLG_outerDiv" and an id equal to the id you passed\r
+to the LiveGrid constructor appended with "_outerDiv"\r
+(i.e. the id of the grid in the first example is "ex1_outerDiv").\r
+Thus, you can use ".ricoLG_outerDiv" as a selector when applying\r
+a style to all grids on a page, or "#ex1_outerDiv" when applying\r
+a style to only the ex1 grid.\r
+\r
+<p>Set the grid's background color:\r
+<pre>\r
+div.ricoLG_outerDiv {\r
+  background-color:aqua;\r
+}\r
+</pre>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/GridStyles_ja.html b/documentation/GridStyles_ja.html
new file mode 100644 (file)
index 0000000..432f1f9
--- /dev/null
@@ -0,0 +1,124 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Rico Grid Styles</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>グリッドスタイル</h1>
+
+<p>Rico LiveGrid と SimpleGrid のスタイルをカスタマイズすることは、非常に簡単です。
+実際に、LiveGrid と SimpleGrid は同じクラス名と DOM 構造の多くを共有するので、
+一方にあてはまるスタイルは他方に適用されることが出来ます。
+
+<h2>あらかじめ構成されたスタイル</h2>
+
+<p>Rico には、LiveGrid のためのいろいろなスタイルシートが付属します。
+PHP、ASP、.net または Perl のセクションの、最初の LiveGrid の実例を選択する事によって、
+それらがどのように見えるのかを知る事が出来ます。
+実例のページのトップで、あなたの気に入るものを見つけるために、
+それぞれの "style" セレクションを試して下さい。
+実際のスタイルシートは src/css ディレクトリにあります。
+
+<p>ここに、"Cursor Row" が設定される "highlight" を持つ、それぞれのスタイルのスクリーンショットがあります。
+
+<p><strong>greenHdg.css</strong>
+<br><img src='images/gridsamples/greenHdg.png'>
+
+<p><strong>tanChisel.css</strong>
+<br><img src='images/gridsamples/tanChisel.png'>
+
+<p><strong>grayedout.css</strong>
+<br><img src='images/gridsamples/grayedout.png'>
+
+<p><strong>coffee-with-milk.css</strong>
+<br><img src='images/gridsamples/coffee-with-milk.png'>
+
+<p><strong>warmfall.css</strong>
+<br><img src='images/gridsamples/warmfall.png'>
+
+<p><strong>iegradient.css</strong> <em>(Internet Explorer のみで動作します)</em>
+<br><img src='images/gridsamples/iegradient.png'>
+
+<p>これらのスタイルのいくつかは、<a href="http://icant.co.uk/csstablegallery/index.php">CSS Table Gallery</a> 
+から変更して作成されました。
+そのギャラリーは LiveGrid のスタイルのためのインスピレーションとして用いる事が出来ますが、
+ギャラリーの CSS は直接 LiveGrid に適用する事は出来ません。
+
+<h2>スタイルのカスタマイズ</h2>
+
+<p>利用出来るあらかじめ構成されたスタイルの種類でさえ、
+望む方法でデータを表示するためには、
+必然的にいくつかのスタイル宣言がオーバーライドされる必要があります。
+以下は、スタイルがオーバーライドされる事を必要とするいくつかの一般的な状況と、
+その問題を解決するために提案される CSS スタイルです。
+
+<h3>列見出しの行の高さ</h3>
+
+<p>列見出しが長すぎる時、
+一般的に 2 または 3 行のテキストとして語句を送る事を認めたいです。
+
+<p>2 行のテキストによる見出しの表示。
+<pre>
+.ricoLG_top div.ricoLG_cell {
+  height:2.5em;
+}
+</pre>
+
+<p>3 行のテキストによる見出しの表示。
+<pre>
+.ricoLG_top div.ricoLG_cell {
+  height:3.5em;
+}
+</pre>
+
+<h3>グリッドボディの行の高さ</h3>
+
+<p>同様に、長い内容を表示するために、グリッドボディのそれぞれの行を、
+より高くする必要があるかも知れません。
+
+<p>2 行のテキストによるボディ行の表示。
+<pre>
+.ricoLG_bottom div.ricoLG_cell {
+  height:2.5em;
+}
+</pre>
+
+<h3>ワードラップ</h3>
+
+<p>デフォルトで、ワードラップはそれぞれのグリッドセルで利用可能にされます。
+しかし、時にはワードラップをオフにする事は意味をなします。
+
+<p>見出しとボディでワードラップをオフにする。
+<pre>
+div.ricoLG_cell {
+  white-space:nowrap;
+}
+</pre>
+
+<p>ボディのみでワードラップをオフにする。
+<pre>
+.ricoLG_bottom div.ricoLG_cell {
+  white-space:nowrap;
+}
+</pre>
+
+<h3>グリッド全体への参照</h3>
+
+<p>時々、あなたはスタイルをグリッド全体に適用したいかもしれません。
+それぞれのグリッドは "ricoLG_outerDiv" クラスと共に &lt;div&gt; で囲まれ、
+id は "_outerDiv" を追加された LiveGrid コンストラクタに渡した id と等しい id です。
+(すなわち、最初の実例のグリッド id は "ex1_outerDiv" です)。
+このように、ページ上ですべてのグリッドにスタイルを適用する時はセレクタとして ".ricoLG_outerDiv" を、
+ex1 グリッドにのみスタイルを適用する時は "#ex1_outerDiv" 利用する事が出来ます。
+
+<p>グリッドの背景色を設定する。
+<pre>
+div.ricoLG_outerDiv {
+  background-color:aqua;
+}
+</pre>
+
+</body>
+</html>
diff --git a/documentation/InstallNotes.html b/documentation/InstallNotes.html
new file mode 100644 (file)
index 0000000..f7475ea
--- /dev/null
@@ -0,0 +1,195 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Installing the Rico Examples</title>\r
+\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+<style type="text/css">\r
+tbody td {\r
+  font-size: 8pt;\r
+  vertical-align: top;\r
+}\r
+p.comment {\r
+  color: #888;\r
+}
+</style>\r
+</head>\r
+\r
+<body>\r
+<h1>Installing the Rico Examples</h1>\r
+\r
+<p><a href='InstallNotes_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='InstallNotes_ja.html'>View this page in Japanese</a></p>\r
+\r
+<p>Simply unzipping the Rico distribution file and copying the resulting\r
+directory structure into your web service's path should be sufficient to get\r
+most, if not all, of the examples running. If you have installed it into a\r
+directory called "rico" under the web service root, then you should be able\r
+to point your browser to the following address to access the examples:\r
+<blockquote><p>http://myserver.mydomain.com/rico/examples/</blockquote>\r
+<p>Or if you installed it on your personal computer, then access it as:\r
+<blockquote><p>http://localhost/rico/examples/</blockquote>\r
+\r
+<h2>File Locations</h2>\r
+\r
+<p>The Rico distribution is divided into 4 subdirectories:\r
+<ul>\r
+<li><strong>ricoClient</strong> - contains all client-side Rico files, including javascript, css, and image files.\r
+<li><strong>plugins</strong> - contains code that runs on the server to support LiveGrids and SimpleGrids.\r
+Plug-ins are currently provided for ASP, PHP, and .net. A Perl plug-in with limited functionality\r
+is also included.\r
+<li><strong>examples</strong> - contains sample code for ASP, PHP, .net, Perl, and HTML.\r
+The examples/data directory contains sample databases for the examples pertaining to LiveGrid.\r
+Databases are provided for MS Access, Oracle, and MySQL. Instructions for installing the data\r
+onto SQL Server are also included.\r
+<li><strong>documentation</strong> - documentation for using the Rico framework.\r
+</ul>\r
+</p>\r
+\r
+<h2>IIS Configuration</h2>\r
+\r
+<p>Rico can be served from any web server. This section describes some configuration issues specific to IIS on Windows.\r
+\r
+<p>On a server running IIS6 or higher, you will need to change the security settings for ASP\r
+in order to run the ASP examples. In particular, you will need to enable ASP files\r
+to reference include files in the parent directory. To do this, follow these steps:\r
+<ol>\r
+<li>Open ISS Manager\r
+<li>Right click on "Default Web Site" and select "Properties" from the context menu\r
+<li>Click on the "Home Directory" tab\r
+<li>Click the "Configuration" button\r
+<li>Click the "Options" tab of the new window\r
+<li>Check the box labelled "Enable parent paths"\r
+</ol>\r
+\r
+<p>In order for the sample scripts to read the Northwind Access database on a computer running IIS7 (e.g. Vista PCs), \r
+you will need to disable the loadUserProfile setting using this command:\r
+<pre>\r
+%windir%\system32\inetsrv\appcmd set config -section:applicationPools /[name='DefaultAppPool'].processModel.loadUserProfile:false\r
+</pre>\r
+The technique is described in \r
+<a href="http://blogs.iis.net/bills/archive/2006/10/18/loadUserProfile-and-IIS7-_2D00_-understanding-temporary-directory-failures.aspx">\r
+this article</a>. If you prefer not to change the loadUserProfile setting, the alternative is to load \r
+the Northwind database into SQL Server or MySQL and change connection settings in the relevant applib file as described below.\r
+\r
+<h2>LiveGrid Examples</h2>\r
+\r
+<p>Many of the LiveGrid examples fetch data from the Northwind sample database.\r
+In order to get these examples to work you will need to do 2 things:\r
+<ol>\r
+<li>Create the Northwind database\r
+<li>Modify the database connection settings which reside in the applib.* file\r
+</ol>\r
+\r
+<h2>Creating the Northwind database</h2>\r
+\r
+<p>The examples/data directory contains several different formats of the database needed \r
+to run most of the Rico LiveGrid ASP, .net, and PHP examples.\r
+\r
+<p>Data is provided in these formats:\r
+\r
+<ol>\r
+<li>northwind.mdb - this is the standard Northwind database provided by Microsoft, \r
+with the exception that the [Order Details] table has been renamed to Order_Details.\r
+If you will be accessing the ASP or .net examples, then no database configuration is\r
+necessary -- those examples will directly access this database using the Microsoft Jet driver.\r
+\r
+<li>mysql-northwind.sql - a backup file for MySQL (created using MySQL version 4.1)\r
+\r
+<li>mysql-northwind-dblquote.sql - same as above, except all instances of \' \r
+have been changed to '' (recommended for MySQL version 5 or above)\r
+\r
+<li>ORA-EXPDAT.DMP - an Oracle export file for the Northwind schema -- generated using the "exp" utility in \r
+<a href='http://www.oracle.com/technology/products/database/xe/index.html'>Oracle XE</a>. \r
+The password for this schema is "password".\r
+</ol>\r
+\r
+<p>A version for MS SQL Server 2000 &amp; 2005 is available as a free download from <a href='http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;displaylang=en'>msdn.microsoft.com</a>. \r
+After downloading it, you should follow <a href='http://msdn2.microsoft.com/en-us/library/ms227484.aspx'>Microsoft's intructions to install it</a>.\r
+Finally, you will need to either rename the [Order Details] table  to Order_Details, \r
+or create a view named Order_Details using the following SQL statement:\r
+<pre>\r
+\r
+create view Order_Details as select * from [Order Details]\r
+\r
+</pre>\r
+\r
+\r
+<h2>Database connection settings</h2>\r
+\r
+<p>Specific instructions depend upon your environment:\r
+<table border='1' cellspacing='0' cellpadding='3'>\r
+<thead><tr>\r
+<th>Database</th>\r
+<th>PHP</th>\r
+<th>ASP</th>\r
+<th>.net</th>\r
+<th>Perl</th>\r
+</tr></thead>\r
+<tbody>\r
+<tr><td>Connection settings located in:</td>\r
+<td>examples/php/applib.php</td>\r
+<td>examples/asp/applib.asp</td>\r
+<td>examples/dotnet/applib.ascx</td>\r
+<td>examples/perl/ricoXMLquery.pl</td>\r
+\r
+<tr><th>MySQL</th>\r
+<td>return $GLOBALS['oDB']->MySqlLogon( "northwind", "userid", "password");</td>\r
+<td>oDB.Use_MySQL\r
+<p>oDB.SqlSvr="localhost"\r
+<p class='comment'>Set the user id, and password in the SqlLogon() statement.\r
+<p class='comment'>The Rico plug-in assumes that the MySQL 3.51 ODBC driver has been installed.\r
+If you are using a later ODBC driver, such as 5.1, then you will need to add this line:\r
+<p>oDB.OdbcDriver="{MySQL ODBC 5.1 Driver}"\r
+</td>\r
+<td>Public const dbDialect = "MySQL"\r
+<p class='comment'>Set the server name, user id, and password in OpenDB()\r
+<p class='comment'>The MySQL 3.51 ODBC driver must also be installed.\r
+</td>\r
+<td>$dbh = DBI->connect( "dbi:mysql:northwind", "userid", "password");</td>\r
+\r
+<tr><th>SQL Server</th>\r
+<td>\r
+$oDB->Dialect="TSQL";\r
+<p>return $GLOBALS['oDB']->MSSqlLogon( "ServerName\InstanceName", "Northwind", "userid", "password");\r
+<p class='comment'>Omit InstanceName when connecting to the default instance\r
+</td>\r
+<td>oDB.SqlSvr= "ServerName\InstanceName"\r
+<p class='comment'>Omit InstanceName when connecting to the default instance\r
+<p class='comment'>Set the user id, and password in the SqlLogon() statement.\r
+</td>\r
+<td>Public const dbDialect = "TSQL"\r
+<p class='comment'>Set the server name, user id, and password in OpenDB()</td>\r
+<td>&nbsp;</td>\r
+\r
+<tr><th>MS Access</th>\r
+<td>\r
+$oDB->Dialect="Access";\r
+<p>return $GLOBALS['oDB']->OdbcLogon( "northwindDSN", "Northwind", "Admin", "");</td>\r
+<td>oDB.Use_Access Server.Mappath( "../data/northwind.mdb")\r
+<p class='comment'>This is the default, so no changes should be required.</td>\r
+<td>Public const dbDialect = "Access"\r
+<p class='comment'>This is the default, so no changes should be required.</td>\r
+<td>&nbsp;</td>\r
+\r
+<tr><th>Oracle</th>\r
+<td>\r
+$oDB->Dialect="Oracle";\r
+<p>return $GLOBALS['oDB']->OracleLogon( "XE", "northwind", "password");</td>\r
+<td>oDB.Use_Oracle "XE"</td>\r
+<td>Public const dbDialect = "Oracle"\r
+<p class='comment'>Set the server name and password in OpenDB()\r
+<td>&nbsp;</td>\r
+\r
+<tr><th>DB2</th>\r
+<td><p class='comment'>not supported</td>\r
+<td>&nbsp;</td>\r
+<td>Public const dbDialect = "DB2"\r
+<p class='comment'>Set the server name, user id, and password in OpenDB()</td>\r
+<td>&nbsp;</td>\r
+</tbody>\r
+</table>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/InstallNotes_ja.html b/documentation/InstallNotes_ja.html
new file mode 100644 (file)
index 0000000..f5deca1
--- /dev/null
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<title>Installing the Rico Examples</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css" />
+<style type="text/css">
+tbody td {
+  font-size: 8pt;
+  vertical-align: top;
+}
+p.comment {
+  color: #888;
+}
+</style>
+</head>
+
+<body>
+<h1>Rico の実例のインストール</h1>
+
+<p>単にディストリビューションファイルを解凍し、
+その結果のディレクトリ構成をあなたのウェブサービスのパスへコピーすれば、
+すべてではありませんが実例を動作させる上でほとんど十分でしょう。
+あなたがウェブサービスのルートに "rico" と呼ばれているディレクトリをインストールしたならば、
+実例にアクセスするためにブラウザを以下のアドレスに向けることができるはずです。
+<blockquote>http://myserver.mydomain.com/rico/examples/</blockquote>
+<p>または、それをあなたのパソコン上にインストールしたならば、次のアドレスにアクセスして下さい。
+<blockquote>http://localhost/rico/examples/</blockquote>
+
+<p>IIS6 を実行しているサーバーでは、
+あなたは ASP の実例を走らせるためにセキュリティセッティングを変更する必要があります。
+特に、親ディレクトリでインクルードファイルを参照し、ASPファイルを利用可能にする必要があります。
+そうするために、以下のステップに従ってください。
+<ol>
+<li>ISS Manager を開いて下さい
+<li>"Default Web Site" で右クリックして、"Properties" をコンテキストメニューから選択して下さい。
+<li>"Home Directory" タブをクリックして下さい
+<li>"Configuration" ボタンをクリックしてください
+<li>新しいウィンドウの "Options" タブをクリックします。
+<li>"Enable parent paths" とラベルされたボックスをクリックして下さい
+</ol>
+
+<h2>LiveGrid の実例</h2>
+
+<p>LiveGrid の実例の多くが Northwind サンプルデータベースからのデータをフェッチします。
+これらの実例に動かすために、あなたは 2 つのことをする必要があります。
+<ol>
+<li>Northwindデータベースを作成してください
+<li>applib.* ファイルにあるデータベース接続設定を変更して下さい
+</ol>
+
+<h2>Northwindデータベースの作成</h2>
+
+<p>examples/data ディレクトリは、 Rico LiveGrid ASP、.net、および PHP の実例を実行するために必要な、
+いくつかの異なるフォーマットのデータベースを含みます。
+
+<p>データはこれらのフォーマットを提供します。
+
+<ol>
+<li>northwind.mdb - これはマイクロソフトによって提供された、標準の Northwind データベースで、
+例外として [Order Details] は Order_Details に改名されました。
+あなたが ASP または .net の実例にアクセスしているならば、データベース構成の変更は必要ではありません。
+ -- それらの実例は Microsoft Jet driver を利用して、このデータベースに直接アクセスするでしょう。
+
+<li>mysql-northwind.sql - MySQLのためのバックアップファイル( MySQL version 4.1 によって作られました)
+
+<li>mysql-northwind-dblquote.sql - すべての \' インスタンスが '' に替えられた事以外は
+上記と同じです(バージョン 5 以上の MySQL に推奨されます)
+
+<li>ORA-EXPDAT.DMP - Northwind スキーマのための Oracle エクスポートファイル
+ -- <a href='http://www.oracle.com/technology/products/database/xe/index.html'>Oracle XE</a> の "exp" ユーティリティによって生成されました。
+ このスキーマのパスワードは "password" です。
+
+</ol>
+
+<p>MS SQL Server 2000 と 2005 用のバージョンは <a href='http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&displaylang=en'>msdn.microsoft.com</a> から
+自由にダウンロード出来ます。
+ダウンロードしたら、<a href='http://msdn2.microsoft.com/en-us/library/ms227484.aspx'>それをインストールするためのマイクロソフトのインストラクション</a>に従うべきです。
+最後に、[Order Details] テーブルを Order_Details に改名するか、Order_Details と言う名前のビューを次の SQL 文を利用して生成するかのどちらかを行う必要があるでしょう。
+<pre>
+
+create view Order_Details as select * from [Order Details]
+
+</pre>
+
+<h2>データベース接続設定</h2>
+
+<p>特定の命令はあなたの環境に依存します。
+<table border='1' cellspacing='0' cellpadding='3'>
+<thead><tr>
+<th>Database</th>
+<th>PHP</th>
+<th>ASP</th>
+<th>.net</th>
+<th>Perl</th>
+</tr></thead>
+<tbody>
+<tr><td>接続の設定は次の場所です。</td>
+<td>examples/php/applib.php</td>
+<td>examples/asp/applib.asp</td>
+<td>examples/dotnet/applib.ascx</td>
+<td>examples/perl/ricoXMLquery.pl</td>
+
+<tr><th>MySQL</th>
+<td>return $GLOBALS['oDB']->MySqlLogon( "northwind", "userid", "password");</td>
+<td>
+<p>oDB.Use_MySQL
+<p>oDB.SqlSvr="localhost"
+<p class='comment'>SqlLogon() の記述の中に、ユーザIDとパスワードを設定して下さい。
+<p class='comment'>MySQL 3.51 ODBC ドライバもインストールされていなければなりません。
+</td>
+<td>Public const dbDialect = "MySQL"
+<p class='comment'>サーバ名、ユーザIDとパスワードを OpenDB() に設定して下さい。
+<p class='comment'>MySQL 3.51 ODBC ドライバもインストールされていなければなりません。
+</td>
+<td>$dbh = DBI->connect( "dbi:mysql:northwind", "userid", "password");</td>
+
+<tr><th>SQL Server</th>
+<td>
+$oDB->Dialect="TSQL";
+<p>return $GLOBALS['oDB']->MSSqlLogon( "ServerName\InstanceName", "Northwind", "userid", "password");
+<p class='comment'>デフォルトインスタンスに接続するとき、InstanceName を省略してください。
+</td>
+<td>oDB.SqlSvr= "ServerName\InstanceName"
+<p class='comment'>デフォルトインスタンスに接続するとき、InstanceName を省略してください。
+<p class='comment'>SqlLogon() の記述の中に、ユーザIDとパスワードを設定して下さい。
+</td>
+<td>Public const dbDialect = "TSQL"
+<p class='comment'>サーバ名、ユーザIDとパスワードを OpenDB() に設定して下さい。</td>
+<td></td>
+
+<tr><th>MS Access</th>
+<td>
+$oDB->Dialect="Access";
+<p>return $GLOBALS['oDB']->OdbcLogon( "northwindDSN", "Northwind", "Admin", "");</td>
+<td>oDB.Use_Access Server.Mappath( "../data/northwind.mdb")
+<p class='comment'>これはデフォルトですので、変更は必要ありません。</td>
+<td>Public const dbDialect = "Access"
+<p class='comment'>これはデフォルトですので、変更は必要ありません。</td>
+<td></td>
+
+<tr><th>Oracle</th>
+<td>
+$oDB->Dialect="Oracle";
+<p>return $GLOBALS['oDB']->OracleLogon( "XE", "northwind", "password");</td>
+<td>oDB.Use_Oracle "XE"</td>
+<td>Public const dbDialect = "Oracle"
+<p class='comment'>サーバ名とパスワードを OpenDB() に設定して下さい。
+<td></td>
+
+<tr><th>DB2</th>
+<td><p class='comment'>サポート外です。</td>
+<td></td>
+<td>Public const dbDialect = "DB2"
+<p class='comment'>サーバ名、ユーザIDとパスワードを OpenDB() に設定して下さい。</td>
+<td></td>
+</tbody>
+</table>
+
+</body>
+</html>
diff --git a/documentation/LiveGrid.html b/documentation/LiveGrid.html
new file mode 100644 (file)
index 0000000..b750abe
--- /dev/null
@@ -0,0 +1,1246 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico LiveGrid</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>\r
+\r
+<body>\r
+<h1>Creating a Rico LiveGrid</h1>\r
+\r
+<p><a href='LiveGrid_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='LiveGrid_ja.html'>View this page in Japanese</a></p>\r
+\r
+<p>Rico LiveGrid displays data in a scrolling table, with the data buffered in a \r
+2-dimensional JavaScript array. As the user scrolls\r
+vertically through the grid, data is dynamically copied from the array onto the grid.\r
+The buffer can can be loaded from:\r
+<ol>\r
+<li><a href='#model1'>a javascript array</a>\r
+<li><a href='#model2'>an HTML table</a>\r
+<li><a href='#model3'>an XML file</a>\r
+<li><a href='#model4'>a SQL database query</a>\r
+<li><a href='#model5'>a custom javascript callback function</a>\r
+</ol>\r
+\r
+\r
+<h2><a name='model1'>Usage Model 1: Loading data from a javascript array</a></h2>\r
+\r
+<ul><li>Load the data to be displayed into a javascript array.\r
+<pre>\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5']\r
+  ];\r
+</pre>\r
+\r
+<li>Load the Rico javascript and css files necessary to display the grid.\r
+<pre>\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGrid\r
+<dd>This loads the Rico javascript and css files necessary to display a LiveGrid \r
+with a static buffer (no AJAX).\r
+<dt>LiveGridMenu\r
+<dd>This loads the default grid menu. This menu provides access to all of the LiveGrid capabilities.\r
+It adjusts the selections presented to the user based on the column selected \r
+and the type of buffer used.\r
+You can also choose to use the grid with no menu at all, or to create your own menu\r
+customized to the needs of your application.\r
+<dt>greenHdg.css\r
+<dd>Rico comes with several sample grid styles: coffee-with-milk,\r
+grayedout, greenHdg, iegradient (Internet Explorer only), tanChisel, and warmfall. \r
+You may choose one of the included styles or create one of your own. \r
+</dl>\r
+\r
+<li>Load the array into a Rico Buffer object:\r
+<pre>\r
+  var buffer=new Rico.Buffer.Base();\r
+  buffer.loadRowsFromArray(myData);\r
+</pre>\r
+\r
+<li>Define the grid's options, including the grid headings:\r
+<pre>\r
+  var opts = {  \r
+    defaultWidth : 90,\r
+    visibleRows  : 'data',\r
+    frozenColumns: 1,\r
+    columnSpecs  : [{Hdg:'Column 1',type:'number', ClassName:'alignright'},\r
+                    {Hdg:'Column 2'},\r
+                    {Hdg:'Column 3'},\r
+                    {Hdg:'Column 4'},\r
+                    {Hdg:'Column 5'}]\r
+  };\r
+</pre>\r
+\r
+<li>Instantiate the LiveGrid, passing in the base id for the grid, \r
+the Rico.Buffer instance, and the grid options.\r
+<pre>\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+</pre>\r
+\r
+<li>To enable the default pop-up menu for the grid, assign the grid's\r
+menu property to an instance of Rico.GridMenu.\r
+<pre>\r
+  ex1.menu=new Rico.GridMenu();\r
+</pre>\r
+\r
+<li>Rico.loadModule may finish <em>after</em> the window.onload event.\r
+So to ensure that the grid initialization runs after the Rico modules\r
+have loaded, you must pass the initialization function to the\r
+Rico.onLoad method. Putting all of the javascript together would look like this:\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5']\r
+  ];\r
+  var opts = {  \r
+    defaultWidth : 90,\r
+    visibleRows  : 'data',\r
+    frozenColumns: 1,\r
+    columnSpecs  : [{Hdg:'Column 1',type:'number', ClassName:'alignright'},\r
+                    {Hdg:'Column 2'},\r
+                    {Hdg:'Column 3'},\r
+                    {Hdg:'Column 4'},\r
+                    {Hdg:'Column 5'}]\r
+  };\r
+  var buffer=new Rico.Buffer.Base();\r
+  buffer.loadRowsFromArray(myData);\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+<li>Finally, place a div element in your HTML markup at the position where the grid should go.\r
+Including the markup for the bookmark will cause the grid's scroll position to be displayed.\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="ex1_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;div id="ex1"&gt;&lt;/div&gt;\r
+</pre>\r
+\r
+\r
+\r
+</ul>\r
+\r
+\r
+<h2><a name='model2'>Usage Model 2: Loading data from an HTML table</a></h2>\r
+\r
+<ul><li>Define an HTML table with the headings in a <code>&lt;thead&gt;</code> section\r
+and the data in a <code>&lt;tbody&gt;</code> section.\r
+Including the markup for the bookmark will cause the grid's scroll position to be displayed.\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;table id="data_grid"&gt;\r
+  &lt;thead&gt;\r
+\r
+  &lt;tr&gt;\r
+    &lt;th&gt;First column name&lt;/th&gt;\r
+    &lt;th&gt;Second column name&lt;/th&gt;\r
+    ...\r
+    &lt;th&gt;Last column name&lt;/th&gt;\r
+  &lt;/tr&gt;\r
+\r
+  &lt;/thead&gt;\r
+\r
+  &lt;tbody&gt;\r
+\r
+  &lt;tr&gt;\r
+    &lt;td&gt;Row 1, column 1 data&lt;/td&gt;\r
+    &lt;td&gt;Row 1, column 2 data&lt;/td&gt;\r
+    ...\r
+    &lt;td&gt;Row 1, last column data&lt;/td&gt;\r
+  &lt;/tr&gt;\r
+\r
+  &lt;tr&gt;\r
+    &lt;td&gt;Row 2, column 1 data&lt;/td&gt;\r
+    &lt;td&gt;Row 2, column 2 data&lt;/td&gt;\r
+    ...\r
+    &lt;td&gt;Row 2, last column data&lt;/td&gt;\r
+  &lt;/tr&gt;\r
+\r
+  ...\r
+\r
+  &lt;tr&gt;\r
+    &lt;td&gt;Row n, column 1 data&lt;/td&gt;\r
+    &lt;td&gt;Row n, column 2 data&lt;/td&gt;\r
+    ...\r
+    &lt;td&gt;Row n, last column data&lt;/td&gt;\r
+  &lt;/tr&gt;\r
+\r
+  &lt;/tbody&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<li>Load the Rico javascript and css files necessary to display the grid.\r
+<pre>\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGrid\r
+<dd>This loads the Rico javascript and css files necessary to display a LiveGrid \r
+with a static buffer (no AJAX).\r
+<dt>LiveGridMenu\r
+<dd>This loads the default grid menu. This menu provides access to all of the LiveGrid capabilities.\r
+It adjusts the selections presented to the user based on the column selected \r
+and the type of buffer used.\r
+You can also choose to use the grid with no menu at all, or to create your own menu\r
+customized to the needs of your application.\r
+<dt>greenHdg.css\r
+<dd>Rico comes with several sample grid styles: coffee-with-milk,\r
+grayedout, greenHdg, iegradient (Internet Explorer only), tanChisel, and warmfall. \r
+You may choose one of the included styles or create one of your own. \r
+</dl>\r
+\r
+<li>Load the table's data rows into a Rico Buffer object:\r
+<pre>\r
+var buffer = new Rico.Buffer.Base($('data_grid').tBodies[0]);\r
+</pre>\r
+\r
+<li>Finally, instantiate the LiveGrid, passing in the DOM id of the HTML table\r
+(this allows the LiveGrid to load the column headings from the table's thead section), \r
+the Rico.Buffer instance, and any options (in this case the first column gets\r
+a width of 50 pixels and the second column gets a width of 80 pixels).\r
+<pre>\r
+var grid_options = { columnSpecs: [ {width:50}, {width:80} ] };\r
+var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+</pre>\r
+\r
+<li>Rico.loadModule may finish <em>after</em> the window.onload event.\r
+So to ensure that the grid initialization runs after the Rico modules\r
+have loaded, you must pass the initialization function to the\r
+Rico.onLoad method. Putting all of the javascript together would look like this:\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var buffer = new Rico.Buffer.Base($('data_grid').tBodies[0]);\r
+  var grid_options = { columnSpecs: [width:50, width:80] };\r
+  var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+</ul>\r
+\r
+\r
+<h2><a name='model3'>Usage Model 3: Loading data from an XML file</a></h2>\r
+\r
+<ul><li>Define an HTML table, supplying the table header cells, but no table body cells.\r
+Including the markup for the bookmark will cause the grid's scroll position to be displayed.\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;table id="data_grid"&gt;\r
+  &lt;tr&gt;\r
+\r
+    &lt;th&gt;First column name&lt;/th&gt;\r
+    &lt;th&gt;Second column name&lt;/th&gt;\r
+\r
+  &lt;/tr&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<li>Load the Rico javascript and css files necessary to display the grid.\r
+<pre>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGridAjax\r
+<dd>This loads the Rico javascript and css files necessary to display a LiveGrid \r
+with an AJAX-enabled buffer.\r
+<dt>LiveGridMenu\r
+<dd>This loads the default grid menu. This menu provides access to all of the LiveGrid capabilities.\r
+It adjusts the selections presented to the user based on the column selected \r
+and the type of buffer used.\r
+You can also choose to use the grid with no menu at all, or to create your own menu\r
+customized to the needs of your application.\r
+<dt>greenHdg.css\r
+<dd>Rico comes with several sample grid styles: coffee-with-milk,\r
+grayedout, greenHdg, iegradient (Internet Explorer only), tanChisel, and warmfall. \r
+You may choose one of the included styles or create one of your own. \r
+</dl>\r
+\r
+<li>Create a Rico Buffer, which fetches data to populate the table.\r
+The AjaxXML buffer makes just one request for data to the supplied URL\r
+at grid startup.\r
+<pre>\r
+var buffer = new Rico.Buffer.AjaxXML('/controller/action?format=xml');\r
+</pre>\r
+\r
+The URL ("/controller/action?format=xml" in this example) must return data in the following format:\r
+<pre>\r
+&lt;ajax-response&gt;\r
+&lt;response type='object' id='data_grid_updater'&gt;\r
+&lt;rows update_ui='true' offset='0'&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;/rows&gt;\r
+&lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+<li>Finally, instantiate the LiveGrid, passing in the DOM id of the HTML table, \r
+the Rico.Buffer instance, and any options (columnSpecs is not required, \r
+but shown here as a placeholder for customization of the columns).\r
+<pre>\r
+var grid_options = { columnSpecs: [,] };\r
+var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+</pre>\r
+\r
+<li>Rico.loadModule may finish <em>after</em> the window.onload event.\r
+So to ensure that the grid initialization runs after the Rico modules\r
+have loaded, you must pass the initialization function to the\r
+Rico.onLoad method. Putting all of the javascript together would look like this:\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var buffer = new Rico.Buffer.AjaxXML('/controller/action?format=xml');\r
+  var grid_options = { columnSpecs: [,] };\r
+  var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+</ul>\r
+\r
+\r
+<h2><a name='model4'>Usage Model 4: Loading data from an SQL database query</a></h2>\r
+\r
+<p>The descriptions below apply directly to the ASP and PHP implementations of the Rico LiveGrid plug-ins.\r
+The concepts are the same in .net, but the implementation is quite different \r
+(examine ex2simple.aspx to see how this gets implemented in .net).\r
+\r
+<ul>\r
+<li>Define a session variable that contains the query to be run. The variable name must\r
+match the id of the table below. When requesting data, the grid will pass its id \r
+to ricoXMLquery, and ricoXMLquery will use it to get the query text from\r
+the session variable.\r
+<ul>\r
+<li>ASP:\r
+<pre>\r
+&lt;%\r
+session.contents("data_grid")="select ID,Name,City from customers"\r
+%&gt;\r
+</pre>\r
+\r
+<li>PHP:\r
+<pre>\r
+&lt;? \r
+$_SESSION['data_grid']="select ID,Name,City from customers";\r
+?&gt;\r
+</pre>\r
+\r
+<li>.net:\r
+<pre>\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  data_grid.sqlQuery="select ID,Name,City from customers"\r
+  ' session variable is set by the control\r
+End Sub\r
+</pre>\r
+</ul>\r
+\r
+\r
+<li>Define an HTML table, supplying the table header cells, but no table body cells.\r
+Including the markup for the bookmark will cause the grid's scroll position to be displayed.\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;table id="data_grid"&gt;\r
+  &lt;tr&gt;\r
+\r
+    &lt;th&gt;Customer #&lt;/th&gt;\r
+    &lt;th&gt;Customer Name&lt;/th&gt;\r
+    &lt;th&gt;City&lt;/th&gt;\r
+\r
+  &lt;/tr&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<li>Load the Rico javascript and css files necessary to display the grid.\r
+<pre>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGridAjax\r
+<dd>This loads the Rico javascript and css files necessary to display a LiveGrid \r
+with an AJAX-enabled buffer.\r
+<dt>LiveGridMenu\r
+<dd>This loads the default grid menu. This menu provides access to all of the LiveGrid capabilities.\r
+It adjusts the selections presented to the user based on the column selected \r
+and the type of buffer used.\r
+You can also choose to use the grid with no menu at all, or to create your own menu\r
+customized to the needs of your application.\r
+<dt>greenHdg.css\r
+<dd>Rico comes with several sample grid styles: coffee-with-milk,\r
+grayedout, greenHdg, iegradient (Internet Explorer only), tanChisel, and warmfall. \r
+You may choose one of the included styles or create one of your own. \r
+</dl>\r
+\r
+<li>Create a Rico Buffer, which fetches data to populate the table.\r
+Unlike the AjaxXML buffer which fetches all grid data at once, the AjaxSQL\r
+buffer fetches data in chunks. This makes it possible for LiveGrid to\r
+efficiently display query results containing thousands, or even hundreds of thousands\r
+of rows.\r
+<pre>\r
+var buffer = new Rico.Buffer.AjaxSQL('ricoXMLquery.asp');\r
+</pre>\r
+\r
+The URL ("ricoXMLquery.asp" in this example) utilizes one of the included plug-ins to\r
+fetch data from the database and return it to the grid in this XML format:\r
+<pre>\r
+&lt;ajax-response&gt;\r
+&lt;response type='object' id='data_grid_updater'&gt;\r
+&lt;rows update_ui='true' offset='0'&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;/rows&gt;\r
+&lt;rowcount&gt;99&lt;/rowcount&gt;\r
+&lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+The &lt;rowcount&gt; tag is optional, but should be returned whenever the "get_total"\r
+querystring parameter is present in the request.\r
+\r
+<li>Finally, instantiate the LiveGrid, passing in the DOM id of the HTML table, \r
+the Rico.Buffer instance, and any options (columnSpecs is not required, \r
+but shown here as a placeholder for customization of the columns).\r
+<pre>\r
+var grid_options = { columnSpecs: [,,] };\r
+var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+</pre>\r
+\r
+<li>Rico.loadModule may finish <em>after</em> the window.onload event.\r
+So to ensure that the grid initialization runs after the Rico modules\r
+have loaded, you must pass the initialization function to the\r
+Rico.onLoad method. Putting all of the javascript together would look like this:\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var buffer = new Rico.Buffer.AjaxSQL('ricoXMLquery.asp');\r
+  var grid_options = { columnSpecs: [,,] };\r
+  var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+</ul>\r
+\r
+\r
+<h2><a name='model5'>Usage Model 5: Loading data using a custom callback function</a></h2>\r
+\r
+<p>This model works the same way as models 3 and 4 except that, rather than fetching\r
+data using an xmlHTTPrequest, the data is fetched using javascript callback functions.\r
+This allows you to do creative things in the callback function - like call Google Gears.\r
+Setting up the callback is very easy. Rather than passing a string containing the data provider's URL\r
+to the AjaxXML or AjaxSQL constructor, you just pass the callback function instead.\r
+\r
+<p>The code that follows is taken from \r
+<a href='client/gridJSbuffer.html'>examples/client/gridJSbuffer.html</a>, \r
+which uses the AjaxXML buffer. The "jsfetch" callback function\r
+returns a 2-dimensional array that is 100 rows long by 5 columns wide.\r
+Note that AjaxXML only loads its buffer once (at grid startup), so\r
+jsfetch will only be called once.\r
+The options hash is identical in structure to the options hash used\r
+by Prototype's <a href='http://prototypejs.org/api/ajax/options'>Ajax.Request</a> method.\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML(<strong>jsfetch</strong>);\r
+\r
+function <strong>jsfetch</strong>(options) {\r
+  Rico.writeDebugMsg("jsfetch");\r
+  var newRows=[], offset=options.parameters.offset;\r
+  for (var r=0; r<100; r++) {\r
+    var row=[];\r
+    row.push(offset.toString());\r
+    row.push(new Date().toString());\r
+    for (var c=2; c<5; c++) row.push('cell '+r+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows);
+}\r
+</pre>\r
+\r
+<p>The code that follows is taken from \r
+<a href='client/gridJSbuffer2.html'>examples/client/gridJSbuffer2.html</a>, \r
+which uses the AjaxSQL buffer. The "jsfetch" callback function\r
+simulates a 2-dimensional array that is 500 rows long by 5 columns wide.\r
+However, only a section of that array is returned during any one callback --\r
+just the rows from <code>options.parameters.offset</code> to\r
+<code>options.parameters.offset + options.parameters.page_size</code>.\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxSQL(<strong>jsfetch</strong>);\r
+\r
+function <strong>jsfetch</strong>(options) {\r
+  var newRows=[], totrows=500;\r
+  var offset=options.parameters.offset;\r
+  var limit=Math.min(totrows-offset,options.parameters.page_size)\r
+  for (var r=0; r&lt;limit; r++) {\r
+    var row=[];\r
+    row.push(new Date().toString());\r
+    row.push(offset.toString());\r
+    for (var c=2; c&lt;5; c++) row.push('cell '+(r+offset)+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows,false,totrows);
+}\r
+</pre>\r
+\r
+<p>options.onComplete takes the following parameters:\r
+<ul>\r
+<li>newRows - 2-dimensional array where each item is a string\r
+<li>newAttr - 2-dimensional array where each item is an object containing acceptAttr values for the cell,\r
+or false if acceptAttr is not being used\r
+<li>totalRows - an integer representing the total number of rows in the dataset\r
+<li>errMsg - if an error occurs, this is the message text to be displayed to the user\r
+</ul>\r
+\r
+\r
+<h2><a name='debug'></a>Debugging</h2>\r
+<p>Rico 2.0 includes the ability to route time-stamped debug messages to a message log.\r
+The log may be an html textarea or the browser's javascript console.\r
+<ul>\r
+<li>If a textarea exists with the id of the LiveGrid table plus '_debugmsgs', i.e.\r
+<pre style='margin:3px;'>&lt;textarea cols="100" rows="5" id="data_grid_debugmsgs" /&gt;</pre>\r
+then this textarea will be used for the message log.\r
+<li>Alternatively, the textarea may be designated by a call to Rico.setDebugArea()\r
+\r
+<pre>\r
+&lt;textarea id='debug' rows='5' cols='80'&gt;&lt;/textarea&gt;\r
+&lt;script type='text/javascript'&gt;\r
+Rico.setDebugArea('debug');\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+<li>If no textarea is designated, Rico will attempt to use the browser's\r
+built-in javascript console. The following consoles are known to work:\r
+  <ul>\r
+  <li>The console in Firefox's <a href='http://www.getfirebug.com/'>Firebug</a> add-on\r
+  <li>The Opera javascript console\r
+  <li>The Safari javascript console\r
+  <li>The console in <a href='http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx'>IE8's Developer Toolbar</a> (under the Script tab)\r
+  </ul>\r
+</ul>\r
+\r
+<p>LiveGrid is programmed to send a number of messages to the message log that may prove helpful in debugging.\r
+You can also send your own messages by using Rico.writeDebugMsg(). For example:\r
+<pre>\r
+Rico.writeDebugMsg('My debug message');\r
+</pre>\r
+\r
+<h2>Grid Menus</h2>\r
+\r
+<p>Rico LiveGrids come with a lot of functionality built in. To access that functionality,\r
+Rico includes a default set of menus -- defined in ricoLiveGridMenu.js.\r
+To use the default menu, simply load the 'LiveGridMenu' module and then\r
+assign the grid's menu property to an instance of the Rico.GridMenu class.\r
+<pre>\r
+  Rico.loadModule('LiveGridMenu');\r
+  ...\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, grid_options);\r
+  ex1.menu=new Rico.GridMenu();\r
+</pre>\r
+<p>By default, the menu will open when a user double-clicks on a grid cell.\r
+To change the event that opens the menu, assign a value to the grid's\r
+<a href='#menuEvent'>menuEvent</a> option. The following code will open the menu on a right-click:\r
+<pre>\r
+  Rico.loadModule('LiveGridMenu');\r
+  ...\r
+  var grid_options = {\r
+    menuEvent: 'contextmenu'\r
+  }\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, grid_options);\r
+  ex1.menu=new Rico.GridMenu();\r
+</pre>\r
+<p>Rico.GridMenu provides a callback (dataMenuHandler) so that additional menu items can be added.\r
+The grid menu is always built dynamically -- customized to the row and column the user\r
+has clicked on. So the callback function is called every time the menu is invoked and\r
+must add the desired menu items at each invocation.\r
+<pre>\r
+  Rico.loadModule('LiveGridMenu');\r
+  ...\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, grid_options);\r
+  ex1.menu=new Rico.GridMenu();\r
+  ex1.menu.options.dataMenuHandler=myCustomMenuItems;\r
+  ...\r
+function myCustomMenuItems(grid,r,c,onBlankRow) {\r
+  if (buffer.getWindowValue(r,c)=='Special Value')\r
+    grid.menu.addMenuItem("Special menu item", specialAction);
+}\r
+function specialAction() {\r
+  ...\r
+}
+</pre>\r
+\r
+<p>It is also possible to create completely custom menus. For an example,\r
+see ex5.php/asp/aspx.\r
+\r
+\r
+<h2>Notes</h2>\r
+\r
+<ul>\r
+<li>If you create an element with a DOM id matching the name of the LiveGrid table \r
+plus '_bookmark', it will be updated with text indicating \r
+the number of records displayed in the grid. The LiveGrid examples typically use\r
+this markup:\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+</pre>\r
+<li>In order to display properly, a browser displaying a LiveGrid must be operating in \r
+<a href="http://www.quirksmode.org/css/quirksmode.html">strict (aka standards) mode</a>.\r
+Therefore, you must include a doctype declaration just before the \r
+<code> &lt;html&gt; </code> tag. For example:\r
+<pre>\r
+&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" \r
+ "http://www.w3.org/TR/html4/strict.dtd"&gt;\r
+</pre>\r
+</ul>\r
+\r
+\r
+<h2>Reference</h2>\r
+\r
+<h3>Constructor</h3>\r
+<pre>\r
+\r
+  var grid = new Rico.LiveGrid (table_id, rico_buffer, grid_options);\r
+\r
+</pre>\r
+\r
+<ul>\r
+<li><strong>table_id</strong> is the DOM id of the table (or div) that will be replaced by a LiveGrid\r
+<li><strong>rico_buffer</strong> is a Rico Buffer object, e.g.\r
+  <ul>\r
+  <li>Rico.Buffer.Base (for non-AJAX tables)\r
+  <li>Rico.Buffer.AjaxXML\r
+  <li>Rico.Buffer.AjaxSQL\r
+  <li>Rico.Buffer.AjaxJSON\r
+  </ul>\r
+<li><strong>grid_options</strong> (see below)\r
+</ul>\r
+\r
+<h3><a name="options"></a>Options</h3>\r
+\r
+\r
+<h4>Grid Size</h4>\r
+<dl>\r
+<dt>visibleRows (rows in .net plug-in)\r
+<dd>How many rows of the grid are made visible?\r
+A positive integer specifies that the grid should always contain exactly that many rows.\r
+<p>Negative values have the following meanings:\r
+  <ul>\r
+  <li>-1: size grid to client window (default)\r
+  <li>-2: size grid to whichever is smaller: the client window or the data\r
+  <li>-3: size grid so that the page body does not have a scrollbar\r
+  <li>-4: size grid to the parent node in the DOM\r
+  </ul>\r
+<p>String values have the following meanings:\r
+  <ul>\r
+  <li>'window': size grid to client window (default)\r
+  <li>'data': size grid to whichever is smaller: the client window or the data\r
+  <li>'body': size grid so that the page body does not have a scrollbar\r
+  <li>'parent': size grid to the parent node in the DOM\r
+  <li>'XX%': size grid to XX percent of the total window height\r
+  <li>'XXpx': size grid to XX pixels\r
+  </ul>\r
+  \r
+<dt>minPageRows\r
+<dd>Minimum # of visible rows. Used only when visibleRows < 0. (default: 2 - after Rico 2b3, 1 - up to Rico 2b3)\r
+\r
+<dt>maxPageRows\r
+<dd>Maximum # of visible rows. Used only when visibleRows < 0. (default: 50)\r
+\r
+<dt><a name="defaultWidth"></a>defaultWidth\r
+<dd>An integer used in setting the initial width of columns. \r
+See the <a href='#width'>column width option</a> for an explanation.\r
+(default: -1 if initializing from an HTML table, 100 otherwise)\r
+\r
+<dt>scrollBarWidth\r
+<dd>For some calculations, LiveGrid needs to know the width of scrollbars on the page. (default: 19)\r
+\r
+<dt>minScrollWidth\r
+<dd>Minimum scroll area width in pixels when width of frozen columns exceeds window width. (default: 100)\r
+</dl>\r
+\r
+\r
+<h4>Grid Data</h4>\r
+<dl>\r
+<dt>offset<dd>First row of data to be displayed (default: 0)\r
+<dt>prefetchBuffer<dd>Load the buffer (and therefore the grid) on page load? (default: true)\r
+<dt>sortCol<dd>Name or index of column for initial sort\r
+<dt>sortDir<dd>Direction of initial sort\r
+  <br>possible values: 'ASC', 'DESC'\r
+<dt>getQueryParms<dd>If true, check the web page's query string for filter parameters and apply\r
+any filter that is found.  Filter parameters must be of the form "f[x]=" where x is the column index.\r
+(default: false)\r
+</dl>\r
+\r
+<h4>Header Configuration</h4>\r
+<dl>\r
+<dt>frozenColumns\r
+<dd>number of columns on the left side of the grid that should be\r
+    frozen (like Excel). \r
+\r
+<dt>headingSort\r
+<dd>A string that defines how headings are displayed to facilitate sorting.\r
+  <ul>\r
+  <li>'link' -- make headings a link that will sort columns (default)\r
+  <li>'hover' -- user can click in any part of the heading cell to sort. \r
+       Heading changes background color when cursor hovers over cell.\r
+  <li>'none' -- events on headings are disabled\r
+  </ul>\r
+\r
+<dt>hdrIconsFirst\r
+<dd>Put sort and filter icons before or after header text (default: true)\r
+\r
+<dt><a name='allowColResize'>allowColResize</a>\r
+<dd>Allow columns to be resized by the user? If true, then resizing for individual columns \r
+can be disabled using <a href='#noResize'>noResize</a> in columnSpecs[].\r
+\r
+<dt>panels\r
+<dd>An array of strings that can serve as secondary headings.\r
+In LiveGrid Forms, they also serve as the headings for the tabbed panels on the input form.\r
+\r
+<dt>PanelNamesOnTabHdr\r
+<dd>Set to 'true' for the strings in panels[] to be used as secondary headings.\r
+In LiveGrid Forms, it may be set to 'false' so that panels[] is only used on the input form.\r
+\r
+<dt><a name='FilterLocation'>FilterLocation</a>\r
+<dd>Specifies the heading row where filters should be placed.\r
+-1 causes a new row to be appended to the header and that new row used for filtering.\r
+See also the <a href='#filterUI'>filterUI</a> option.\r
+\r
+<dt>FilterAllToken\r
+<dd>Token in select filters used to indicate "show all values" (default: "___ALL___").\r
+</dl>\r
+\r
+<h4>Images</h4>\r
+<dl>\r
+<dt>resizeBackground\r
+<dd>Image to use for column resize handle. (default: 'resize.gif')\r
+\r
+<dt>sortAscendImg\r
+<dd>Image to use to indicate that the column is sorted in ascending order. (default: 'sort_asc.gif')\r
+\r
+<dt>sortDescendImg\r
+<dd>Image to use to indicate that the column is sorted in descending order. (default: 'sort_desc.gif')\r
+\r
+<dt>filterImg\r
+<dd>Image used to indicate an active filter on a column. (default: 'filtercol.gif')\r
+</dl>\r
+\r
+\r
+<h4>Cookie options</h4>\r
+<dl>\r
+\r
+<dt><a name='saveColumnInfo'>saveColumnInfo</a>\r
+<dd>Specifies which details to save in the grid's cookie. Only one cookie is used for each grid.\r
+Note that the width setting includes the hide/show status of the column. \r
+(default: {width:true, filter:false, sort:false})\r
+<br>In the .net plug-in, this option is represented by 3 separate properties:\r
+saveColumnWidth, saveColumnFilter, saveColumnSort\r
+\r
+<dt>cookiePrefix\r
+<dd>A string that is prepended to the cookie name. (default: 'RicoGrid.')\r
+\r
+<dt>cookieDays\r
+<dd>Number of days before the cookie expires. \r
+If you don't specify it, then the cookie is only maintained for the current session. (default: null)\r
+\r
+<dt>cookiePath\r
+<dd>Sets the top level directory from which the grid cookie can be read.\r
+If you don't specify it, it becomes the path of the page that sets the cookie. (default: null)\r
+\r
+<dt>cookieDomain\r
+<dd>Tells the browser to which domain the cookie should be sent. \r
+If you don't specify it, it becomes the domain of the page that sets the cookie. (default: null)\r
+\r
+</dl>\r
+\r
+<h4>Highlighting and selection</h4>\r
+<dl>\r
+\r
+<dt>highlightElem\r
+<dd>a string that specifies what gets highlighted/selected\r
+  <ul>\r
+  <li>'cursorRow' -- the grid row under the cursor\r
+  <li>'cursorCell' -- the grid cell under the cursor\r
+  <li>'menuRow' -- the grid row where the menu is displayed\r
+  <li>'menuCell' -- the grid cell where the menu is displayed\r
+  <li>'selection' -- allow the user to select cells\r
+  <li>'none' -- never highlight\r
+  </ul>\r
+\r
+<dt>highlightSection\r
+<dd>an integer that specifies which section of the table is highlighted\r
+  <ul>\r
+  <li>1 -- frozen\r
+  <li>2 -- scrolling\r
+  <li>3 -- all (default)\r
+  <li>0 -- none\r
+  </ul>\r
+\r
+<dt>highlightMethod\r
+<dd>Method used to highlight cells &amp; rows. Possible values:\r
+  <ul>\r
+  <li>'outline' -- least CPU-intensive on client-side\r
+  <li>'class' -- adds CSS class to highlighted cell/row (default)\r
+  <li>'both' -- highlight using both outline and class\r
+  </ul>\r
+\r
+<dt>highlightClass\r
+<dd>When highlighting by class, this is the class name used (default: 'ricoLG_selection')\r
+</dl>\r
+\r
+\r
+<h4>Export and print</h4>\r
+<dl>\r
+\r
+<dt>maxPrint\r
+<dd>The maximum number of rows that the user is allowed\r
+to Print/Export.  Set to 0 to disable print/export. (default: 1000)\r
+\r
+<dt>exportWindow\r
+<dd>Options string passed to <a href='http://www.w3schools.com/htmldom/met_win_open.asp'>window.open()</a>\r
+when the export window is created. (default: "height=400,width=500,scrollbars=1,menubar=1,resizable=1")\r
+\r
+<dt>exportStyleList\r
+<dd>An array of CSS attributes that will be extracted from the first visible row of the grid and used\r
+to format all rows of the exported table. \r
+(default: ['background-color', 'color', 'text-align', 'font-weight', 'font-size', 'font-family'])\r
+</dl>\r
+\r
+\r
+<h4>Behavior Defaults</h4>\r
+<dl>\r
+<dt><a name='canHideDefault'>canHideDefault</a>\r
+<dd>Controls whether columns can be hidden/shown (default: true). \r
+Hide/show can be disabled for individual columns using the <a href='#canHide'>canHide</a> property in columnSpecs.\r
+\r
+<dt><a name='canSortDefault'>canSortDefault</a>\r
+<dd>Controls whether columns can be sorted (default: true).\r
+Sorting can be disabled for individual columns using the <a href='#canSort'>canSort</a> property in columnSpecs.\r
+\r
+<dt><a name='canFilterDefault'>canFilterDefault</a>\r
+<dd>Controls whether columns can be filtered (default: true).\r
+Filtering can be disabled for individual columns using the <a href='#canFilter'>canFilter</a> property in columnSpecs.\r
+\r
+<dt><a name='dndMgrIdx'>dndMgrIdx</a>\r
+<dd>Specifies which drag-and-drop management zone should be used for drag operations (default: 0).\r
+This only needs to be specified if the web page uses multiple distinct zones.\r
+\r
+</dl>\r
+\r
+\r
+<h4>Event control</h4>\r
+<dl>\r
+<dt><a name='menuEvent'>menuEvent</a>\r
+<dd>A string that specifies when the grid's menu should be invoked\r
+  <ul>\r
+  <li>'click' -- invoke menu on single-click\r
+  <li>'dblclick' -- invoke menu on double-click (default)\r
+  <li>'contextmenu' -- invoke menu on right-click\r
+  <li>'none' -- no pop-up menu\r
+  </ul>\r
+\r
+<dt>windowResize\r
+<dd>A boolean value specifying whether to resize the grid during a window.resize event.\r
+This should be set to false when the grid is embedded in an accordian. (default: true)\r
+</dl>\r
+\r
+\r
+<h4>Event handles</h4>\r
+<dl>\r
+<dt style='font-weight:normal;'>Event handlers cannot be passed in options to the constructor, but may be set after the LiveGrid has been constructed.\r
+<dt>sortHandler<dd> (default: Rico.LiveGridMethods.sortHandler -- bound)\r
+<dt>filterHandler<dd> (default: Rico.LiveGridMethods.filterHandler -- bound)\r
+<dt>onRefreshComplete<dd> (default: Rico.LiveGridMethods.bookmarkHandler -- bound)\r
+<dt>rowOverHandler<dd> (default: Rico.LiveGridMethods.rowMouseOver -- bound as event listener)\r
+<dt>mouseDownHandler<dd> (default: Rico.LiveGridMethods.selectMouseDown -- bound as event listener)\r
+<dt>mouseOverHandler<dd> (default: Rico.LiveGridMethods.selectMouseOver -- bound as event listener)\r
+<dt>mouseUpHandler<dd> (default: Rico.LiveGridMethods.selectMouseUp -- bound as event listener)\r
+<dt>onscroll<dd> called whenever the grid is scrolled vertically. (default: null)\r
+<dt>onscrollidle<dd> called 1.2 seconds after the grid is scrolled vertically. (default: null)\r
+<dt>click<dd> called when a grid cell is clicked. (default: null, unless menuEvent='click')\r
+<dt>dblclick<dd> called when a grid cell is double-clicked. (default: null, unless menuEvent='dblclick')\r
+<dt>contextmenu<dd> called when a grid cell is right-clicked. (default: null, unless menuEvent='contextmenu')\r
+</dl>\r
+\r
+<h4><a name="column"></a>Per-column configuration</h4>\r
+<dl>\r
+<dt style='font-weight:normal;'>Options for each individual column are contained in the columnSpecs option.\r
+columnSpecs is an array with an entry for each column. \r
+Each column entry can either be:\r
+<ul>\r
+\r
+<li>null (default) --  in which case the column is formatted according to the spec in Rico.TableColumn.DEFAULT.\r
+If most columns in your grid share common formatting, then it may make sense to override\r
+the default column spec for that grid:\r
+<pre>\r
+Rico.TableColumn.DEFAULT = {ClassName:'aligncenter', width:50};\r
+</pre>\r
+In this case, any column with no spec will have content aligned to the center and a width of 50 pixels.\r
+\r
+<li>a string -- provides a simple way to specify a column format.\r
+These values are built-in: DOLLAR, EURO, PERCENT, QTY, DEFAULT.\r
+It is also possible to define your own. This example, which defines a temperature format,\r
+is taken from weather.php:\r
+<pre>\r
+Rico.TableColumn.TEMP = {type:'number', decPlaces:0, \r
+  ClassName:'alignright', suffix:'&amp;deg;C', width:50};\r
+var opts = {  \r
+  frozenColumns : 1,
+  columnSpecs   : [{width:120},{width:70},{width:70},{width:100},\r
+                   'TEMP','TEMP','TEMP',\r
+                   {width:150},{width:200},{width:60}]\r
+};\r
+</pre>\r
+\r
+<li>an object -- containing entries for one or more of the properties listed below.\r
+Here is an example that contains specifications for columns 0, 1, and 3.\r
+Column 2 would get the default spec.\r
+<pre>\r
+columnSpecs : [{canSort:false, noResize:true, ClassName:'alignright'},\r
+               {ClassName:'aligncenter'},\r
+               ,\r
+               {visible:false}]\r
+</pre>\r
+</ul>\r
+\r
+<dt>Hdg\r
+<dd>An alternate way of specifying the heading text for a column.\r
+Only used by LiveGrid if the grid id refers to a &lt;div&gt; instead of an html table.\r
+\r
+<dt><a name='canSort'>canSort</a>\r
+<dd>Column can be sorted. (default: <a href='#canSortDefault'>grid.options.canSortDefault</a>)\r
+\r
+<dt><a name='canFilter'>canFilter</a>\r
+<dd>Column can be filtered. (default: <a href='#canFilterDefault'>grid.options.canFilterDefault</a>)\r
+\r
+<dt>canDrag\r
+<dd>Column cells can serve as the source for a drag-n-drop operation. The "DragAndDrop" module must be loaded. \r
+The temporary drag objects have a class of "LiveGridDraggable".\r
+For an example, see <a href='client/drag_and_drop_grid.html'>drag_and_drop_grid.html</a>. (default: false)\r
+\r
+<dt><a name='canHide'>canHide</a>\r
+<dd>Column can be hidden/unhidden. (default: <a href='#canHideDefault'>grid.options.canHideDefault</a>)\r
+\r
+<dt>visible\r
+<dd>Controls whether the column is visible at grid startup (default: true). \r
+If <a href='#saveColumnInfo'>grid.options.saveColumnInfo.width</a> is true\r
+and there is a value in the cookie for this column, the cookie value will take precedence.\r
+\r
+<dt><a name='width'>width</a>\r
+<dd>An integer specifying the initial width (in pixels) for the column. \r
+Here is the algorithm LiveGrid uses for setting the initial width of each column:\r
+<ol>\r
+<li>If <a href='#saveColumnInfo'>options.saveColumnInfo.width</a> is true and column information is present in the grid's cookie \r
+(due to the user previously performing a resize on that grid's column), \r
+then the width in the cookie is used. Otherwise...\r
+\r
+<li>If there is a width spec for the column in options.columnSpecs[], then the width in the spec is used. For an example, see ex3.php/asp/aspx. Otherwise...\r
+\r
+<li>If <a href='#defaultWidth'>options.defaultWidth</a> is true (default) and the grid header is initialized from an html table, then the column's width in the html table is used. \r
+You can usually control the column widths of the initial table by using col tags (e.g. &lt;col style='width:40px;' &gt;). \r
+If the total table width is less than the browser width then this works; however if it is greater, then the browser often ignores &lt;col width&gt; \r
+and tries to squeeze all of the columns into the available window width. Thus, using this method to set the column width is unreliable. Otherwise...\r
+\r
+<li>If <a href='#defaultWidth'>options.defaultWidth</a> is false, then the column's width is set to options.defaultWidth (which defaults to 100).\r
+</ol>\r
+Therefore, the most reliable way to set column widths in LiveGrid and SimpleGrid is to specify a width for every column in options.columnSpecs[]. \r
+If many columns share a common width, then you can shortcut this somewhat by setting options.defaultWidth=false, \r
+and setting options.defaultWidth to the common width.\r
+\r
+<dt><a name='noResize'>noResize</a>\r
+<dd>Allow column to be resized? (default <a href='#allowColResize'>grid.options.allowColResize</a> )\r
+\r
+<dt>ClassName\r
+<dd>By default, LiveGrid assigns a unique CSS class name to each\r
+column, which follows the naming convention: table_id + '_col' + column_index.\r
+For example, the fourth column in the grid 'mygrid' would have the class name\r
+'mygrid_col3'. The value of the ClassName option overrides this default name.\r
+The ClassName option is most commonly used to specify column alignment via the\r
+Rico-provided 'alignright' and 'aligncenter' classes. \r
+So, if you wanted the first 3 columns in your grid to be displayed with white\r
+text on a red background, you could do either of the following:\r
+\r
+<pre>\r
+In CSS:\r
+.mygrid_col0 div.ricoLG_cell, \r
+.mygrid_col1 div.ricoLG_cell, \r
+.mygrid_col2 div.ricoLG_cell {\r
+  color: white;\r
+  background-color: red;\r
+}\r
+</pre>\r
+\r
+OR\r
+\r
+<pre>\r
+In CSS:\r
+.WhiteOnRed div.ricoLG_cell {\r
+  color: white;\r
+  background-color: red;\r
+}\r
+\r
+In javascript:\r
+columnSpecs : [{ClassName:'WhiteOnRed'},\r
+               {ClassName:'WhiteOnRed'},\r
+               {ClassName:'WhiteOnRed'},\r
+               ...\r
+</pre>\r
+\r
+Finally, please note that this ClassName is not applied to the grid headings - \r
+use a align="right" on the &lt;th&gt; tag to accomplish the header alignment.\r
+\r
+<dt>type (DataType in .net plug-in)\r
+<dd>A string containing one of these values: \r
+<ul>\r
+<li>text - any tags in the column value are removed before being displayed to the user.\r
+<li>showTags - any tags in the column value are displayed to the user as text.\r
+<li>number - column value is treated as a number, \r
+and any <a href='#NumberFormatting'>number formatting options</a> \r
+supplied in the column specification are applied.\r
+<li>datetime - column value is treated as a date &amp; time, \r
+and any <a href='#DateFormatting'>date formatting options</a> \r
+supplied in the column specification are applied.\r
+<li>UTCasLocalTime - column/database value is treated as a GMT/UTC date &amp; time, and any <a href='#DateFormatting'>date formatting options</a> \r
+supplied in the column specification are applied. Before display, the value is converted to the user's local time zone.\r
+<li>date - column value is treated as a date, and any <a href='#DateFormatting'>date formatting options</a> \r
+supplied in the column specification are applied.\r
+<li>raw (default) - column values are displayed directly to the grid cell. \r
+Any HTML markup gets copied into the cell.\r
+</ul>\r
+</dd>\r
+\r
+<dt><a name='control'></a>control\r
+<dd>An object that can be used to provide special formatting for a column.\r
+Several column controls are provided with LiveGrid. The code for them\r
+resides in ricoLiveGridControls.js. Here is a brief description of the\r
+provided controls:\r
+\r
+<dl style='font-size:smaller;'>\r
+<dt>Rico.TableColumn.checkboxKey(showKey)\r
+<dd>Display unique key column as: &lt;checkbox&gt; &lt;key value&gt;
+and keep track of which keys the user selects.
+Key values should not contain &lt;, &gt;, or &amp;.
+\r
+<dt>Rico.TableColumn.checkbox(checkedValue, uncheckedValue, defaultValue, readOnly)\r
+<dd>Display column as checkboxes. Database column should contain only two-values  (e.g. yes/no).
+The following code is taken from ex7 (column values are 1 and 0):\r
+<pre>\r
+columnSpecs: [{canHide:false,\r
+               control:new Rico.TableColumn.checkbox('1','0'),\r
+               ClassName:'aligncenter'},\r
+              'specQty'],\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.textbox(boxSize, boxMaxLen, readOnly)\r
+<dd>Display the column value in a text box.\r
+\r
+<dt>Rico.TableColumn.HighlightCell(chkcol,chkval,highlightColor,highlightBackground,chkop)\r
+<dd>Highlight a grid cell when a particular value is present in the specified column.\r
+chkop optionally specifies the comparison to be performed: ==, !=, &lt;, &lt;=, &gt;, &gt;=.\r
+If not specified, then == is used.\r
+The following code is taken from ex2highlight and highlights the entire row when column 1\r
+contains "HANAR":\r
+<pre>\r
+var CustId='HANAR';\r
+var CustIdCol=1;\r
+var highlight=Rico.TableColumn.HighlightCell;\r
+...\r
+columnSpecs: [\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ type:'date', control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ type:'date', control:new highlight(CustIdCol,CustId,'red','yellow') }]\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.bgColor()\r
+<dd>Database value contains a css color name/value\r
+\r
+<dt>Rico.TableColumn.link(href,target)\r
+<dd>Database value contains a url to another page.\r
+The href parameter may contain references to grid values by including "{x}" in the string,\r
+where x is a column number. The following code is taken from ex6:\r
+<pre>\r
+columnSpecs: [,\r
+{control:new Rico.TableColumn.link('ex2.asp?id={0}','_blank'),\r
+ width:250},\r
+,'specQty']\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.image()\r
+<dd>Database value contains a url to an image.\r
+The following code is taken from photos.php:\r
+<pre>\r
+imgctl=new Rico.TableColumn.image();\r
+...\r
+columnSpecs: [\r
+{control:imgctl,width:90},,,\r
+{type:'datetime'},{width:200}]\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.lookup(map, defaultCode, defaultDesc)\r
+<dd>Map a database value to a display value\r
+\r
+<dt>Rico.TableColumn.MultiLine()\r
+<dd>Overcomes issues when displaying multi-line content (i.e. content with &lt;br&gt; tags) in IE6 and IE7\r
+\r
+</dl>\r
+\r
+<br>It is also possible to write your own column control, which\r
+implements logic specific to your application. Here is an example:\r
+<pre>\r
+// Display values white on black if\r
+//   first column contains the value "reverse"\r
+// Usage: { control:new MyCustomColumn() }
+MyCustomColumn = Class.create();
+
+MyCustomColumn.prototype = {
+  initialize: function() {},
+
+  _clear: function(gridCell,windowRow) {
+    gridCell.style.color='';
+    gridCell.style.backgroundColor='';
+    gridCell.innerHTML='&amp;nbsp;';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    var col0=this.liveGrid.buffer.getWindowValue(windowRow,0);\r
+    if (col0=="reverse") {\r
+      gridCell.style.color='white';
+      gridCell.style.backgroundColor='black';\r
+    } else {\r
+      gridCell.style.color='';
+      gridCell.style.backgroundColor='';
+    }
+    gridCell.innerHTML=this._format(v);
+  }
+}
+</pre>\r
+\r
+<dt><a name='filterUI'></a>filterUI\r
+<dd>If a <a href='#FilterLocation'>FilterLocation</a> option is specified for the grid, then filterUI will control\r
+how each column is filtered. If filterUI is:\r
+<ul>\r
+<li>null or omitted, then no filter is displayed for the column.\r
+<li>'t' - will generate a text box filter and the records being displayed\r
+are filtered as the user types. \r
+<br>May optionally be followed by a caret (^) to\r
+indicate that text box values should match the beginning of the column value.\r
+Otherwise, they can match anywhere in the column's value.\r
+<br>May also be followed by a number to indicate the size of the text box (default size is 10).\r
+<pre>\r
+filterUI:'t^20' \r
+// will create a text box that is 20 characters wide\r
+// text typed into the box will be compared to\r
+//    the beginning of each column value\r
+</pre>\r
+<li>'s' - will generate a select list filter with all possible column values contained in the list.\r
+Populated using a 'select distinct' query if the grid's source is a SQL query.\r
+</ul>\r
+\r
+<dt></a>filterCol\r
+<dd>Specifies that the filter should be applied to a different column. For example, ex3livegrid.asp/aspx/php\r
+uses this feature to filter the order and ship date columns by year. The full date is shown in the column\r
+in which the filter appears; however, there is another hidden, calculated column containing "year(orderdate)"\r
+to which the filter is applied.\r
+</dl>\r
+\r
+<dl>\r
+<dt style='color:navy;'><a name='NumberFormatting'></a><em>Number formatting:</em>\r
+\r
+<dt>multiplier\r
+<dd>The value is multiplied by this number before it is displayed. (default: 1)\r
+\r
+<dt>decPlaces\r
+<dd>Number of places to the right of the decimal point. (default: 0)\r
+\r
+<dt>decPoint\r
+<dd>Decimal point symbol. (default: '.' but overridden in the translation files)\r
+\r
+<dt>thouSep\r
+<dd>Symbol for thousands separator. (default: ',' but overridden in the translation files)\r
+\r
+<dt>negSign\r
+<dd>Specifies how negative numbers should be displayed. Possible values:\r
+<ul>\r
+<li>L=leading minus (default)\r
+<li>T=trailing minus\r
+<li>P=parentheses\r
+</ul>\r
+\r
+<dt>prefix\r
+<dd>A string added to the beginning of the number. Typically a currency symbol.\r
+\r
+<dt>suffix\r
+<dd>A string added to the end of a number. For example, a "%" symbol.</dd>\r
+</dl>\r
+\r
+<dl>\r
+<dt style='color:navy;'><a name='DateFormatting'></a><em>Date formatting:</em>\r
+\r
+<dt>dateFmt\r
+<dd>A string specifying how the date or datetime should be displayed. Default is "translateDate", which means\r
+that the dateFmt and timeFmt strings in the RicoTranslate object are used \r
+(this defaults to "mm/dd/yyyy" for dates and "mm/dd/yyyy hh:nn:ss a/pm" for datetimes, \r
+but is overridden by the various language translation files). \r
+If dateFmt="localeDate", then the value is formatted using javascript's built-in toLocaleDateString() function. \r
+If dateFmt="localeDateTime", then the value is formatted using javascript's built-in toLocaleString() function. \r
+The dateFmt string may contain the following special character sequences:\r
+\r
+<ul>\r
+<li>yyyy - 4 digit year
+<li>yy - 2 digit year
+<li>mmmm - month name
+<li>mmm - 3 character month name abbreviation. In Asian languages this often doesn't make sense - in these cases it returns the full month name (same as mmmm).
+<li>mm - 2 digit month number (zero padded)
+<li>m - 1 or 2 digit month number
+<li>dddd - day-of-the-week
+<li>ddd - 3 character day-of-the-week abbreviation
+<li>dd - 2 digit day number (zero padded)
+<li>d - 1 or 2 digit day number
+<li>hh - 2 digit hour, 12-hour clock (zero padded)
+<li>h - 1 or 2 digit hour, 12-hour clock
+<li>HH - 2 digit hour, 24-hour clock (zero padded)
+<li>H - 1 or 2 digit hour, 24-hour clock
+<li>nn - 2 digit minutes (zero padded)
+<li>ss - 2 digit seconds (zero padded)
+<li>a/p - a or p (for am or pm)
+</ul>\r
+\r
+<pre>\r
+// display first column as "month year"\r
+columnSpecs : [{type:date, dateFmt:'mmm yyyy'}]\r
+</pre>\r
+</dd>\r
+\r
+<dt>prefix\r
+<dd>A string added to the beginning of the date.\r
+\r
+<dt>suffix\r
+<dd>A string added to the end of a date. For example, you could use this to include a time zone:\r
+<pre>\r
+// indicate that times are GMT/UTC\r
+columnSpecs : [{type:datetime, suffix:' UTC'}]\r
+</pre>\r
+</dl>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/LiveGridAjax.html b/documentation/LiveGridAjax.html
new file mode 100644 (file)
index 0000000..d677819
--- /dev/null
@@ -0,0 +1,447 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico LiveGrid AJAX</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+
+<style type="text/css">\r
+.request, .response {
+  border: 1px solid black;
+  background-color: #FFF8DC;
+  padding: 4px;
+}
+dt span {
+  font-weight:normal;
+  font-style:italic;
+}
+</style>
+</head>
+
+<body>
+<h1>Rico LiveGrid AJAX</h1>
+
+<p><a href='LiveGridAjax_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='LiveGridAjax_ja.html'>View this page in Japanese</a></p>\r
+\r
+<p>One of the key features of the Rico LiveGrid is its ability to load data dynamically
+via AJAX. This document focuses on the format of the LiveGrid AJAX requests and responses. 
+More specifically, it is the LiveGrid <strong>Buffer</strong> object that is
+generating requests and processing responses. So if you are in a situation where data
+is coming from a web service that is out of your control, you could create a custom
+LiveGrid buffer class that would serve as an interface between the web service
+and LiveGrid. However, in this document we will focus on the request and response
+formats of the buffer classes that come with the Rico distribution.
+
+<p>The Rico distribution includes 4 distinct buffer classes:
+<dl>
+<dt>Rico.Buffer.Base
+<dd>Used for static datasets, no AJAX (i.e. no calls to XMLHttpRequest).
+Data can be loaded from an HTML table or from a javascript array.
+Since this buffer does not use AJAX, it will not be discussed further in this document. 
+<dt><a href='#AjaxXML'>Rico.Buffer.AjaxXML</a>
+<dd>All LiveGrid data is loaded in a single AJAX call, data returned in XML format
+<dt><a href='#AjaxSQL'>Rico.Buffer.AjaxSQL</a>
+<dd>LiveGrid data is loaded in chunks as the user scrolls through the grid, data returned in XML format
+<dt><a href='#AjaxJSON'>Rico.Buffer.AjaxJSON</a>
+<dd>Same as AjaxSQL, except that responses are in JSON format
+</dl>
+
+<h2><a name='AjaxXML'>Rico.Buffer.AjaxXML</a></h2>
+
+<p>An AjaxXML buffer will only perform a single XMLHttpRequest 
+regardless of the amount of scrolling a user does in a LiveGrid.
+An AjaxXML buffer is created using the following javascript:
+
+<pre>
+buffer=new Rico.Buffer.AjaxXML(url,options,ajaxOptions)
+</pre>
+
+<dl>
+<dt>url
+<dd>A string containing the url to the data provider.
+<dt>options
+<dd>A Rico buffer options object, which may contain any of the following:
+
+<dl>
+<dt>bufferTimeout
+<dd>An integer that specifies the number of milliseconds a wait message should be presented to the
+user before indicating a timeout. Default is 20000 (20 seconds).
+
+<dt>requestParameters
+<dd>An array of strings of the form "parm=value" that get added to the
+search string of the XMLHttpRequest.
+
+<dt>isEncoded
+<dd>Specifies whether the response will be HTML encoded or not. Default is true.
+All plug-ins supplied with Rico encode the response.
+
+<dt>waitMsg
+<dd>The message that gets displayed to the user while waiting for and XMLHttpRequest response.
+Default is RicoTranslate.getPhraseById("waitForData").
+Note that this can be an image tag, for example: 
+<pre>
+buffer=new Rico.Buffer.AjaxXML(
+  url,
+  {waitMsg: "&lt;img src='MySpinner.gif'&gt;"},
+  ajaxOptions);
+</pre>
+
+<dt>canFilter
+<dd>A boolean value indicating whether the buffer supports filtering. Default is true.
+</dl>
+
+<dt>ajaxOptions
+<dd>An <a href='http://prototypejs.org/api/ajax/options'>Ajax options object</a>
+that is passed to Prototype's Ajax.Request method.
+The "parameters" and "onComplete" options are used by Rico
+and have no effect if specified. The "method" option
+defaults to "get", but can be overridden.
+</dl>
+
+Here is an example taken from ex3livegridxml.php:
+<pre>
+buffer=new Rico.Buffer.AjaxXML('ricoXMLquery.php');\r
+ex3=new Rico.LiveGrid ('ex3', buffer, grid_options);\r
+</pre>
+
+<h3>AjaxXML Request</h3>
+
+<p>Assuming grid_options.prefetchBuffer is true (which is the default),
+then a single XMLHttpRequest will be generated during grid initialization
+that will fetch data from ricoXMLquery.php. The URL will include the
+following querystring (search) parameters:
+
+<dl>
+<dt>id
+<dd>The id of the grid that was specified as the first parameter in the call to
+Rico.LiveGrid(), "ex3" in the previous example.
+<dt>offset
+<dd>The first record in the dataset that should be returned. Always "0" for AjaxXML.
+<dt>page_size
+<dd>The number of records that should be returned in the dataset. 
+Always "-1" for AjaxXML, meaning all records should be returned.
+</dl>
+
+<p>Plus, if any options.requestParameters were specified, they would be included also.
+So the complete URL that would be used to fetch data for ex3 would be:
+<pre class='request'>
+ricoXMLquery.php?id=ex3&amp;offset=0&amp;page_size=-1
+</pre>
+
+<h3><a name='AjaxXMLresponse'>AjaxXML Response</a></h3>
+
+<p>Here is a sample response that will populate our ex3 LiveGrid:
+
+<pre class='response'>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;ajax-response&gt;\r
+  &lt;response type='object' id='ex3_updater'&gt;\r
+    &lt;rows update_ui='true' offset='0'&gt;\r
+    &lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+    &lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+    &lt;/rows&gt;
+    &lt;rowcount&gt;2&lt;/rowcount&gt;\r
+    &lt;debug&gt;Generated by test server&lt;/debug&gt;\r
+  &lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+
+<p>When you are creating the response in your request handler you must set the\r
+content-type of the response header to text/xml. Also you will need to specify the\r
+xml version and <a href='http://www.opentag.com/xfaq_enc.htm'>character encoding</a>. 
+The encoding value is very important and depends on your specific environment.
+Two common values are "UTF-8" and "iso-8859-1".
+Here is how the first couple of lines would look in Java Server Pages\r
+(JSP):\r
+<pre>
+&lt;% response.setHeader(“Content-Type”, “text/xml”); %&gt;\r
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;\r
+</pre>
+
+And this is how they would look in PHP:\r
+<pre>
+header("Content-type: text/xml");\r
+echo "&lt;?xml version='1.0' encoding='UTF-8'?"."&gt;\n";\r
+</pre>
+
+<p>Notice several important items about the Ajax response.\r
+
+<p>First the response is wrapped in the tags &lt;ajax-response&gt;&lt;/ajax-response&gt;. 
+Every Rico Ajax response must have this element as the root of the XML returned.\r
+Second, notice the response contained within the ajax-response. 
+The response tags (&lt;response&gt;&lt;/response&gt;) wrap the response content.
+The type and id attributes of the &lt;response&gt; tag were required in Rico 1.1, 
+but are ignored by Rico 2.0.
+Finally, notice the &lt;rowcount&gt; element.
+This specifies the total number of rows in the dataset. In an AjaxXML response,
+this should match the number of &lt;tr&gt; elements.
+
+<p>The debug tag (&lt;debug&gt;&lt;/debug&gt;) is optional. The response
+may contain 0, 1, or more of them. The content of each debug tag is
+sent to Rico's <a href='LiveGrid.html#debug'>message logging facility</a>.
+The Rico plug-ins can return the actual SQL queries that get
+executed by setting ricoXmlResponse.sendDebugMsgs to true in
+ricoXMLquery.php/asp/aspx. This can be very useful during development
+but should be turned off in production, as it is a security risk (gives
+users visibility to actual table and column names).
+
+<p>If an error occurs on the server during the processing of the request,
+the server can return error information to the user by enclosing an
+error message in &lt;error&gt;&lt;/error&gt; tags. For example:
+
+<pre class='response'>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;ajax-response&gt;\r
+  &lt;response type='object' id='ex3_updater'&gt;\r
+    &lt;rows update_ui='true' offset='0'&gt;\r
+    &lt;/rows&gt;
+    &lt;rowcount&gt;0&lt;/rowcount&gt;\r
+    &lt;error&gt;Unable to retrieve the data&lt;/error&gt;\r
+  &lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+
+<p>The mere presence of the &lt;error&gt; tag will cause any row data and the rowcount to be ignored.
+Thus, &lt;rows&gt; and &lt;rowcount&gt; can be included or omitted when returning an error.
+The Rico plug-ins will send the database-generated error message when an error occurs.
+
+
+<h2><a name='AjaxSQL'>Rico.Buffer.AjaxSQL</a></h2>
+
+<p>The AjaxSQL buffer extends the capabilities provided by the AjaxXML buffer.
+Many of the concepts are the same, but the AjaxSQL buffer is more complex.
+Query results are returned to the buffer in chunks, rather than returning
+all rows in a single response. Also, an AjaxSQL buffer assumes filtering
+and sorting will occur on the server. So filtering and sorting parameters
+must be sent in each request and the server must process those parameters correctly.
+Fortunately, the Rico plug-ins take care of this complexity for you.
+
+<p>An AjaxSQL buffer is created using the following javascript:
+
+<pre>
+buffer=new Rico.Buffer.AjaxSQL(url,options,ajaxOptions)
+</pre>
+
+Here is an example taken from ex2simple.php:
+<pre>
+buffer=new Rico.Buffer.AjaxSQL(
+  'ricoXMLquery.php', 
+  {TimeOut:&lt;? print array_shift(session_get_cookie_params())/60 ?&gt;});\r
+orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);\r
+</pre>
+
+<dl>
+<dt>url
+<dd>A string containing the url to the data provider.
+<dt><a name='AjaxSQLoptions'>options</a>
+<dd>A Rico buffer options object, which may contain any of the following:
+
+<dl>
+<dt>bufferTimeout
+<dd>An integer that specifies the number of milliseconds a wait message should be presented to the
+user before indicating a timeout. Default is 20000 (20 seconds).
+
+<dt>requestParameters
+<dd>An array of strings of the form "parm=value" that get added to the
+search string of the XMLHttpRequest.
+
+<dt>isEncoded
+<dd>Specifies whether the response will be HTML encoded or not. Default is true.
+All plug-ins supplied with Rico encode the response.
+
+<dt>waitMsg
+<dd>The message that gets displayed to the user while waiting for and XMLHttpRequest response.
+Default is RicoTranslate.getPhraseById("waitForData").
+Note that this can be an image tag, for example: 
+<pre>
+buffer=new Rico.Buffer.AjaxXML(
+  url,
+  {waitMsg: "&lt;img src='MySpinner.gif'&gt;"},
+  ajaxOptions);
+</pre>
+
+<dt>canFilter
+<dd>A boolean value indicating whether the buffer supports filtering. Default is true.
+
+<dt>largeBufferSize
+<dd>Used to set the size of the buffer. Default value is 7. The actual buffer size is set to: 
+(the number of visible grid rows) * largeBufferSize; but no less than 50.
+So a grid with 4 rows visible would get the minimum buffer size of 50, while a grid
+with 30 visible rows would have a buffer size of 210.
+
+<dt>nearLimitFactor
+<dd>Used to determine when the user has scrolled near the end of the buffer,
+triggering a new request for data. Default value is 1. The nearLimit value is set to: 
+(the number of visible grid rows) * nearLimitFactor.
+
+<dt>TimeOut
+<dd>The Rico plug-ins store the SQL query in a 
+<a href='http://www.talkphp.com/general/1077-understanding-life-session.html'>session variable</a>. 
+The server can respond to data requests for only as long as the session is valid. The TimeOut
+option is used to measure the time remaining in the session. If option.TimeOut has been
+specified and there is an html element in the document with an id of "MyGridId_timer", then
+the innerHTML of that element will be populated with the remaining time in the session.
+The TimeOut value is specified in minutes and has no default.
+
+<dt><a name='sortParmFmt'>sortParmFmt</a>
+<dd>If set, then sortParmFmt should be the name of an attribute in the Rico column object.
+Set to "displayName" in order generate requests in a format compatible with Rico 1.1:
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;sort_col=Column0&amp;sort_dir=ASC
+</pre>
+Set to "index" in order generate requests in this format:
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;sort_col=0&amp;sort_dir=ASC
+</pre>
+When unspecified (the default), then sort parameters are sent in this format 
+('s' followed by the column number). This is what the Rico plug-ins expect.
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;s0=ASC
+</pre>
+</dl>
+
+<dt>ajaxOptions
+<dd>An <a href='http://prototypejs.org/api/ajax/options'>Ajax options object</a>
+that is passed to Prototype's Ajax.Request method.
+The "parameters" and "onComplete" options are used by Rico
+and have no effect if specified. The "method" option
+defaults to "get", but can be overridden.
+</dl>
+
+
+
+<h3><a name='AjaxSQLrequests'>AjaxSQL Request</a></h3>
+
+<p>An XMLHttpRequest will be generated every time the AjaxSQL buffer needs more data.
+Data is requested in chunks as specified by the offset and page_size parameters.
+This makes it possible for a LiveGrid to efficiently display hundreds of thousands of records;
+because only a small portion of those records would reside in the client-side buffer
+at any one time.
+The URL will include the following querystring (search) parameters:
+
+<dl>
+<dt>id
+<dd>The id of the grid that was specified as the first parameter in the call to
+Rico.LiveGrid(), "ex2" in the previous example.
+
+<dt>offset
+<dd>The first record in the dataset that should be returned. Always "0" for AjaxXML.
+
+<dt>page_size
+<dd>The number of records that should be returned in the dataset. 
+Always "-1" for AjaxXML, meaning all records should be returned.
+
+<dt>get_total
+<dd>If true, then the response should include a &lt;rowcount&gt; element
+that contains the total number of rows in the dataset (not just
+the chunk being requested), with the specified filters.
+"get_total=true" will be sent during the first request to populate
+a grid and any time the user has changed the filters.
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;get_total=true
+</pre>
+
+<dt>sX <span>(where X is the column #)</span>
+<dd>Specifies that results should be sorted by column X.
+Parameter will be ASC or DESC. See also <a href='#sortParmFmt'>options.sortParmFmt</a>.
+Even though this parameter format theoretically allows for sorting on more than
+one column at a time, this is not possible with the current LiveGrid UI.
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;s0=ASC
+</pre>
+
+<dt>f[X][op] <span>(where X is the column #)</span>
+<dd>Specifies the filter operator being applied to column X.
+Parameter will be one of the following: EQ (equal), NE (not equal),
+ GE (greater than or equal), LE (less than or equal), LIKE, NULL, NOTNULL
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;f[0][op]=EQ
+</pre>
+
+<dt>f[X][len] <span>(where X is the column #)</span>
+<dd>Specifies the number of filter values being supplied.
+This will be 1 for EQ, GE, LE, and LIKE filter operators.
+It will be 0 for NULL and NOTNULL operators. It will be
+1 or more for NE.
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;f[0][op]=EQ&amp;f[0][len]=1
+</pre>
+
+<dt>f[X][Y] <span>(where X is the column #)</span>
+<dd>Specifies the filter value(s) for EQ, NE, GE, LE, and LIKE filter operators.
+Y will range from 0 to f[X][len]-1.
+For the LIKE operator, '*' is treated as the wildcard character,
+which gets converted to '%' by the Rico plug-in for most databases.
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;...&amp;f[0][op]=EQ&amp;f[0][len]=1&amp;f[0][0]=Column0Value
+</pre>
+</dl>
+
+<p>Plus, if any options.requestParameters were specified, they would be included also.
+So the complete URL that would be used to fetch data for ex2 would be:
+<pre class='request'>
+ricoXMLquery.php?id=ex2&amp;offset=0&amp;page_size=28
+</pre>
+
+
+<h3>AjaxSQL Response</h3>
+
+<p>The format of the AjaxSQL response is exactly the same as the 
+<a href='#AjaxXMLresponse'>AjaxXML response</a>.
+
+
+<h2><a name='AjaxJSON'>Rico.Buffer.AjaxJSON</a></h2>
+
+<p>The AjaxJSON buffer was created by Jeremy Green and is an extension to the AjaxSQL buffer.
+An AjaxJSON buffer is created using the following javascript:
+
+<pre>
+buffer=new Rico.Buffer.AjaxJSON(jsonUrl,options)
+</pre>
+
+<dl>
+<dt>url
+<dd>A string containing the url to the JSON data provider.
+
+<dt>options
+<dd>A Rico buffer options object. The values available in AjaxJSON are same as those in 
+<a href='#AjaxSQLoptions'>AjaxSQL</a>.
+</dl>
+
+
+<h3>AjaxJSON Request</h3>
+
+<p>The format of AjaxJSON requests are exactly the same as 
+<a href='#AjaxSQLrequests'>AjaxSQL requests</a>.
+
+
+<h3>AjaxJSON Response</h3>
+
+<p>Here is an example of a LiveGrid response in JSON format.\r
+\r
+<pre class='response'>
+{
+"update_ui": true,
+"offset": 0,
+"rows": [
+["10248","VINET","Vins et alcools Chevalier","Reims","France","1996-07-04 00:00:00","1996-07-16 00:00:00"],
+["10249","TOMSP","Toms Spezialitäten","Münster","Germany","1996-07-05 00:00:00","1996-07-10 00:00:00"],
+["10250","HANAR","Hanari Carnes","Rio de Janeiro","Brazil","1996-07-08 00:00:00","1996-07-12 00:00:00"],
+["10251","VICTE","Victuailles en stock","Lyon","France","1996-07-08 00:00:00","1996-07-15 00:00:00"],
+["10252","SUPRD","Suprêmes délices","Charleroi","Belgium","1996-07-09 00:00:00","1996-07-11 00:00:00"],
+["10253","HANAR","Hanari Carnes","Rio de Janeiro","Brazil","1996-07-10 00:00:00","1996-07-16 00:00:00"],
+["10254","CHOPS","Chop-suey Chinese","Bern","Switzerland","1996-07-11 00:00:00","1996-07-23 00:00:00"]
+],
+"rowCount": 830
+}
+</pre>
+\r
+<p>The format closely follows the XML based data consumed by the Rico.Buffer.AjaxSQL buffer 
+and all values should be returned accordingly.\r
+The ‘rows’ value object of the data object is a normal JS Array with each element 
+being a JS hash that represents the row. For the hash the key/value combo should be colName/colValue.\r
+
+
+</body>
+</html>
diff --git a/documentation/LiveGridAjax_ja.html b/documentation/LiveGridAjax_ja.html
new file mode 100644 (file)
index 0000000..2ad1776
--- /dev/null
@@ -0,0 +1,424 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<title>Rico LiveGrid AJAX</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">\r
+\r
+<style type="text/css">\r
+.request, .response {\r
+  border: 1px solid black;\r
+  background-color: #FFF8DC;\r
+  padding: 4px;\r
+}\r
+dt span {\r
+  font-weight:normal;\r
+  font-style:italic;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+<h1>Rico LiveGrid AJAX</h1>\r
+\r
+<p>Rico LiveGrid の鍵となる特徴の一つは AJAX を通して動的にデータをロードするその能力です。\r
+このドキュメントは、LiveGrid AJAX のリクエストとレスポンスのフォーマットに焦点を合わせます。\r
+より明確には、LiveGrid <strong>バッファ</strong>オブジェクトがリクエストを生成し、レスポンスを処理します。\r
+それで、もし支配外のウェブサービスからデータが来る状況下にいるなら、ウェブサービスと LiveGrid \r
+の間のインタフェースとして用いられるカスタム LiveGrid バッファクラスを作成して下さい。\r
+しかし、このドキュメントでは Rico ディストリビューションに付属するバッファクラスのリクエストと\r
+レスポンスのフォーマットに焦点を合わせます。\r
+\r
+<p>Rico ディストリビューションは 4 つの異なるバッファクラスを含みます。\r
+<dl>\r
+<dt>Rico.Buffer.Base\r
+<dd>AJAX では無い(すなわち XMLHttpRequest の呼び出しの無い)静的なデータセットの利用。\r
+データは HTML テーブル又は javascript 配列からロードされる事が出来ます。\r
+このバッファは AJAX を利用しないので、このドキュメントでこれ以上議論されません。\r
+<dt><a href='#AjaxXML'>Rico.Buffer.AjaxXML</a>\r
+<dd>すべての LiveGrid データは一回の AJAX の呼び出しでロードされ、データは XML フォーマットで返されます\r
+<dt><a href='#AjaxSQL'>Rico.Buffer.AjaxSQL</a>\r
+<dd>LiveGrid のデータは、ユーザがグリッドを通してスクロールすることにより、塊でロードされます\r
+<dt><a href='#AjaxJSON'>Rico.Buffer.AjaxJSON</a>\r
+<dd>レスポンスが JSON フォーマットである事を除いては AjaxSQL と同じです\r
+</dl>\r
+\r
+<h2><a name='AjaxXML'>Rico.Buffer.AjaxXML</a></h2>\r
+\r
+<p>AjaxXML バッファは、LiveGrid でユーザが行うスクロールの量を考慮しないで、\r
+一回の XMLHttpRequest の実行だけを行います。\r
+AjaxXML バッファは以下の javascript を利用して生成されます。\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML(url,options,ajaxOptions)\r
+</pre>\r
+\r
+<dl>\r
+<dt>url\r
+<dd>データプロバイダへの url を含んでいる文字列。\r
+<dt>options\r
+<dd>以下のどれかを含む Rico バッファオプションオブジェクト。\r
+\r
+<dl>\r
+<dt>bufferTimeout\r
+<dd>タイムアウトを示す前に待ちメッセージをユーザに表示すべきミリ秒の数を指定する整数\r
+デフォルトは 20000 (20 秒)。\r
+\r
+<dt>requestParameters\r
+<dd>XMLHttpRequest の検索文字列に加えられる "parm=value" の形の文字列の配列。\r
+\r
+<dt>isEncoded\r
+<dd>レスポンスが HTML エンコードされるかどうかを指定します。デフォルトは true です。\r
+Rico と共に提供されるすべてのプラグインは、レスポンスをエンコードします。\r
+\r
+<dt>waitMsg\r
+<dd>XMLHttpRequest レスポンスを待つ間ユーザに表示されるメッセージ。\r
+デフォルトは RicoTranslate.getPhraseById("waitForData")。\r
+これがイメージタグである事が出来る点に注意して下さい、例えば。\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML(\r
+  url,\r
+  {waitMsg: "&lt;img src='MySpinner.gif'&gt;"},\r
+  ajaxOptions);\r
+</pre>\r
+\r
+<dt>canFilter\r
+<dd>バッファがフィルタリングをサポートするかどうかを示す真偽値。デフォルトは true です。\r
+</dl>\r
+\r
+<dt>ajaxOptions\r
+<dd>Prototype の Ajax.Request メソッドに渡す \r
+<a href='http://prototypejs.org/api/ajax/options'>Ajax オプションオブジェクト</a>。\r
+"parameters" と "onComplete" オプションが指定されるならば、Rico によって利用され、\r
+エフェクトを持ちません。\r
+"method" オプションはデフォルトで "get" ですが、オーバーライドされる事が出来ます。\r
+</dl>\r
+\r
+ここに ex3livegridxml.php から取った実例があります。\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML('ricoXMLquery.php');\r
+ex3=new Rico.LiveGrid ('ex3', buffer, grid_options);\r
+</pre>\r
+\r
+<h3>AjaxXML リクエスト</h3>\r
+\r
+<p>grid_options.prefetchBuffer が true (それはデフォルトです)なら、グリッドの初期化の間に、\r
+ricoXMLquery.php からデータをフェッチする、一つの XMLHttpRequest が生成されます。\r
+この URL は、以下のクエリーストリング(検索)パラメータを含みます。\r
+\r
+<dl>\r
+<dt>id\r
+<dd>以前の実例 "ex3" の Rico.LiveGrid() の呼び出しで、\r
+最初のパラメータとして指定されたグリッドの id。\r
+<dt>offset\r
+<dd>返さなければならないデータセットの最初のレコード。 AjaxXML では常に "0" です。\r
+<dt>page_size\r
+<dd>データセットで返されなければならないレコードの数。\r
+AjaxXML では常に "-1" で、すべてのレコードが返されなければならない事を意味します。\r
+</dl>\r
+\r
+<p>加えて、options.requestParameters が指定されるならば、それらもまた含まれる事になります。\r
+そして、ex3 のためのデータのフェッチに利用される完全な URL は、次の通りです。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex3&amp;offset=0&amp;page_size=-1\r
+</pre>\r
+\r
+<h3><a name='AjaxXMLresponse'>AjaxXML レスポンス</a></h3>\r
+\r
+<p>ここに ex3 の LiveGrid を実装するサンプルのレスポンスがあります。\r
+\r
+<pre class='response'>\r
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;\r
+&lt;ajax-response&gt;\r
+  &lt;response type='object' id='ex3_updater'&gt;\r
+    &lt;rows update_ui='true' offset='0'&gt;\r
+    &lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+    &lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+    &lt;/rows&gt;\r
+    &lt;rowcount&gt;2&lt;/rowcount&gt;\r
+    &lt;debug&gt;Generated by test server&lt;/debug&gt;\r
+  &lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+<p>リクエストハンドラでレスポンスを作成する時に、レスポンスヘッダの content-type に \r
+text/xml を設定しなければなりません。\r
+xml バージョンと<a href='http://www.opentag.com/xfaq_enc.htm'>文字エンコーディング</a>も指定する必要があります。\r
+エンコーディングの値は非常に重要で、環境に依存します。\r
+二つの一般的な値は "UTF-8" と "iso-8859-1" です。\r
+Java Server Pages (JSP) で、最初の 2、3 行がどのように見えるかは、ここにあります。\r
+<pre>\r
+&lt;% response.setHeader(“Content-Type”, “text/xml”); %&gt;\r
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;\r
+</pre>\r
+\r
+そして、これは PHP ではそれらがどのように見えるかです。\r
+<pre>\r
+header("Content-type: text/xml");\r
+echo "&lt;?xml version='1.0' encoding='UTF-8'?"."&gt;\n";\r
+</pre>\r
+\r
+<p>Ajax レスポンスについての、いくつかの重要なアイテムに注意して下さい。\r
+\r
+<p>最初に、レスポンスは &lt;ajax-response&gt;&lt;/ajax-response&gt; タグで囲まれます。\r
+すべての Rico Ajax レスポンスは、返す XML の root に、この要素を持たなければなりません。\r
+第二に、レスポンスは ajax-response の範囲内に含まれる事に注意して下さい。\r
+レスポンスタグ(&lt;response&gt;&lt;/response&gt;)はレスポンスの内容を囲みます。\r
+&lt;response&gt; タグの type と id 属性は、Rico 1.1 では必要とされていましたが、Rico 2.0 では無視されます。\r
+最後に、&lt;rowcount&gt; 要素に注意して下さい。\r
+これはデータセットの総行数を指定します。\r
+AjaxXML レスポンスにおいて、これは &lt;tr&gt; 要素の数と一致するはずです。\r
+\r
+<p>デバッグタグ(&lt;debug&gt;&lt;/debug&gt;)は任意です。\r
+レスポンスはそれらを 0、1、またはそれ以上含むかもしれません。\r
+それぞれのデバッグタグの内容は、Rico の<a href='LiveGrid.html#debug'>メッセージログ機能</a>へ送られます。\r
+Rico プラグインは、ricoXMLquery.php/asp/aspx で ricoXmlResponse.sendDebugMsgs を true に設定することにより、\r
+実行された実際の SQL クエリを返す事が出来ます。\r
+これは、開発の間はとても役に立ちますが、セキュリティーリスク(ユーザに実際のテーブルと列の名前を見せる)\r
+となるので、製品においては削除しなければなりません。\r
+\r
+<p>リクエストの進行中にサーバでエラーが発生するなら、サーバはエラーメッセージを &lt;error&gt;&lt;/error&gt; \r
+タグで囲んでユーザにエラー情報を返す事が出来ます。\r
+例えば。\r
+\r
+<pre class='response'>\r
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;\r
+&lt;ajax-response&gt;\r
+  &lt;response type='object' id='ex3_updater'&gt;\r
+    &lt;rows update_ui='true' offset='0'&gt;\r
+    &lt;/rows&gt;\r
+    &lt;rowcount&gt;0&lt;/rowcount&gt;\r
+    &lt;error&gt;Unable to retrieve the data&lt;/error&gt;\r
+  &lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+<p>&lt;error&gt; タグが存在すると、いかなる行データや rowcount も無視されます。\r
+このように、エラーを返す時には &lt;rows&gt; と &lt;rowcount&gt; は含まれる事や省略される事が出来ます。\r
+エラーが発生する時、Rico プラグインはデータベース生成エラーを送ります。\r
+\r
+<h2><a name='AjaxSQL'>Rico.Buffer.AjaxSQL</a></h2>\r
+\r
+<p>AjaxSQL バッファは、AjaxXML バッファにより提供される能力を拡張します。\r
+コンセプトの多くは同じですが、AjaxSQL バッファはより複雑です。\r
+クエリ結果は、一回のレスポンスですべての行を返すのでは無く、塊でバッファに返されます。\r
+また、AjaxSQL バッファはサーバ上でフィルタとソートが発生すると考えられます。\r
+そして、フィルタとソートのパラメータはそれぞれのリクエストに送られなくてはならず、\r
+サーバはそれらのパラメータを正しく処理しなければなりません。\r
+幸いにも、Rico プラグインは、あなたのためにこの複雑さを解決します。\r
+\r
+<p>AjaxSQL バッファは以下の javascript を利用して作成されます。\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxSQL(url,options,ajaxOptions)\r
+</pre>\r
+\r
+ここに ex2simple.php から取った実例があります。\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxSQL(\r
+  'ricoXMLquery.php', \r
+  {TimeOut:&lt;? print array_shift(session_get_cookie_params())/60 ?&gt;});\r
+orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);\r
+</pre>\r
+\r
+<dl>\r
+<dt>url\r
+<dd>データプロバイダへの url を含んでいる文字列。\r
+<dt><a name='AjaxSQLoptions'>options</a>\r
+<dd>以下のどれかを含む Rico バッファオプションオブジェクト。\r
+\r
+<dl>\r
+<dt>bufferTimeout\r
+<dd>タイムアウトを示す前に待ちメッセージをユーザに表示すべきミリ秒の数を指定する整数。\r
+デフォルトは 20000 (20 秒)。\r
+\r
+<dt>requestParameters\r
+<dd>XMLHttpRequest の検索文字列に加えられる "parm=value" の形の文字列の配列。\r
+\r
+<dt>isEncoded\r
+<dd>レスポンスが HTML エンコードされるかどうかを指定します。デフォルトは true です。\r
+Rico と共に提供されるすべてのプラグインは、レスポンスをエンコードします。\r
+\r
+<dt>waitMsg\r
+<dd>XMLHttpRequest レスポンスを待つ間ユーザに表示されるメッセージ。\r
+デフォルトは RicoTranslate.getPhraseById("waitForData")。\r
+これがイメージタグである事が出来る点に注意して下さい、例えば。\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML(\r
+  url,\r
+  {waitMsg: "&lt;img src='MySpinner.gif'&gt;"},\r
+  ajaxOptions);\r
+</pre>\r
+\r
+<dt>canFilter\r
+<dd>バッファがフィルタリングをサポートするかどうかを示す真偽値。デフォルトは true です。\r
+\r
+<dt>largeBufferSize\r
+<dd>バッファのサイズを設定するために利用されます。デフォルトは 7 です。\r
+実際のバッファサイズは「(グリッドの表示行数)* largeBufferSize」に設定されますが、少なくとも 50 です。\r
+そして、4 行を表示するグリッドは 50 のサイズの最小のバッファを手にいれますが、\r
+一方 30 行を表示するグリッドは 210 のサイズを持ちます。\r
+\r
+<dt>nearLimitFactor\r
+<dd>ユーザがバッファの最後付近にスクロールした時、データの新しいリクエストのトリガーを決定するのに利用されます。\r
+デフォルトは 1 です。\r
+nearLimit の値は「(グリッドの表示行数)* nearLimitFactor」に設定されます。\r
+\r
+<dt>TimeOut\r
+<dd>Rico プラグインは SQL クエリを\r
+<a href='http://www.talkphp.com/general/1077-understanding-life-session.html'>セッション変数</a>に保管します。\r
+サーバはセッションが有効な間だけはデータのリクエストに返答する事が出来ます。\r
+TimeOut オプションはセッションが存続する時間を測るために利用されます。\r
+option.TimeOut が指定され、document に id が "MyGridId_timer" の html 要素があるなら、\r
+その要素の innerHTML はセッションが存続する時間で実装されます。\r
+TimeOut の値は分で指定され、デフォルトを持ちません。\r
+\r
+<dt><a name='sortParmFmt'>sortParmFmt</a>\r
+<dd>セットされるならば、sortParmFmt は Rico 列オブジェクトの属性の名前でなければなりません。\r
+Rico 1.1 互換のフォーマットでリクエストを生成するために、"displayName" を設定して下さい。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;sort_col=Column0&amp;sort_dir=ASC\r
+</pre>\r
+リクエストをこのフォーマットで生成するために、"index" を設定して下さい。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;sort_col=0&amp;sort_dir=ASC\r
+</pre>\r
+指定しない(デフォルト)時、ソートパラメータは、このフォーマットで送信されます('s' に続く列番号)。\r
+これは、Rico プラグインが期待するものです。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;s0=ASC\r
+</pre>\r
+</dl>\r
+\r
+<dt>ajaxOptions\r
+<dd>Prototype の Ajax.Request メソッドへ渡される <a href='http://prototypejs.org/api/ajax/options'>Ajax オプションオブジェクト</a>。\r
+"parameters" と "onComplete" オプションは Rico によって利用され、指定されたとしても効果がありません。\r
+"method" オプションのデフォルトは "get" ですが、オーバーライドされる事が出来ます。\r
+</dl>\r
+\r
+\r
+\r
+<h3><a name='AjaxSQLrequests'>AjaxSQL リクエスト</a></h3>\r
+\r
+<p>AjaxSQL バッファがより多くのデータを必要とするたびに XMLHttpRequest は生成されます。\r
+offset と page_size パラメータによって指定されるように、データは塊でリクエストされます。\r
+これは、LiveGrid が効率的に何十万ものレコードを表示する事を可能にします。\r
+なぜなら、どんな時でもクライアントサイドバッファに、それらのレコードの小さな部分だけが記録されているからです。\r
+この URL は以下のクエリーストリング(検索)パラメータを含みます。\r
+\r
+<dl>\r
+<dt>id\r
+<dd>以前の実例 "ex2" の Rico.LiveGrid() の呼び出しで、最初のパラメータとして指定されたグリッドの id。\r
+\r
+<dt>offset\r
+<dd>返さなければならないデータセットの最初のレコード。 AjaxXML では常に "0" です。\r
+\r
+<dt>page_size\r
+<dd>データセットで返されなければならないレコードの数。\r
+AjaxXML では常に "-1" で、すべてのレコードが返されなければならない事を意味します。\r
+\r
+<dt>get_total\r
+<dd>true なら、そのレスポンスは、指定されたフィルタと共に(リクエストされた塊だけで無く)\r
+データセットの総行数を含む &lt;rowcount&gt; 要素を含むはずです。\r
+"get_total=true" は、どんな時にユーザがフィルタを変更しても、\r
+グリッドを実装するための最初のリクエストの間に送られます。\r
+\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;get_total=true\r
+</pre>\r
+\r
+<dt>sX <span>( X は列の数です)</span>\r
+<dd>列 X によってソートされるべき結果を指定します。\r
+パラメータは ASC または DESC です。\r
+<a href='#sortParmFmt'>options.sortParmFmt</a> も見て下さい。\r
+たとえ、このパラメータのフォーマットが一度に複数列をソートする事を理論的に許すとしても、\r
+それは現在の LiveGrid UI では不可能です。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;s0=ASC\r
+</pre>\r
+\r
+<dt>f[X][op] <span>( X は列の数です)</span>\r
+<dd>列 X に適応されているフィルタオペレータを指定します。\r
+パラメータは以下の内の一つです。EQ(等しい)、NE(等しく無い)、GE(以上)、LE(以下)、LIKE、NULL、NOTNULL\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;f[0][op]=EQ\r
+</pre>\r
+\r
+<dt>f[X][len] <span>( X は列の数です)</span>\r
+<dd>供給されているフィルタの値の数を指定します。\r
+これは EQ、GE、LE、そして LIKE フィルタオペレータでは 1 です。\r
+これは NULL そして NOTNULL オペレータでは 0 です。\r
+これは NE では 1 またはそれ以上です。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;f[0][op]=EQ&amp;f[0][len]=1\r
+</pre>\r
+\r
+<dt>f[X][Y] <span>( X は列の数です)</span>\r
+<dd>EQ、NE、GE、LE、そして LIKE フィルタオペレータのフィルタの(複数の)値を指定します。\r
+Y は 0 から f[X][len]-1 の範囲です。\r
+LIKE オペレータでの '*' は ワイルドカードとして扱われ、\r
+それは Rico プラグインによって多くのデータベースのために '%' に変換されます。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;...&amp;f[0][op]=EQ&amp;f[0][len]=1&amp;f[0][0]=Column0Value\r
+</pre>\r
+</dl>\r
+\r
+<p>加えて、options.requestParameters が指定されるならば、それらもまた含まれる事になります。\r
+そして、ex2 のためのデータのフェッチに利用される完全な URL は、次の通りでしょう。\r
+<pre class='request'>\r
+ricoXMLquery.php?id=ex2&amp;offset=0&amp;page_size=28\r
+</pre>\r
+\r
+\r
+<h3>AjaxSQL レスポンス</h3>\r
+\r
+<p>AjaxSQL レスポンスのフォーマットは、<a href='#AjaxXMLresponse'>AjaxXML レスポンス</a>と全く同じです。\r
+\r
+<h2><a name='AjaxJSON'>Rico.Buffer.AjaxJSON</a></h2>\r
+\r
+<p>AjaxJSON バッファは Jeremy Green により作成された AjaxSQL バッファの拡張です。\r
+AjaxJSON バッファは、以下の javascript を利用して作成されます。\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxJSON(jsonUrl,options)\r
+</pre>\r
+\r
+<dl>\r
+<dt>url\r
+<dd>JSON データプロバイダへの url を含んでいる文字列。\r
+\r
+<dt>options\r
+<dd>Rico バッファオプションオブジェクト。\r
+AjaxJSON で利用出来る値は <a href='#AjaxSQLoptions'>AjaxSQL</a> のそれらと同じです。\r
+</dl>\r
+\r
+\r
+<h3>AjaxJSON リクエスト</h3>\r
+\r
+<p>AjaxJSON リクエストのフォーマットは、<a href='#AjaxSQLrequests'>AjaxSQL リクエスト</a>と全く同じです。\r
+\r
+\r
+<h3>AjaxJSON レスポンス</h3>\r
+\r
+<p>ここに JSON フォーマットによる LiveGrid レスポンスの実例があります。\r
+\r
+<pre class='response'>\r
+{\r
+  "update_ui":"true",\r
+  "offset":"0",\r
+  "rowCount":"20",\r
+  "rows":[\r
+            {"id":"1","name":"Bob"},\r
+            {"id":"2","name":"Bill"}\r
+         ]\r
+}\r
+</pre>\r
+\r
+<p>そのフォーマットは Rico.Buffer.AjaxSQL バッファによって消費される XML に基づくデータに密接に従い、\r
+そしてそれによってすべての値は返されるべきです。\r
+データオブジェクトの 'rows' の値オブジェクトは、行を表す JS ハッシュであるそれぞれの要素による通常の JS 配列です。\r
+ハッシュの key/value の組み合わせは colName/colValue であるべきです。\r
+\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/LiveGridForms.html b/documentation/LiveGridForms.html
new file mode 100644 (file)
index 0000000..f1f0762
--- /dev/null
@@ -0,0 +1,474 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico LiveGrid Forms</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>\r
+\r
+<body>\r
+<h1>Using Rico LiveGrid Forms</h1>\r
+\r
+<p><a href='LiveGridForms_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='LiveGridForms_ja.html'>View this page in Japanese</a></p>\r
+\r
+<h2>OVERVIEW</h2>\r
+\r
+<p>While this document just refers to ASP, identical functionality is provided\r
+by the PHP and .net plugins.\r
+\r
+<ol>\r
+<li>create a new ASP file that includes ricoLiveGridForms.vbs\r
+\r
+<li>in the new ASP, define each of the fields in the table to be edited - usually 1-3 lines of code per field\r
+\r
+<li>the resulting ASP not only creates the appropriate grid, but also generates an input form in a hidden div\r
+\r
+<li>the ASP also adds "add/edit/delete record" entries to the popup menu\r
+\r
+<li>when add or edit is chosen, the form is unhidden (and filled in if edit was chosen)\r
+\r
+<li>when the user hits the save button, the form silently posts back to the original ASP\r
+\r
+<li>the ASP saves the data to the database and sends a response back to the client\r
+\r
+<li>the client displays a success or failure message in the bookmark area\r
+</ol>\r
+\r
+<p>The following two diagrams shows how requests and responses flow with LiveGrid Forms pages,\r
+and with LiveGrid pages without forms.\r
+While the two diagrams are labelled ASP/PHP, they also apply to .net (except that there is no dbClass2 in .net).\r
+<p><img src='images/asp-php-structure1.jpg'>\r
+<p><img src='images/asp-php-structure2.jpg'>\r
+\r
+\r
+<h2>USAGE</h2>\r
+\r
+<p>This class provides all of the functions necessary to view, insert, update, and delete\r
+records on a single table. An ASP script should follow these steps:\r
+\r
+<ol>\r
+<li>Create a single instance of the class\r
+<pre>set oForm=new TableEditClass</pre>\r
+\r
+<li>call the SetTableName method\r
+<pre>oForm.SetTableName "customer"</pre>\r
+\r
+<li>optionally set the CanAdd, CanEdit, CanDelete, ConfirmDelete, and/or RecordName properties if desired\r
+<pre>\r
+oForm.options("canAdd")=CanAdd\r
+oForm.options("canEdit")=CanModify\r
+oForm.options("canDelete")=CanDelete\r
+</pre>\r
+<li>if TableName is a view or has no primary key defined, editing will be disabled\r
+<li>call AddEntryField or AddCalculatedField for each field/column to be displayed\r
+      Fields appear in both the table and form views, with the following exceptions:\r
+<ul>\r
+<li>entry type is H never gets sent to the client. Writes to the database get the defined default value.\r
+<li>if FormView field property is set to "exclude", then the field appears in the table only.\r
+<li>if FormView field property is set to "hidden", then the data is put in a hidden form field.\r
+<li>Calculated fields appear in the table view only (same as FormView=exclude)\r
+</ul>\r
+\r
+<li>After each call to AddEntryField or AddCalculatedField, the other methods and properties\r
+      can be invoked to control how the field is presented to the user (e.g. SortAsc).\r
+      Calls to these properties/methods apply only to the field most recently added.\r
+<li>call DisplayPage - this displays the grid or executes the database update\r
+<pre>oForm.DisplayPage</pre>\r
+</ol>\r
+\r
+\r
+<h2>TABBED FORMS</h2>\r
+\r
+<p>Forms with multiple panels/tabs are fully supported using the Rico.TabbedPanel class.\r
+ Simply call AddPanel before calling AddEntryField to define the fields for that panel.\r
+ For example:\r
+<pre>\r
+' these fields appear on the first panel\r
+oForm.AddPanel "Panel #1"\r
+oForm.AddEntryField "field1", "Field #1", "T", ""\r
+oForm.AddEntryField "field2", "Field #2", "T", ""\r
+oForm.AddEntryField "field3", "Field #3", "T", ""\r
+\r
+' these fields appear on the second panel\r
+oForm.AddPanel "Panel #2"\r
+oForm.AddEntryField "field4", "Field #4", "T", ""\r
+oForm.AddEntryField "field5", "Field #5", "T", ""\r
+oForm.AddEntryField "field6", "Field #6", "T", ""\r
+</pre>\r
+\r
+<p>Alternatively, the panelIdx property can be set for each field as it is defined. In this\r
+case, AddPanel can be called at any time prior to DisplayPage.\r
+<pre>\r
+' these fields appear on the first panel\r
+oForm.AddEntryField "field1", "Field #1", "T", ""\r
+oForm.CurrentField("panelIdx")=0\r
+oForm.AddEntryField "field2", "Field #2", "T", ""\r
+oForm.CurrentField("panelIdx")=0\r
+oForm.AddEntryField "field3", "Field #3", "T", ""\r
+oForm.CurrentField("panelIdx")=0\r
+\r
+' these fields appear on the second panel\r
+oForm.AddEntryField "field4", "Field #4", "T", ""\r
+oForm.CurrentField("panelIdx")=1\r
+oForm.AddEntryField "field5", "Field #5", "T", ""\r
+oForm.CurrentField("panelIdx")=1\r
+oForm.AddEntryField "field6", "Field #6", "T", ""\r
+oForm.CurrentField("panelIdx")=1\r
+\r
+oForm.AddPanel "Panel #1"\r
+oForm.AddPanel "Panel #2"\r
+</pre>\r
+\r
+\r
+<h2>FORM METHODS</h2>\r
+<dl>\r
+  <dt>AddPanel "Panel Heading"\r
+  <dd>Defines the heading for a tabbed panel on the input form.\r
+\r
+  <dt>DisplayPage\r
+  <dd>Displays the grid or updates the database depending on the value of "action".\r
+\r
+  <dt><a name='DefineAltTable'></a>DefineAltTable (TableName, FieldList, FieldData, Delim)\r
+  <dd>Function that returns a TabId to be used in subsequent <a href='#AltTable'>AltTable</a> calls.\r
+  Defines a secondary table to store additional, related fields.\r
+  Key field(s) in main table must also exist in AltTable.\r
+  FieldList & FieldData are delimited strings that define\r
+  additional, constant values/functions to be stored in the secondary table.\r
+  Delim specifies the delimiter character used in FieldList & FieldData.\r
+  FieldList & FieldData must contain the same number of delimited entries.\r
+\r
+  <dt>genXHTML\r
+  <dd>Call to generate pure XHTML output.\r
+\r
+  <dt>SetDbConn (dbcls)\r
+  <dd>Specifies the instance of dbClass to be used.\r
+  If a global instance named oDB exists, then it will be used without this method having to be called.\r
+</dl>\r
+\r
+\r
+<h2>FORM PROPERTIES</h2>\r
+\r
+<p>All <a href="LiveGrid.html#options">LiveGrid</a> options are supported as properties, in addition to these which are specific to LiveGrid Forms.\r
+\r
+<dl>\r
+\r
+<dt>action (read only)\r
+<dd>specifies the current action being performed: table, ins, upd, del\r
+\r
+<dt>gridVar (read only)\r
+<dd>returns the name of the client-side LiveGrid object\r
+\r
+<dt>bufferVar (read only)\r
+<dd>returns the name of the client-side LiveGrid Buffer object\r
+\r
+<dt>AutoInit\r
+<dd>automatically initialize the grid (create the data rows)\r
+    default is true\r
+\r
+<dt>InitScript (read only)\r
+<dd>returns the javascript code (as a string) to initialize the grid (use when AutoInit is false)\r
+\r
+<dt>TableFilter\r
+<dd>specifies a where clause to be used in table view (optional)\r
+<pre>\r
+// only show records for the logged in user\r
+$oForm->TableFilter = "userid=$myuserid";\r
+</pre>\r
+\r
+<dt>canAdd\r
+<dd>allow user to add new records, defaults to true\r
+<dt>canEdit\r
+<dd>allow user to edit records, defaults to true\r
+<dt>canDelete\r
+<dd>allow user to delete records, defaults to true\r
+<dt>canClone\r
+<dd>allow user to clone records (edit existing record but save as new), defaults to false\r
+\r
+<dt>formView\r
+<dd>Extend the grid with LiveGrid Forms -- data entry form is created, add/edit/delete items are\r
+added to the grid menu, etc. Default is true in ASP and PHP, false in .net.\r
+\r
+<dt>updateURL\r
+<dd>post updates back to this location, defaults to the page that generated the grid\r
+\r
+<dt>ConfirmDelete\r
+<dd>flag specifying whether a confirmation popup should be displayed\r
+    after the user clicks the delete button, defaults to true\r
+    (see also <a href='#ConfirmDeleteCol'>ConfirmDeleteCol</a>)\r
+\r
+<dt>DebugFlag\r
+<dd>displaying debugging messages, defaults to false\r
+\r
+<dt>RecordName\r
+<dd>string to customize add, edit, and delete title tags,\r
+    defaults to "Record"\r
+\r
+<dt>maxDisplayLen\r
+<dd>Text box width. default is 20.\r
+\r
+<dt>TableName (write only)\r
+<dd>the table or view to be displayed/edited (required)\r
+\r
+<dt>TableSelectNew\r
+<dd>String used to identify when a user has selected to create a new value\r
+for an EntryType N field. Default is "___new___".\r
+\r
+<dt>showSaveMsg\r
+<dd>Disposition of database update responses:\r
+<ul>\r
+<li>full - show full response\r
+<li>errors - show full response for errors and short response otherwise (default)\r
+</ul>\r
+</dd>\r
+\r
+<dt style='color:navy;'><em>When using tabbed panels on the input form:</em>\r
+\r
+<dt>panelWidth\r
+<dd>Width of tabbed panels in pixels. Default is 500.\r
+\r
+<dt>panelHeight\r
+<dd>Height of tabbed panels in pixels. Default is 200.\r
+\r
+<dt>hoverClass\r
+<dd>CSS class when hovering over panel tab. Default is "tabHover".\r
+\r
+<dt>selectedClass\r
+<dd>CSS class when panel tab is selected. Default is "tabSelected".\r
+\r
+</dl>\r
+\r
+\r
+<h2>FORM EVENTS</h2>\r
+\r
+<p>It is possible to hook into several form events.\r
+\r
+<dl>\r
+<dt>formOpen\r
+<dd>Fires when the input form is displayed.\r
+<pre>\r
+oForm.options("formOpen")=\r
+  "alert('Questions? Please call the support desk.');"\r
+</pre>\r
+\r
+<dt>formClose\r
+<dd>Fires right after the input form is closed.\r
+\r
+<dt>onSubmitResponse\r
+<dd>Fires after a form has been sent to the server and a response has been received and processed.\r
+\r
+</dl>\r
+\r
+\r
+<h2>FIELD DEFINITION-METHODS</h2>\r
+<dl>\r
+<dt>AddEntryField (ColumnName, Heading, EntryTypeCode, DefaultValue)\r
+<dd>Adds a new column to the grid and a new entry field to the popup form in ASP and PHP.\r
+  <dl>\r
+\r
+  <dt>ColumnName\r
+  <dd>column name in the database table (does not support blanks or any name that would require square brackets in SQL, e.g.  [Apr 2005])\r
+\r
+  <dt>Heading\r
+  <dd>name that appears on the grid column's heading and also on the popup form\r
+\r
+  <dt>EntryTypeCode\r
+  <dd>string containing a code that controls how the column is displayed on the input form\r
+\r
+    <ul>\r
+    <li><strong>S</strong>:\r
+    Display this column as a drop-down select list during data entry.\r
+    Values may be specified using the "SelectValues" or "SelectSql" options.\r
+    If neither is specified, then the values for the column are obtained using \r
+    a "select distinct" query.\r
+    <li><strong>R</strong>: Same as "S", except the items are displayed using radio buttons.\r
+    <li><strong>SL,RL</strong>: \r
+    Same as S & R, except that a lookup value is displayed in table view \r
+    (uses query specified by SelectSql).\r
+    Typically used on columns that are foreign keys. SQL to get the display value \r
+    is specified using the "SelectSql" option.\r
+    <li><strong>CL</strong>:  Same as "SL", except that the value is selected \r
+    using a custom control (such as the Rico Tree control).\r
+    The SelectCtl option must be assigned the id of the custom control.\r
+    <li><strong>N</strong>:\r
+    Same as "S", but allows the user to create a new value.\r
+    Typically used <em>without</em> the "SelectValues" or "SelectSql" options.\r
+    <li><strong>H</strong>:   column is hidden from the user (DefaultValue will be stored in the table on adds and edits)\r
+    <li><strong>D</strong>:   this is a date field (blanks allowed if column allows nulls)\r
+    <li><strong>DT</strong>:  same as D, except that it also includes the time\r
+    <li><strong>I</strong>:   integer number (blanks allowed if column allows nulls and required is false)\r
+    <li><strong>F</strong>:   floating-point number (blanks allowed if column allows nulls and required is false)\r
+    <li><strong>B</strong>:   non-blank text field (user gets a popup message in form view when clicking save and the field is empty)\r
+    <li><strong>T</strong>:   standard text field (blanks allowed)\r
+    <li><strong>TA</strong>:  text area field\r
+    <li><strong>tinyMCE</strong>:  rich text edit field using the \r
+    <a href="http://tinymce.moxiecode.com/">tinyMCE</a> library.\r
+    </ul>\r
+\r
+  <dt>DefaultValue\r
+  <dd>column's default value in the form view\r
+  </dl>\r
+\r
+  <p>The equivalent to AddEntryField() in .net is to declare column fields as part of the markup.\r
+  The "ColData" attribute contains the default value.\r
+  Here is an example from ex2edit.aspx:\r
+<pre>\r
+&lt;Rico:Column runat='server' heading='Order#' width='60' \r
+             ColName='OrderID' EntryType='B' ColData='&lt;auto&gt;' /&gt;\r
+</pre>\r
+\r
+<dt>AddEntryFieldW (ColumnName, Heading, EntryTypeCode, DefaultValue, ColWidth)\r
+<dd>Same as AddEntryField except an extra parameter is added for column width (in pixels).\r
+\r
+<dt>AddCalculatedField (ColumnFormula, Heading)\r
+<dd>ColumnFormula is any valid SQL expression or subquery.\r
+    If the subquery needs to reference a column in the table being displayed,\r
+    then the column name should be prefaced with the alias "t."\r
+    Calculated fields will be displayed in table view, but not in form view.\r
+\r
+<dt>AddFilterField (ColumnName, FilterValue)\r
+<dd>Only display records where the contents of ColumnName=FilterValue.\r
+    This becomes a hidden field (entry type H).\r
+\r
+<dt><a name='ConfirmDeleteCol'></a>ConfirmDeleteCol  (ConfirmDeleteColumn in .net plug-in)\r
+<dd>The text content of the column will be included in delete confirmation messages\r
+\r
+<dt>SortAsc\r
+<dd>In table view, sort by this column in ascending order (applies to most recently added field)\r
+\r
+<dt>SortDesc\r
+<dd>In table view, sort by this column in descending order (applies to most recently added field)\r
+\r
+</dl>\r
+\r
+\r
+<h2>FIELD DEFINITION-PROPERTIES</h2>\r
+\r
+<p>All <a href="LiveGrid.html#column">LiveGrid</a> column properties are supported, in addition to these which are specific to LiveGrid Forms.\r
+\r
+<dl>\r
+\r
+<dt>AddQuotes\r
+<dd>When false, the column value will be left unquoted when inserting or updating \r
+    the database (default=true). This makes it possible to populate columns with \r
+    SQL function calls. For example:\r
+<pre>\r
+oForm.AddEntryField "LastEditUser","","H","suser_sname()"\r
+oForm.CurrentField("AddQuotes")=false\r
+oForm.AddEntryField "LastEditDate","","H","getdate()"\r
+oForm.CurrentField("AddQuotes")=false\r
+</pre>\r
+\r
+<dt>required\r
+<dd>Boolean value that specifies whether the input field may be left empty \r
+(default: false if column allows nulls and EntryType is not "B", true otherwise).\r
+  \r
+<dt>noFormBreak\r
+<dd>Boolean value that when true, specifies that this entry field should placed on the same form row as the last field\r
+(default: false - each form field is place on a separate row).\r
+  \r
+<dt><a name='AltTable'></a>AltTable (TabId)\r
+<dd>Specifies that the field should be stored in an alternate table\r
+    TabId should be the value returned by a previous call to <a href='#DefineAltTable'>DefineAltTable</a>\r
+\r
+<dt>TxtAreaRows\r
+<dd>For columns with entry type "TA", this is # of rows to display in the \r
+    textarea when in form view (default 4)\r
+\r
+<dt>TxtAreaCols\r
+<dd>For columns with entry type "TA", this is # of columns to display in the \r
+    textarea when in form view (default 80)\r
+\r
+<dt>FilterFlag\r
+<dd>If true, then the grid is filtered by the default value for this column (default=false)\r
+\r
+<dt>Help\r
+<dd>Creates a title tag containing the specified text (form view only). So if the user\r
+hovers over the field label, they will see this text as balloon help. For example:\r
+<pre>\r
+oForm.CurrentField("Help")="Date must be entered in mm/dd/yyyy format"\r
+</pre>\r
+\r
+<dt>pattern\r
+<dd>A string containing a regular expression. User entries will be checked to ensure\r
+they match the pattern specified. There are a few special values:\r
+<ul>\r
+<li>"email" - tests for a valid email address\r
+<li>"float-unsigned" - tests for a valid unsigned floating point (real) number\r
+<li>"float-signed" - tests for a valid signed floating point (real) number (this is the default when EntryType is "F")\r
+<li>"int-unsigned" - tests for a valid unsigned integer number\r
+<li>"int-signed" - tests for a valid signed integer number (this is the default when EntryType is "I")\r
+</ul>\r
+<br>It is recommended that a Help entry be included\r
+whenever a pattern is specified. If the field fails validation, the help text\r
+will be included in the error message presented to the user. For example:\r
+<pre>\r
+oForm.CurrentField("Help")="Enter date as mm/dd/yyyy"\r
+oForm.CurrentField("pattern")="^\\d{1,2}/\\d{1,2}/\\d{4}$"\r
+</pre>\r
+\r
+<dt>min/max\r
+<dd>Specifies the minimum/maximum allowable values for fields with EntryType "I", "F", and "D". \r
+For example:\r
+<pre>\r
+oForm.AddEntryField "field1", "Field #1", "I", "0"\r
+oForm.CurrentField("min")=1\r
+oForm.CurrentField("max")=10\r
+oForm.CurrentField("Help")="Enter a value between 1 and 10"\r
+\r
+oForm.AddEntryField "field2", "Field #2", "D", Date()\r
+oForm.CurrentField("min")="2000-01-01"\r
+oForm.CurrentField("max")="2099-12-31"\r
+oForm.CurrentField("Help")="Enter a value in the 21st century!"\r
+</pre>\r
+\r
+<dt>InsertOnly\r
+<dd>Only write this field to the database when peforming an insert (default=false).\r
+<pre>\r
+oForm.AddEntryField "CreateDate","","H","getdate()"\r
+oForm.CurrentField("AddQuotes")=false\r
+oForm.CurrentField("InsertOnly")=true\r
+</pre>\r
+\r
+<dt>UpdateOnly\r
+<dd>Only write this field to the database when peforming an update (default=false).\r
+<pre>\r
+oForm.CurrentField("UpdateOnly")=true\r
+</pre>\r
+\r
+<dt>ReadOnly\r
+<dd>If true, data is displayed on the entry form but cannot be changed, text is gray (default=false).\r
+Does not apply to entry types of S, SL, N, R, RL -- use objTE.CurrentField("FormView")="hidden" instead.\r
+\r
+<dt>SelectValues\r
+<dd>Specifies the choices the user sees in form view for EntryTypes of N, S, and R.\r
+    If supplied, then this should be a string of comma-separated values. For example:\r
+<pre>\r
+oForm.CurrentField("SelectValues")="Y,N"\r
+</pre>\r
+\r
+<dt>SelectSql\r
+<dd>Specifies the SQL select statement to use for EntryTypes of SL, CL, and RL.\r
+    The select statement should return 2 columns: the first being the code \r
+    and the second being the text value/description. For example:\r
+<pre>\r
+oForm.CurrentField("SelectSql")="select ID,Name from Customers"\r
+</pre>\r
+\r
+<dt>SelectFilter\r
+<dd>SelectSql serves 2 purposes. First, it is used to retrieve the appropriate\r
+    data to display in the grid. Second, it is used to populate the values in\r
+    the select box (SL) or radio buttons (RL) on the pop-up form. In some cases,\r
+    you may want these to be different. In the SelectSql example above, we\r
+    are retrieving customer name. But let's say that our Customers table has\r
+    a "CreditHold" field and we want to disable the selection of customers on\r
+    credit hold in the form view, but still display them in the grid.\r
+    This is where SelectFilter comes in:\r
+<pre>\r
+oForm.CurrentField("SelectFilter")="CreditHold='NO'"\r
+</pre>\r
+\r
+</dl>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/LiveGridForms_ja.html b/documentation/LiveGridForms_ja.html
new file mode 100644 (file)
index 0000000..95801fc
--- /dev/null
@@ -0,0 +1,449 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<title>Rico LiveGrid Forms</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">\r
+</head>\r
+\r
+<body>\r
+<h1>Rico LiveGrid フォームの利用</h1>\r
+\r
+<h2>概要</h2>\r
+\r
+<p>このドキュメントがちょうど ASP に言及すると同時に、同一の機能が PHP と .net プラグインによって提供されます。\r
+\r
+<ol>\r
+<li>ricoLiveGridForms.vbs を含む、新しい ASP ファイルを作成して下さい。\r
+\r
+<li>新しい ASP で、編集されるテーブルのそれぞれのフィールドを定義して下さい - 通常はフィールドごとに 1-3 行。\r
+\r
+<li>結果として ASP は、適当なグリッドを作成するだけで無く、隠された div に入力フォームを生成します。\r
+\r
+<li>その ASP は "レコードの追加/編集/削除" のエントリもポップアップメニューに追加します。\r
+\r
+<li>追加または編集が選択された時、そのフォームは表示されます(編集が選択されれば、項目が満たされます)\r
+\r
+<li>ユーザが保存ボタンをクリックする時、そのフォームは元の ASP に黙ってポストバックします。\r
+\r
+<li>ASP はデータベースにデータを保存し、クライアントにレスポンスを送り返します。\r
+\r
+<li>クライアントは、成功または失敗のメッセージをブックマークエリアに表示します\r
+</ol>\r
+\r
+<p>以下の二つの図解は、LiveGrid フォームページで、そしてフォームの無い LiveGrid ページで、\r
+どのようにリクエストとレスポンスが流れるかについて表示します。\r
+その二つの図解は ASP/PHP とラベルされていますが、.net にも適用されます(.net には dbClass2 が無い事を除いて)。\r
+<p><img src='images/asp-php-structure1.jpg'>\r
+<p><img src='images/asp-php-structure2.jpg'>\r
+\r
+<h2>使い方</h2>\r
+\r
+<p>このクラスは、一つのテーブルのレコードの表示、挿入、更新そして削除をするのに、\r
+必要なすべての機能を提供します。ASP スクリプトは、次の手順に従わなければなりません。\r
+\r
+\r
+<ol>\r
+<li>クラスのインスタンスを一つ作成して下さい\r
+<pre>set oForm=new TableEditClass</pre>\r
+\r
+<li>SetTableName メソッドを呼んで下さい\r
+<pre>oForm.SetTableName "customer"</pre>\r
+\r
+<li>任意に CanAdd、CanEdit、CanDelete、ConfirmDelete および/または 必要に応じて RecordName プロパティを設定して下さい\r
+<pre>\r
+oForm.options("canAdd")=CanAdd\r
+oForm.options("canEdit")=CanModify\r
+oForm.options("canDelete")=CanDelete\r
+</pre>\r
+<li>TableName がビューであるか、またはプライマリーキーが定義されていない場合、編集は利用不能です\r
+<li>テーブルとフォームビューに見えるフィールドを、次の例外と共に、フィールドおよび列に表示するために、 \r
+      AddEntryField または AddCalculatedField を呼んで下さい。\r
+<ul>\r
+<li>エントリタイプ H は、決してクライアントへ送信されません。定義されたデフォルト値を取得してデータベースへ書き込みます。\r
+<li>FormView フィールドプロパティに "exclude" がセットされていれば、そのフィールドはテーブルだけに表示されます。\r
+<li>FormView フィールドプロパティに "hidden" がセットされていれば、そのデータは隠れたフォームフィールドに設定されます。\r
+<li>計算されたフィールドはテーブルビューにだけ表示されます(FormView=exclude と同じです)\r
+</ul>\r
+\r
+<li>AddEntryField または AddCalculatedField のそれぞれの呼び出しの後、他のメソッドとプロパティは、\r
+      どのようにしてユーザにフィールドを表示するかを、コントロールするために起動する事が出来ます(例えば SortAsc)\r
+      これらのプロパティおよびメソッドの呼び出しは、最も最近追加されたフィールドのみに適用されます。\r
+<li>DisplayPage を呼び出します - これはグリッドを表示するか、データベースの更新を実行します。\r
+<pre>oForm.DisplayPage</pre>\r
+</ol>\r
+\r
+\r
+<h2>タブフォーム</h2>\r
+\r
+<p>複数パネルや複数タブを持つフォームは Rico アコーディオンクラスを利用して、完全にサポートされます。\r
+ そのパネルのフィールドを定義するために、AddEntryField を呼ぶ前に、単に AddPanel を呼ぶだけです。\r
+ 例えば。\r
+<pre>\r
+' these fields appear on the first panel\r
+oForm.AddPanel "Panel #1"\r
+oForm.AddEntryField "field1", "Field #1", "T", ""\r
+oForm.AddEntryField "field2", "Field #2", "T", ""\r
+oForm.AddEntryField "field3", "Field #3", "T", ""\r
+\r
+' these fields appear on the second panel\r
+oForm.AddPanel "Panel #2"\r
+oForm.AddEntryField "field4", "Field #4", "T", ""\r
+oForm.AddEntryField "field5", "Field #5", "T", ""\r
+oForm.AddEntryField "field6", "Field #6", "T", ""\r
+</pre>\r
+\r
+<p>あるいは panelIdx プロパティは、それが定義されるように、それぞれのフィールドにセットされる事が出来ます。\r
+この場合、DisplayPage の前にいつでも AddPanel は呼ばれる事が出来ます。\r
+<pre>\r
+' these fields appear on the first panel\r
+oForm.AddEntryField "field1", "Field #1", "T", ""\r
+oForm.CurrentField("panelIdx")=0\r
+oForm.AddEntryField "field2", "Field #2", "T", ""\r
+oForm.CurrentField("panelIdx")=0\r
+oForm.AddEntryField "field3", "Field #3", "T", ""\r
+oForm.CurrentField("panelIdx")=0\r
+\r
+' these fields appear on the second panel\r
+oForm.AddEntryField "field4", "Field #4", "T", ""\r
+oForm.CurrentField("panelIdx")=1\r
+oForm.AddEntryField "field5", "Field #5", "T", ""\r
+oForm.CurrentField("panelIdx")=1\r
+oForm.AddEntryField "field6", "Field #6", "T", ""\r
+oForm.CurrentField("panelIdx")=1\r
+\r
+oForm.AddPanel "Panel #1"\r
+oForm.AddPanel "Panel #2"\r
+</pre>\r
+\r
+\r
+<h2>フォームメソッド</h2>\r
+<dl>\r
+  <dt>AddPanel "パネルの見出し"\r
+  <dd>入力フォーム上で、タブパネルのための見出しを定義します。\r
+\r
+  <dt>DisplayPage\r
+  <dd>グリッドを表示するか、"action" の値に応じてデータベースを更新します。\r
+\r
+  <dt><a name='DefineAltTable'></a>DefineAltTable (TableName, FieldList, FieldData, Delim)\r
+  <dd>次の <a href='#AltTable'>AltTable</a> の呼び出しで利用される TabId を返す関数。\r
+  関連のあるフィールドの追加を記録するために、二番目のテーブルを定義して下さい。\r
+  メインテーブルのキーフィールド(達)も、 AltTable に存在べきです。\r
+  FieldList と FieldData は、二番目のテーブルに記録される定数や固定された関数を、\r
+  追加で定義する区切られた文字列です。\r
+  Delim は、FieldList と FieldData で利用されるデリミタキャラクタを定義します。\r
+  FieldList と FieldData は、同じ数の区切られたエントリを含まなければなりません。\r
+\r
+  <dt>genXHTML\r
+  <dd>純粋な XHTML アウトプットを生成するために呼び出して下さい。\r
+\r
+  <dt>SetDbConn (dbcls)\r
+  <dd>dbClass を利用するためのインスタンスを定義します\r
+  oDB と言う名前のグローバルインスタンスが存在するのなら、このメソッドの呼び出しをしないでも利用する事が出来るでしょう。\r
+</dl>\r
+\r
+\r
+<h2>フォームプロパティ</h2>\r
+\r
+<p>これら LiveGrid フォーム特有のものに加えて、すべての <a href="LiveGrid.html#options">LiveGrid</a> のオプションはプロパティとしてサポートされています。\r
+\r
+<dl>\r
+\r
+<dt>action (read only)\r
+<dd>実行されているカレントアクションを指定します。table、ins、upd、del\r
+\r
+<dt>gridVar (read only)\r
+<dd>クライアントサイドの LiveGrid オブジェクトの名前を返します\r
+\r
+<dt>bufferVar (read only)\r
+<dd>クライアントサイドの LiveGrid バッファオブジェクトの名前を返します\r
+\r
+<dt>AutoInit\r
+<dd>自動的にグリッドを初期化します(データの行を作成)\r
+    デフォルトは true です\r
+\r
+<dt>InitScript (read only)\r
+<dd>グリッドを初期化するための javascript コードを(文字列として)返します(AutoInit が false の時に利用する)\r
+\r
+<dt>TableFilter\r
+<dd>テーブルビューで利用される節がどこかを指定します(オプションの)\r
+<pre>\r
+// only show records for the logged in user\r
+$oForm->TableFilter = "userid=$myuserid";\r
+</pre>\r
+\r
+<dt>canAdd\r
+<dd>ユーザが新しいレコードを追加する事を許可する、デフォルトは true\r
+<dt>canEdit\r
+<dd>ユーザがレコードを編集する事を許可する、デフォルトは true\r
+<dt>canDelete\r
+<dd>ユーザがレコードを削除する事を許可する、デフォルトは true\r
+<dt>canClone\r
+<dd>ユーザがレコードを複製する事を許可する(既存のレコードの編集するが、新規で保存する)デフォルトは false\r
+\r
+<dt>updateURL\r
+<dd>この位置へのポストアップデートを行います、デフォルトはグリッドを生成したページ\r
+\r
+<dt>ConfirmDelete\r
+<dd>ユーザが削除ボタンをクリックした後で、確認のポップアップを表示するかどうかを指定するフラグ、\r
+    デフォルトは true \r
+    (<a href='#ConfirmDeleteCol'>ConfirmDeleteCol</a> も見て下さい)\r
+\r
+<dt>DebugFlag\r
+<dd>デバッグメッセージを表示します、デフォルトは false\r
+\r
+<dt>RecordName\r
+<dd>追加、編集および削除タイトルタグのカスタマイズ用の文字列、\r
+    デフォルトは "Record"\r
+\r
+<dt>SelectMaxLen\r
+<dd>セレクトボックスの文字数の最大値、デフォルトは 50。\r
+\r
+<dt>TableName (write only)\r
+<dd>表示/編集されるテーブルまたはビュー(必須)\r
+\r
+<dt>TableSelectNew\r
+<dd>EntryType が N のフィールドの、新しい値を作成するためにユーザが選択した時に、\r
+識別するために用いる文字列。デフォルトは "___new___"。\r
+\r
+<dt>showSaveMsg\r
+<dd>データベースの更新レスポンスの処理。\r
+<ul>\r
+<li>full - すべてのレスポンスを表示する\r
+<li>errors - エラーに関するすべてのレスポンスか、そうで無い場合は短いレスポンスを表示する(デフォルト)\r
+</ul>\r
+</dd>\r
+\r
+<dt style='color:navy;'><em>入力フォームで、タブパネルを利用する時。</em>\r
+\r
+<dt>panelWidth\r
+<dd>タブパネルのピクセル単位の幅。デフォルトは 500。\r
+\r
+<dt>panelHeight\r
+<dd>タブパネルのピクセル単位の高さ。デフォルトは 200。\r
+\r
+<dt>hoverClass\r
+<dd>タブパネルの上をホバーする時の CSS クラス。デフォルトは "tabHover"。\r
+\r
+<dt>selectedClass\r
+<dd>タブパネルを選択する時の CSS クラス。デフォルトは "tabHover"。\r
+\r
+</dl>\r
+\r
+\r
+<h2>フォームイベント</h2>\r
+\r
+<p>いくつかのフォームイベントをフックする事が可能です。\r
+\r
+<dl>\r
+<dt>formOpen\r
+<dd>入力フォームが表示される時、始動します。\r
+<pre>\r
+oForm.options("formOpen")=\r
+  "alert('Questions? Please call the support desk.');"\r
+</pre>\r
+\r
+<dt>formClose\r
+<dd>入力フォームが閉じられてすぐに、始動します。\r
+\r
+<dt>onSubmitResponse\r
+<dd>フォームがサーバに送信され、レスポンスを受け取って処理された後で、起動されます。\r
+\r
+</dl>\r
+\r
+\r
+<h2>フィールド定義メソッド</h2>\r
+<dl>\r
+<dt>AddEntryField (ColumnName, Heading, EntryTypeCode, DefaultValue)\r
+<dd>グリッドへ新しい列と、ASP と PHP でのポップアップフォームにより新しいエントリフィールドを追加します。\r
+  <dl>\r
+\r
+  <dt>ColumnName\r
+  <dd>データベーステーブルの列名(空白や角括弧を含む SQL をサポートしません、例えば [Apr 2005] )\r
+\r
+  <dt>Heading\r
+  <dd>グリッドの列見出しやポップアップフォーム上に現れる名前\r
+\r
+  <dt>EntryTypeCode\r
+  <dd>どのように入力フォーム上に列が表示されるかについて、コントロールするコードを含む文字列\r
+\r
+    <ul>\r
+    <li><strong>S</strong>:\r
+    データエントリ中のドロップダウンセレクトリストとして、この列を表示します。\r
+    "SelectValues" または "SelectSql" オプションを利用して指定された値です。\r
+    どちらも指定されなければ、列の値は "select distinct" クエリを利用して得られます。\r
+    <li><strong>R</strong>: ラジオボタンを利用してアイテムが表示される以外は "S" と同じです。\r
+    <li><strong>SL,RL</strong>: \r
+    テーブルビューに検索された値を表示する以外は、S & R と同じです\r
+    (SelectSql により指定されたクエリを利用して)。\r
+    外部キーの列で典型的に利用されます。\r
+    表示する値を取得するための SQL は "SelectSql" オプションを利用して指定します。\r
+    <li><strong>CL</strong>: \r
+    カスタムコントロールを利用して値が選択される以外は "SL" と同じです\r
+    (Rico ツリーコントロールのような)。\r
+    SelectCtl オプションは、カスタムコントロールの id を割り当てられるべきです。\r
+    <li><strong>N</strong>:\r
+    "S" と同じですが、ユーザが新しい値を作成する事を許します。\r
+    典型的には "SelectValues" または "SelectSql" オプション <em>無し</em> で利用されます。\r
+    <li><strong>H</strong>:   列はユーザから隠されます(DefaultValue が、追加と編集でテーブルに保管されます)\r
+    <li><strong>D</strong>:   これはデータフィールドです(列が null を許していたら、空白が許されます)\r
+    <li><strong>DT</strong>:  時間も含む以外は D と同じです\r
+    <li><strong>I</strong>:   整数値(列が null を許していて、false が必要とされるなら、空白が許されます)\r
+    <li><strong>F</strong>:   浮動小数点数(列が null を許していて、false が必要とされるなら、空白が許されます)\r
+    <li><strong>B</strong>:   空白の無いテキストフィールド(フィールドが空で保存をクリックするとき、ユーザはフォームビューでのポップアップメッセージを取得します)\r
+    <li><strong>T</strong>:   標準テキストフィールド(空白が許されます)\r
+    <li><strong>TA</strong>:  テキストエリアフィールド\r
+    <li><strong>tinyMCE</strong>:  <a href="http://tinymce.moxiecode.com/">tinyMCE</a> \r
+    ライブラリを利用するリッチテキスト編集フィールド。\r
+    </ul>\r
+\r
+  <dt>DefaultValue\r
+  <dd>フォームビューでの列のデフォルト値\r
+  </dl>\r
+\r
+  <p>.net で AddEntryField() と同等なのは、マークアップの一部として列フィールドを宣言する事です。\r
+  "ColData" 属性はデフォルト値を含みます。\r
+  ex2edit.aspx からの例は、ここにあります。\r
+<pre>\r
+&lt;Rico:Column runat='server' heading='Order#' width='60' \r
+             ColName='OrderID' EntryType='B' ColData='&lt;auto&gt;' /&gt;\r
+</pre>\r
+\r
+<dt>AddEntryFieldW (ColumnName, Heading, EntryTypeCode, DefaultValue, ColWidth)\r
+<dd>列の(ピクセルでの)幅のためのエクストラパラメータが追加される以外は AddEntryField と同じです。\r
+\r
+<dt>AddCalculatedField (ColumnFormula, Heading)\r
+<dd>ColumnFormula は、どれも妥当な SQL 式またはサブクエリです。\r
+    サブクエリが表示されているテーブルの列への参照を必要としているなら、\r
+    列名はエイリアス "t." で始まらなくてはなりません\r
+    計算されたフィールドは、フォームビューでは無く、テーブルビューに表示されます。\r
+\r
+<dt>AddFilterField (ColumnName, FilterValue)\r
+<dd>ColumnName=FilterValue の内容のレコードを表示するだけです。\r
+    隠れたフィールドになります(エントリタイプ H)。\r
+\r
+<dt><a name='ConfirmDeleteCol'></a>ConfirmDeleteCol\r
+<dd>最も最近追加された列の内容は、削除確認メッセージに含まれます\r
+\r
+<dt>SortAsc\r
+<dd>テーブルビューにて昇順で列をソートします(最も最近追加されたフィールドに適応されます)\r
+\r
+<dt>SortDesc\r
+<dd>テーブルビューにて降順で列をソートします(最も最近追加されたフィールドに適応されます)\r
+\r
+</dl>\r
+\r
+\r
+<h2>フィールド定義プロパティ</h2>\r
+\r
+<p>これらの LiveGrid フォーム特有のものに加えて、すべての <a href="LiveGrid.html#column">LiveGrid</a> 列プロパティはサポートされます。\r
+\r
+<dl>\r
+\r
+<dt>AddQuotes\r
+<dd>false で、データベースに挿入するか更新する時は、列の値はバッククォートで囲まれません\r
+    (デフォルト=true)\r
+    これは SQL 関数呼び出しで、列を実装する事を可能にします。例えば。\r
+<pre>\r
+oForm.AddEntryField "LastEditUser","","H","suser_sname()"\r
+oForm.CurrentField("AddQuotes")=false\r
+oForm.AddEntryField "LastEditDate","","H","getdate()"\r
+oForm.CurrentField("AddQuotes")=false\r
+</pre>\r
+\r
+<dt>required\r
+<dd>入力フィールドが空のままにしてもよいかどうかを指定する真偽値です\r
+(デフォルトは、 列が null を許して EntryType が "B" で無ければ false 、そうで無い場合は true です)。\r
+  \r
+<dt><a name='AltTable'></a>AltTable (TabId)\r
+<dd>代わりのテーブルにフィールドは保存されるべきである事を指定し、\r
+    TabId は以前の <a href='#DefineAltTable'>DefineAltTable</a> の呼び出しによって返される値でなければなりません。\r
+\r
+<dt>TxtAreaRows\r
+<dd>エントリタイプが "TA" の列のための、フォームビューの時に\r
+    テキストエリアに表示する行数です(デフォルト 4)\r
+\r
+<dt>FilterFlag\r
+<dd>true なら、グリッドはその列のデフォルト値によってフィルタされます(デフォルト = false)\r
+\r
+<dt>TxtAreaCols\r
+<dd>エントリタイプが "TA" の列のための、フォームビューの時に\r
+    テキストエリアに表示する列数です(デフォルト 80)\r
+\r
+<dt>Help\r
+<dd>指定されたテキストを含んでいるタイトルタグを作成します(フォームビューのみ)。\r
+そして、ユーザがフィールドラベルの上をホバーするなら、バルーンヘルプとしてこのテキストを見るでしょう。例えば。\r
+<pre>\r
+oForm.CurrentField("Help")="Date must be entered in mm/dd/yyyy format"\r
+</pre>\r
+\r
+<dt>pattern\r
+<dd>正規表現を含んでいる文字列。\r
+ユーザエントリは、その指定されたパターンにマッチする事を確実にするためにチェックされます。\r
+少しの特別な値があります。\r
+<ul>\r
+<li>"email" - メールアドレスを検証するためのテスト\r
+<li>"float-unsigned" - 符号無し浮動小数点(実)数を検証するためのテスト\r
+<li>"float-signed" - 符号付き浮動小数点(実)数を検証するためのテスト(EntryType が "F" の時、これがデフォルトです)\r
+<li>"int-unsigned" - 符号無し整数を検証するためのテスト\r
+<li>"int-signed" - 符号付き整数を検証するためのテスト(EntryType が "I" の時、これがデフォルトです)\r
+</ul>\r
+<br>いつでも、パターンを指定するヘルプエントリが含まれる事が推薦されます。\r
+フィールドが検証に失敗したなら、そのヘルプテキストは、ユーザに表示されるエラーメッセージに含まれます。\r
+例えば。\r
+<pre>\r
+oForm.CurrentField("Help")="Enter date as mm/dd/yyyy"\r
+oForm.CurrentField("pattern")="^\\d{1,2}/\\d{1,2}/\\d{4}$"\r
+</pre>\r
+\r
+<dt>min/max\r
+<dd>EntryType が "I" 、"F" 、そして "D" のフィールドの、最大/最少の許される値を指定します。\r
+例えば。\r
+<pre>\r
+oForm.AddEntryField "field1", "Field #1", "I", "0"\r
+oForm.CurrentField("min")=1\r
+oForm.CurrentField("max")=10\r
+oForm.CurrentField("Help")="Enter a value between 1 and 10"\r
+\r
+oForm.AddEntryField "field2", "Field #2", "D", Date()\r
+oForm.CurrentField("min")="2000-01-01"\r
+oForm.CurrentField("max")="2099-12-31"\r
+oForm.CurrentField("Help")="Enter a value in the 21st century!"\r
+</pre>\r
+\r
+<dt>InsertOnly\r
+<dd>挿入を実行する時は、データベースに単にこのフィールドを書いて下さい(デフォルト=false)。\r
+<pre>\r
+oForm.AddEntryField "CreateDate","","H","getdate()"\r
+oForm.CurrentField("AddQuotes")=false\r
+oForm.CurrentField("InsertOnly")=true\r
+</pre>\r
+\r
+<dt>UpdateOnly\r
+<dd>更新を実行する時は、データベースに単にこのフィールドを書いて下さい(デフォルト=false)。\r
+<pre>\r
+oForm.CurrentField("UpdateOnly")=true\r
+</pre>\r
+\r
+<dt>ReadOnly\r
+<dd>true なら、データはエントリフォームで表示されますが、変更は出来ず、テキストは灰色です(デフォルト = false)。\r
+\r
+<dt>SelectValues\r
+<dd>N、S、そして R の EntryType  のために、ユーザをフォームビューに案内する選択を指定して下さい。\r
+    供給されるなら、カンマで区切られた値の文字列で無ければなりません。例えば。\r
+<pre>\r
+oForm.CurrentField("SelectValues")="Y,N"\r
+</pre>\r
+\r
+<dt>SelectSql\r
+<dd>SL 、CL 、そして RL の EntryType のために、SQL 検索ステートメントを指定します。\r
+    その検索ステートメントは 2 つの列を返さなければなりません。\r
+    一つ目はコードで、そして二つ目は値または説明のテキストです。例えば。\r
+<pre>\r
+oForm.CurrentField("SelectSql")="select ID,Name from Customers"\r
+</pre>\r
+\r
+</dl>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/LiveGrid_ja.html b/documentation/LiveGrid_ja.html
new file mode 100644 (file)
index 0000000..2c8fba1
--- /dev/null
@@ -0,0 +1,1156 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
+<title>Rico LiveGrid</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css" />\r
+</head>\r
+\r
+<body>\r
+<h1>Rico LiveGrid の作成</h1>\r
+\r
+<p>Rico LiveGrid は 2 次元の JavaScript 配列でデータをバッファリングして、スクロールするテーブルにデータを表示します。\r
+ユーザがグリッドを垂直にスクロールする事によって、データは配列からグリッド上へ動的にコピーされます。\r
+バッファは次の項目からロードされる事が出来ます。\r
+<ol>\r
+<li><a href='#model1'>javascript 配列</a>\r
+<li><a href='#model2'>HTML テーブル</a>\r
+<li><a href='#model3'>XML ファイル</a>\r
+<li><a href='#model4'>SQL データベースクエリ</a>\r
+<li><a href='#model5'>カスタム javascript コールバック関数</a>\r
+</ol>\r
+\r
+\r
+<h2><a name='model1'>利用モデル 1: javascript 配列からのデータのロード</a></h2>\r
+\r
+<ul><li>javascript 配列へ表示されるデータをロードして下さい。\r
+<pre>\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5']\r
+  ];\r
+</pre>\r
+\r
+<li>グリッドを表示するのに必要な Rico javascript と css ファイルをロードして下さい。\r
+<pre>\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGrid\r
+<dd>これは、静的なバッファ( AJAX では無い)で LiveGrid を表示するのに必要な Rico javascript と css ファイルをロードします。\r
+<dt>LiveGridMenu\r
+<dd>これは、デフォルトのグリッドメニューをロードします。\r
+このメニューは、LiveGrid で出来る事の全てにアクセスする方法を提供します。\r
+それは選択された列と使用されるバッファのタイプに基づく、ユーザに提示された選択項目を調整します。\r
+メニュー無しでグリッドを使用するか、またはアプリケーションの必要性によりカスタマイズされた独自のメニューを作成するかを、選ぶことが出来ます。\r
+<dt>greenHdg.css\r
+<dd>Rico は、いくつかのサンプルグリッドスタイルを持っています。\r
+coffee-with-milk、grayedout、greenHdg、iegradient (Internet Explorer 専用)、tanChisel、そして warmfall。\r
+あなたは、含まれているスタイルの 1 つを選ぶか、独自の物を作成するかを選ぶでしょう。\r
+</dl>\r
+\r
+<li>テーブルのデータ列を Rico バッファオブジェクトにロードして下さい。\r
+<pre>\r
+  var buffer=new Rico.Buffer.Base();\r
+  buffer.loadRowsFromArray(myData);\r
+</pre>\r
+\r
+<li>グリッドの見出しを含む、グリッドのオプションを定義して下さい。\r
+<pre>\r
+  var opts = {  \r
+    useUnformattedColWidth: false,\r
+    defaultWidth : 90,\r
+    visibleRows  : 'data',\r
+    frozenColumns: 1,\r
+    columnSpecs  : [{Hdg:'Column 1',type:'number', ClassName:'alignright'},\r
+                    {Hdg:'Column 2'},\r
+                    {Hdg:'Column 3'},\r
+                    {Hdg:'Column 4'},\r
+                    {Hdg:'Column 5'}]\r
+  };\r
+</pre>\r
+\r
+<li>グリッド、Rico.Buffer インスタンス、およびグリッドオプションのためにベース id を渡して、LiveGrid をインスタンス化してください。\r
+\r
+<pre>\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+</pre>\r
+\r
+<li>グリッドのためのデフォルトポップアップメニューを利用可能にするために、グリッドのメニューのプロパティを Rico.GridMenu のインスタンスに割り当てて下さい。\r
+\r
+<pre>\r
+  ex1.menu=new Rico.GridMenu();\r
+</pre>\r
+\r
+<li>Rico.loadModule は、window.onload イベントの終了<em>後</em>に実行されると思います。\r
+あなたは Rico.onLoad メソッドに初期化関数を渡さなければなりません、なぜなら、Rico モジュールがロードされた後で、グリッドの初期化が実行される事を確実なものにするためです。\r
+javascript のすべてをまとめると、このようになります。\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5']\r
+  ];\r
+  var opts = {  \r
+    useUnformattedColWidth: false,\r
+    defaultWidth : 90,\r
+    visibleRows  : 'data',\r
+    frozenColumns: 1,\r
+    columnSpecs  : [{Hdg:'Column 1',type:'number', ClassName:'alignright'},\r
+                    {Hdg:'Column 2'},\r
+                    {Hdg:'Column 3'},\r
+                    {Hdg:'Column 4'},\r
+                    {Hdg:'Column 5'}]\r
+  };\r
+  var buffer=new Rico.Buffer.Base();\r
+  buffer.loadRowsFromArray(myData);\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+<li>最後に、グリッドを実行すべき位置に、HTML マークアップ に div 要素を配置して下さい。\r
+ブックマークのためのマークアップを含む事により、グリッドのスクロール位置が表示されます。\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="ex1_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;div id="ex1"&gt;&lt;/div&gt;\r
+</pre>\r
+\r
+\r
+\r
+</ul>\r
+\r
+\r
+<h2><a name='model2'>利用モデル 2: HTML テーブルからのデータのロード</a></h2>\r
+\r
+<ul><li>見出しは <code>&lt;thead&gt;</code> セクションにより、データは <code>&lt;tbody&gt;</code> セクションにより、HTML テーブルを定義して下さい。\r
+ブックマークのためのマークアップを含む事により、グリッドのスクロール位置が表示されます。\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;table id="data_grid"&gt;\r
+  &lt;thead&gt;\r
+\r
+  &lt;tr&gt;\r
+    &lt;th&gt;First column name&lt;/th&gt;\r
+    &lt;th&gt;Second column name&lt;/th&gt;\r
+    ...\r
+    &lt;th&gt;Last column name&lt;/th&gt;\r
+  &lt;/tr&gt;\r
+\r
+  &lt;/thead&gt;\r
+\r
+  &lt;tbody&gt;\r
+\r
+  &lt;tr&gt;\r
+    &lt;td&gt;Row 1, column 1 data&lt;/td&gt;\r
+    &lt;td&gt;Row 1, column 2 data&lt;/td&gt;\r
+    ...\r
+    &lt;td&gt;Row 1, last column data&lt;/td&gt;\r
+  &lt;/tr&gt;\r
+\r
+  &lt;tr&gt;\r
+    &lt;td&gt;Row 2, column 1 data&lt;/td&gt;\r
+    &lt;td&gt;Row 2, column 2 data&lt;/td&gt;\r
+    ...\r
+    &lt;td&gt;Row 2, last column data&lt;/td&gt;\r
+  &lt;/tr&gt;\r
+\r
+  ...\r
+\r
+  &lt;tr&gt;\r
+    &lt;td&gt;Row n, column 1 data&lt;/td&gt;\r
+    &lt;td&gt;Row n, column 2 data&lt;/td&gt;\r
+    ...\r
+    &lt;td&gt;Row n, last column data&lt;/td&gt;\r
+  &lt;/tr&gt;\r
+\r
+  &lt;/tbody&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<li>グリッドを表示するために必要な Rico javascript と css ファイルをロードして下さい。\r
+<pre>\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGrid\r
+<dd>これは、静的なバッファ( AJAX では無い)で LiveGrid を表示するのに必要な Rico javascript と css ファイルをロードします。\r
+<dt>LiveGridMenu\r
+<dd>これは、デフォルトのグリッドメニューをロードします。\r
+このメニューは、LiveGrid で出来る事の全てにアクセスする方法を提供します。\r
+それは選択された列と使用されるバッファのタイプに基づく、ユーザに提示された選択項目を調整します。\r
+メニュー無しでグリッドを使用するか、またはアプリケーションの必要性によりカスタマイズされた独自のメニューを作成するかを、選ぶことが出来ます。\r
+<dt>greenHdg.css\r
+<dd>Rico は、いくつかのサンプルグリッドスタイルを持っています。\r
+coffee-with-milk、grayedout、greenHdg、iegradient (Internet Explorer 専用)、tanChisel、そして warmfall。\r
+あなたは、含まれているスタイルの 1 つを選ぶか、独自の物を作成するかを選ぶでしょう。\r
+</dl>\r
+\r
+<li>テーブルのデータ列を Rico バッファオブジェクトにロードして下さい。\r
+<pre>\r
+var buffer = new Rico.Buffer.Base($('data_grid').tBodies[0]);\r
+</pre>\r
+\r
+<li>最後に、HTML テーブルの DOM の id とオプションを Rico.Buffer インスタンス に渡して\r
+(これは、 LiveGrid がテーブルの thead セクションから列の見出しをロードするのを許可します)、\r
+LiveGrid を初期化します\r
+(この場合、最初の列の幅は 50 ピクセル、2 番目の列は 80 ピクセルの幅となります)。\r
+\r
+<pre>\r
+var grid_options = { columnSpecs: [ {width:50}, {width:80} ] };\r
+var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+</pre>\r
+\r
+<li>Rico.loadModule は、window.onload イベントの終了<em>後</em>に実行されると思います。\r
+あなたは Rico.onLoad メソッドに初期化関数を渡さなければなりません、\r
+なぜなら、Rico モジュールがロードされた後で、グリッドの初期化が実行される事を確実なものにするためです。\r
+javascript のすべてをまとめると、このようになります。\r
+\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var buffer = new Rico.Buffer.Base($('data_grid').tBodies[0]);\r
+  var grid_options = { columnSpecs: [width:50, width:80] };\r
+  var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+</ul>\r
+\r
+\r
+<h2><a name='model3'>利用モデル 3: XML ファイルからのデータのロード</a></h2>\r
+\r
+<ul><li>テーブルのヘッダセルを持ち、テーブルのボディセルは持たない、HTML テーブルを定義して下さい。\r
+ブックマークのためのマークアップを含む事により、グリッドのスクロール位置が表示されます。\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;table id="data_grid"&gt;\r
+  &lt;tr&gt;\r
+\r
+    &lt;th&gt;First column name&lt;/th&gt;\r
+    &lt;th&gt;Second column name&lt;/th&gt;\r
+\r
+  &lt;/tr&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<li>グリッドを表示するために必要な Rico javascript と css ファイルをロードして下さい。\r
+<pre>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGridAjax\r
+<dd>これは、AJAX 対応のバッファで LiveGrid を表示するのに必要な Rico javascript と css ファイルをロードします。\r
+<dt>LiveGridMenu\r
+<dd>これは、デフォルトのグリッドメニューをロードします。\r
+このメニューは、LiveGrid で出来る事の全てにアクセスする方法を提供します。\r
+それは選択された列と使用されるバッファのタイプに基づく、ユーザに提示された選択項目を調整します。\r
+メニュー無しでグリッドを使用するか、またはアプリケーションの必要性によりカスタマイズされた独自のメニューを作成するかを、選ぶことが出来ます。\r
+<dt>greenHdg.css\r
+<dd>Rico は、いくつかのサンプルグリッドスタイルを持っています。\r
+coffee-with-milk、grayedout、greenHdg、iegradient (Internet Explorer 専用)、tanChisel、そして warmfall。\r
+あなたは、含まれているスタイルの 1 つを選ぶか、独自の物を作成するかを選ぶでしょう。\r
+</dl>\r
+\r
+<li>データをフェッチしてテーブルを実装するために、Rico バッファを作成して下さい。\r
+AjaxXML バッファは、グリッドのスタートアップで提供された URL に、一つだけのデータのリクエストを行います。\r
+<pre>\r
+var buffer = new Rico.Buffer.AjaxXML('/controller/action?format=xml');\r
+</pre>\r
+\r
+この URL(実例の中にある "/controller/action?format=xml")は、次のフォーマットでデータを返さなければなりません。\r
+<pre>\r
+&lt;ajax-response&gt;\r
+&lt;response type='object' id='data_grid_updater'&gt;\r
+&lt;rows update_ui='true' offset='0'&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;/rows&gt;\r
+&lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+<li>最後に、HTML テーブルの DOM の ID とオプションを Rico.Buffer インスタンス に渡して、LiveGrid を初期化します\r
+(columnSpecs は必要ではありませんが、列のカスタム化のためのプレースホルダーとして、ここに表示されます)。\r
+<pre>\r
+var grid_options = { columnSpecs: [,] };\r
+var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+</pre>\r
+\r
+<li>Rico.loadModule は、window.onload イベントの終了<em>後</em>に実行されると思います。\r
+あなたは Rico.onLoad メソッドに初期化関数を渡さなければなりません、\r
+なぜなら、Rico モジュールがロードされた後で、グリッドの初期化が実行される事を確実なものにするためです。\r
+javascript のすべてをまとめると、このようになります。\r
+\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var buffer = new Rico.Buffer.AjaxXML('/controller/action?format=xml');\r
+  var grid_options = { columnSpecs: [,] };\r
+  var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+</ul>\r
+\r
+\r
+<h2><a name='model4'>利用モデル 4: SQL データベースクエリからデータをロードする</a></h2>\r
+\r
+<p>下記の説明は、Rico LiveGrid プラグインにおける ASP と PHP の実装に直接当てはまります。\r
+概念は .net の同じですが、実装方法は全く異なります\r
+(これがどのように .net で実装されるかについては、"ex2simple.aspx" を調べて下さい)。\r
+\r
+<ul>\r
+<li>実行するためにクエリを含むセッション変数を定義して下さい。\r
+変数名は、下の表の ID に適合しなければなりません。\r
+データを要求するとき、グリッドは ricoXMLquery にそのIDを渡します、そして、ricoXMLquery はセッションからクエリテキストを取得するためにそれを利用するでしょう。\r
+<ul>\r
+<li>ASP:\r
+<pre>\r
+&lt;%\r
+session.contents("data_grid")="select ID,Name,City from customers"\r
+%&gt;\r
+</pre>\r
+\r
+<li>PHP:\r
+<pre>\r
+&lt;? \r
+$_SESSION['data_grid']="select ID,Name,City from customers";\r
+?&gt;\r
+</pre>\r
+\r
+<li>.net:\r
+<pre>\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  data_grid.sqlQuery="select ID,Name,City from customers"\r
+  ' session variable is set by the control\r
+End Sub\r
+</pre>\r
+</ul>\r
+\r
+\r
+<li>テーブルのボディセルでは無く、ヘッダセルを供給して、HTML テーブルを定義して下さい。\r
+ブックマークのためのマークアップを含む事により、グリッドのスクロール位置が表示されます。\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+&lt;table id="data_grid"&gt;\r
+  &lt;tr&gt;\r
+\r
+    &lt;th&gt;Customer #&lt;/th&gt;\r
+    &lt;th&gt;Customer Name&lt;/th&gt;\r
+    &lt;th&gt;City&lt;/th&gt;\r
+\r
+  &lt;/tr&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<li>グリッドを表示するために必要な Rico javascript と css ファイルをロードして下さい。\r
+<pre>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+</pre>\r
+<dl>\r
+<dt>LiveGridAjax\r
+<dd>これは、AJAX 対応バッファで LiveGrid を表示するのに必要な Rico javascript と css ファイルをロードします。\r
+<dt>LiveGridMenu\r
+<dd>これは、デフォルトのグリッドメニューをロードします。\r
+このメニューは、LiveGrid で出来る事の全てにアクセスする方法を提供します。\r
+それは選択された列と使用されるバッファのタイプに基づく、ユーザに提示された選択項目を調整します。\r
+メニュー無しでグリッドを使用するか、またはアプリケーションの必要性によりカスタマイズされた独自のメニューを作成するかを、選ぶことが出来ます。\r
+<dt>greenHdg.css\r
+<dd>Rico は、いくつかのサンプルグリッドスタイルを持っています。\r
+coffee-with-milk、grayedout、greenHdg、iegradient (Internet Explorer 専用)、tanChisel、そして warmfall。\r
+あなたは、含まれているスタイルの 1 つを選ぶか、独自の物を作成するかを選ぶでしょう。\r
+</dl>\r
+\r
+<li>データをフェッチしてテーブルを実装するために、Rico バッファを作成して下さい。\r
+一度にすべてのデータをグリッドにフェッチする AjaxXML バッファと異なり、 AjaxSQL バッファは、塊でデータをフェッチします。\r
+これは、LiveGrid が能率的に数千または何十万の列を含んでいるクエリ結果を表示する事を可能にします。\r
+\r
+<pre>\r
+var buffer = new Rico.Buffer.AjaxSQL('ricoXMLquery.asp');\r
+</pre>\r
+\r
+この URL ("ricoXMLquery.asp" の実例で)は、データベースからデータをフェッチして、\r
+この XML フォーマットでグリッドにそれを戻すために、含まれるプラグインの内の 1 つを利用します。\r
+\r
+<pre>\r
+&lt;ajax-response&gt;\r
+&lt;response type='object' id='data_grid_updater'&gt;\r
+&lt;rows update_ui='true' offset='0'&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;/rows&gt;\r
+&lt;rowcount&gt;99&lt;/rowcount&gt;\r
+&lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+&lt;rowcount&gt; タグはオプションですが、リクエストに "get_total" クエリーストリングパラメータが存在する場合は、\r
+いつでも返されなければなりません。\r
+\r
+<li>最後に、HTML テーブルの DOM の ID とオプションを Rico.Buffer インスタンス に渡して、LiveGrid を初期化します\r
+(columnSpecs は必要ではありませんが、列のカスタム化のためのプレースホルダーとして、ここに表示されます)。\r
+<pre>\r
+var grid_options = { columnSpecs: [,,] };\r
+var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+</pre>\r
+\r
+<li>Rico.loadModule は、window.onload イベントの終了<em>後</em>に実行されると思います。\r
+あなたは Rico.onLoad メソッドに初期化関数を渡さなければなりません、\r
+なぜなら、Rico モジュールがロードされた後で、グリッドの初期化が実行される事を確実なものにするためです。\r
+javascript のすべてをまとめると、このようになります。\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var buffer = new Rico.Buffer.AjaxSQL('ricoXMLquery.asp');\r
+  var grid_options = { columnSpecs: [,,] };\r
+  var grid = new Rico.LiveGrid('data_grid', buffer, grid_options);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+</ul>\r
+\r
+\r
+<h2><a name='model5'>利用モデル 5: カスタムコールバック関数を利用してデータをロードする</a></h2>\r
+\r
+<p>このモデルは、 xmlHTTPrequest を利用してデータをフェッチするのでは無く、 javascript コールバック関数を\r
+利用してデータをフェッチする事以外はモデル 3 や 4 と同じ方法で動作します。\r
+これにより、コールバック関数で Google Gears を呼ぶような創造的な事をすることが出来ます。\r
+コールバックをセットアップする事は、非常に簡単です。\r
+データプロバイダの URL の文字列を含むデータを AjaxXML または AjaxSQL コンストラクタに渡すのでは無く、\r
+その代りにコールバック関数を渡すだけです。\r
+\r
+<p>以下の AjaxXML バッファを利用するコードは <a href='client/gridJSbuffer.html'>examples/client/gridJSbuffer.html</a> から取得出来ます。\r
+"jsfetch" コールバック関数は 100 行の長さで 5 列の幅の二次元配列を返します。\r
+AjaxXML は、そのバッファを(グリッドのスタートアップで)一度だけロードするので、 jsfetch は一度だけ呼ばれます。\r
+このオプションのハッシュは、Prototype の Ajax.Request メソッドで利用されるオプションのハッシュと構造が同じです。\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML(<strong>jsfetch</strong>);\r
+\r
+function <strong>jsfetch</strong>(options) {\r
+  Rico.writeDebugMsg("jsfetch");\r
+  var newRows=[], offset=options.parameters.offset;\r
+  for (var r=0; r<100; r++) {\r
+    var row=[];\r
+    row.push(offset.toString());\r
+    row.push(new Date().toString());\r
+    for (var c=2; c<5; c++) row.push('cell '+r+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows);\r
+}\r
+</pre>\r
+\r
+<p>以下の AjaxSQL バッファを利用するコードは <a href='client/gridJSbuffer2.html'>examples/client/gridJSbuffer2.html</a> から取得出来ます。\r
+"jsfetch" コールバック関数は、500 行の長さで 5 列の幅の二次元配列をシミュレーションします。\r
+しかし、どんなコールバック中でも、その配列の <code>options.parameters.offset</code> 行から \r
+<code>options.parameters.offset + options.parameters.page_size</code> 行までのセクションが返されます。\r
+\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxSQL(<strong>jsfetch</strong>);\r
+\r
+function <strong>jsfetch</strong>(options) {\r
+  var newRows=[], totrows=500;\r
+  var offset=options.parameters.offset;\r
+  var limit=Math.min(totrows-offset,options.parameters.page_size)\r
+  for (var r=0; r&lt;limit; r++) {\r
+    var row=[];\r
+    row.push(new Date().toString());\r
+    row.push(offset.toString());\r
+    for (var c=2; c&lt;5; c++) row.push('cell '+(r+offset)+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows,false,totrows);\r
+}\r
+</pre>\r
+\r
+<p>options.onComplete は、次のパラメータをとります。\r
+<ul>\r
+<li>newRows - それぞれのアイテムが文字列の二次元配列\r
+<li>newAttr - それぞれのアイテムが、セルの acceptAttr の値、または acceptAttr が利用されていないなら false を含むオブジェクトの二次元配列\r
+<li>totalRows - データセット内の行の総数を表す整数\r
+<li>errMsg - エラーが起こったとき、ユーザに表示されるメッセージテキスト\r
+</ul>\r
+\r
+</ul>\r
+\r
+\r
+<h2><a name='debug'></a>デバッグ</h2>\r
+<p>Rico 2.0 はメッセージログにタイムスタンプデバッグメッセージを配達する能力を持っています。\r
+そのログは、HTML のテキストエリアか、ブラウザの javascript コンソールに表示されるでしょう。\r
+<ul>\r
+<li>もし、テキストエリアが '_debugmsgs' を加えたライブグリッドテーブルの ID と共に存在するならば、例えば\r
+<pre style='margin:3px;'>&lt;textarea cols="100" rows="5" id="data_grid_debugmsgs" /&gt;</pre>\r
+そして、このテキストエリアがメッセージログのために使われます。\r
+<li>あるいは、テキストエリアは Rico.setDebugArea() の呼び出しによって指定されるかもしれません。\r
+\r
+<pre>\r
+&lt;textarea id='debug' rows='5' cols='80'&gt;&lt;/textarea&gt;\r
+&lt;script type='text/javascript'&gt;\r
+Rico.setDebugArea('debug');\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+<li>テキストエリアが指定されないならば、Rico はブラウザのビルトイン javascript コンソールを使おうとします。\r
+以下のコンソールで動作する事が知られています:\r
+  <ul>\r
+  <li>Firefox の <a href='http://www.getfirebug.com/' target='_blank'>Firebug</a> アドオンコンソール\r
+  <li>Opera javascript コンソール\r
+  <li>Safari javascript コンソール\r
+  </ul>\r
+</ul>\r
+\r
+<h2>グリッドメニュー</h2>\r
+\r
+<p>Rico LiveGrid は、多くの機能的なビルトインが付属します\r
+その機能にアクセスするために、Rico はメニューのデフォルトの設定を含みます -- \r
+ricoLiveGridMenu.js で定義されています。\r
+デフォルトメニューを使うために、単に 'LiveGridMenu' モジュールをロードして、\r
+そのグリッドメニュープロパティを Rico.GridMenu クラスのインスタンスに割り当てて下さい。\r
+<pre>\r
+  Rico.loadModule('LiveGridMenu');\r
+  ...\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, grid_options);\r
+  ex1.menu=new Rico.GridMenu();\r
+</pre>\r
+<p>デフォルトでは、ユーザがグリッドセルをダブルクリックする時メニューが開きます。\r
+メニューを開くイベントを変更するために、グリッドの <a href='#menuEvent'>menuEvent</a> \r
+オプションに値を割り当てて下さい。\r
+以下のコードは、右クリックでメニューを開きます。\r
+<pre>\r
+  Rico.loadModule('LiveGridMenu');\r
+  ...\r
+  var grid_options = {\r
+    menuEvent: 'contextmenu'\r
+  }\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, grid_options);\r
+  ex1.menu=new Rico.GridMenu();\r
+</pre>\r
+<p>Rico.GridMenu は、更なるメニューアイテムを追加するために、コールバック(dataMenuHandler)を提供します。\r
+グリッドメニューは常に動的に構築されます -- ユーザーがクリックした行と列のためにカスタマイズされます。\r
+コールバック関数が毎回呼ばれるように、メニューは起動されて、\r
+それぞれの起動で要求されるメニューアイテムを加えなければなりません。\r
+<pre>\r
+  Rico.loadModule('LiveGridMenu');\r
+  ...\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, grid_options);\r
+  ex1.menu=new Rico.GridMenu();\r
+  ex1.menu.options.dataMenuHandler=myCustomMenuItems;\r
+  ...\r
+function myCustomMenuItems(grid,r,c,onBlankRow) {\r
+  if (buffer.getWindowValue(r,c)=='Special Value')\r
+    grid.menu.addMenuItem("Special menu item", specialAction);\r
+}\r
+function specialAction() {\r
+  ...\r
+}\r
+</pre>\r
+\r
+<p>完全なカスタムメニューを作成する事も可能です。\r
+例えば、ex5.php/asp/aspx を見て下さい。\r
+\r
+\r
+<h2>注意</h2>\r
+<ul>\r
+<li>もし、ライブグリッドテーブル名に '_bookmark' が追加された名前に、DOM の ID が一致する要素を作成するなら、\r
+グリッドに表示されいるレコードの数を示しているテキストが更新されるでしょう。\r
+LiveGrid の実例は、一般的にこのマークアップを使います。\r
+<pre>\r
+&lt;p class="ricoBookmark"&gt;&lt;span id="data_grid_bookmark"&gt;&nbsp;&lt;/span&gt;&lt;/p&gt;\r
+</pre>\r
+<li>ライブグリッドを表示するブラウザは、<a href="http://www.quirksmode.org/css/quirksmode.html">strict (別名 "標準" )モード</a> で実行されていなければなりません。\r
+したがって、あなたは <code> &lt;html&gt; </code> タグの直前に doctype の宣言を含めなければなりません。例えば\r
+\r
+<pre>\r
+&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" \r
+ "http://www.w3.org/TR/html4/strict.dtd"&gt;\r
+</pre>\r
+</ul>\r
+\r
+<h2>リファレンス</h2>\r
+<h3>コンストラクタ</h3>\r
+<pre>\r
+\r
+  var grid = new Rico.LiveGrid (table_id, rico_buffer, grid_options);\r
+\r
+</pre>\r
+\r
+<ul>\r
+<li><strong>table_id</strong> はライブグリッドによって実装される、テーブルの DOM id です\r
+<li><strong>rico_buffer</strong> は Rico のバッファです、例えば\r
+  <ul>\r
+  <li>Rico.Buffer.Base (AJAX 対応では無いテーブルのために)\r
+  <li>Rico.Buffer.AjaxXML\r
+  <li>Rico.Buffer.AjaxSQL\r
+  </ul>\r
+<li><strong>grid_options</strong> (下記参照)\r
+</ul>\r
+\r
+<h3><a name="options"></a>オプション</h3>\r
+\r
+<h4>グリッドサイズ</h4>\r
+<dl>\r
+<dt>visibleRows (.net の行)\r
+<dd>グリッドに何行表示しますか?\r
+正の整数は、グリッドが正確に多くの行を常に含まなければならないことを示しています。\r
+負の値は、以下の意味を持ちます。\r
+  <ul>\r
+  <li>-1: クライアントウィンドウに合わせたグリッドサイズ(デフォルト)\r
+  <li>-2: クライアントウィンドウとデータの小さい方のグリッドサイズ\r
+  <li>-3: ページのボディにスクロールバーを持たないためのグリッドサイズ\r
+  <li>-4: DOM の親ノードによるグリッドサイズ\r
+  </ul>\r
+  \r
+<dt>minPageRows\r
+<dd>表示される行数の最小値。visibleRows が 0 以下の時のみ利用される。(Rico 2b3 からはデフォルトが 2 で、Rico 2b3 までは 1)\r
+\r
+<dt>maxPageRows\r
+<dd>表示される行数の最大値。visibleRows が 0 以下の時のみ利用される。(デフォルトは 50)\r
+\r
+<dt>defaultWidth\r
+<dd>列の初期幅を設定する際に使われる整数。\r
+説明については <a href='#width'>列幅オプション</a> を見て下さい。\r
+(デフォルトは 100)\r
+\r
+<dt>useUnformattedColWidth\r
+<dd>列の初期幅を設定する際に使われる真偽値。\r
+説明については <a href='#width'>列幅オプション</a> を見て下さい。\r
+(デフォルトは true)\r
+\r
+<dt>scrollBarWidth\r
+<dd>いくらかの計算のために、LiveGrid はページ上のスクロールバーの幅を知っている必要があります。(デフォルトは 19)\r
+\r
+<dt>minScrollWidth\r
+<dd>固定された列の幅がウィンドウ幅を上回る時の、スクロールエリアのピクセル幅の最小値。(デフォルトは 100)\r
+</dl>\r
+\r
+\r
+<h4>グリッドデータ</h4>\r
+<dl>\r
+<dt>offset<dd>表示されるデータの最初の行(デフォルトは 0)\r
+<dt>prefetchBuffer<dd>ページのロード時にバッファの(そして、その結果グリッドの)ロードを行いますか?\r
+<dt>sortCol<dd>初期ソートのための、列の名前かインデックス\r
+<dt>sortDir<dd>初期ソートの方向\r
+  <br>取り得る値は 'ASC'、'DESC'\r
+<dt>getQueryParms<dd>もし true なら、フィルタパラメータのための、そのウェブページのクエリ文字列をチェックし、そして見つかるどんなフィルタでも適用します。\r
+フィルタパラメータは "f[x]=" の形でなければならず、"x" は列のインデックスです。(デフォルトは false )\r
+</dl>\r
+\r
+<h4>ヘッダ構成</h4>\r
+<dl>\r
+<dt>frozenColumns\r
+<dd>グリッドの左側の固定された列の数(Excel のように)\r
+\r
+<dt>headingSort\r
+<dd>ソートを容易にするために、どのように見出しが表示されるかを定義する文字列。\r
+  <ul>\r
+  <li>'link' -- 見出しに列をソートしてくれるリンクを作成します(デフォルト)\r
+  <li>'hover' -- ユーザは、ソートするために、見出しのセルのどんな部分でもクリックする事が出来ます。カーソルがセル上でホバーする時、見出しは背景色を変えます。\r
+  <li>'none' -- 見出し上のイベントは利用不能です。\r
+  </ul>\r
+\r
+<dt>hdrIconsFirst<dd>見出しの前後に、ソートとフィルタのアイコンを置きます(デフォルトは true)\r
+\r
+<dt><a name='allowColResize'>allowColResize</a><dd>ユーザによる列のリサイズを許しますか?\r
+true なら、個々の列のリサイズを利用不能にするために columnSpecs の <a href='#noResize'>noResize</a> を利用します。\r
+\r
+<dt>panels<dd>第二の見出しとして用いる事が出来る文字列の配列です。\r
+LiveGrid Forms で、入力フォーム上のタブを付けられたパネルのための見出しを提供します。\r
+\r
+<dt>PanelNamesOnTabHdr<dd>panels[] の文字列を第二の見出しとして利用するために 'true' を設定します。\r
+LiveGrid Forms では、 panels[] は入力フォームとしてのみ利用されるので、'false' が設定されるでしょう。\r
+\r
+<dt><a name='FilterLocation'></a>FilterLocation\r
+<dd>フィルタを設置する見出しの行を指定します。\r
+-1 は、新しい行をヘッダに追加し、新しい行がフィルタリングのために利用されるようにします。\r
+<a href='#filterUI'>filterUI</a> のオプションも見て下さい。\r
+\r
+<dt>FilterAllToken\r
+<dd>選択フィルタで "show all values" を示すトークン(デフォルトは "___ALL___")。\r
+</dl>\r
+\r
+<h4>画像</h4>\r
+<dl>\r
+<dt>resizeBackground\r
+<dd>列のリサイズハンドルに利用される画像(デフォルトは 'resize.gif')\r
+\r
+<dt>sortAscendImg\r
+<dd>列を昇順でソートする事を示すために使われる画像(デフォルトは 'sort_asc.gif')\r
+\r
+<dt>sortDescendImg\r
+<dd>列を降順でソートする事を示すために使われる画像(デフォルトは 'sort_desc.gif')\r
+\r
+<dt>filterImg\r
+<dd>列に対し現在利用中のフィルタを示すために使われる画像(デフォルトは 'filtercol.gif')\r
+</dl>\r
+\r
+\r
+<h4>クッキーオプション</h4>\r
+<dl>\r
+\r
+<dt>saveColumnInfo\r
+<dd>グリッドのクッキーに、どの詳細設定を保存するかを指定します。\r
+一つのクッキーだけが、それぞれのグリッドのために利用されます。\r
+幅の設定が、列の非表示/表示の状態を含む事に注意して下さい。\r
+(デフォルトは {width:true, filter:false, sort:false})\r
+<br>.netプラグインでは、このオプションは、3 つの別々のプロパティによって表現されます。\r
+saveColumnWidth、saveColumnFilter、saveColumnSort。\r
+\r
+<dt>cookiePrefix\r
+<dd>クッキー名の先頭に付け加えられる文字列(デフォルトは 'RicoGrid.')\r
+\r
+<dt>cookieDays\r
+<dd>数字の日数前のクッキーは期限切れになります。\r
+指定しなければ、クッキーは現在のセッションの間だけ維持されます。(デフォルトは null)\r
+\r
+<dt>cookiePath\r
+<dd>グリッドのクッキーを読む事が出来るトップレベルディレクトリを設定します。\r
+指定しなければ、それはクッキーを設定するページのパスになります。(デフォルトは null)\r
+\r
+<dt>cookieDomain\r
+<dd>クッキーがどのドメインに送られなければならないかについて、ブラウザに知らせます。\r
+指定しなければ、それはクッキーを設定するページのドメインになります。(デフォルトは null)\r
+\r
+</dl>\r
+\r
+<h4>ハイライティングとセレクション</h4>\r
+<dl>\r
+\r
+<dt>highlightElem\r
+<dd>何がハイライトまたは選択されるかについて指定する文字列。\r
+  <ul>\r
+  <li>'cursorRow' -- the grid row under the cursor\r
+  <li>'cursorCell' -- the grid cell under the cursor\r
+  <li>'menuRow' -- the grid row where the menu is displayed\r
+  <li>'menuCell' -- the grid cell where the menu is displayed\r
+  <li>'selection' -- allow the user to select cells\r
+  <li>'none' -- never highlight\r
+  </ul>\r
+\r
+<dt>highlightSection\r
+<dd>テーブルのどのセレクションがハイライトされるかについて指定する整数\r
+  <ul>\r
+  <li>1 -- 固定された部分\r
+  <li>2 -- スクロールする部分\r
+  <li>3 -- すべて(デフォルト)\r
+  <li>0 -- 無し\r
+  </ul>\r
+<dt>highlightMethod\r
+<dd>セルや行がハイライトされる方法。取り得る値は\r
+  <ul>\r
+  <li>'outline' -- クライアント側で、最も CPU 集約型では無い\r
+  <li>'class' -- ハイライトされた セル/行 のCSS クラスを追加(デフォルト)\r
+  <li>'both' -- アウトラインとクラスの両方を利用するハイライト\r
+  </ul>\r
+<dt>highlightClass\r
+<dd>クラスによってハイライトされる時、クラス名として利用されます(デフォルトは 'ricoLG_selection')\r
+</dl>\r
+\r
+<h4>エクスポートと印刷</h4>\r
+<dl>\r
+<dt>maxPrint\r
+<dd>ユーザに 印刷/エクスポート を許す最大行数。\r
+印刷/エクスポート を利用不能にするには 0 を設定します。(デフォルトは 1000)\r
+\r
+<dt>exportWindow\r
+<dd>エクスポートウィンドウが生成される時に、\r
+<a href='http://www.w3schools.com/htmldom/met_win_open.asp'>window.open()</a> に渡されるオプション文字列。\r
+(デフォルトは "height=400,width=500,scrollbars=1,menubar=1,resizable=1")\r
+</dl>\r
+\r
+<h4>イベントコントロール</h4>\r
+<dl>\r
+<dt><a name='menuEvent'></a>menuEvent\r
+<dd>グリッドメニューがいつ呼び出されるべきかを指定する文字列\r
+  <ul>\r
+  <li>'click' -- シングルクリックでメニューを呼び出す\r
+  <li>'dblclick' -- ダブルクリックでメニューを呼び出す(デフォルト)\r
+  <li>'contextmenu' -- 右クリックでメニューを呼び出す\r
+  <li>'none' -- メニューをポップアップしない\r
+  </ul>\r
+\r
+<dt>windowResize\r
+<dd>window.resize イベントの間にグリッドの大きさを変更するかどうかを指定する真偽値?\r
+グリッドがアコーディオンに組み込まれる時に、これに false が設定されなくてはなりません。(デフォルトは true)\r
+</dl>\r
+\r
+<h4>イベントハンドル</h4>\r
+<dl>\r
+<p>コンストラクタにオプションでイベントハンドラを渡す事は出来ませんが、LiveGrid が生成された後なら、設定されるかも知れません。</p>\r
+<dt>sortHandler<dd> (デフォルトは Rico.LiveGridMethods.sortHandler -- バインドされた)\r
+<dt>filterHandler<dd> (デフォルトは Rico.LiveGridMethods.filterHandler -- バインドされた)\r
+<dt>onRefreshComplete<dd> (デフォルトは Rico.LiveGridMethods.bookmarkHandler -- バインドされた)\r
+<dt>rowOverHandler<dd> (デフォルトは Rico.LiveGridMethods.rowMouseOver -- イベントリスナーとしてバインドされた)\r
+<dt>mouseDownHandler<dd> (デフォルトは Rico.LiveGridMethods.selectMouseDown -- イベントリスナーとしてバインドされた)\r
+<dt>mouseOverHandler<dd>(デフォルトは Rico.LiveGridMethods.selectMouseOver -- イベントリスナーとしてバインドされた)\r
+<dt>mouseUpHandler<dd> (デフォルトは Rico.LiveGridMethods.selectMouseUp -- イベントリスナーとしてバインドされた)\r
+<dt>onscroll<dd> グリッドが垂直にスクロールされる時は、いつでも呼ばれます。(デフォルトは null)\r
+<dt>onscrollidle<dd> グリッドが垂直にスクロールされた 1、2 秒後に呼ばれます。(デフォルトは null)\r
+<dt>click<dd> グリッドセルがクリックされた時に呼ばれます。(デフォルトは menuEvent='click' で無ければ null)\r
+<dt>dblclick<dd> グリッドセルがダブルクリックされた時に呼ばれます。(デフォルトは menuEvent='dblclick' で無ければ null)\r
+<dt>contextmenu<dd> グリッドセルが右クリックされた時に呼ばれます。(デフォルトは menuEvent='contextmenu' で無ければ null)\r
+</dl>\r
+\r
+<h4><a name="column"></a>列ごとの構成</h4>\r
+<dl>\r
+<p>各々の列のためのオプションは、columnSpecs オプションに含まれます。\r
+columnSpecs は、各々の列のためのエントリに関する配列です。\r
+各々の列のエントリは、以下のいずれかで行う事が出来ます。\r
+<ul>\r
+\r
+<li>null (デフォルト) -- その場合、Rico.TableColumn.DEFAULT. の仕様によって列はフォーマットされます。\r
+グリッドの多くの列が共通のフォーマットを共有するならば、グリッドのデフォルト列仕様をオーバーライドする事は意味があるかもしれません。\r
+<pre>\r
+Rico.TableColumn.DEFAULT = {ClassName:'aligncenter', width:50};\r
+</pre>\r
+この場合は、仕様の無いどんな列でも、整列は中央で幅は 50 ピクセルの内容を持ちます。\r
+\r
+<li>a string -- 列のフォーマットを指定する単純な方法を提供します。\r
+DOLLAR、EURO、PERCENT、QTY、DEFAULT の値がビルトインされています。\r
+独自のものを定めることも可能です。\r
+温度フォーマットを定義したこの例は、weather.php から取得されます\r
+\r
+<pre>\r
+Rico.TableColumn.TEMP = {type:'number', decPlaces:0, \r
+  ClassName:'alignright', suffix:'&amp;deg;C', width:50};\r
+var opts = {  \r
+  frozenColumns : 1,\r
+  columnSpecs   : [{width:120},{width:70},{width:70},{width:100},\r
+                   'TEMP','TEMP','TEMP',\r
+                   {width:150},{width:200},{width:60}]\r
+};\r
+</pre>\r
+\r
+<li>an object -- 下記の表にあるプロパティの一つ以上のエントリを含む。\r
+ここに、列 0、1 と 3 が仕様を含む例を挙げます。\r
+列 2 はデフォルトの仕様を取得します。\r
+<pre>\r
+columnSpecs : [{canSort:false, noResize:true, ClassName:'alignright'},\r
+               {ClassName:'aligncenter'},\r
+               ,\r
+               {visible:false}]\r
+</pre>\r
+</ul>\r
+\r
+<dt>Hdg\r
+<dd>列の見出しテキストを指定する代わりの方法。\r
+グリッド ID が、html テーブルの代わりに &lt;div&gt; を参照するなら、LiveGrid によってのみ利用されます。\r
+\r
+<dt>canSort\r
+<dd>列をソートする事が出来ます。(デフォルトは grid.options.canSortDefault)\r
+\r
+<dt>canFilter\r
+<dd>列をフィルタする事が出来ます。(デフォルトは grid.options.canFilterDefault)\r
+\r
+<dt>canDrag\r
+<dd>列のセルは、ドラッグアンドドロップオペレーションのソースとして用いられる事が出来ます。\r
+"DragAndDrop" モジュールはロードされなければなりません。\r
+一時的なドラッグオブジェクトは "LiveGridDraggable" クラスが持ちます。\r
+実例として、<a href='client/drag_and_drop_grid.html'>drag_and_drop_grid.html</a> を見て下さい。(デフォルトは false)\r
+\r
+<dt>canHide\r
+<dd>列を 表示/非表示 する事が出来ます。(デフォルトは grid.options.canHideDefault)\r
+\r
+<dt>visible\r
+<dd>列は、初めは隠されていません。\r
+grid.options.saveColumnInfo.width が true で、列のためのクッキーに値があるなら、クッキーの値が優先されます。\r
+(デフォルトは true)\r
+\r
+<dt><a name='width'></a>width\r
+<dd>列の初期幅(ピクセルで)を指定する整数。\r
+ここに、それぞれの列の初期幅を設定するために LiveGrid が利用するアルゴリズムがあります。\r
+<ol>\r
+<li>options.saveColumnInfo.width が true で、列情報がグリッドのクッキーに存在する場合は\r
+(以前にグリッドの列の上でリサイズを実行したユーザのために)\r
+クッキーのその幅が利用されます。\r
+そうでない場合は、、、\r
+\r
+<li>options.columnSpecs に列の幅仕様があれば、その幅仕様が利用されます。一例として、 ex3.php/asp/aspx を見て下さい。そうでない場合は、、、\r
+\r
+<li>options.useUnformattedColWidth が true で(デフォルト)、グリッドヘッダが html テーブルから初期化されるならば、htmlテーブルの列の幅が利用されます。\r
+通常 col タグを用いて初期テーブルの列幅をコントロールする事が出来ます。(例えば &lt;col style='width:40px;' &gt;)。\r
+\r
+テーブル幅全体がブラウザー幅より小さいならば、これは動作します。\r
+しかし、それがより大きいならば、ブラウザはしばしば "col width" を無視して、全ての列を利用できるウインドウ幅の中に押し込もうとします。\r
+このように、列幅を設定するためにこの方法を使用することは信頼出来ません。\r
+そうでない場合は、、、\r
+\r
+<li>options.useUnformattedColWidth が false ならば、列の幅は options.defaultWidth により設定されます。(デフォルトは 100)\r
+</ol>\r
+したがって、列幅を LiveGrid と SimpleGrid で設定する最も信頼できる方法は、options.columnSpecs[] ですべての列に幅を指定することになります。 \r
+多くの列が共通の幅を共有するならば、options.useUnformattedColWidth=false を設定して、options.defaultWidth を共通の幅に設定する事によって、\r
+いくらかの近道をする事が出来ます。\r
+\r
+<dt><a name='noResize'>noResize</a>\r
+<dd>列のリサイズを許しますか?(デフォルトは <a href='#allowColResize'>grid.options.allowColResize</a>)\r
+\r
+<dt>ClassName\r
+<dd>デフォルトでは、LiveGrid はユニークな CSS クラス名を、table_id + '_col' + column_index の命名規約に従い、それぞれの列に割り当てます。\r
+例えば、グリッド 'mygrid' の第 4 列は、クラス名 'mygrid_col3' を持ちます。\r
+ClassName オプションの値は、このデフォルト名をオーバーライドします。\r
+ClassName オプションは、Rico が提供する 'alignright' と 'aligncenter' クラスによって列の整列を指定するために、最も一般的に用いられます。\r
+なので、グリッドの最初の 3 つの列が赤い背景色に白いテキストで表示されることを望むならば、あなたは以下のどちらでもすることが出来ます。\r
+\r
+<pre>\r
+In CSS:\r
+.mygrid_col0 div.ricoLG_cell, \r
+.mygrid_col1 div.ricoLG_cell, \r
+.mygrid_col2 div.ricoLG_cell {\r
+  color: white;\r
+  background-color: red;\r
+}\r
+</pre>\r
+\r
+または\r
+\r
+<pre>\r
+In CSS:\r
+.WhiteOnRed div.ricoLG_cell {\r
+  color: white;\r
+  background-color: red;\r
+}\r
+\r
+In javascript:\r
+columnSpecs : [{ClassName:'WhiteOnRed'},\r
+               {ClassName:'WhiteOnRed'},\r
+               {ClassName:'WhiteOnRed'},\r
+               ...\r
+</pre>\r
+\r
+最後に、この ClassName がグリッドの見出しに適用されない点に注意してください - \r
+ヘッダの整列を達成するためには、&lt;th&gt; タグで align="right" を利用して下さい。\r
+\r
+<dt>type\r
+<dd>これらの値の内の一つを含む文字列。\r
+<ul>\r
+<li>text - 列の値のどんなタグでも、ユーザに表示される前に取り除かれます。\r
+<li>showTags - 列の値のどんなタグでも、ユーザにテキストとして表示されます。\r
+<li>number - 列の値は数として扱われ、列仕様で与えられるどんな <a href='#NumberFormatting'>number formatting options</a> でも適用されます。\r
+<li>datetime - 列の値は 日付 &amp; 時間 として扱われ、列仕様で与えられるどんな <a href='#DateFormatting'>date formatting options</a> でも適用されます。\r
+<li>UTCasLocalTime - 列やデータベースの値は GMT/UTC 日付 &amp; 時間 として扱われ、列仕様で与えられるどんな <a href='#DateFormatting'>date formatting options</a> でも適用されます。\r
+表示される前に、その値はユーザのローカルタイムゾーンに変換されます。\r
+<li>date - 列の値は日付として扱われ、列仕様で与えられるどんな <a href='#DateFormatting'>date formatting options</a> でも適用されます。\r
+<li>raw (default) - 列の値は、グリッドのセルに直接表示されます。どんなHTMLマークアップでもセルにコピーされます。\r
+</ul>\r
+</dd>\r
+\r
+<dt><a name='control'></a>コントロール\r
+<dd>特別なフォーマットを列に提供するのに用いられるオブジェクト。\r
+いくつかの列コントロールは LiveGrid により提供されます。\r
+それらのためのコードは、 ricoLiveGridControls.js にあります。\r
+ここに、提供されるコントロールの簡潔な記述があります。\r
+\r
+<dl style='font-size:smaller;'>\r
+<dt>Rico.TableColumn.checkboxKey(showKey)\r
+<dd> &lt;checkbox&gt; &lt;key value&gt; として列のユニークキーを表示し、どのキーがユーザによって選択されているかを見逃しません。\r
+キーの値は &lt;、 &gt;、 または &amp; を含むべきではありません。\r
+\r
+<dt>Rico.TableColumn.checkbox(checkedValue, uncheckedValue, defaultValue, readOnly)\r
+<dd>チェックボックスとして列を表示します。データベースの列は、二つの値のみを含まなければなりません(例えば yes/no)。\r
+以下のコードは、ex7 から取得されます(列の値は 1 と 0)。\r
+<pre>\r
+columnSpecs: [{canHide:false,\r
+               control:new Rico.TableColumn.checkbox('1','0'),\r
+               ClassName:'aligncenter'},\r
+              'specQty'],\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.textbox(boxSize, boxMaxLen, readOnly)\r
+<dd>テキストボックス内に列の値を表示します。\r
+\r
+<dt>Rico.TableColumn.HighlightCell(chkcol,chkval,highlightColor,highlightBackground)\r
+<dd>特定の値が指定された列に存在する時、グリッドのセルをハイライトします。\r
+以下のコードは ex2highlight から取得され、列 1 が "HANAR" を含む時、行全体をハイライトします。\r
+<pre>\r
+var CustId='HANAR';\r
+var CustIdCol=1;\r
+var highlight=Rico.TableColumn.HighlightCell;\r
+...\r
+columnSpecs: [\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ type:'date', control:new highlight(CustIdCol,CustId,'red','yellow') },\r
+{ type:'date', control:new highlight(CustIdCol,CustId,'red','yellow') }]\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.bgColor()\r
+<dd>データベースの値が css カラーの名前や値を含みます。\r
+\r
+<dt>Rico.TableColumn.link(href,target)\r
+<dd>データベースの値が、他のページへの URL を含みます。\r
+href パラメータは、文字列に "{x}" を含む事により、グリッドの値への参照を含むかもしれません。 x は列の番号です。\r
+以下のコードは ex6 から取得されます。\r
+<pre>\r
+columnSpecs: [,\r
+{control:new Rico.TableColumn.link('ex2.asp?id={0}','_blank'),\r
+ width:250},\r
+,'specQty']\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.image()\r
+<dd>データベースの値が画像への url を含みます。\r
+以下のコードは photos.php から取得されます。\r
+<pre>\r
+imgctl=new Rico.TableColumn.image();\r
+...\r
+columnSpecs: [\r
+{control:imgctl,width:90},,,\r
+{type:'datetime'},{width:200}]\r
+</pre>\r
+\r
+<dt>Rico.TableColumn.lookup(map, defaultCode, defaultDesc)\r
+<dd>データベースの値を表示される値にマップします。\r
+</dl>\r
+\r
+<br>アプリケーション特有のロジックを実装する、独自の列コントロールを書く事も可能です。\r
+ここに例があります。\r
+<pre>\r
+// Display values white on black if\r
+//   first column contains the value "reverse"\r
+// Usage: { control:new MyCustomColumn() }\r
+MyCustomColumn = Class.create();\r
+\r
+MyCustomColumn.prototype = {\r
+  initialize: function() {},\r
+\r
+  _clear: function(gridCell,windowRow) {\r
+    gridCell.style.color='';\r
+    gridCell.style.backgroundColor='';\r
+    gridCell.innerHTML='&amp;nbsp;';\r
+  },\r
+\r
+  _display: function(v,gridCell,windowRow) {\r
+    var col0=this.liveGrid.buffer.getWindowValue(windowRow,0);\r
+    if (col0=="reverse") {\r
+      gridCell.style.color='white';\r
+      gridCell.style.backgroundColor='black';\r
+    } else {\r
+      gridCell.style.color='';\r
+      gridCell.style.backgroundColor='';\r
+    }\r
+    gridCell.innerHTML=this._format(v);\r
+  }\r
+}\r
+</pre>\r
+\r
+<dt><a name='filterUI'></a>filterUI\r
+<dd><a href='#FilterLocation'>FilterLocation</a> オプションがグリッドに指定されるならば、filterUI はそれぞれの列がどのようにフィルタされるかについてコントロールします。\r
+もし filterUI が、\r
+<ul>\r
+<li>null または省略されたら、列にはフィルタが表示されません。\r
+<li>'t' - テキストボックスフィルタを生成し、レコードはユーザのキーボードからの入力によってフィルタされて表示されます。\r
+<br>任意に後につくキャレット(^)は、テキストボックスの値が列の値の始めに一致すべき事を示します。\r
+そうでない場合は、列の値のどこにでも一致します。\r
+<br>任意に後につく数値はテキストボックスの数値を意味します(デフォルトのサイズは 10)\r
+<pre>\r
+filterUI:'t^20' \r
+// will create a text box that is 20 characters wide\r
+// text typed into the box will be compared to\r
+//    the beginning of each column value\r
+</pre>\r
+<li>'s' - リストに含む事の出来るすべての列の値と共にセレクトリストフィルタを生成します。\r
+グリッドのソースが SQL クエリなら、'select distinct' クエリを利用して実装されます。\r
+<ul>\r
+</dl>\r
+\r
+<dl>\r
+<a name='NumberFormatting'></a>\r
+<p><em>数値フォーマット:</em></p>\r
+\r
+<dt>multiplier\r
+<dd>表示される前に、その値はこの数値によって乗算されます。(デフォルトは 1)\r
+\r
+<dt>decPlaces\r
+<dd>小数点より右側の桁数(デフォルトは 0)\r
+\r
+<dt>decPoint\r
+<dd>小数点のシンボル(翻訳ファイルでオーバーライドされなければ、デフォルトは '.')\r
+\r
+<dt>thouSep\r
+<dd>千桁区切りのためのシンボル。(翻訳ファイルでオーバーライドされなければ、デフォルトは ',')\r
+\r
+<dt>negSign\r
+<dd>負数がどのように表示されるべきかを指定します。取り得る値は\r
+<ul>\r
+<li>L= 先頭にマイナスをつける(デフォルト)\r
+<li>T= 後ろにマイナスをつける\r
+<li>P= 括弧で囲む\r
+</ul>\r
+\r
+<dt>prefix\r
+<dd>数に始まりの文字列を付加します。一般的に通貨シンボルです。\r
+\r
+<dt>suffix\r
+<dd>数値の終わりに付加される文字列。例えば、 "%" シンボル。</dd>\r
+</dl>\r
+\r
+<dl>\r
+<a name='DateFormatting'></a>\r
+<p><em>日付フォーマット:</em></p>\r
+\r
+<dt>dateFmt\r
+<dd>date または datetime をどのように表示するのかを指定する文字列。\r
+デフォルトは "translateDate" であり、RicoTranslate オブジェクトで利用される dateFmt と timeFmt 文字列を意味します。\r
+(各種言語の翻訳ファイルでオーバーライドされなければ、、date のデフォルトは "mm/dd/yyyy" であり、datetime は "mm/dd/yyyy hh:mm:ss a/pm" です。)\r
+dateFmt="localeDate" ならば、その値は javascript のビルトイン関数である toLocaleDateString() を利用してフォーマットされる。\r
+dateFmt="localeDateTime" ならば、その値は javascript のビルトイン関数である toLocaleString() を利用してフォーマットされる。\r
+dateFmt 文字列は、以下の特殊文字シーケンスを含むでしょう。\r
+\r
+<ul>\r
+<li>yyyy - 4 桁の年\r
+<li>yy - 2 桁の年\r
+<li>mmmm - 月名\r
+<li>mmm - 3 文字の月名省略形。アジアの言語では、これはしばしば意味をなしません - これらの場合、それは完全な月の名前(mmmm と同じ)を返します。\r
+<li>mm - 2 桁の月数(ゼロで埋められた)\r
+<li>m - 1 または 2 桁の月数\r
+<li>dddd - 曜日\r
+<li>ddd - 3 文字の曜日省略形\r
+<li>dd - 2 桁の日数(ゼロで埋められた)\r
+<li>d - 1 または 2 桁の日数\r
+<li>hh - 2 桁の時、 12 時間時計(ゼロで埋められた)\r
+<li>h - 1 または 2 桁の時、 12 時間時計\r
+<li>HH - 2 桁の分、 24 時間時計(ゼロで埋められた)\r
+<li>H - 1 または 2 桁の時間、 24 時間時計\r
+<li>nn - 2 桁の分(ゼロで埋められた)\r
+<li>ss - 2 桁の秒(ゼロで埋められた)\r
+<li>a/p - a または p (am または pm のための)\r
+</ul>\r
+\r
+<pre>\r
+// display first column as "month year"\r
+columnSpecs : [{type:date, dateFmt:'mmm yyyy'}]\r
+</pre>\r
+</dd>\r
+\r
+<dt>prefix\r
+<dd>日付の先頭に付け加えられる文字列\r
+\r
+<dt>suffix\r
+<dd>日付の終わりに付加される文字列。例えば、タイムゾーンを含めるために利用出来ます。\r
+<pre>\r
+// indicate that times are GMT/UTC\r
+columnSpecs : [{type:datetime, suffix:' UTC'}]\r
+</pre>\r
+</dl>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/SimpleGrid.html b/documentation/SimpleGrid.html
new file mode 100644 (file)
index 0000000..16ab95f
--- /dev/null
@@ -0,0 +1,455 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico SimpleGrid</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>\r
+\r
+<body>\r
+<h1>Creating a Rico SimpleGrid</h1>\r
+\r
+<p><a href='SimpleGrid_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='SimpleGrid_ja.html'>View this page in Japanese</a></p>\r
+\r
+<p>SimpleGrid's are new to Rico 2.0 and share some of the same functionality as LiveGrids - \r
+resizable columns, frozen columns, and frozen headings. \r
+However, unlike a LiveGrid, the data is static and resides in the DOM -\r
+so no buffering, no AJAX refreshes, no sorting, no filtering.\r
+Why would you use a SimpleGrid? \r
+<ul>\r
+<li>Because it is more flexible in what each cell can contain - \r
+cells in a column do not all have to be of the same type.\r
+<li>In some circumstances, it can perform better on the client than LiveGrid; \r
+particularly on a slow client and there are many columns in the grid.\r
+<li>Finally, a SimpleGrid can contain input elements (checkboxes, select lists, etc). \r
+While a LiveGrid can also contain input elements, because the element values are stored in the\r
+LiveGrid buffer, submitting the values back to the server can be tricky.\r
+SimpleGrids do not suffer from this problem. You can simply surround the\r
+entire grid with standard <code>&lt;form&gt;...&lt;/form&gt;</code> tags and any\r
+input elements within the grid will be submitted back to the server.\r
+</ul>\r
+\r
+<p>SimpleGrids can be created either of two ways:\r
+<ol>\r
+<li>By using one of the SimpleGrid plug-ins. Plug-ins exist for PHP, ASP, and .net.\r
+<li>By using XSLT. Rico includes an XSL file that will convert a standard\r
+HTML table to a SimpleGrid.\r
+</ol>\r
+\r
+<h2>Usage Model 1: Using a SimpleGrid plug-in</h2>\r
+<p>This section describes the examples simplegrid.php/asp/aspx, \r
+which are included in the Rico distribution.\r
+<ul>\r
+<li>In PHP:\r
+<ul>\r
+<li>First, create a reference to the SimpleGrid plug-in:\r
+<pre>\r
+require "../../plugins/php/SimpleGrid.php";\r
+</pre>\r
+<li>Create an instance of the SimpleGrid plug-in class (server side):\r
+<pre>\r
+$grid=new SimpleGrid();\r
+</pre>\r
+\r
+<li>Create the grid's headings. Passing 'true' to AddHeadingRow indicates\r
+that this is the main heading row - the one that will get the resizers.\r
+The number of columns in the main heading row <em>must</em> be the same\r
+as the number of data columns. Other heading rows may include "colspan" tags\r
+to cover multiple columns. If you have multiple heading rows, one and only one\r
+row may be designated as the main row.\r
+<pre>\r
+$grid->AddHeadingRow(true);\r
+for ($c=1; $c<=$numcol; $c++) {\r
+  $grid->AddCell("Column $c");\r
+}\r
+</pre>\r
+\r
+<li>Populate the grid's data section. Call AddDataRow() everywhere you would normally\r
+place a <code>&lt;tr&gt;</code> tag in a standard html table. Call AddCell() everywhere you would\r
+place a <code>&lt;td&gt;</code> tag.\r
+<pre>\r
+for ($r=1; $r<=100; $r++) {\r
+  $grid->AddDataRow();\r
+  $grid->AddCell($r);\r
+  for ($c=2; $c<=$numcol; $c++) {\r
+    $grid->AddCell("Cell $r:$c");\r
+  }\r
+}\r
+</pre>\r
+\r
+<li>Render the table (generate the html output). The first parameter is the grid id, and the\r
+second parameter is the number of frozen columns.\r
+<pre>\r
+$grid->Render("ex1", 1);\r
+</pre>\r
+\r
+</ul>\r
+\r
+<li>In ASP:\r
+<ul>\r
+<li>First, create a reference to the SimpleGrid plug-in:\r
+<pre>\r
+&lt;!-- #INCLUDE FILE = "../../plugins/asp/SimpleGrid.vbs" --&gt;\r
+</pre>\r
+\r
+<li>Create an instance of the SimpleGrid plug-in class (server side):\r
+<pre>\r
+set grid=new SimpleGrid\r
+</pre>\r
+\r
+<li>Create the grid's headings. Passing 'true' to AddHeadingRow indicates\r
+that this is the main heading row - the one that will get the resizers.\r
+The number of columns in the main heading row <em>must</em> be the same\r
+as the number of data columns. Other heading rows may include "colspan" tags\r
+to cover multiple columns. If you have multiple heading rows, one and only one\r
+row may be designated as the main row.\r
+<pre>\r
+grid.AddHeadingRow true\r
+for c=1 to numcol\r
+  grid.AddCell "Column " & c\r
+next\r
+</pre>\r
+\r
+<li>Populate the grid's data section. Call AddDataRow() everywhere you would normally\r
+place a <code>&lt;tr&gt;</code> tag in a standard html table. Call AddCell() everywhere you would\r
+place a <code>&lt;td&gt;</code> tag.\r
+<pre>\r
+for r=1 to 100\r
+  grid.AddDataRow\r
+  grid.AddCell r\r
+  for c=2 to numcol\r
+    grid.AddCell "Cell " & r & ":" & c\r
+  next\r
+next\r
+</pre>\r
+\r
+<li>Render the table (generate the html output). The first parameter is the grid id, and the\r
+second parameter is the number of frozen columns.\r
+<pre>\r
+grid.Render "ex1", 1\r
+</pre>\r
+</ul>\r
+\r
+<li>In .net:\r
+<ul>\r
+<li>First, create a reference to the SimpleGrid plug-in:\r
+<pre>\r
+&lt;%@ Register TagPrefix="Rico" TagName="SimpleGrid" \r
+    Src="../../plugins/dotnet/SimpleGrid.ascx" %&gt;\r
+</pre>\r
+\r
+<li>Create an instance of the SimpleGrid plug-in class (server side):\r
+<pre>\r
+&lt;Rico:SimpleGrid runat='server' id='ex1' FrozenCols='1' /&gt;\r
+</pre>\r
+\r
+<li>Create the grid's headings - usually within the Page_Load event. \r
+Passing 'true' to AddHeadingRow indicates\r
+that this is the main heading row - the one that will get the resizers.\r
+The number of columns in the main heading row <em>must</em> be the same\r
+as the number of data columns. Other heading rows may include "colspan" tags\r
+to cover multiple columns. If you have multiple heading rows, one and only one\r
+row may be designated as the main row.\r
+<pre>\r
+  ex1.AddHeadingRow(true)\r
+  for c=1 to numcol\r
+    ex1.AddCell("Column " & c)\r
+  next\r
+</pre>\r
+\r
+<li>Populate the grid's data section. Call AddDataRow() everywhere you would normally\r
+place a <code>&lt;tr&gt;</code> tag in a standard html table. Call AddCell() everywhere you would\r
+place a <code>&lt;td&gt;</code> tag.\r
+<pre>\r
+  for r=1 to 100\r
+    ex1.AddDataRow()\r
+    ex1.AddCell(r)\r
+    for c=2 to numcol\r
+      ex1.AddCell("Cell " & r & ":" & c)\r
+    next\r
+  next\r
+</pre>\r
+\r
+<li>Unlike the other plug-ins, rendering happens automatically in the .net control.\r
+</ul>\r
+\r
+<li>Finally, regardless of the plug-in used, you need to \r
+initialize the javascript SimpleGrid object (client side):\r
+<pre>\r
+&lt;script type='text/javascript'&gt;\r
+Rico.loadModule('SimpleGrid','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    columnSpecs: ['specQty']  // display first column as a numeric quantity\r
+  };\r
+  var ex1=new Rico.SimpleGrid ('ex1', opts);\r
+});\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+</ul>\r
+\r
+\r
+<h2>Usage Model 2: Using the XSLT transform</h2>\r
+\r
+<p>If your web page is XHTML compliant, then it is possible to turn a standard html table\r
+on that page into a SimpleGrid using the XSL stylesheet "ricoSimpleGrid.xsl". \r
+At one time, Rico supported doing this\r
+transformation on the client; however, due to changes in the Prototype library, this\r
+is no longer possible. Therefore, if you choose to use this approach, the XSLT transform\r
+<em>must</em> be performed on the server. Instructions for doing a server-side transform:\r
+<ul>\r
+<li><a href="http://www.php.net/manual/en/ref.xsl.php">using PHP5</a>\r
+<li><a href="http://www.topxml.com/dotnet/articles/xslt/default.asp">using .net</a>\r
+</ul>\r
+\r
+<p>The tranform will only convert tables with a class of "ricoSimpleGrid".\r
+<pre>\r
+&lt;table id='test1' class='ricoSimpleGrid'&gt;\r
+</pre>\r
+\r
+<p>Headings for frozen columns must have class="ricoFrozen"\r
+in the <code>&lt;th&gt;</code> tag. If there are multiple heading rows,\r
+then the main heading row should have an id ending in "_main" (this is the\r
+row that will display resizing handles). The transform\r
+will look for grid headings in the table's <code>&lt;thead&gt;</code> section.\r
+If no thead section exists, then the transform will assume the first row of the table\r
+is the heading row.\r
+<pre>\r
+&lt;table id="test1" class="ricoSimpleGrid"&gt;\r
+\r
+  &lt;thead&gt;\r
+     &lt;tr id="customer_livegrid_main"&gt;\r
+        &lt;th class="ricoFrozen"&gt;ID&lt;/th&gt;\r
+        &lt;th&gt;Customer&lt;/th&gt;\r
+        &lt;th&gt;Address&lt;/th&gt;\r
+        &lt;th&gt;City&lt;/th&gt;\r
+     &lt;/tr&gt;\r
+  &lt;/thead&gt;\r
+\r
+  &lt;tbody&gt;\r
+    &lt;!-- grid data --&gt;\r
+  &lt;/tbody&gt;\r
+&lt;/table&gt;\r
+</pre>\r
+\r
+<p>Finally, the SimpleGrid javascript object must be declared and initialized in a CDATA section.\r
+The call to ricoInit() is generated by the XSLT transform.\r
+<pre>\r
+&lt;script type="text/javascript"&gt;\r
+//&lt;![CDATA[\r
+\r
+function ricoInit() {\r
+  try {\r
+  Rico.loadModule('SimpleGrid');\r
+  Rico.onLoad(ricoInit2);\r
+  } catch(e) { alert(e.message); }\r
+}\r
+\r
+var grid1\r
+function ricoInit2() {\r
+  try {\r
+  grid1=new Rico.SimpleGrid ('test1',{maxHt:180});\r
+  } catch(e) { alert(e.message); }\r
+}\r
+//]]&gt;\r
+&lt;/script&gt;\r
+</pre>\r
+\r
+\r
+\r
+<h2>Reference</h2>\r
+\r
+<h3>Constructor</h3>\r
+<pre>\r
+\r
+  var grid = new Rico.SimpleGrid (table_id, grid_options);\r
+\r
+</pre>\r
+<ul><li><strong>table_id</strong> is the DOM id of the table to be populated by LiveGrid\r
+<li><strong>grid_options</strong> (see below)\r
+</ul>\r
+\r
+<h3>Options</h3>\r
+<h4>General options</h4>\r
+<dl>\r
+\r
+<dt>frozenColumns\r
+<dd>Number of frozen columns on the left side of the grid (default: 0)\r
+\r
+<dt>maxHt\r
+<dd>Maximum height of a SimpleGrid in pixels. (default: null)\r
+\r
+<dt>windowResize\r
+<dd>Resize grid on window.resize event?\r
+Set to false when embedded in an Accordian. (default: true)\r
+\r
+<dt>useUnformattedColWidth\r
+<dd>Use column widths in source html table when configuring the grid? (default: true)\r
+\r
+<dt>scrollBarWidth\r
+<dd>Used in positioning, does not actually change the width of the scrollbar. (default: 19)\r
+\r
+<dt>minScrollWidth\r
+<dd>When the width of the frozen columns exceeds the client window width, \r
+how wide should the total width of the scrolling columns be?\r
+\r
+<dt>highlightElem\r
+<dd>What gets highlighted in the grid. Possible values: \r
+<ul>\r
+<li>cursorRow - the grid row under the cursor\r
+<li>cursorCell - the grid cell under the cursor\r
+<li>menuRow - the relevant row when the user opens the grid's context menu\r
+<li>menuCell - the relevant cell when the user opens the grid's context menu\r
+<li>selection - the cells selected by the user\r
+<li>none - nothing is highlighted (default)\r
+</ul>\r
+\r
+<dt>exportWindow\r
+<dd>Option string that gets passed to window.open() when the user exports data from the grid.\r
+(default: "height=300,width=500,scrollbars=1,menubar=1,resizable=1")\r
+\r
+<dt>exportStyleList\r
+<dd>An array of CSS attributes that will be extracted from the each cell in the grid\r
+and used to format the exported table. \r
+(default: ['background-color', 'color', 'text-align', 'font-weight', 'font-size', 'font-family'])\r
+\r
+<dt>exportImgTags\r
+<dd>Boolean value that specifies whether img text should be included in the export. img text\r
+is the alt text if it exists, otherwise it is the title text, otherwise it is the src value. (default: true)\r
+\r
+<dt>exportFormFields\r
+<dd>Boolean value that specifies whether form fields should be included in the export. (default: true)\r
+</dl>\r
+\r
+\r
+<h4>Images</h4>\r
+<dl>\r
+<dt>resizeBackground\r
+<dd>Image to use for column resize handle. (default: 'resize.gif')\r
+\r
+<dt>sortAscendImg\r
+<dd>Image to use to indicate that the column is sorted in ascending order. (default: 'sort_asc.gif')\r
+\r
+<dt>sortDescendImg\r
+<dd>Image to use to indicate that the column is sorted in descending order. (default: 'sort_desc.gif')\r
+</dl>\r
+\r
+\r
+<h4>Menu and event-handling options</h4>\r
+<dl>\r
+\r
+<dt>contextmenu\r
+<dd>Action to take when the user right-clicks on a grid cell (default: null)\r
+\r
+<dt>menuEvent\r
+<dd>Event that triggers menus. Possible values: \r
+<ul>\r
+<li>click\r
+<li>dblclick (default)\r
+<li>contextmenu\r
+<li>none\r
+</ul>\r
+\r
+<dt>click\r
+<dd>Action to take when the user single-clicks on a grid cell (default: null)\r
+\r
+<dt>dblclick\r
+<dd>Action to take when the user double-clicks on a grid cell (default: null)\r
+\r
+</dl>\r
+\r
+<h4>Cookie options</h4>\r
+<dl>\r
+\r
+<dt>saveColumnInfo\r
+<dd>Specifies which details to save in the grid's cookie. Only one cookie is used for each grid.\r
+Note that the width setting includes the hide/show status of the column. \r
+(default: {width:true, filter:false, sort:false})\r
+\r
+<dt>cookiePrefix\r
+<dd>A string that is prepended to the cookie name. (default: 'RicoGrid.')\r
+\r
+<dt>cookieDays\r
+<dd>Number of days before the cookie expires. \r
+If you don't specify it, then the cookie is only maintained for the current session. (default: null)\r
+\r
+<dt>cookiePath\r
+<dd>Sets the top level directory from which the grid cookie can be read.\r
+If you don't specify it, it becomes the path of the page that sets the cookie. (default: null)\r
+\r
+<dt>cookieDomain\r
+<dd>Tells the browser to which domain the cookie should be sent. \r
+If you don't specify it, it becomes the domain of the page that sets the cookie. (default: null)\r
+\r
+</dl>\r
+\r
+<h4>Column defaults</h4>\r
+<dl>\r
+<dt style='font-weight:normal;'>Each of these items can be overridden \r
+on a per-column basis via the columnSpecs option.\r
+\r
+<dt>canSortDefault\r
+<dd>Are columns sortable by default? (LiveGrid default: true, SimpleGrid default: false)\r
+\r
+<dt>canFilterDefault\r
+<dd>Can the column be filtered? \r
+(LiveGrid default: RicoBuffer.options.canFilter, SimpleGrid default: false) \r
+\r
+<dt>canHideDefault\r
+<dd>Columns can be hidden/unhidden (default: true)\r
+\r
+<dt>allowColResize\r
+<dd>Allow user to resize columns (default: true)\r
+\r
+<dt>defaultWidth\r
+<dd>Default width of each column in pixels (default: 100)\r
+\r
+</dl>\r
+\r
+<h4>Per-column configuration</h4>\r
+<dl>\r
+<dt style='font-weight:normal;'>Options for each individual column are contained in the columnSpecs option.\r
+columnSpecs is an array with an entry for each column. \r
+Each column entry can either be:\r
+<ul>\r
+<li>null (default) --  in which case the column is formatted according to the spec in Rico.TableColumn.DEFAULT.\r
+<li>a string -- specifying one of the pre-defined formats: QTY, PERCENT, DOLLAR, or EURO\r
+<li>an object -- containing entries for one or more of the properties listed below.\r
+</ul>\r
+<p>Here is an example that contains specifications for columns 0, 1, and 3:\r
+<pre>\r
+columnSpecs : [{noResize:true, ClassName:'alignright'},\r
+               {ClassName:'aligncenter'},\r
+               ,\r
+               {visible:false}]\r
+</pre>\r
+\r
+<dt>canHide\r
+<dd>Column can be hidden/unhidden. (default: grid.options.canHideDefault)\r
+\r
+<dt>visible\r
+<dd>Column is initially unhidden. If grid.options.saveColumnInfo.width is true\r
+and there is a value in the cookie for this column, the cookie value will take precedence.\r
+(default: true)\r
+\r
+<dt>width\r
+<dd>Initial width for column. If grid.options.saveColumnInfo.width is true\r
+and there is a value in the cookie for this column, the cookie value will take precedence.\r
+(default: grid.options.defaultWidth)\r
+\r
+<dt>noResize\r
+<dd>Allow column to be resized? (default grid.options.allowColResize )\r
+\r
+<dt>ClassName\r
+<dd>Set this to 'alignright' or 'aligncenter' as needed - see example. \r
+Note that this does not align the header - \r
+use a align="right" on the &lt;th&gt; line to accomplish the header alignment.\r
+(default: table_id + '_col' + column_index)\r
+\r
+</dl>\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/SimpleGrid_ja.html b/documentation/SimpleGrid_ja.html
new file mode 100644 (file)
index 0000000..c69870f
--- /dev/null
@@ -0,0 +1,435 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico SimpleGrid</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>Rico SimpleGrid の作成</h1>
+
+<p>SimpleGrid は Rico 2.0 で追加され、LiveGrids と同じ機能のいくらかを共有します - 
+リサイズ可能な列、固定された列と固定された見出し。
+しかしながら、LiveGrid と異なり、データは静的であり DOM に存在します - 
+それゆえに、バッファリング、AJAX リフレッシュ、ソート、フィルタリングの機能がありません。
+なぜ、SimpleGrid を使うのでしょうか?
+<ul>
+<li>それぞれのセルが含むことが出来るものが、より柔軟であるので - 
+列内のセルがすべて同じタイプである必要はありません。
+<li>状況によって、それは LiveGrid よりクライアント上で、より良く実行することができます。
+特にグリッドに多くの列を表示している遅いクライアントで。
+<li>最後に、SimpleGrid は入力要素である(チェックボックス、セレクトリスト、その他)を含むことができます。 
+LiveGrid も入力要素を含むことができますが、要素の値が LiveGrid のバッファに保存されるので、
+サーバに値をサブミットするには扱いにくいです。
+SimpleGrids は、この問題で苦しみません。
+あなたが単に標準的な <code>&lt;form&gt;...&lt;/form&gt;</code> タグでグリッド全体を囲めば、
+グリッド中のどんな入力要素でもサーバーへサブミットされます。
+</ul>
+
+<p>SimpleGrids は、次の 2 つの方法で作成する事が出来ます。
+<ol>
+<li>SimpleGrid プラグインの中の 1 つを用いて。PHP、ASP と .net のためのプラグインが存在します。
+<li>XSLTを用いて。Rico は、標準的なHTMLテーブルを SimpleGrid に変換する XSL ファイルを持っています。
+</ol>
+
+<h2>利用モデル 1: SimpleGrid プラグインの利用</h2>
+<p>このセクションは、Rico ディストリビューションに含まれる 
+simplegrid.php/asp/aspx の実例について記述します
+<ul>
+<li>PHP では。
+<ul>
+<li>最初に、SimpleGrid プラグインへの参照を作成して下さい。
+<pre>
+require "../../plugins/php/SimpleGrid.php";
+</pre>
+<li>SimpleGrid プラグインクラスのインスタンスを作成して下さい(サーバサイド)。
+<pre>
+$grid=new SimpleGrid();
+</pre>
+
+<li>グリッドの見出しを作成して下さい。
+AddHeadingRow に 'true' を渡して、これがメインの見出し行である事を示します - 
+それはリサイザを得ます。
+メインの見出し行の列数は、データの列数と <em>必ず</em> 同じでなければなりません。
+他の見出し行は、複合列を扱うために "colspan" タグを含むかも知れません。
+複合見出し行を持つならば、唯一無二の一行だけが、メインの行として指定されるかもしれません。
+<pre>
+$grid->AddHeadingRow(true);
+for ($c=1; $c<=$numcol; $c++) {
+  $grid->AddCell("Column $c");
+}
+</pre>
+
+<li>グリッドデータセクションを実装して下さい。
+どこででも AddDataRow() を呼んで、通常は、標準的な html テーブルに <code>&lt;tr&gt;</code> タグを配置します。
+どこででも AddCell() を呼んで、 <code>&lt;td&gt;</code> タグを配置します。
+<pre>
+for ($r=1; $r<=100; $r++) {
+  $grid->AddDataRow();
+  $grid->AddCell($r);
+  for ($c=2; $c<=$numcol; $c++) {
+    $grid->AddCell("Cell $r:$c");
+  }
+}
+</pre>
+
+<li>テーブルをレンダリングして下さい(html 出力を生成します)。
+最初のパラメータはグリッド id で、第二のパラメータは、固定された列の数です。
+<pre>
+$grid->Render("ex1", 1);
+</pre>
+
+</ul>
+
+<li>ASP では。
+<ul>
+<li>最初に、SimpleGrid プラグインへの参照を作成して下さい。
+<pre>
+&lt;!-- #INCLUDE FILE = "../../plugins/asp/SimpleGrid.vbs" --&gt;
+</pre>
+
+<li>SimpleGrid プラグインクラスのインスタンスを作成して下さい(サーバサイド)。
+<pre>
+set grid=new SimpleGrid
+</pre>
+
+<li>グリッドの見出しを作成して下さい。
+AddHeadingRow に 'true' を渡して、これがメインの見出し行である事を示します - 
+それはリサイザを得ます。
+メインの見出し行の列数は、データの列数と <em>必ず</em> 同じでなければなりません。
+他の見出し行は、複合列を扱うために "colspan" タグを含むかも知れません。
+複合見出し行を持つならば、唯一無二の一行だけが、メインの行として指定されるかもしれません。
+<pre>
+grid.AddHeadingRow true
+for c=1 to numcol
+  grid.AddCell "Column " & c
+next
+</pre>
+
+<li>グリッドデータセクションを実装して下さい。
+どこででも AddDataRow() を呼んで、通常は、標準的な html テーブルに <code>&lt;tr&gt;</code> タグを配置します。
+どこででも AddCell() を呼んで、<code>&lt;td&gt;</code> タグを配置します。
+<pre>
+for r=1 to 100
+  grid.AddDataRow
+  grid.AddCell r
+  for c=2 to numcol
+    grid.AddCell "Cell " & r & ":" & c
+  next
+next
+</pre>
+
+<li>テーブルをレンダリングして下さい(html 出力を生成します)。
+最初のパラメータはグリッド id で、第二のパラメータは、固定された列の数です。
+<pre>
+grid.Render "ex1", 1
+</pre>
+</ul>
+
+<li>.net では。
+<ul>
+<li>最初に、SimpleGrid プラグインへの参照を作成して下さい。
+<pre>
+&lt;%@ Register TagPrefix="Rico" TagName="SimpleGrid" 
+    Src="../../plugins/dotnet/SimpleGrid.ascx" %&gt;
+</pre>
+
+<li>SimpleGrid プラグインクラスのインスタンスを作成して下さい(サーバサイド)。
+<pre>
+&lt;Rico:SimpleGrid runat='server' id='ex1' FrozenCols='1' /&gt;
+</pre>
+
+<li>グリッドの見出しを作成して下さい - 通常は Page_Load イベント内で。
+AddHeadingRow に 'true' を渡して、これがメインの見出し行である事を示します - 
+それはリサイザを得ます。
+メインの見出し行の列数は、データの列数と <em>必ず</em> 同じでなければなりません。
+他の見出し行は、複合列を扱うために "colspan" タグを含むかも知れません。
+複合見出し行を持つならば、唯一無二の一行だけが、メインの行として指定されるかもしれません。
+<pre>
+  ex1.AddHeadingRow(true)
+  for c=1 to numcol
+    ex1.AddCell("Column " & c)
+  next
+</pre>
+
+<li>グリッドデータセクションを実装して下さい。
+どこででも AddDataRow() を呼んで、通常は、標準的な html テーブルに <code>&lt;tr&gt;</code> タグを配置します。
+どこででも AddCell() を呼んで、<code>&lt;td&gt;</code> タグを配置します。
+<pre>
+  for r=1 to 100
+    ex1.AddDataRow()
+    ex1.AddCell(r)
+    for c=2 to numcol
+      ex1.AddCell("Cell " & r & ":" & c)
+    next
+  next
+</pre>
+
+<li>他のプラグインと違い、.net コントロールにより自動的にレンダリングされます。
+</ul>
+
+<li>最後に、利用されるプラグインに関係なく javascript SimpleGrid オブジェクトを
+初期化する必要があります(クライアントサイド):
+<pre>
+&lt;script type='text/javascript'&gt;
+Rico.loadModule('SimpleGrid','greenHdg.css');
+
+Rico.onLoad( function() {
+  var opts = {  
+    columnSpecs: ['specQty']  // display first column as a numeric quantity
+  };
+  var ex1=new Rico.SimpleGrid ('ex1', opts);
+});
+&lt;/script&gt;
+</pre>
+
+</ul>
+
+
+<h2>利用モデル 2: XSLT 変換の利用</h2>
+
+<p>ウェブページが XHTML 対応であるなら、ページ上の標準的な html テーブルを、
+"ricoSimpleGrid.xsl" XSL スタイルシートを利用した SimpleGrid にする事が可能です。
+一時、Rico はクライアントでこの変換をする事をサポートしていました。
+しかし、Prototype ライブラリの変化により、これは既に可能でありません。
+したがって、このアプローチを使う方を選ぶなら、XSLT 変換は <em>必ず</em> サーバで実行されなければなりません。
+サーバサイド変換を行うインストラクション。
+<ul>
+<li><a href="http://www.php.net/manual/en/ref.xsl.php">PHP5 を利用して</a>
+<li><a href="http://www.topxml.com/dotnet/articles/xslt/default.asp">.net を利用して</a>
+</ul>
+
+<p>この変換は "ricoSimpleGrid" クラスでテーブルをコンバートするだけです。
+<pre>
+&lt;table id='test1' class='ricoSimpleGrid'&gt;
+</pre>
+
+<p>固定された列の見出しは、 <code>&lt;th&gt;</code> タグに class="ricoFrozen" を持たなければなりません。
+複合見出し行があるならば、メインの見出し行は "_main" で終わる id を持たなければなりません
+(これは、リサイズハンドルを表示する行です)。
+その変換は、テーブルの <code>&lt;thead&gt;</code> セクションでグリッドの見出しを探します。
+thead セクションが存在しないなら、その変換はテーブルの最初の行が見出し列であると仮定します。
+<pre>
+&lt;table id="test1" class="ricoSimpleGrid"&gt;
+
+  &lt;thead&gt;
+     &lt;tr id="customer_livegrid_main"&gt;
+        &lt;th class="ricoFrozen"&gt;ID&lt;/th&gt;
+        &lt;th&gt;Customer&lt;/th&gt;
+        &lt;th&gt;Address&lt;/th&gt;
+        &lt;th&gt;City&lt;/th&gt;
+     &lt;/tr&gt;
+  &lt;/thead&gt;
+
+  &lt;tbody&gt;
+    &lt;!-- grid data --&gt;
+  &lt;/tbody&gt;
+&lt;/table&gt;
+</pre>
+
+<p>最後に、SimpleGrid javascript オブジェクトは、CDATA セクションで宣言と初期化が行われなければなりません。
+ricoInit() の呼び出しは、XSLT 変換によって生成されます。
+<pre>
+&lt;script type="text/javascript"&gt;
+//&lt;![CDATA[
+
+function ricoInit() {
+  try {
+  Rico.loadModule('SimpleGrid');
+  Rico.onLoad(ricoInit2);
+  } catch(e) { alert(e.message); }
+}
+
+var grid1
+function ricoInit2() {
+  try {
+  grid1=new Rico.SimpleGrid ('test1',{maxHt:180});
+  } catch(e) { alert(e.message); }
+}
+//]]&gt;
+&lt;/script&gt;
+</pre>
+
+
+
+<h2>リファレンス</h2>
+
+<h3>コンストラクタ</h3>
+<pre>
+
+  var grid = new Rico.SimpleGrid (table_id, grid_options);
+
+</pre>
+<ul><li><strong>table_id</strong> は、LiveGrid によって実装されるテーブルの DOM id です
+<li><strong>grid_options</strong>(下記参照)
+</ul>
+
+<h3>オプション</h3>
+<h4>一般的なオプション</h4>
+<dl>
+
+<dt>frozenColumns
+<dd>グリッドの左側の固定された列の数(デフォルトは 0)
+
+<dt>maxHt
+<dd>SimpleGrid の高さの最大ピクセル(デフォルトは null)
+
+<dt>windowResize
+<dd>window.resize イベントでグリッドをリサイズしますか?
+アコーディオンに埋め込まれる時は false を設定して下さい(デフォルトは true)
+
+<dt>useUnformattedColWidth
+<dd>グリッドの構成時に、html テーブルの列幅を利用しますか?(デフォルトは true)
+
+<dt>scrollBarWidth
+<dd>実際にはスクロールバーの幅を変えず、位置決めで使用されます。(デフォルトは 19)
+
+<dt>minScrollWidth
+<dd>固定された列の幅がクライアントウィンドウの幅を上回る時、
+スクロールしている列の幅の合計がどのくらい広がるべきですか?
+
+<dt>highlightElem
+<dd>グリッドで何がハイライトされますか。取り得る値は。
+<ul>
+<li>cursorRow - カーソルの下のグリッドの行
+<li>cursorCell - カーソルの下のグリッドのセル
+<li>menuRow - ユーザがグリッドのコンテキストメニューを開く時に関連のある行
+<li>menuCell - ユーザがグリッドのコンテキストメニューを開く時に関連のあるセル
+<li>selection - ユーザによって選択されるセル
+<li>none - 何もハイライトされない(デフォルト)
+</ul>
+
+<dt>exportWindow
+<dd>ユーザがグリッドからデータをエクスポートする時 window.open() に渡されるオプション文字列。
+(デフォルトは "height=300,width=500,scrollbars=1,menubar=1,resizable=1")
+</dl>
+
+
+<h4>画像</h4>
+<dl>
+<dt>resizeBackground
+<dd>列のリサイズハンドルに利用される画像(デフォルトは 'resize.gif')
+
+<dt>sortAscendImg
+<dd>列を昇順でソートする事を示すために使われる画像(デフォルトは 'sort_asc.gif')
+
+<dt>sortDescendImg
+<dd>列を降順でソートする事を示すために使われる画像(デフォルトは 'sort_desc.gif')
+</dl>
+
+
+<h4>メニューとイベントハンドリングオプション</h4>
+<dl>
+
+<dt>contextmenu
+<dd>ユーザがグリッドのセル上で右クリックした時に取る行動(デフォルトは null)
+
+<dt>menuEvent
+<dd>メニューのトリガーイベント。取り得る値は。
+<ul>
+<li>click
+<li>dblclick (デフォルト)
+<li>contextmenu
+<li>none
+</ul>
+
+<dt>click
+<dd>ユーザがグリッドのセル上でシングルクリックした時に取る行動(デフォルトは null)
+
+<dt>dblclick
+<dd>ユーザがグリッドのセル上でダブルクリックした時に取る行動(デフォルトは null)
+
+</dl>
+
+<h4>クッキーオプション</h4>
+<dl>
+
+<dt>saveColumnInfo
+<dd>グリッドのクッキーに、どの詳細設定を保存するかを指定します。
+一つのクッキーだけが、それぞれのグリッドのために利用されます。
+幅の設定が、列の非表示/表示の状態を含む事に注意して下さい。(デフォルトは {width:true, filter:false, sort:false}) 
+
+<dt>cookiePrefix
+<dd>クッキー名の先頭に付け加えられる文字列(デフォルトは 'RicoGrid.')
+
+<dt>cookieDays
+<dd>数字の日数前のクッキーは期限切れになります。
+指定しなければ、クッキーは現在のセッションの間だけ維持されます。(デフォルトは null)
+
+<dt>cookiePath
+<dd>グリッドのクッキーを読む事が出来るトップレベルディレクトリを設定します。
+指定しなければ、それはクッキーを設定するページのパスになります。(デフォルトは null)
+
+<dt>cookieDomain
+<dd>クッキーがどのドメインに送られなければならないかについて、ブラウザに知らせます。
+指定しなければ、それはクッキーを設定するページのドメインになります。(デフォルトは null)
+
+</dl>
+
+<h4>デフォルトの列</h4>
+<dl>
+<dt style='font-weight:normal;'>これらのアイテムはそれぞれ、
+columnSpecs  オプションによって、列ごとのベースにオーバーライドする事が出来ます。
+
+<dt>canSortDefault
+<dd>列はデフォルトでソート可能ですか?(LiveGrid のデフォルトは true、SimpleGrid のデフォルトは false)
+
+<dt>canFilterDefault
+<dd>列をフィルタする事が出来ますか?
+(LiveGrid のデフォルトは RicoBuffer.options.canFilter、SimpleGrid のデフォルトは false)
+
+<dt>canHideDefault
+<dd>列を 表示/非表示 する事が出来ますか?(デフォルトは true)
+
+<dt>allowColResize
+<dd>ユーザによる列のリサイズを許しますか? (デフォルトは true)
+
+<dt>defaultWidth
+<dd>それぞれの列のデフォルトのピクセル幅
+
+</dl>
+
+<h4>列ごとの構成</h4>
+<dl>
+<dt style='font-weight:normal;'>各々の列のためのオプションは、columnSpecs オプションに含まれます。
+columnSpecs は、各々の列のためのエントリに関する配列です。
+各々の列のエントリは、以下のいずれかで行う事が出来ます。
+<ul>
+<li>null (デフォルト) --  その場合、Rico.TableColumn.DEFAULT. の仕様によって列はフォーマットされます。
+<li>a string -- あらかじめ定義されたフォーマットの内の一つを定義します:QTY、PERCENT、DOLLAR、または EURO
+<li>an object -- 下記の表にあるプロパティの一つ以上のエントリを含みます。
+</ul>
+<p>ここに、列 0、1 と 3 が仕様を含む例を挙げます。
+<pre>
+columnSpecs : [{noResize:true, ClassName:'alignright'},
+               {ClassName:'aligncenter'},
+               ,
+               {visible:false}]
+</pre>
+
+<dt>canHide
+<dd>列を 表示/非表示 する事が出来ます。(デフォルトは grid.options.canHideDefault)
+
+<dt>visible
+<dd>列は、初めは隠されていません。
+grid.options.saveColumnInfo.width が true で、列のためのクッキーに値があるなら、クッキーの値が優先されます。
+(デフォルトは true)
+
+<dt>width
+<dd>列の初期幅。
+grid.options.saveColumnInfo.width が true で、列のためのクッキーに値があるなら、クッキーの値が優先されます。
+(デフォルトは grid.options.defaultWidth)
+
+<dt>noResize
+<dd>列のリサイズを許しますか?(デフォルトは grid.options.allowColResize)
+
+<dt>ClassName
+<dd>必要に応じて、これを 'alignright' または 'aligncenter' にセットして下さい - 例を見て下さい。
+これが見出しを整列しない事に注意して下さい - ヘッダの整列を達成するためには、&lt;th&gt; タグで align="right" を利用して下さい。
+(デフォルトは table_id + '_col' + column_index)
+
+</dl>
+
+</body>
+</html>
diff --git a/documentation/browsers.html b/documentation/browsers.html
new file mode 100644 (file)
index 0000000..fda2349
--- /dev/null
@@ -0,0 +1,131 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Grid Browser Compatibility</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>Rico Grid Browser Compatibility</h1>
+
+<p><a href='browsers_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>
+<a href='browsers_ja.html'>View this page in Japanese</a></p>
+
+<p>Rico 2.x grid examples have been tested on the following browsers and operating systems.
+LiveGrid and SimpleGrid likely work in other environments 
+(e.g. Opera on the Mac, etc); this list
+just indicates where developer testing has been completed.
+Except where noted below, all aspects of the grid are fully functional.
+<p><table border="1" cellpadding='4' cellspacing='0' class="compat">
+       <thead><tr>
+         <th>&nbsp;</th>
+         <th colspan="3">Operating System</th>
+       </tr>
+       <tr>
+         <th>Browser</th>
+         <th>Windows XP/Vista</th>
+         <th>Macintosh 10.4</th>
+         <th>Linux (Knoppix 5)</th>
+       </tr></thead>
+       <tbody><tr>
+         <th>IE6</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>IE7</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>IE8</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>4</sup></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>FF 1.5/2.0</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>1</sup></td>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+       </tr>
+       <tr>
+         <th>FF 3.0</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Opera 9.0 - 9.2</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>1,2,3</sup></td>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>1,2,3</sup></td>
+       </tr>
+       <tr>
+         <th>Opera 9.5 or later</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>2</sup></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Safari 2.0</th>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Safari 3.x</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Camino</th>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>1</sup></td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Konqueror 3.5</th>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+       </tr>
+       <tr>
+         <th>Google Chrome (beta)</th>
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       </tbody>
+</table>
+<p>Notes:
+<ol>
+<li>In these configurations scrollbars are hidden when the menu is displayed
+(the scrollbars interfered with the menus).
+<li>In Opera, when using double-clicking to invoke menus, you should
+  turn off Opera's "Double click text to display context menu" setting by
+  going to Tools > Preferences > Advanced tab > Toolbars.
+<li>LiveGrid Forms is not recommended with Opera versions less than 9.5 due to a 
+<a href="http://dowdybrown.com/dbprod/testselect.htm">bug</a> 
+in the way it handles select boxes.
+<li>The production release of IE8 works correctly with Rico 2.1 in both standards and compatibility modes. 
+With Rico 2.0, the column resizer image is not displayed in grids, but everything else works. 
+Pre-release versions of IE8 only worked with Rico when IE8 was set to compatibility mode.
+</ol>
+
+<p>The <a href="http://laptop.org">OLPC</a> contains a custom browser based on 
+the Gecko layout engine. Rico runs without issue on this system.
+
+<p>Firefox versions 1.x and 2.x displayed minor artifacts when a popup menu
+overlayed a scrollbar. This is fixed in version 3.
+
+<p>In order to display properly, a browser displaying a LiveGrid must be operating in 
+<a href="http://www.quirksmode.org/css/quirksmode.html">strict (aka standards) mode</a>.
+
+
+</body>
+</html>
diff --git a/documentation/browsers_ja.html b/documentation/browsers_ja.html
new file mode 100644 (file)
index 0000000..1cc291b
--- /dev/null
@@ -0,0 +1,110 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<title>Grid Browser Compatibility</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>Rico Grid のブラウザ互換性</h1>
+
+<p>Rico 2.0 グリッドの実例は、以下のブラウザとオペレーティングシステム上でテストされました。
+LiveGrid と SimpleGrid は、他の環境でも、おそらく動きます。
+(例えば、MS Vista、Mac 上の Opera、その他)
+この表は、単に開発者のテストがどの環境で行われ、完了したかについて示します。
+下で注意される場合を除き、グリッドのすべての側面は完全に機能的です。
+<p><table border="1" cellpadding='4' cellspacing='0' class="compat">
+       <thead><tr>
+         <th>&nbsp;</th>
+         <th colspan="3">オペレーティングシステム</th>
+       </tr>
+       <tr>
+         <th>ブラウザ</th>
+         <th>Windows XP</th>
+         <th>Macintosh 10.4</th>
+         <th>Linux (Knoppix 5)</th>
+       </tr></thead>
+       <tbody><tr>
+         <th>IE6</th>
+         <td><img src='images/checkmark.gif'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>IE7</th>
+         <td><img src='images/checkmark.gif'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>FF 1.5/2.0</th>
+         <td><img src='images/checkmark.gif'></td>
+         <td><img src='images/checkmark.gif'><sup>1</sup></td>
+         <td><img src='images/checkmark.gif'></td>
+       </tr>
+       <tr>\r
+         <th>FF 3.0</th>\r
+         <td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+         <td>&nbsp;</td>\r
+         <td>&nbsp;</td>\r
+       </tr>\r
+       <tr>\r
+         <th>Opera 9.0 - 9.2</th>\r
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>1,2,3</sup></td>\r
+         <td>&nbsp;</td>\r
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>1,2,3</sup></td>\r
+       </tr>\r
+       <tr>\r
+         <th>Opera 9.5+</th>\r
+         <td><img src='images/checkmark.gif' alt='checkmark'><sup>2</sup></td>\r
+         <td>&nbsp;</td>\r
+         <td>&nbsp;</td>\r
+       </tr>\r
+       <tr>
+         <th>Safari 2.0</th>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif'></td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Safari 3.0 (beta)</th>
+         <td><img src='images/checkmark.gif'></td>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Camino</th>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif'><sup>1</sup></td>
+         <td>&nbsp;</td>
+       </tr>
+       <tr>
+         <th>Konqueror 3.5</th>
+         <td>&nbsp;</td>
+         <td>&nbsp;</td>
+         <td><img src='images/checkmark.gif'></td>
+       </tr></tbody>
+</table>
+<p>注意
+<ol>
+<li>1. これらの構成では、メニューが表示される時、スクロールバーは隠されます
+(スクロールバーはメニューに干渉しました)。
+<li>Operaでは、ダブルクリックを使用してメニューを呼び出す場合、
+"Tools -> Preferences -> Advanced tab -> Toolbars" へ行き、
+Opera の "Double click text to display context menu" をオフにするべきです。
+<li>LiveGridForms は、
+選んだボックスを扱う方法に関する <a href="http://dowdybrown.com/dbprod/testselect.htm">バグ</a> のため Opera で利用する事は
+推薦されません。<em>朗報です! このバグはバージョン9.5で直されるようです。</em>
+</ol>
+
+<p><a href="http://laptop.org">OLPC</a> は Gecko レイアウトエンジンに基づくカスタムブラウザを含んでいます。
+Rico は、このシステム上で問題無く実行出来ます。
+
+<p>Firefox のバージョンが 1.x と 2.x で、ポップアップメニューがスクロールバーの上に来た場合、
+minor artifacts を表示しました。これは、バージョン3で改善されるようです。
+
+<p>IE8 ベータ 1 は、IE7 互換モードで操作する時だけ動作します。
+
+</body>
+</html>
diff --git a/documentation/grids.html b/documentation/grids.html
new file mode 100644 (file)
index 0000000..9102090
--- /dev/null
@@ -0,0 +1,201 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico Grid Overview</title>\r
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>\r
+\r
+<body>\r
+<h1>Rico Grids</h1>\r
+\r
+<p><a href='grids_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>\r
+<a href='grids_ja.html'>View this page in Japanese</a></p>\r
+\r
+<p>The Rico library supports 2 different types of grids: \r
+<strong>LiveGrid</strong> and <strong>SimpleGrid</strong>. \r
+LiveGrid data is always buffered in a 2-dimensional JavaScript array. As the user scrolls\r
+vertically through the grid, data is dynamically copied from the array onto the grid.\r
+SimpleGrids on the other hand are unbuffered -- all data for the grid exists in the \r
+<a href="http://en.wikipedia.org/wiki/Document_Object_Model">DOM</a>, not\r
+in a JavaScript data structure.\r
+\r
+<p>Both types of grids share some common features, including:\r
+<ul>\r
+<li>column headings that stay fixed and don't scroll off the top of the screen\r
+<li>frozen columns on the left side of the grid\r
+<li>resizable columns\r
+<li>common css styling - styles developed for LiveGrids also work for SimpleGrids and vice versa\r
+<li>compatibility with languages that read right-to-left (rtl) - \r
+<a href="asp/rtl/ex1.asp">ASP</a> &amp; <a href="php/rtl/ex1.php">PHP</a> examples are included\r
+<li>compatibility with Rico pop-up (context) menus\r
+</ul>\r
+\r
+<hr>\r
+<h2>LiveGrid</h2>\r
+<p>Rico provides lots of support for loading a LiveGrid buffer. The buffer can can be loaded from:\r
+<ul>\r
+<li>a SQL database query\r
+<li>an XML file\r
+<li>an HTML table\r
+<li>a javascript array\r
+</ul>\r
+\r
+<h3>Connecting LiveGrid to a database</h3>\r
+<p>To simplify the task of loading a LiveGrid with SQL query results, Rico comes with a set of "plug-ins" which\r
+connect your database to your LiveGrid. Rico plug-ins have been tested with the following\r
+databases:\r
+\r
+<p><table border='1' cellspacing='0' cellpadding='4' class='compat' style='margin-bottom:0px'>\r
+<thead>\r
+<tr>\r
+<th>&nbsp;</th>\r
+<th>MySQL</th>\r
+<th>Oracle</th>\r
+<th>DB2</th>\r
+<th>SQL Server</th>\r
+<th>MS Access</th>\r
+</tr>\r
+</thead>\r
+<tbody>\r
+<tr>\r
+<th>PHP</th>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td>&nbsp;</td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+</tr>\r
+<tr>\r
+<th>ASP</th>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+</tr>\r
+<tr>\r
+<th>.net</th>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+<td><img src='images/checkmark.gif' alt='checkmark'></td>\r
+</tr>\r
+</tbody>\r
+</table>\r
+<p style='font-size:8pt; margin:0px;'>Rico plug-in/database compatibility as of Nov 2007\r
+<br>\r
+<br>* The ASP plug-in uses ADO and the .net plug-in uses ADO.net,\r
+<br>and thus should be able to connect with any data source that is compatible with ADO</p>\r
+\r
+<p>LiveGrid uses <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">AJAX</a> \r
+technology so that only a portion of the SQL query result is\r
+sent to the client at a time. As the user scrolls the grid, the JavaScript code determines\r
+which portion of the query results are required and sends an AJAX request back to the plug-in.\r
+The plug-in retrieves those results from the database and returns them back to the client.\r
+So whether your query returns 10 rows or 100,000 rows, LiveGrid can display the results\r
+quickly and easily with an intuitive user interface.\r
+\r
+<p>Finally, if your users are allowed to make changes to the data, the Rico plug-ins \r
+make that easy too. Just define your grid using <strong>LiveGrid Forms</strong> -- \r
+Add, Edit, and Delete record\r
+selections will be added to the grid's context (popup) menu. \r
+\r
+<ul>\r
+<li>When Add or Edit is selected, a popup\r
+form will be presented to the user. \r
+<li>When the user "saves" the form, the data is posted back\r
+to the original script, which writes the results back to the database. \r
+</ul>\r
+\r
+<p>If it sounds complicated, don't worry! All of this work is handled by the plug-in. \r
+See the "ex2edit" example\r
+for a demonstration of how easy it is, both for the user and the programmer.\r
+"ex4edit" demonstrates how to make multiple grids on a page editable.\r
+\r
+<h3>Populating LiveGrid with XML</h3>\r
+\r
+<p>While plug-ins make it easy to load data into a LiveGrid, they are not required.\r
+A LiveGrid buffer can be loaded with XML data from any source, as long as the data follows this format:\r
+\r
+<pre>\r
+&lt;ajax-response&gt;\r
+&lt;response type='object' id='MyGridId_updater'&gt;\r
+&lt;rows update_ui='true' offset='0'&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;\r
+&lt;/rows&gt;\r
+&lt;/response&gt;\r
+&lt;/ajax-response&gt;\r
+</pre>\r
+\r
+<p>See the weather and photo examples, which retrieve data from Yahoo Weather and Flickr respectively and reformat the data\r
+into the structure shown above. These examples are currently available in PHP and .net versions, but not ASP.\r
+\r
+<h3>Populating LiveGrid with data from an HTML table</h3>\r
+\r
+<p>A LiveGrid can also be easily created on a web page that contains a traditional HTML table.\r
+Just assign an id to the table and pass that id in during LiveGrid initialization. Headings\r
+will be taken from the table's thead section and data from the tbody. No AJAX is\r
+performed in this case, but the data is still buffered in a JavaScript array. Several\r
+examples are included in the Rico distribution, look for the ones marked "LiveGrid-Static Buffer"</p>\r
+\r
+<hr>\r
+<h2>SimpleGrid</h2>\r
+\r
+<p>SimpleGrid's are new to Rico 2.0 and share some of the same functionality as LiveGrids - \r
+resizable columns, frozen columns, and frozen headings. \r
+However, unlike a LiveGrid, the data is static and resides in the DOM -\r
+so no buffering, no AJAX refreshes, no sorting, no filtering.\r
+Why would you use a SimpleGrid? \r
+<ol>\r
+<li>Because it is more flexible in what each cell can contain - \r
+cells in a column do not all have to be of the same type.\r
+<li>In some circumstances, it can perform better on the client than LiveGrid; \r
+particularly on a slow client displaying a grid with many columns.\r
+<li>Finally, a SimpleGrid can contain input elements (checkboxes, select lists, etc). \r
+While a LiveGrid can also contain input elements, because the element values are stored in the\r
+LiveGrid buffer, submitting the values back to the server can be tricky.\r
+SimpleGrids do not suffer from this problem. You can simply surround the\r
+entire grid with standard &lt;form&gt;&lt;/form&gt; tags and any\r
+input elements within the grid will be submitted back to the server.\r
+</ol>\r
+\r
+<p>The most sophisticated example of a SimpleGrid is the spreadsheet\r
+included with this distribution. You can enter formulas and it will\r
+recalculate when you change the inputs - just like a commercial spreadsheet.\r
+A link to the spreadsheet example can be found under the "HTML Examples" section\r
+of the examples menu.\r
+When in the spreadsheet, click the <img alt="help" style="vertical-align:top;" src="images/sheet/help.gif"> button to see all it can do.\r
+\r
+<p>SimpleGrids can be created either of two ways:\r
+<ul>\r
+<li>By using one of the SimpleGrid plug-ins. Plug-ins exist for PHP, ASP, and .net.\r
+<li>By using XSLT. Rico includes an XSL file that will convert a standard\r
+HTML table to a SimpleGrid.\r
+</ul>\r
+\r
+<h3>Creating a SimpleGrid by using a plug-in</h3>\r
+\r
+<p>Each plug-in defines a SimpleGrid class. Within the class, there are methods\r
+to start header rows and data rows - just call one of these methods everywhere\r
+you would put a &lt;tr&gt; tag in an HTML table. There is also a method to\r
+create a cell - just call it everywhere\r
+you would put a &lt;th&gt; or &lt;td&gt; tag in an HTML table.\r
+When you are done defining the table content, just call the render method\r
+(except in the .net plugin where render is called automatically).\r
+It's that easy!\r
+\r
+<h3>Creating a SimpleGrid by using XSLT</h3>\r
+\r
+<p>If your web page is XHTML compliant, then there is another way to generate a SimpleGrid.\r
+Just use the XSL stylesheet "ricoSimpleGrid.xsl" to transform tables in your page\r
+to SimpleGrids. The stylesheet looks for tables with a class name of "ricoSimpleGrid" \r
+and then does the transformation for you. At one time, Rico supported doing this\r
+transformation on the client. However, due to changes in the Prototype library, this\r
+is no longer possible. Therefore, if you choose to use this approach, the XSLT transform\r
+must be performed on the server.\r
+\r
+</body>\r
+</html>\r
diff --git a/documentation/grids_ja.html b/documentation/grids_ja.html
new file mode 100644 (file)
index 0000000..5563947
--- /dev/null
@@ -0,0 +1,197 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<title>Rico Grid Overview</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>Rico のグリッド</h1>
+<p>Rico ライブラリは 2 つの異なったタイプのグリッドをサポートします。
+<strong>LiveGrid</strong> と <strong>SimpleGrid</strong>. 
+LiveGrid のデータは、2次元の JavaScript 配列で、常にバッファリングされます。
+ユーザがグリッドを通して垂直にスクロールするとき、データは配列からグリッドに動的にコピーされます。
+一方、SimpleGrids はバッファリングを行いません。
+-- グリッドのためのすべてのデータは JavaScript のデータ構造では無く、
+<a href="http://en.wikipedia.org/wiki/Document_Object_Model">DOM</a> に存在しています。
+
+<p>どちらのタイプのグリッドも、次のようないくつかの共通点を持っています。
+<ul>
+<li>画面上部で切り離されてスクロールしない、固定された列見出し
+<li>グリッドの左端で固定された列
+<li>リサイズ可能な列
+<li>共通の css スタイリング - LiveGrids 用に開発されたスタイルは、SimpleGrids でも同様に機能します
+<li>右から左に読む言語(rtl)との互換性 - 
+<a href="asp/rtl/ex1.asp" target="_top">ASP</a> と <a href="php/rtl/ex1.php" target="_top">PHP</a> の実例に含まれます</a>
+<li>Rico のポップアップ(コンテキスト)メニューとの互換性
+</ul>
+
+<hr>
+<h2>LiveGrid</h2>
+<p>Rico は、LiveGrid バッファをロードするために多くのサポートを提供します。
+バッファは次の項目からロードする事が出来ます。
+<ul>
+<li>SQL データベースクエリ
+<li>XML ファイル
+<li>HTML テーブル
+<li>javascript 配列
+</ul>
+
+<h3>LiveGrid のデータベース接続</h3>
+<p>SQL クエリの実行結果を LiveGrid にロードするタスクを簡素化するために、
+Rico にはデータベースと LiveGrid を接続する "plug-ins" のセットが付属しています。
+Rico プラグインは次のデータベースでテストされました。
+
+<p><table border='1' cellspacing='0' cellpadding='4' class='compat' style='margin-bottom:0px'>
+<thead>
+<tr bgcolor='#DDD'>
+<th>&nbsp;</th>
+<th>MySQL</th>
+<th>Oracle</th>
+<th>DB2</th>
+<th>SQL Server</th>
+<th>MS Access</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<th>PHP</th>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td>&nbsp;</td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+</tr>
+<tr>
+<th>ASP</th>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+</tr>
+<tr>
+<th>.net</th>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+<td><img src='images/checkmark.gif'></td>
+</tr>
+</tbody>
+</table>
+<p style='font-size:8pt; margin:0px;'>2007 年 11 月における Rico プラグイン/データベース の互換性
+<br>
+<br>* ASP プラグインは ADO を、.netプラグインは ADO.net を使用するので、
+<br>ADO と互換性があるどんなデータソースにも接続することができるはずです。</p>
+
+<p>LiveGrid は <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">AJAX</a> テクノロジーを使うので、
+一度にクライアントへ送る SQL クエリの実行結果は一部だけです。
+ユーザーが格子をスクロールすると、
+JavaScript コードはクエリの結果のどの部分が必要とされているかについて決定し、
+AJAX リクエストをプラグインに送り返します。
+プラグインはそれらの結果をデータベースから検索して、それらをクライアントに返します。
+なので、クエリが返す結果が 10 行か 100,000 行かに関係なく、
+LiveGrid はインタラクティブなユーザインタフェースで迅速かつ容易に結果を表示する事ができます。
+
+<p>最後に、もしユーザーがデータの変更を許されているならば、Rico プラグインは、それさえも簡単にします。
+単に <strong>LiveGrid Forms</strong> を使っているグリッドを定義して下さい 
+-- レコードセレクションの追加、編集、そして削除は、グリッドのコンテキスト(ポップアップ)メニューから追加されます。
+
+<ul>
+<li>追加や編集が選ばれるとき、ポップアップフォームはユーザに提示されます。
+<li>ユーザーがフォームを "保存する" とき、データはオリジナルスクリプトへポストバックされ、
+それはデータベースへ結果を書きます。
+</ul>
+
+それが複雑に聞こえるならば、心配しないでください!
+この仕事の全ては、プラグインによって取り扱われます。
+それがユーザーとプログラマーの両方にとって、
+どれくらい簡単かという実証については、 "ex2edit" の実例を見て下さい。
+"ex4edit" は、一つのページ内で複数のグリッドを編集可能にする方法を示します。
+
+<h3>LiveGrid の XML 実装</h3>
+
+<p>LiveGrid にデータをロードするのがプラグインで簡単になっている間は、それらは必要ではありません。
+データがこの形式に従う限り、どんなソースからも LiveGrid のバッファを XML データにロードする事が出来ます。
+
+<pre>
+&lt;ajax-response&gt;
+&lt;response type='object' id='MyGridId_updater'&gt;
+&lt;rows update_ui='true' offset='0'&gt;
+&lt;tr&gt;&lt;td&gt;Data for row 1, cell 1&lt;/td&gt;&lt;td&gt;Data for row 1, cell 2&lt;/td&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Data for row 2, cell 1&lt;/td&gt;&lt;td&gt;Data for row 2, cell 2&lt;/td&gt;&lt;/tr&gt;
+&lt;/rows&gt;
+&lt;/response&gt;
+&lt;/ajax-response&gt;
+</pre>
+
+天気と写真の実例を見てください、それぞれ Yahoo 天気情報と Flickr からデータを検索して、上記のデータ構造に再フォーマットしています。
+これらの実例は、現在、、ASP では無く PHP と .net のバージョンで利用できます。
+
+<h3>HTML テーブルデータによる LiveGrid 実装</h3>
+
+<p>LiveGrid は伝統的な HTML テーブルを持つウェブページの上で簡単に作る事も出来ます。
+単に ID をテーブルに割り当てて、LiveGrid の初期化中に、そのIDを渡してください。
+テーブルの thead セレクションと tbody のデータから見出しは取得する事が出来ます。
+この場合 AJAX は実行されませんが、データは JavaScript 配列でまだバッファリングされます。
+いくつかの実例は Rico ディストリビューションに含まれますので、
+"LiveGrid-Static Buffer" と印されている物を探して下さい。
+</p>
+
+<hr>
+<h2>SimpleGrid</h2>
+
+<p>SimpleGrid は Rico 2.0 にとって新しく、LiveGrids と同じ機能のいくらかを共有します
+ - リサイズ可能な列、固定された列と固定された見出し。
+しかしながら、LiveGrid と異なり、データは静的であり DOM に存在します
+ - それゆえに、バッファリング、AJAX リフレッシュ、ソート、フィルタリングの機能がありません。
+なぜ、SimpleGrid を使うのでしょうか?
+<ol>
+<li>それぞれのセルが含むことが出来るものが、より柔軟であるので - 
+列内のセルがすべて同じタイプである必要はありません。
+<li>状況によって、それは LiveGrid よりクライアント上で、より良く実行することができます。
+特にグリッドに多くの列を表示している遅いクライアントで。
+<li>最後に、SimpleGrid は入力要素である(チェックボックス、セレクトリスト、その他)を含むことができます。
+LiveGrid も入力要素を含むことができますが、要素の値が LiveGrid のバッファに保存されるので、
+サーバに値をサブミットするには扱いにくいです。
+SimpleGrids は、この問題で苦しみません。
+あなたが単に標準的な &lt;form&gt;&lt;/form&gt; タグでグリッド全体を囲めば、
+グリッド中のどんな入力要素でもサーバーへサブミットされます。
+</ol>
+
+<p>SimpleGrid の最も洗練された例は、ディストリビューションに含まれているスプレッドシートです。
+式を入力する事ができ、入力値を変更すると、それは再計算されるでしょう - 
+まさしく商業スプレッドシートのように。
+実例のメニューの "HTML Examples" のセクションでスプレッドシートへのリンクを見つけることができます。
+スプレッドシートで、 <img alt="help" src="images/sheet/help.gif"> ボタンをクリックして、それができるすべてを見て下さい。
+
+<p>SimpleGrids は、次の 2 つの方法で作成する事が出来ます。
+<ul>
+<li>SimpleGrid プラグインの中の 1 つを用いて。PHP、ASP と .net のためのプラグインが存在します。
+<li>XSLTを用いて。Rico は、標準的なHTMLテーブルを SimpleGrid に変換する XSL ファイルを持っています。
+</ul>
+
+<h3>プラグインを利用しての SimpleGrid の作成</h3>
+
+<p>各プラグインは SimpleGrid のクラスを定義します。
+クラスの中に、ヘッダ行とデータ行を始めるメソッドがあります。 - 
+HTML テーブル内のどこかに &lt;tr&gt; タブを置いて、それらのメソッドの内の一つを呼ぶだけです。
+また、セルを作成するメソッドもあります。 - 
+HTML テーブル内のどこかに &lt;th&gt; タブか &lt;td&gt; タブを置いて、それを呼ぶだけです。
+テーブルの内容を定義し終わったら、描画メソッドを呼ぶだけです。
+(.net プラグイン以外では描画は自動的に行われます)
+それは、とても簡単です!
+
+<h3>XSLT を利用しての SimpleGrid の作成</h3>
+
+<p>ウェブページが XHTML 対応であるならば、SimpleGrid を生成するもう一つの方法があります。
+ページ上のテーブルを SimpleGrids に変換するために、XSL スタイルシートである "ricoSimpleGrid.xsl" を使うだけです。
+スタイルシートは "ricoSimpleGrid" のクラス名でテーブルを探して、それから変換を行います。
+一時は、Rico はクライアント上でこの変換をサポートしていました。
+しかしながら、Prototype ライブラリの変更のために、すでに出来なくなりました。
+したがって、このアプローチで行う方を選ぶならば、 XSLT 変換はサーバーで実行されなければなりません。
+
+</body>
+</html>
diff --git a/documentation/images/asp-php-structure1.jpg b/documentation/images/asp-php-structure1.jpg
new file mode 100644 (file)
index 0000000..a1a52ff
Binary files /dev/null and b/documentation/images/asp-php-structure1.jpg differ
diff --git a/documentation/images/asp-php-structure2.jpg b/documentation/images/asp-php-structure2.jpg
new file mode 100644 (file)
index 0000000..3825a4c
Binary files /dev/null and b/documentation/images/asp-php-structure2.jpg differ
diff --git a/documentation/images/checkmark.gif b/documentation/images/checkmark.gif
new file mode 100644 (file)
index 0000000..f8d01ed
Binary files /dev/null and b/documentation/images/checkmark.gif differ
diff --git a/documentation/images/chinese.jpg b/documentation/images/chinese.jpg
new file mode 100644 (file)
index 0000000..0596cb9
Binary files /dev/null and b/documentation/images/chinese.jpg differ
diff --git a/documentation/images/japanese.gif b/documentation/images/japanese.gif
new file mode 100644 (file)
index 0000000..3045a6f
Binary files /dev/null and b/documentation/images/japanese.gif differ
diff --git a/documentation/images/ricologo.gif b/documentation/images/ricologo.gif
new file mode 100644 (file)
index 0000000..9b14203
Binary files /dev/null and b/documentation/images/ricologo.gif differ
diff --git a/documentation/index.html b/documentation/index.html
new file mode 100644 (file)
index 0000000..4744cf4
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\r
+<html>\r
+<HEAD>\r
+<title>Rico 3.0 Documentation</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+</HEAD>\r
+<frameset cols="300, *">\r
+  <frame name="menu" src="menu.html">\r
+  <frame name="content" src="welcome.html" scrolling="yes">\r
+</frameset>\r
+</html>\r
diff --git a/documentation/menu.html b/documentation/menu.html
new file mode 100644 (file)
index 0000000..238fec0
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
+<html>\r
+<head>\r
+<title>Rico 3.0</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<base target="content">\r
+\r
+<script src="../ricoClient/js/baselibs/prototype.js" type="text/javascript"></script>\r
+<script src="../ricoClient/js/rico.js" type="text/javascript"></script>\r
+<script src="../ricoClient/js/rico2Proto.js" type="text/javascript"></script>\r
+<script src="../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<link href="../ricoClient/css/rico.css" type="text/css" rel="stylesheet" />\r
+<script type='text/javascript'>\r
+\r
+var acc;\r
+Rico.onLoad( function() {\r
+  $('RicoVersion').innerHTML=Rico.Version;\r
+  Rico.Corner.round('menuheader');\r
+});\r
+</script>\r
+\r
+<link href="../examples/menu.css" type="text/css" rel="stylesheet">\r
+\r
+<!--[if lt IE 7]>\r
+  <style type="text/css">\r
+ul li {
+   height: 1%;\r
+}
+ </style>\r
+<![endif]-->\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<div id="menuheader">
+<p>Rico <span id='RicoVersion'></span>&nbsp;Documentation</p>\r
+</div>
+\r
+<div id="accordion1" style="margin-top:20px;">\r
+<ul>\r
+<li><a href="welcome.html">Welcome to Rico!</a>\r
+<li><a href="InstallNotes.html">Installing the examples</a>\r
+<li><a href="grids.html">Grid overview</a>\r
+<li><a href="browsers.html">LiveGrid browser compatibility</a>\r
+<li><a href="LiveGrid.html">Creating a LiveGrid</a>\r
+<li><a href="SimpleGrid.html">Creating a SimpleGrid</a>\r
+<li><a href="GridStyles.html">Grid Styles</a>\r
+<li><a href="LiveGridForms.html">Using LiveGrid Forms</a>\r
+<li><a href="LiveGridAjax.html">LiveGrid AJAX request &amp; response formats</a>\r
+<li><a href="translations.html">Multiple language support</a>\r
+</ul>\r
+</div>\r
+\r
+</body></html>\r
diff --git a/documentation/ricoDocs.css b/documentation/ricoDocs.css
new file mode 100644 (file)
index 0000000..ee8f9c5
--- /dev/null
@@ -0,0 +1,23 @@
+body {font-family: Arial, Tahoma, Verdana, sans-serif; padding: 8px;}
+li { margin-top: 0.25em; margin-bottom: 0.25em; }\r
+pre { background-color: #DDD; }\r
+img { border: 0px; }\r
+\r
+h1 { \r
+  font-family : Trebuchet MS, Arial, Tahoma, Verdana, Helvetica, sans-serif; \r
+  background-color:#EEE;\r
+  margin-top: 0px;\r
+  padding: 4px;\r
+  -moz-border-radius: 8px;\r
+  -webkit-border-radius: 8px;\r
+}\r
+h2 { margin-top: 2em; }\r
+h4 { text-decoration: underline; }\r
+\r
+dl { margin-left: 2em; }\r
+dt { font-weight: bold; margin-top: 0.7em; }\r
+\r
+thead tr { background-color:#DDD; }\r
+table.compat td { text-align:center; }\r
+table.compat tr { vertical-align:bottom; }\r
+tbody th {   text-align: left; }
diff --git a/documentation/ricologo.gif b/documentation/ricologo.gif
new file mode 100644 (file)
index 0000000..9b14203
Binary files /dev/null and b/documentation/ricologo.gif differ
diff --git a/documentation/translations.html b/documentation/translations.html
new file mode 100644 (file)
index 0000000..3198d99
--- /dev/null
@@ -0,0 +1,197 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico Translation</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>Rico Translation</h1>
+
+<p><a href='translations_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>
+<a href='translations_ja.html'>View this page in Japanese</a></p>
+
+<p>The Rico library contains a translation object (RicoTranslate) so that
+applications can be written using Rico that support multiple languages.
+The translation object also stores the default date and number
+formats, so that different defaults can be specified for each language.
+The Rico distribution includes language files that load the translation object
+with the phrases necessary to display the default grid menus and the Rico calendar.
+
+<h2>Translation Status</h2>
+
+<p>Language files are stored in
+"src/translations/ricoLocale_xx.js" where xx is the 2-character language code. 
+Rico is currently distributed with the following translations:
+
+<p><table border='1' cellspacing='0' cellpadding='3'>
+<thead>
+<tr><th>Language</th><th>Code</th><th>Status</th></tr>
+</thead>
+<tbody>
+
+<tr>
+<td>English</td>
+<td>en</td>
+<td>Baseline</td>
+</tr>
+
+<tr>
+<td>French</td>
+<td>fr</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>Spanish</td>
+<td>es</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>Japanese</td>
+<td>ja</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>Chinese (simplified)</td>
+<td>zh</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>Korean</td>
+<td>ko</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>German</td>
+<td>de</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>Portugese</td>
+<td>pt</td>
+<td>Complete, needs review</td>
+</tr>
+
+<tr>
+<td>Italian</td>
+<td>it</td>
+<td>Complete, needs review</td>
+</tr>
+
+<tr>
+<td>Russian</td>
+<td>ru</td>
+<td>Complete and reviewed</td>
+</tr>
+
+<tr>
+<td>Ukranian</td>
+<td>ua</td>
+<td>Complete and reviewed</td>
+</tr>
+
+</tbody>
+</table>
+
+<h2>Supporting Multiple Languages</h2>
+
+<p>As Rico evolves, additional phrases are required in the translation files.
+English phrases are added first, then members of the Rico community
+add the new phrases to the other translation files.
+We try to keep all of the translations synchonized, 
+but this is not always possible.
+Therefore, when rico.js is loaded, it in turn loads the language file 
+for English first. 
+Then it looks for a Rico translation matching the user's OS or browser language.
+If one is found, it is loaded next.
+This ensures that, if a phrase is missing from a translation file or a translation
+for their language is not available, the user at least
+sees the phrase in English (instead of a blank message).
+
+<p>So with no additional coding, Rico should, in most cases, 
+present localized menus and calendars that are appropriate to the user.
+However, all modern browsers give the user a way to override the OS language.
+For example, in Firefox you go to Tools menu > Options > Advanced > General Tab > Languages button.
+In Internet Explorer you go to Tools menu > Internet Options > General Tab > Languages button.
+This setting is called the 
+<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">accept language</a> 
+and is not directly accessible via javascript.
+However, Rico does provide a way to load a translation file based on the accept language.
+For users who have configured this setting, the language resolved using this approach
+may be closer to their true preference.
+The accept language is resolved in Rico by having the server-side script return the
+accept language header back to the javascript method "Rico.acceptLanguage()".
+This happens automatically when using the LiveGrid Forms plug-ins for ASP and PHP,
+and in the LiveGrid plug-in for .net.
+For other situations, server-side include files are provided in the Rico distribution.
+
+<p>In PHP:
+<pre>
+&lt;? 
+// Not required when using ricoLiveGridForms.php
+// Must be placed after the line to include rico.js
+
+require "chklang2.php";
+?&gt;
+</pre>
+
+<p>In ASP:
+<pre>
+' Not required when using ricoLiveGridForms.asp
+' Must be placed after the line to include rico.js
+
+&lt;!-- #INCLUDE FILE = "chklang2.vbs" --&gt;
+</pre>
+
+<p>In .net:
+<pre>
+' Not required when using ricoLiveGrid.ascx
+' Must be placed after the line to include rico.js
+
+&lt;%@ Register TagPrefix="Rico" TagName="ChkLang" Src="chklang.ascx" %&gt;
+&lt;Rico:ChkLang runat='server' id='translation' /&gt;
+</pre>
+
+<h2>RicoTranslate Object Reference</h2>
+
+<p>The RicoTranslate object contains the following properties and methods:
+<dl>
+<dt>monthNames[]
+<dd>A 12 item array containing the translated names of each month (January is item 0)
+<dt>dayNames[]
+<dd>A 7 item array containing the translated names of each day of the week (Sunday is item 0)
+<dt>monthAbbr()
+<dd>A function that takes a month number (0-11) and returns the abbreviated month name (defaults to the first 3 characters of monthNames[], but is overridden by some translations)
+<dt>dayAbbr()
+<dd>A function that takes a day of week number (0-6) and returns the abbreviated day name (defaults to the first 3 characters of dayNames[], but is overridden by some translations)
+<dt>langCode
+<dd>Contains the 2-character language code that is currently loaded (default is "en")
+<dt>thouSep
+<dd>Contains the character to use as the thousands separator when formatting numbers (default is ",")
+<dt>decPoint
+<dd>Contains the character to use as the decimal point when formatting numbers (default is ".")
+<dt>dateFmt
+<dd>Contains the default date format (default is "mm/dd/yyyy")
+<dt>timeFmt
+<dd>Contains the default time format (default is "hh:nn:ss a/pm")
+<dt>addPhraseId (phraseId, phrase)
+<dd>Adds the specified phrase and assigns it to phraseId. The phrase string may contain references to optional substitution parameters, which are specified using $1, $2, etc.
+<dt>getPhraseById (phraseId)
+<dd>Returns the phrase specified by phraseId. Optional substitution parameters may follow phraseId.
+</dl>
+
+<h2>Submitting Updates</h2>
+
+<p>Questions and corrections may be posted to the 
+<a href='http://sourceforge.net/forum/forum.php?forum_id=470997'>Open Discussion forum on SourceForge</a>.
+Alternatively, you can send them directly to: dowdybrown at yahoo dot com.
+
+</body>
+</html>
diff --git a/documentation/translations_ja.html b/documentation/translations_ja.html
new file mode 100644 (file)
index 0000000..2cf6ff4
--- /dev/null
@@ -0,0 +1,192 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico Translation</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+</head>
+
+<body>
+<h1>Rico の翻訳</h1>
+
+<p>Rico ライブラリは翻訳オブジェクト(RicoTranslate)を含むので、
+複数の言語をサポートするアプリケーションを、 Rico を利用して書く事が出来ます。
+翻訳オブジェクトは、異なるデフォルト値を言語ごとに指定する事が出来、
+デフォルトの日付および数値フォーマットも保持しています。
+Rico ディストリビューションは、デフォルトグリッドメニューと Rico カレンダーを表示するために
+必要なフレーズと共に、翻訳オブジェクトをロードする言語ファイルを含みます。
+
+<h2>翻訳ステータス</h2>
+
+<p>言語ファイルは "src/translations/ricoLocale_xx.js" に保持されており、
+xx は 2 文字の言語コードです。
+現在、Rico は以下の翻訳と共に配布されています。
+
+<table border='1' cellspacing='0' cellpadding='3'>
+<thead>
+<tr><th>言語</th><th>コード</th><th>ステータス</th></tr>
+</thead>
+<tbody>
+
+<tr>
+<td>英語</td>
+<td>en</td>
+<td>ベースライン</td>
+</tr>
+
+<tr>
+<td>フランス語</td>
+<td>fr</td>
+<td>完了して検査された</td>
+</tr>
+
+<tr>
+<td>スペイン語</td>
+<td>es</td>
+<td>完了して検査された</td>
+</tr>
+
+<tr>
+<td>日本語</td>
+<td>ja</td>
+<td>完了して検査された</td>
+</tr>
+
+<tr>
+<td>中国語(単純化された)</td>
+<td>zh</td>
+<td>完了して検査された</td>
+</tr>
+
+<tr>
+<td>韓国語</td>
+<td>ko</td>
+<td>完了して検査された</td>
+</tr>
+
+<tr>
+<td>ドイツ語</td>
+<td>de</td>
+<td>完了して検査を必要としている</td>
+</tr>
+
+<tr>
+<td>ポルトガル語</td>
+<td>pt</td>
+<td>完了して検査を必要としている</td>
+</tr>
+
+<tr>
+<td>イタリア語</td>
+<td>it</td>
+<td>完了して検査を必要としている</td>
+</tr>
+
+<tr>
+<td>ロシア語</td>
+<td>ru</td>
+<td>新しい ricoLocale フォーマットへの更新を必要としている</td>
+</tr>
+
+<tr>
+<td>ウクライナ語</td>
+<td>ua</td>
+<td>新しい ricoLocale フォーマットへの更新を必要としている</td>
+</tr>
+
+</tbody>
+</table>
+
+<h2>複数言語のサポート</h2>
+
+<p>Rico が進化するにつれ、翻訳ファイルに追加のフレーズが必要とされます。
+英語のフレーズが最初に追加され、そして Rico コミュニティのメンバーが
+新しいフレーズを他の翻訳ファイルに加えます。
+私達は全ての翻訳を同期し続けようとしますが、
+これは必ずしも可能ではありません。
+そのため、rico.js がロードされる時、
+最初に英語の言語ファイルをロードします。
+それから、それはユーザの OS またはブラウザの言語に一致する Rico 翻訳を探します。
+見つかったなら、それは次にロードされます。
+これは、フレーズが翻訳ファイルやそれらの言語用の翻訳が利用出来ない場合に、
+(空白メッセージの代わりに)少なくとも英語でのフレーズを見る事を確実にします。
+
+<p>追加のコーディング無しで、Rico は多くの場合、
+ユーザにふさわしいローカライズされたメニューやカレンダーを表示するはずです。
+しかし、全ての最新のブラウザは、ユーザに OS の言語をオーバライドする方法を与えます。
+例えば、Firefox では ツールメニュー > オプション > 詳細 > 一般タブ > 言語設定ボタン へ進みます。
+Internet Explorer では ツールメニュー > インターネットオプション > 全般タブ > 言語ボタン へ進みます
+この設定は 
+<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">accept language</a> 
+から呼ばれ、javascript を通して直接アクセスする事は出来ません。
+しかし、Rico は適切な言語に基づく翻訳ファイルをロードする方法を提供します。
+この設定を構成したユーザーにとって、このアプローチを利用して解析される言語は、
+彼らの本当の選択により近いかもしれません。
+その適切な言語は "Rico.acceptLanguage()" javascript メソッドに、
+適切な言語のヘッダを返すサーバサイドスクリプトを持つ事により Rico で解析されます。
+これは、ASP と PHP のための LiveGrid フォームプラグインと、
+.net のための LiveGrid プラグインを利用する時に、自動的に行われます。
+他の状況では、サーバサイドインクルードファイルは Rico ディストリビューションで提供されます。
+
+<p>PHP では。
+<pre>
+&lt;? 
+// ricoLiveGridForms.php を利用する時は必要ありません
+// rico.js をインクルードする行の後に置かれなければなりません
+
+require "chklang2.php";
+?&gt;
+</pre>
+
+<p>ASP では。
+<pre>
+' ricoLiveGridForms.asp を利用する時は必要ありません
+' rico.js をインクルードする行の後に置かれなければなりません
+
+&lt;!-- #INCLUDE FILE = "chklang2.vbs" --&gt;
+</pre>
+
+<p>.net では。
+<pre>
+' ricoLiveGridForms.ascx を利用する時は必要ありません
+' rico.js をインクルードする行の後に置かれなければなりません
+
+&lt;%@ Register TagPrefix="Rico" TagName="ChkLang" Src="chklang.ascx" %&gt;
+&lt;Rico:ChkLang runat='server' id='translation' /&gt;
+</pre>
+
+<h2>RicoTranslate オブジェクトリファレンス</h2>
+
+<p>RicoTranslate オブジェクトは以下のプロパティとメソッドを含みます。
+<dl>
+<dt>monthNames[]
+<dd>それぞれの月の翻訳された名前を含む 12 アイテムの配列(1 月はアイテム 0)
+<dt>dayNames[]
+<dd>それぞれの曜日の翻訳された名前を含む 7 アイテムの配列(日曜はアイテム 0)
+<dt>monthAbbr()
+<dd>月の数字(0-11)を受け取り、月の省略名を返す関数(デフォルトは monthNames[] の始めの 3 文字ですが、翻訳によってオーバーライドされます)
+<dt>dayAbbr()
+<dd>曜日の数字(0-6)を受け取り、曜日の省略名を返す関数(デフォルトは dayNames[] の始めの 3 文字ですが、翻訳によってオーバーライドされます)
+<dt>langCode
+<dd>現在ロードされた 2 文字の言語コードを含みます(デフォルトは "en")
+<dt>thouSep
+<dd>数値をフォーマットする時に千桁区切りのセパレータとして利用する文字を含みます(デフォルトは ",")
+<dt>decPoint
+<dd>数値をフォーマットする時に小数点として利用する文字を含みます(デフォルトは ".")
+<dt>dateFmt
+<dd>デフォルトの日付フォーマットを含みます(デフォルトは "mm/dd/yyyy")
+<dt>timeFmt
+<dd>デフォルトの時間フォーマットを含みます(デフォルトは "hh:nn:ss a/pm")
+<dt>addPhraseId (phraseId, phrase)
+<dd>指定されたフレーズを加えて、それを phraseId に割り当てます。フレーズの文字列は、任意の置き換えパラメータの参照を含むかもしれず、$1、$2、等を利用して指定されます。
+<dt>getPhraseById (phraseId)
+<dd>phraseId によって指定されたフレーズを返します。任意の置き換えパラメータは phraseId に続くかもしれません。
+</dl>
+
+<h2>最新情報の提出</h2>
+
+<p>質問と訂正は <a href='http://sourceforge.net/forum/forum.php?forum_id=470997'>SourceForge の Open Discussion フォーラム</a> にポストされるかもしれません。
+あるいは、 dowdybrown at yahoo dot com に直接送信する事も出来ます。
+
+</body>
+</html>
diff --git a/documentation/welcome.html b/documentation/welcome.html
new file mode 100644 (file)
index 0000000..44bee13
--- /dev/null
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico 3.0</title>
+<style type="text/css">
+#welcome img {
+  vertical-align: middle; 
+  float: left; 
+  margin: 0px 8px 8px 0px;
+}
+#welcome span {
+  font-family: Trebuchet MS, Arial, Tahoma, Verdana, Helvetica, sans-serif; 
+  font-size: 60px;
+  font-weight: bold;
+  margin: 0px; 
+  padding-top: 5px;
+}
+.important, .important a {
+  font-size: 12pt !important;
+  font-weight: bold;
+}
+p, li {
+  font-family: Arial, Tahoma, Verdana;
+}
+li { margin-bottom : 5px }
+</style>
+</head>
+
+<body>
+
+<div id='welcome'><img alt="Rico Logo" src="ricologo.gif"><span>Welcome to Rico 3!</span></div>
+
+<p style="clear:both;">Rico is an open source JavaScript framework 
+used to create rich, highly interactive web applications. 
+Rico is released under the Apache Licence, Version 2.0.
+This allows you to use Rico in nearly all circumstances, commercial and non-commercial, and to modify it as you see fit.
+Read the full license description at <a href="http://www.apache.org/licenses/LICENSE-2.0">the Apache web site</a>. 
+
+<p>Previous versions of Rico have relied on the excellent 
+<a href="http://www.prototypejs.org" target="_top">Prototype</a>
+library to provide a base level of cross-browser functions.
+Rico 3 has been redesigned to work
+with a variety of popular Javascript libraries using a small
+adapter layer to bridge the differences between each library.
+Thus, you are no longer be required to load Prototype in order to run Rico.
+Of course you can if you choose to, but you can also run it with 
+<a href="http://jquery.com" target="_top">jQuery</a> instead,
+or <a href="http://mootools.net" target="_top">MooTools</a>, 
+or <a href="http://www.dojotoolkit.org/" target="_top">dojo</a>, 
+or <a href="http://extjs.com/products/extcore/" target="_top">ext</a>, 
+or <a href="http://www.bbc.co.uk/glow/" target="_top">BBC Glow</a>.
+</p>
+
+
+<p>Functions supported by Rico 3 include:
+<ul>
+<li>Event model, Ajax model, Animation model, and CSS selector model tied to the base library, but adapters
+provide common calling conventions (since Prototype does not include animation support,
+the adapter for Prototype provides this support).
+<li>pop-up "windows" (div's) and menus with shadows
+<li>scrolling grids with frozen columns and headings that can be
+populated with static content or dynamically loaded via AJAX.
+<li>localization support functions, with calendars and standard grid menus provided in 
+English, French, German, Italian, Portugese, Spanish, Chinese, Japanese, Korean, Russian, and Ukranian
+<li>number and date formatting
+<li>A variety of Rico themes are included, or you can use <a href="http://jqueryui.com/themeroller/">jQuery Themeroller</a> themes, 
+or you can create your own
+<li>Console logging to support debugging
+</ul>
+</p>
+
+<p>Rico resources:
+<ul>
+<li><a href="http://sourceforge.net/projects/openrico/" target="_top">OpenRico@SourceForge</a> - home of OpenRico!
+<li><a href="http://dowdybrown.com/dbprod/" target="_top">dowdybrown.com</a> - online demos &amp; javascript reference
+<li><a href="http://openrico.org/" target="_top">openrico.org</a> - original forums &amp; demos
+</ul>
+</p>
+
+
+</body>
+</html>
diff --git a/documentation/welcome_ja.html b/documentation/welcome_ja.html
new file mode 100644 (file)
index 0000000..fcab8c0
--- /dev/null
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico 2.0</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+<style type="text/css">\r
+#translations { clear:both; }\r
+#translations td { font-size:smaller; }\r
+#welcome img {\r
+  vertical-align: middle; \r
+  float: left; \r
+  margin: 0px 8px 8px 0px;\r
+}\r
+#welcome span {\r
+  font-family: Trebuchet MS, Arial, Tahoma, Verdana, Helvetica, sans-serif; \r
+  font-size: 60px;\r
+  font-weight: bold;\r
+  margin: 0px; \r
+  padding-top: 5px;\r
+}\r
+</style>
+</head>
+
+<body>
+
+<div id='welcome'><img alt="Rico Logo" src="images/ricologo.gif"><span>Rico へようこそ!</span></div>\r
+
+<p style="clear:both;">Rico は、多機能で対話的なウェブアプリケーションを作成するために利用される、
+オープンソース JavaScript フレームワークです。
+Rico は、<a href="http://www.prototypejs.org/">Prototype Javascript フレームワーク</a>に基づき、
+<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache ライセンス</a>の下で公開されます。
+
+<p>それは、次の機能をサポートします
+<ul>
+<li>ドラッグアンドドロップ
+<li>丸みのある HTML 要素
+<li>アニメーション効果
+<li>アコーディオンとタブパネル
+<li>カレンダー、カラーピッカー、そしてツリーコントロール
+<li>数値と日付のフォーマッティング
+<li>ポップアップ "ウィンドウ"(div's)と影付きのメニュー
+<li>内容の編集が可能なサポートを加えた、
+静的な内容や AJAX を通して動的にロードされた内容を保持し、
+固定された列や見出しを持ちスクロール出来るグリッド
+<li>グリッドメニューとカレンダーのための複数の言語 - 
+フランス語、ドイツ語、イタリア語、ポルトガル語、スペイン語、日本語、中国語、韓国語、ロシア語とウクライナ語への翻訳が含まれます
+</ul>
+
+<p>Rico ディストリビューションは、次の3つのサブディレクトリに分割されます
+<ul>
+<li><strong>src</strong> - javascript、cssと画像ファイルを含む、 Rico の中心部を含みます。
+<li><strong>plugins</strong> - LiveGridsとSimpleGridsをサポートするためにサーバで動くコードを含んでいます。
+現在のところ、プラグインを ASP (PHP) と .net に提供します。限られた機能を持つ Perl プラグインも含まれています。
+<li><strong>examples</strong> - ASP、PHP、.net、Perl、およびHTMLのためのサンプルコードを含んでいます。
+examples/data ディレクトリは LiveGrid に関係する実例のためのサンプルデータベースを含んでいます。
+データベースは MS Access、Oracle、および MySQL のために提供されます。また、データを SQL Server にインストールするための指示も含まれています。
+</ul>
+
+</body>
+</html>
diff --git a/documentation/welcome_zh.html b/documentation/welcome_zh.html
new file mode 100644 (file)
index 0000000..e5ca665
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico 2.0</title>
+<link href="ricoDocs.css" rel="Stylesheet" type="text/css">
+<style type="text/css">\r
+#translations { clear:both; }\r
+#translations td { font-size:smaller; }\r
+#welcome img {\r
+  vertical-align: middle; \r
+  float: left; \r
+  margin: 0px 8px 8px 0px;\r
+}\r
+#welcome span {\r
+  font-family: Trebuchet MS, Arial, Tahoma, Verdana, Helvetica, sans-serif; \r
+  font-size: 60px;\r
+  font-weight: bold;\r
+  margin: 0px; \r
+  padding-top: 5px;\r
+}\r
+</style>
+</head>
+
+<body>
+
+<div id='welcome'><img alt="Rico Logo" src="images/ricologo.gif"><span>Rico 欢迎你!</span></div>\r
+
+<p style="clear:both;">\r
+Rico是开源的JavaScript类库, 用来创建丰富的, 高度交互性的internet应用. \r
+\r
+Rico是基于 <a href="http://www.prototypejs.org/">Prototype Javascript 类库</a> 之上的,
+\r
+ 它的发行是根据<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License</a>\r
+
+
+<p>Rico 支持以下功能:
+<ul>
+<li>拖放操作
+<li>圆角的HTML元素
+<li>动画效果
+<li>可折叠的TAB面板
+<li>日历, 色彩选择, 和树的控件
+<li>数据和日期的格式化
+<li>带有阴影的弹出式”windows”(div’s)和菜单
+<li>静态或动态内容可由AJAX殖入有固定的列和标题的滚动数据网格, 并支持网格内容编辑
+<li>具有多种语言的网格菜单和日历 – 包括法语, 德语, 意大利语, 葡萄牙语, 西班牙语, 中文, 日文, 朝鲜文, 俄文和乌克兰文的翻译
+</ul>
+
+<p>Rico的发布版本分为3个部分:
+<ul>
+<li><strong>src</strong> - 含有Rico核心, 包括javascript, css和图像文件.
+<li><strong>plugins</strong> - 含有在服务器上运行的, 支持LiveGrids和SimpleGrids的程序. Plug-ins 可供ASP, PHP, .net使用. 还包括Perl plug-in有限的功能.
+<li><strong>examples</strong> - 含有ASP, PHP, .net, Perl 和HTML的样本程序. examples 和data目录中含有与LiveGrid有关的例子的样本数据库. 数据库可供MS Access, Oracle 和MySQL使用. 还包括安装数据到SQL Server上的说明.
+</ul>
+
+</body>
+</html>
diff --git a/dotnet_logo.gif b/dotnet_logo.gif
new file mode 100644 (file)
index 0000000..81da27d
Binary files /dev/null and b/dotnet_logo.gif differ
diff --git a/examples/ChangesSinceRico2.txt b/examples/ChangesSinceRico2.txt
new file mode 100644 (file)
index 0000000..6942e00
--- /dev/null
@@ -0,0 +1,98 @@
+Rico has undergone some major changes in version 3.0. Goals for this version
+included:
+
+1) More themes of higher quality. This was achieved by making Rico compatible
+with jQuery Themeroller. Even better, the use of Themeroller themes does not require
+the use of jQuery.
+
+2) Break Rico's dependence on Prototype. Rico can still run with Prototype,
+but it can also run with jQuery, MooTools, dojo, ext (core), or Glow.
+Adaptors to each base library provide a common calling convention
+within the Rico environment.
+
+3) Reduce Rico's impact on the global namespace to a single symbol - Rico.
+RicoUtil, RicoTranslate and several other namespaces have been folded into
+the Rico namespace. Date, String, and Number prototypes have been removed.
+
+4) More deeply integrate JSON support. All server plugins can now selectively generate
+XML or JSON output.
+
+5) Better LiveGrid export to Excel. LiveGrids with an SQL data source can now 
+export directly to MS Excel on all client browsers.
+
+6) When loading a LiveGrid with SQL data, support a mode where server variables 
+are not required to process the AJAX calls.
+
+
+Methods and properties previously defined in RicoCommon.js:
+-----------------------------------------------------------
+RicoUtil.getDirectChildrenByTag -> Rico.getDirectChildrenByTag (now defined in each adaptor file)
+RicoUtil.createXmlDocument -> Rico.createXmlDocument (now defined in rico.js)
+RicoUtil.getInnerText -> Rico.getInnerText (now defined in rico.js)
+RicoUtil.getContentAsString -> Rico.getContentAsString (now defined in rico.js)
+RicoUtil.docElement (removed)
+RicoUtil.windowHeight  -> Rico.windowHeight  (now defined in each adaptor file)
+RicoUtil.windowWidth   -> Rico.windowWidth   (now defined in each adaptor file)
+RicoUtil.docScrollLeft -> Rico.docScrollLeft (now defined in each adaptor file)
+RicoUtil.docScrollTop  -> Rico.docScrollTop  (now defined in each adaptor file)
+RicoUtil.nan2zero -> Rico.nan2zero (now defined in rico.js)
+RicoUtil.eventKey -> Rico.eventKey (now defined in each adaptor file)
+RicoUtil.getPreviosSiblingByTagName -> Rico.getPreviosSiblingByTagName (now defined in rico.js)
+RicoUtil.getParentByTagName -> Rico.getParentByTagName (now defined in rico.js)
+RicoUtil.wrapChildren -> Rico.wrapChildren (now defined in rico.js)
+RicoUtil.DOMNode_insertAfter (removed)
+RicoUtil.positionCtlOverIcon -> Rico.positionCtlOverIcon (now defined in rico.js)
+RicoUtil.createFormField -> Rico.createFormField (now defined in rico.js)
+RicoUtil.addSelectOption -> Rico.addSelectOption (now defined in rico.js)
+RicoUtil.getCookie -> Rico.getCookie (now defined in rico.js)
+RicoUtil.setCookie -> Rico.setCookie (now defined in rico.js)
+
+RicoTranslate.thouSep    -> Rico.thouSep    (now defined in rico.js)
+RicoTranslate.decPoint   -> Rico.decPoint   (now defined in rico.js)
+RicoTranslate.langCode   -> Rico.langCode   (now defined in rico.js)
+RicoTranslate.dateFmt    -> Rico.dateFmt    (now defined in rico.js)
+RicoTranslate.timeFmt    -> Rico.timeFmt    (now defined in rico.js)
+RicoTranslate.monthNames -> Rico.monthNames (now defined in rico.js)
+RicoTranslate.dayNames   -> Rico.dayNames   (now defined in rico.js)
+RicoTranslate.monthAbbr  -> Rico.monthAbbr  (now defined in rico.js)
+RicoTranslate.dayAbbr    -> Rico.dayAbbr    (now defined in rico.js)
+RicoTranslate.addPhrase (removed)
+RicoTranslate.getPhrase (removed)
+RicoTranslate.addPhraseId   -> Rico.addPhraseId   (now defined in rico.js)
+RicoTranslate.getPhraseById -> Rico.getPhraseById (now defined in rico.js)
+
+RicoUtil.formatPosNumber -> Rico.formatPosNumber (now defined in rico.js)
+Date.prototype.setISO8601 -> Rico.setISO8601 (now defined in rico.js)
+String.prototype.toISO8601Date -> Rico.setISO8601 (now defined in rico.js)
+Date.prototype.toISO8601String -> Rico.toISO8601String (now defined in rico.js)
+Date.prototype.formatDate -> Rico.formatDate (now defined in rico.js)
+String.prototype.formatDate -> Rico.formatDate (now defined in rico.js)
+Number.prototype.formatNumber -> Rico.formatNumber (now defined in rico.js)
+String.prototype.formatNumber -> Rico.formatNumber (now defined in rico.js)
+
+Rico.Shim -> no change (now defined in ricoUI.js)
+Rico.Shadow -> no change (now defined in ricoUI.js)
+Rico.Popup -> split into Rico.Popup and Rico.Window  (now defined in ricoUI.js)
+
+
+
+Methods and properties previously defined in ricoMenu.js:
+---------------------------------------------------------
+Rico.Menu -> no change (now defined in ricoUI.js)
+
+
+
+Methods and properties previously defined in ricoBehaviors.js:
+--------------------------------------------------------------
+Rico.selectionSet -> no change (now defined in ricoUI.js)
+Rico.HoverSet -> no change (now defined in ricoUI.js)
+Rico.Hover (removed)
+Rico.HoverDisplay (removed)
+Rico.EventWrapper (removed)
+
+
+
+Methods and properties previously defined in ricoStyles.js:
+-----------------------------------------------------------
+Rico.Color -> removed gradient functions (now defined in ricoUI.js)
+Rico.Corner -> no change (now defined in ricoUI.js)
diff --git a/examples/asp/CustTree.asp b/examples/asp/CustTree.asp
new file mode 100644 (file)
index 0000000..77c4c0b
--- /dev/null
@@ -0,0 +1,49 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoResponse.vbs" --> \r
+<%\r
+dim id,parent,oXmlResp\r
+\r
+id=trim(Request.QueryString("id"))\r
+parent=trim(Request.QueryString("Parent"))\r
+response.clear\r
+Response.CacheControl = "no-cache"\r
+Response.AddHeader "Pragma", "no-cache"\r
+Response.Expires = -1\r
+Response.ContentType="text/xml"\r
+Response.write "<?xml version='1.0' encoding='iso-8859-1'?>" & vbLf\r
+response.write vbLf & "<ajax-response><response type='object' id='" & id & "_updater'>"\r
+\r
+if id="" then\r
+  response.write vbLf & "<rows update_ui='false' /><error>"\r
+  response.write vbLf & "No ID provided!"\r
+  response.write vbLf & "</error>"\r
+elseif not OpenDB then\r
+  response.write vbLf & "<rows update_ui='false' /><error>"\r
+  response.write vbLf & server.htmlencode(oDB.LastErrorMsg)\r
+  response.write vbLf & "</error>"\r
+else\r
+  oDB.DisplayErrors=false\r
+  oDB.ErrMsgFmt="MULTILINE"\r
+  set oXmlResp=new ricoXmlResponse\r
+\r
+  response.write vbLf & "<rows update_ui='true' offset='0'>"\r
+  if parent <> "" then\r
+    oXmlResp.Query2xmlRaw "SELECT '" & parent & "',CustomerID,CompanyName,'L',1 FROM customers where CompanyName like '" & parent & "%'",0,99\r
+  else\r
+    oXmlResp.WriteTreeRow "","root","Customer names starting with...","C",0\r
+    oXmlResp.Query2xmlRaw "SELECT distinct 'root',left(CompanyName,1),left(CompanyName,1),'C',0 FROM customers",0,99\r
+  end if\r
+  response.write vbLf & "</rows>"\r
+\r
+  if not IsEmpty(oDB.LastErrorMsg) then\r
+    response.write vbLf & "<error>"\r
+    response.write vbLf & server.htmlencode(oDB.LastErrorMsg)\r
+    response.write vbLf & "</error>"\r
+  end if\r
+  set oXmlResp=Nothing\r
+end if\r
+CloseApp\r
+response.write vbLf & "</response></ajax-response>"\r
+\r
+%>
\ No newline at end of file
diff --git a/examples/asp/LoadRicoClient.asp b/examples/asp/LoadRicoClient.asp
new file mode 100644 (file)
index 0000000..21a9dd9
--- /dev/null
@@ -0,0 +1,140 @@
+<%\r
+\r
+' ***********************************************************\r
+' This generates the link and script tags for the Rico client\r
+' ***********************************************************\r
+\r
+Dim jsDir,cssDir,imgDir,transDir,baselibsDir\r
+Dim ricoLib,ricoTheme,ricoLogging\r
+const grid_striping = true     ' apply row striping to LiveGrids?\r
+const checkQueryString = true  ' load settings from QueryString? true for demo, false for production\r
+const LoadBaseLib = true       ' load base Javascript library (prototype, jQuery, etc) from Rico directory?\r
+const jQuery_theme_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/"\r
+\r
+\r
+jsDir="../../ricoClient/js/"       ' directory containing Rico's javascript files\r
+cssDir="../../ricoClient/css/"     ' directory containing Rico's css files\r
+imgDir="../../ricoClient/images/"  ' directory containing Rico's image files\r
+transDir=jsDir & "translations/"\r
+baselibsDir=jsDir & "baselibs/"\r
+\r
+\r
+if checkQueryString then\r
+  ricoLib=LCase(Request.QueryString("lib"))\r
+  ricoTheme=trim(Request.QueryString("theme"))\r
+  ricoLogging=CBool(trim(Request.QueryString("log")) <> "")\r
+else\r
+  ' set your production values here\r
+  ricoLib="proto"    ' base library (proto, jquery, moo, dojo, ext, or glow)\r
+  ricoTheme="j-ui-lightness"  ' jquery themes start with j-, rico themes start with r-\r
+  ricoLogging=false\r
+end if\r
+\r
+SetConfig\r
+LoadLib ricoLib, LoadBaseLib\r
+setLang\r
+if ricoTheme<>"" then\r
+  LoadTheme ricoTheme\r
+end if\r
+\r
+\r
+' initialize Rico\r
+sub SetConfig()\r
+  Response.Write vbLf & "<script type='text/javascript'>"\r
+  Response.Write vbLf & "Rico_CONFIG = {"\r
+  if ricoLogging then Response.Write vbLf & "enableLogging: true,"\r
+  Response.Write vbLf & "jsDir: '" & jsDir & "',"\r
+  Response.Write vbLf & "cssDir: '" & cssDir & "',"\r
+  Response.Write vbLf & "imgDir: '" & imgDir & "'"\r
+  Response.Write vbLf & "};"\r
+  Response.Write vbLf & "</script>"\r
+end sub\r
+\r
+\r
+sub LoadLib(baseLib, baseLoadFlag)\r
+  dim baseFile,adapter\r
+  select case baseLib\r
+    case "proto":\r
+      baseFile="prototype"\r
+      adapter="2Proto"\r
+    case "jquery":\r
+      baseFile="jquery"\r
+      adapter="2jQuery"\r
+    case "moo":\r
+      baseFile="mootools"\r
+      adapter="2Moo"\r
+    case "dojo":\r
+      baseFile="dojo"\r
+      adapter="2Dojo"\r
+    case "ext":\r
+      baseFile="ext-core"\r
+      adapter="2Ext"\r
+    case "glow":\r
+      baseFile="glow.core"\r
+      adapter="2Glow"\r
+    case else:\r
+      Response.End\r
+  end select\r
+\r
+  if baseLoadFlag then Response.Write vbLf & "<script src='" & baselibsDir & baseFile & ".js' type='text/javascript'></script>"\r
+  requireRicoJS ""\r
+  requireRicoJS adapter\r
+  Response.Write vbLf & "<script src='" & transDir & "ricoLocale_en.js' type='text/javascript'></script>"\r
+  requireRicoCSS "rico"\r
+  requireRicoJS "UI"\r
+end sub\r
+\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Check languages accepted by browser\r
+' and see if there is a match\r
+' -------------------------------------------------------------\r
+sub setLang()\r
+  dim fso,lang,lang2,fname,i\r
+  \r
+  Set fso=Server.CreateObject("Scripting.FileSystemObject")\r
+  lang=lcase(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"))\r
+  arLang=split(lang,",")\r
+  for i=0 to ubound(arLang)\r
+    lang2=lcase(left(trim(arLang(i)),2))\r
+    if lang2="en" then exit for\r
+    fname=transDir & "ricoLocale_" & lang2 & ".js"\r
+    if fso.FileExists(Server.MapPath(fname)) then\r
+      Response.Write "<script src='" & fname & "' type='text/javascript'></script>"\r
+      exit for\r
+    end if\r
+  next\r
+  set fso=nothing\r
+end sub\r
+\r
+\r
+' set theme\r
+' "j-ui-lightness" for a Themeroller theme\r
+' "r-greenHdg" for a native Rico theme\r
+sub LoadTheme(theme)\r
+  dim prefix,themeFile\r
+  prefix=left(theme,1)\r
+  themeFile=mid(theme,3)\r
+  select case prefix\r
+    case "j":\r
+      requireRicoJS "Themeroller"\r
+      Response.Write vbLf & "<link type='text/css' rel='stylesheet' href='" & cssDir & "jquery-base/ui.base.css' />"\r
+      Response.Write vbLf & "<link type='text/css' rel='Stylesheet' href='" & jQuery_theme_path & themeFile & "/jquery-ui.css' />"\r
+    case "r":\r
+      requireRicoCSS themeFile\r
+  end select\r
+  if grid_striping then Response.Write vbLf & "<link type='text/css' rel='stylesheet' href='" & cssDir & "striping/" & themeFile & ".css' />"\r
+end sub\r
+\r
+\r
+sub requireRicoJS(filename)\r
+  Response.Write vbLf & "<script src='" & jsDir & "rico" & filename & ".js' type='text/javascript'></script>"\r
+end sub\r
+\r
+\r
+sub requireRicoCSS(filename)\r
+  Response.Write vbLf & "<link href='" & cssDir & filename & ".css' type='text/css' rel='stylesheet' />"\r
+end sub\r
+\r
+%>\r
diff --git a/examples/asp/RicoDbViewer.asp b/examples/asp/RicoDbViewer.asp
new file mode 100644 (file)
index 0000000..f195880
--- /dev/null
@@ -0,0 +1,70 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico-Table List</title>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+\r
+<style type="text/css">\r
+html, body {\r
+  height:97%;\r
+  margin: 0px;\r
+  padding: 0px;\r
+  border: none;\r
+}\r
+\r
+#tablist {\r
+  height:100%;\r
+  width:25%;\r
+  overflow:auto;\r
+  float:left;\r
+  border: 1px solid #EEE;\r
+  font-size:smaller;\r
+}\r
+\r
+#detail {\r
+  height:100%;\r
+  width:70%;\r
+  float:left;\r
+  border: 1px solid #EEE;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<div id='tablist'>\r
+<p><strong>Rico Raw Data Viewer</strong>\r
+<%\r
+if OpenDB then\r
+  DisplaysObjects "TABLE"\r
+  DisplaysObjects "VIEW"\r
+end if\r
+CloseApp\r
+\r
+\r
+Sub DisplaysObjects(ObjType)\r
+  Dim conn,rs,dbname,owner,table\r
+\r
+  oDB.SplitTabName "X",dbname,owner,table\r
+  set conn = oDB.Connection()\r
+  Set rs = conn.OpenSchema (20, Array(dbname, owner, Empty, ObjType))\r
+  response.write vbLf & "<p><strong>" & ObjType & "S</strong>"\r
+  response.write vbLf & "<ul>"\r
+  while not rs.eof\r
+    response.write vbLf & "<li><a href='RicoDbViewerDetail.asp?id=" & server.urlencode(rs("TABLE_NAME")) & "&" & Request.QueryString & "' target='detail'>" & rs("TABLE_NAME") & "</a>"\r
+    rs.movenext\r
+  wend\r
+  response.write vbLf & "</ul>"\r
+  rs.Close\r
+End Sub\r
+%>\r
+</div>\r
+\r
+<iframe id='detail' name='detail'>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/asp/RicoDbViewerDetail.asp b/examples/asp/RicoDbViewerDetail.asp
new file mode 100644 (file)
index 0000000..0f6f709
--- /dev/null
@@ -0,0 +1,68 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico-Table Detail</title>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+<%\r
+\r
+dim id,arColumns(100),i,columnlist,colspecs,colcnt\r
+id=trim(request.querystring("id"))\r
+if OpenDB then\r
+  colcnt=oDB.GetColumnInfo(id,arColumns)\r
+  for i=0 to colcnt-1\r
+    if not IsEmpty(columnlist) then\r
+      columnlist=columnlist & ","\r
+      colspecs=colspecs & ","\r
+    end if\r
+    if left(arColumns(i).ColType,3)<>"???" then\r
+      columnlist=columnlist & arColumns(i).ColName\r
+    else\r
+      columnlist=columnlist & "'?'"\r
+    end if\r
+    colspecs=colspecs & "{Hdg:'" & arColumns(i).ColName & "'"\r
+    if arColumns(i).ColType="DATETIME" then colspecs=colspecs & ",type:'datetime'"\r
+    colspecs=colspecs & "}"\r
+  next\r
+end if\r
+CloseApp\r
+session.contents(id)="select " & columnlist & " from [" & id & "] order by " & arColumns(0).ColName\r
+%>\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    useUnformattedColWidth: false,\r
+    menuEvent: 'click',\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs: [<%=colspecs%>]\r
+  };\r
+  var buffer=new Rico.Buffer.AjaxSQL('ricoQuery.asp', {TimeOut:<%=Session.Timeout%>});\r
+  var grid=new Rico.LiveGrid ('<%=id%>', buffer, opts);\r
+  grid.menu = new Rico.GridMenu();\r
+});\r
+</script>\r
+\r
+<style type="text/css">\r
+html { border: none; }\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+<p><strong><%=id%></strong>\r
+<p class="ricoBookmark"><span id='<%=id%>_timer' class='ricoSessionTimer'></span><span id="<%=id%>_bookmark">&nbsp;</span></p>\r
+<div id="<%=id%>"></div>\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/asp/ShipperEdit.asp b/examples/asp/ShipperEdit.asp
new file mode 100644 (file)
index 0000000..d251a30
--- /dev/null
@@ -0,0 +1,89 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<% Response.CacheControl = "no-cache" %>\r
+<% Response.AddHeader "Pragma", "no-cache" %> \r
+<% Response.Expires = -1 %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Shippers (editable)</title>\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoLiveGridForms.vbs" --> \r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridForms');\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">
+div.ricoLG_cell {
+  white-space:nowrap;
+}
+</style>
+</head>\r
+\r
+\r
+<body>\r
+\r
+<%\r
+'************************************************************************************************************\r
+'  LiveGrid-Edit Example\r
+'************************************************************************************************************\r
+'  Matt Brown\r
+'************************************************************************************************************\r
+\r
+if OpenGridForm(empty,"shippers") then\r
+  if oForm.action="table" then\r
+    DisplayTable\r
+  else\r
+    DefineFields\r
+  end if\r
+end if\r
+CloseApp\r
+\r
+\r
+sub DisplayTable()\r
+  response.write vbLf & "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>"\r
+  response.write vbLf & "Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>"\r
+  response.write vbLf & "<hr>The data on this grid can be edited using pop-up forms. "\r
+  response.write vbLf & "Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. "\r
+  response.write vbLf & "The Add and Edit forms are automatically generated by LiveGrid. "\r
+  response.write vbLf & "Updates are disabled on the database, so you will get an error message if you try to save."\r
+  response.write vbLf & "</td><td>"\r
+  response.write vbLf & "<script type='text/javascript'><!--"\r
+  response.write vbLf & "google_ad_client = 'pub-7218597156507462';"\r
+  response.write vbLf & "/* 125x125, created 5/11/09 */"\r
+  response.write vbLf & "google_ad_slot = '9298106441';"\r
+  response.write vbLf & "google_ad_width = 125;"\r
+  response.write vbLf & "google_ad_height = 125;"\r
+  response.write vbLf & "//-->"\r
+  response.write vbLf & "</script>"\r
+  response.write vbLf & "<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>"\r
+  response.write vbLf & "</td></tr></table>"\r
+\r
+  response.write "<p><strong>Shippers Table</strong></p>"
+\r
+  oForm.options("frozenColumns")=1\r
+  oForm.options("menuEvent")="click"\r
+  oForm.options("highlightElem")="cursorRow"\r
+  DefineFields\r
+\r
+  'response.write "<p><textarea id='shippers_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>"\r
+end sub\r
+\r
+\r
+sub DefineFields()\r
+  oForm.AddEntryFieldW "ShipperID", "ID", "B", "<auto>",50
+  oForm.AddEntryFieldW "CompanyName", "Company Name", "B", "", 150
+  oForm.ConfirmDeleteColumn
+  oForm.SortAsc
+  oForm.AddEntryFieldW "Phone", "Phone Number", "B", "", 150
+\r
+  oForm.DisplayPage\r
+end sub\r
+\r
+%>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/asp/dbConnect.asp b/examples/asp/dbConnect.asp
new file mode 100644 (file)
index 0000000..3ea0c84
--- /dev/null
@@ -0,0 +1,91 @@
+<!-- #INCLUDE FILE = "../../plugins/asp/dbClass3.vbs" --> \r
+<%\r
+\r
+' ***********************************************************\r
+' This is where the database connection settings go.\r
+' The ASP and .net LiveGrid examples should run without changes on Windows - accessing the examples\data\Northwind.mdb database by default.\r
+' As your application develops, this would also be a logical place to put security checks.\r
+' ***********************************************************\r
+\r
+\r
+Dim oDB,oForm,accessRights,appDB\r
+const appName="Northwind"\r
+appDB="Northwind"\r
+\r
+\r
+Function CreateDbClass()\r
+  Set oDB = new dbClass\r
+  'oDB.debug=true\r
+\r
+  ' ***********************************************************\r
+  ' UNCOMMENT THE APPROPRIATE LINE FOR YOUR DATABASE\r
+  ' IF ALL ARE COMMENTED, SQL SERVER (TSQL) WILL BE THE DEFAULT\r
+  '\r
+  'oDB.SqlSvr="myserver"   ' put your server name here (if not localhost)\r
+  'oDB.SqlSvr="mbrown27"\r
+  oDB.Use_Access Server.Mappath("../data/northwind.mdb")\r
+  'oDB.Use_Oracle "XE"\r
+  'oDB.Use_MySQL\r
+  ' ***********************************************************\r
+end function\r
+\r
+\r
+Function OpenDB()\r
+  OpenDB=false\r
+  CreateDbClass\r
+  select case oDB.Dialect\r
+    case "TSQL"  : OpenDB=oDB.SqlLogon(appDB, "edituser", "password")\r
+    'case "TSQL"  : OpenDB=oDB.SqlLogon(appDB, "userid", "password")\r
+    case "Access": OpenDB=oDB.SqlLogon(empty, "Admin", "")\r
+    case "Oracle": OpenDB=oDB.SqlLogon(empty, "NORTHWIND", "Password")\r
+    case "MySQL" : OpenDB=oDB.SqlLogon(appDB, "UserID", "Password")\r
+  end select\r
+end function\r
+\r
+\r
+function OpenApp(title)\r
+  OpenApp=false\r
+  if not OpenDB then exit function\r
+  if not IsEmpty(title) then AppHeader appName & "-" & title\r
+  accessRights="rw"  ' CHECK APPLICATION SECURITY HERE  (in this example, "r" gives read-only access and "rw" gives read/write access)\r
+  if IsEmpty(accessRights) or IsNull(accessRights) or left(accessRights,1)<>"r" then\r
+    response.write "<p class='error'>You do not have permission to access this application"\r
+  else\r
+    OpenApp=true\r
+  end if\r
+end function\r
+\r
+\r
+function OpenTableEdit(tabname)\r
+  set obj=new TableEditClass\r
+  obj.SetTableName tabname\r
+  obj.options("XMLprovider")="ricoQuery.asp"\r
+  set OpenTableEdit=obj\r
+end function\r
+\r
+\r
+function OpenGridForm(title,tabname)\r
+  dim CanModify\r
+  OpenGridForm=false\r
+  if not OpenApp(title) then exit function\r
+  set oForm=OpenTableEdit(tabname)\r
+  CanModify=CBool(accessRights="rw")\r
+  oForm.options("canAdd")=CanModify\r
+  oForm.options("canEdit")=CanModify\r
+  oForm.options("canDelete")=CanModify\r
+  Session.Timeout=60\r
+  OpenGridForm=true\r
+end function\r
+\r
+\r
+sub CloseApp()\r
+  set oDB = Nothing\r
+  set oForm = Nothing\r
+end sub\r
+\r
+\r
+Sub AppHeader(hdg)\r
+  response.write "<h2 class='appHeader'>" & replace(hdg,"<dialect>",oDB.Dialect) & "</h2>"\r
+end sub\r
+\r
+%>\r
diff --git a/examples/asp/ex1.asp b/examples/asp/ex1.asp
new file mode 100644 (file)
index 0000000..4695e73
--- /dev/null
@@ -0,0 +1,1925 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\r
+<title>Rico LiveGrid sourced from HTML table</title>\r
+\r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridBasic','LiveGridMenu');\r
+\r
+Rico.onLoad( function() {\r
+  //alert('We are stopping here, at the start of the onLoad event, to show you that the grid is populated with data from a regular HTML table. This is what browsers with javascript disabled would display.');\r
+  var opts = {\r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    defaultWidth : 90,\r
+    useUnformattedColWidth: false,\r
+    columnSpecs  : [{width:200},'specQty','specQty','specQty','specQty','specQty']\r
+  };\r
+  var ex1=new Rico.LiveGrid ('population', new Rico.Buffer.Base(document.getElementById('population').tBodies[0]), opts);\r
+  ex1.menu=new Rico.GridMenu({});\r
+});\r
+</script>\r
+\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how Rico can convert an existing HTML table into\r
+a much more usable LiveGrid. \r
+LiveGrid provides scrolling, column resizing, filtering, and sorting capabilities.\r
+Click on a cell to see available actions.\r
+<p style='font-size:smaller;'>Data source: <a href="http://www.un.org/esa/population/unpop.htm">Population Division of the \r
+Department of Economic and Social Affairs of the United Nations Secretariat</a> (2009). \r
+<em>World Population Prospects: The 2008 Revision. Highlights.</em> New York: United Nations.  </p>                            \r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id="population_bookmark">&nbsp;</span></p>\r
+<table class="ricoLiveGrid" id="population">\r
+<thead>\r
+ <tr>\r
+  <td class='ricoFrozen'></td>\r
+  <td colspan=5>Population (thousands)</td>\r
+ </tr>\r
+ <tr>\r
+  <td class='ricoFrozen'>Country or area</td>\r
+  <td>1950</td>\r
+  <td>2009</td>\r
+  <td>2015</td>\r
+  <td>2025</td>\r
+  <td>2050</td>\r
+ </tr>\r
+</thead>\r
+<tbody>\r
+ <tr>\r
+  <td>Afghanistan</td>\r
+  <td>8151</td>\r
+  <td>28150</td>\r
+  <td>34246</td>\r
+  <td>44970</td>\r
+  <td>73938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Albania</td>\r
+  <td>1215</td>\r
+  <td>3155</td>\r
+  <td>3256</td>\r
+  <td>3395</td>\r
+  <td>3303</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Algeria</td>\r
+  <td>8753</td>\r
+  <td>34895</td>\r
+  <td>38088</td>\r
+  <td>42882</td>\r
+  <td>49610</td>\r
+ </tr>\r
+ <tr>\r
+  <td>American Samoa</td>\r
+  <td>19</td>\r
+  <td>67</td>\r
+  <td>74</td>\r
+  <td>86</td>\r
+  <td>107</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Andorra</td>\r
+  <td>6</td>\r
+  <td>86</td>\r
+  <td>93</td>\r
+  <td>107</td>\r
+  <td>137</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Angola</td>\r
+  <td>4148</td>\r
+  <td>18498</td>\r
+  <td>21690</td>\r
+  <td>27441</td>\r
+  <td>42267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Anguilla</td>\r
+  <td>5</td>\r
+  <td>15</td>\r
+  <td>17</td>\r
+  <td>18</td>\r
+  <td>20</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Antigua and Barbuda</td>\r
+  <td>46</td>\r
+  <td>88</td>\r
+  <td>93</td>\r
+  <td>101</td>\r
+  <td>112</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Argentina</td>\r
+  <td>17150</td>\r
+  <td>40276</td>\r
+  <td>42548</td>\r
+  <td>45883</td>\r
+  <td>50943</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Armenia</td>\r
+  <td>1354</td>\r
+  <td>3083</td>\r
+  <td>3139</td>\r
+  <td>3181</td>\r
+  <td>3018</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Aruba</td>\r
+  <td>38</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>112</td>\r
+  <td>106</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Australia</td>\r
+  <td>8219</td>\r
+  <td>21293</td>\r
+  <td>22607</td>\r
+  <td>24703</td>\r
+  <td>28724</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Austria</td>\r
+  <td>6936</td>\r
+  <td>8364</td>\r
+  <td>8467</td>\r
+  <td>8600</td>\r
+  <td>8515</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Azerbaijan</td>\r
+  <td>2896</td>\r
+  <td>8832</td>\r
+  <td>9426</td>\r
+  <td>10128</td>\r
+  <td>10579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahamas</td>\r
+  <td>79</td>\r
+  <td>342</td>\r
+  <td>366</td>\r
+  <td>402</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahrain</td>\r
+  <td>116</td>\r
+  <td>791</td>\r
+  <td>882</td>\r
+  <td>1021</td>\r
+  <td>1277</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bangladesh</td>\r
+  <td>43595</td>\r
+  <td>162221</td>\r
+  <td>175217</td>\r
+  <td>195012</td>\r
+  <td>222495</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Barbados</td>\r
+  <td>211</td>\r
+  <td>256</td>\r
+  <td>260</td>\r
+  <td>262</td>\r
+  <td>237</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belarus</td>\r
+  <td>7745</td>\r
+  <td>9634</td>\r
+  <td>9355</td>\r
+  <td>8851</td>\r
+  <td>7275</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belgium</td>\r
+  <td>8628</td>\r
+  <td>10647</td>\r
+  <td>10878</td>\r
+  <td>11191</td>\r
+  <td>11493</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belize</td>\r
+  <td>69</td>\r
+  <td>307</td>\r
+  <td>344</td>\r
+  <td>404</td>\r
+  <td>506</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Benin</td>\r
+  <td>2050</td>\r
+  <td>8935</td>\r
+  <td>10647</td>\r
+  <td>13767</td>\r
+  <td>21982</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bermuda</td>\r
+  <td>37</td>\r
+  <td>65</td>\r
+  <td>65</td>\r
+  <td>66</td>\r
+  <td>63</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bhutan</td>\r
+  <td>168</td>\r
+  <td>697</td>\r
+  <td>770</td>\r
+  <td>865</td>\r
+  <td>1013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bolivia</td>\r
+  <td>2714</td>\r
+  <td>9863</td>\r
+  <td>10854</td>\r
+  <td>12368</td>\r
+  <td>14908</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bosnia and Herzegovina</td>\r
+  <td>2661</td>\r
+  <td>3767</td>\r
+  <td>3727</td>\r
+  <td>3608</td>\r
+  <td>3008</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Botswana</td>\r
+  <td>413</td>\r
+  <td>1950</td>\r
+  <td>2106</td>\r
+  <td>2337</td>\r
+  <td>2758</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brazil</td>\r
+  <td>53975</td>\r
+  <td>193734</td>\r
+  <td>202866</td>\r
+  <td>213802</td>\r
+  <td>218512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>British Virgin Islands</td>\r
+  <td>7</td>\r
+  <td>23</td>\r
+  <td>24</td>\r
+  <td>26</td>\r
+  <td>28</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brunei Darussalam</td>\r
+  <td>48</td>\r
+  <td>400</td>\r
+  <td>443</td>\r
+  <td>513</td>\r
+  <td>658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bulgaria</td>\r
+  <td>7251</td>\r
+  <td>7545</td>\r
+  <td>7263</td>\r
+  <td>6752</td>\r
+  <td>5392</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burkina Faso</td>\r
+  <td>4080</td>\r
+  <td>15757</td>\r
+  <td>19013</td>\r
+  <td>24837</td>\r
+  <td>40830</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burundi</td>\r
+  <td>2456</td>\r
+  <td>8303</td>\r
+  <td>9413</td>\r
+  <td>11161</td>\r
+  <td>14846</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cambodia</td>\r
+  <td>4346</td>\r
+  <td>14805</td>\r
+  <td>16357</td>\r
+  <td>18973</td>\r
+  <td>23795</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cameroon</td>\r
+  <td>4466</td>\r
+  <td>19522</td>\r
+  <td>22169</td>\r
+  <td>26478</td>\r
+  <td>36736</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Canada</td>\r
+  <td>13737</td>\r
+  <td>33573</td>\r
+  <td>35493</td>\r
+  <td>38659</td>\r
+  <td>44414</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cape Verde</td>\r
+  <td>146</td>\r
+  <td>506</td>\r
+  <td>548</td>\r
+  <td>616</td>\r
+  <td>703</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cayman Islands</td>\r
+  <td>7</td>\r
+  <td>56</td>\r
+  <td>59</td>\r
+  <td>63</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Central African Republic</td>\r
+  <td>1327</td>\r
+  <td>4422</td>\r
+  <td>4927</td>\r
+  <td>5747</td>\r
+  <td>7603</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chad</td>\r
+  <td>2429</td>\r
+  <td>11206</td>\r
+  <td>13120</td>\r
+  <td>16906</td>\r
+  <td>27776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Channel Islands</td>\r
+  <td>102</td>\r
+  <td>150</td>\r
+  <td>151</td>\r
+  <td>152</td>\r
+  <td>144</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chile</td>\r
+  <td>6082</td>\r
+  <td>16970</td>\r
+  <td>17926</td>\r
+  <td>19266</td>\r
+  <td>20657</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China</td>\r
+  <td>544951</td>\r
+  <td>1345751</td>\r
+  <td>1395998</td>\r
+  <td>1453140</td>\r
+  <td>1417045</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Hong Kong SAR</td>\r
+  <td>1974</td>\r
+  <td>7022</td>\r
+  <td>7398</td>\r
+  <td>7969</td>\r
+  <td>8623</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Macao SAR</td>\r
+  <td>190</td>\r
+  <td>538</td>\r
+  <td>568</td>\r
+  <td>603</td>\r
+  <td>593</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Colombia</td>\r
+  <td>12000</td>\r
+  <td>45660</td>\r
+  <td>49385</td>\r
+  <td>54920</td>\r
+  <td>62877</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Comoros</td>\r
+  <td>156</td>\r
+  <td>676</td>\r
+  <td>767</td>\r
+  <td>907</td>\r
+  <td>1226</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Congo</td>\r
+  <td>808</td>\r
+  <td>3683</td>\r
+  <td>4225</td>\r
+  <td>5094</td>\r
+  <td>6863</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cook Islands</td>\r
+  <td>15</td>\r
+  <td>20</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>24</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Costa Rica</td>\r
+  <td>966</td>\r
+  <td>4579</td>\r
+  <td>4957</td>\r
+  <td>5521</td>\r
+  <td>6373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Côte d'Ivoire</td>\r
+  <td>2505</td>\r
+  <td>21075</td>\r
+  <td>24210</td>\r
+  <td>29738</td>\r
+  <td>43373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Croatia</td>\r
+  <td>3850</td>\r
+  <td>4416</td>\r
+  <td>4370</td>\r
+  <td>4254</td>\r
+  <td>3825</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cuba</td>\r
+  <td>5920</td>\r
+  <td>11204</td>\r
+  <td>11213</td>\r
+  <td>11148</td>\r
+  <td>9725</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cyprus</td>\r
+  <td>494</td>\r
+  <td>871</td>\r
+  <td>925</td>\r
+  <td>1014</td>\r
+  <td>1175</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Czech Republic</td>\r
+  <td>8925</td>\r
+  <td>10369</td>\r
+  <td>10510</td>\r
+  <td>10573</td>\r
+  <td>10294</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. People's Rep. of Korea</td>\r
+  <td>9737</td>\r
+  <td>23906</td>\r
+  <td>24399</td>\r
+  <td>25128</td>\r
+  <td>24562</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. Republic of the Congo</td>\r
+  <td>12184</td>\r
+  <td>66020</td>\r
+  <td>77419</td>\r
+  <td>98123</td>\r
+  <td>147512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Denmark</td>\r
+  <td>4271</td>\r
+  <td>5470</td>\r
+  <td>5523</td>\r
+  <td>5590</td>\r
+  <td>5551</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Djibouti</td>\r
+  <td>62</td>\r
+  <td>864</td>\r
+  <td>953</td>\r
+  <td>1111</td>\r
+  <td>1469</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominica</td>\r
+  <td>51</td>\r
+  <td>67</td>\r
+  <td>67</td>\r
+  <td>68</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominican Republic</td>\r
+  <td>2427</td>\r
+  <td>10090</td>\r
+  <td>10867</td>\r
+  <td>11973</td>\r
+  <td>13441</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ecuador</td>\r
+  <td>3387</td>\r
+  <td>13625</td>\r
+  <td>14596</td>\r
+  <td>16074</td>\r
+  <td>17989</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Egypt</td>\r
+  <td>21514</td>\r
+  <td>82999</td>\r
+  <td>91778</td>\r
+  <td>104970</td>\r
+  <td>129533</td>\r
+ </tr>\r
+ <tr>\r
+  <td>El Salvador</td>\r
+  <td>2200</td>\r
+  <td>6163</td>\r
+  <td>6383</td>\r
+  <td>6895</td>\r
+  <td>7882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Equatorial Guinea</td>\r
+  <td>226</td>\r
+  <td>676</td>\r
+  <td>781</td>\r
+  <td>971</td>\r
+  <td>1445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Eritrea</td>\r
+  <td>1141</td>\r
+  <td>5073</td>\r
+  <td>6009</td>\r
+  <td>7404</td>\r
+  <td>10787</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Estonia</td>\r
+  <td>1101</td>\r
+  <td>1340</td>\r
+  <td>1337</td>\r
+  <td>1321</td>\r
+  <td>1233</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ethiopia</td>\r
+  <td>18434</td>\r
+  <td>82825</td>\r
+  <td>96237</td>\r
+  <td>119822</td>\r
+  <td>173811</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Faeroe Islands</td>\r
+  <td>32</td>\r
+  <td>50</td>\r
+  <td>52</td>\r
+  <td>55</td>\r
+  <td>58</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Falkland Islands (Malvinas)</td>\r
+  <td>2</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Fiji</td>\r
+  <td>289</td>\r
+  <td>849</td>\r
+  <td>874</td>\r
+  <td>905</td>\r
+  <td>910</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Finland</td>\r
+  <td>4009</td>\r
+  <td>5326</td>\r
+  <td>5432</td>\r
+  <td>5533</td>\r
+  <td>5445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>France</td>\r
+  <td>41832</td>\r
+  <td>62343</td>\r
+  <td>63900</td>\r
+  <td>65769</td>\r
+  <td>67668</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Guiana</td>\r
+  <td>25</td>\r
+  <td>226</td>\r
+  <td>261</td>\r
+  <td>323</td>\r
+  <td>462</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Polynesia</td>\r
+  <td>61</td>\r
+  <td>269</td>\r
+  <td>289</td>\r
+  <td>318</td>\r
+  <td>354</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gabon</td>\r
+  <td>469</td>\r
+  <td>1475</td>\r
+  <td>1639</td>\r
+  <td>1915</td>\r
+  <td>2471</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gambia</td>\r
+  <td>258</td>\r
+  <td>1705</td>\r
+  <td>1985</td>\r
+  <td>2478</td>\r
+  <td>3763</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Georgia</td>\r
+  <td>3527</td>\r
+  <td>4260</td>\r
+  <td>4084</td>\r
+  <td>3888</td>\r
+  <td>3267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Germany</td>\r
+  <td>68376</td>\r
+  <td>82167</td>\r
+  <td>81346</td>\r
+  <td>79258</td>\r
+  <td>70504</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ghana</td>\r
+  <td>4981</td>\r
+  <td>23837</td>\r
+  <td>26925</td>\r
+  <td>32233</td>\r
+  <td>45213</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gibraltar</td>\r
+  <td>20</td>\r
+  <td>31</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>30</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greece</td>\r
+  <td>7566</td>\r
+  <td>11161</td>\r
+  <td>11261</td>\r
+  <td>11274</td>\r
+  <td>10939</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greenland</td>\r
+  <td>23</td>\r
+  <td>57</td>\r
+  <td>57</td>\r
+  <td>56</td>\r
+  <td>50</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Grenada</td>\r
+  <td>77</td>\r
+  <td>104</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guadeloupe</td>\r
+  <td>210</td>\r
+  <td>465</td>\r
+  <td>476</td>\r
+  <td>489</td>\r
+  <td>477</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guam</td>\r
+  <td>60</td>\r
+  <td>178</td>\r
+  <td>191</td>\r
+  <td>211</td>\r
+  <td>242</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guatemala</td>\r
+  <td>3146</td>\r
+  <td>14027</td>\r
+  <td>16227</td>\r
+  <td>19927</td>\r
+  <td>27480</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea</td>\r
+  <td>2619</td>\r
+  <td>10069</td>\r
+  <td>11844</td>\r
+  <td>15158</td>\r
+  <td>23975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea-Bissau</td>\r
+  <td>518</td>\r
+  <td>1611</td>\r
+  <td>1848</td>\r
+  <td>2296</td>\r
+  <td>3555</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guyana</td>\r
+  <td>423</td>\r
+  <td>762</td>\r
+  <td>754</td>\r
+  <td>732</td>\r
+  <td>558</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Haiti</td>\r
+  <td>3221</td>\r
+  <td>10033</td>\r
+  <td>10957</td>\r
+  <td>12476</td>\r
+  <td>15485</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Holy See</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Honduras</td>\r
+  <td>1487</td>\r
+  <td>7466</td>\r
+  <td>8386</td>\r
+  <td>9844</td>\r
+  <td>12402</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Hungary</td>\r
+  <td>9338</td>\r
+  <td>9993</td>\r
+  <td>9874</td>\r
+  <td>9647</td>\r
+  <td>8934</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iceland</td>\r
+  <td>143</td>\r
+  <td>323</td>\r
+  <td>353</td>\r
+  <td>384</td>\r
+  <td>407</td>\r
+ </tr>\r
+ <tr>\r
+  <td>India</td>\r
+  <td>371857</td>\r
+  <td>1198003</td>\r
+  <td>1294192</td>\r
+  <td>1431272</td>\r
+  <td>1613800</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Indonesia</td>\r
+  <td>77152</td>\r
+  <td>229965</td>\r
+  <td>244191</td>\r
+  <td>263287</td>\r
+  <td>288110</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iran (Islamic Republic of)</td>\r
+  <td>16913</td>\r
+  <td>74196</td>\r
+  <td>79454</td>\r
+  <td>87134</td>\r
+  <td>96975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iraq</td>\r
+  <td>5719</td>\r
+  <td>30747</td>\r
+  <td>35884</td>\r
+  <td>44692</td>\r
+  <td>63995</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ireland</td>\r
+  <td>2969</td>\r
+  <td>4515</td>\r
+  <td>4886</td>\r
+  <td>5370</td>\r
+  <td>6295</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Isle of Man</td>\r
+  <td>55</td>\r
+  <td>80</td>\r
+  <td>81</td>\r
+  <td>80</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Israel</td>\r
+  <td>1258</td>\r
+  <td>7170</td>\r
+  <td>7823</td>\r
+  <td>8769</td>\r
+  <td>10649</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Italy</td>\r
+  <td>46367</td>\r
+  <td>59870</td>\r
+  <td>60604</td>\r
+  <td>60018</td>\r
+  <td>57066</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jamaica</td>\r
+  <td>1403</td>\r
+  <td>2719</td>\r
+  <td>2786</td>\r
+  <td>2866</td>\r
+  <td>2683</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Japan</td>\r
+  <td>82824</td>\r
+  <td>127156</td>\r
+  <td>125791</td>\r
+  <td>120793</td>\r
+  <td>101659</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jordan</td>\r
+  <td>472</td>\r
+  <td>6316</td>\r
+  <td>6957</td>\r
+  <td>8088</td>\r
+  <td>10241</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kazakhstan</td>\r
+  <td>6703</td>\r
+  <td>15637</td>\r
+  <td>16289</td>\r
+  <td>17025</td>\r
+  <td>17848</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kenya</td>\r
+  <td>6077</td>\r
+  <td>39802</td>\r
+  <td>46433</td>\r
+  <td>57573</td>\r
+  <td>85410</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kiribati</td>\r
+  <td>26</td>\r
+  <td>98</td>\r
+  <td>107</td>\r
+  <td>123</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kuwait</td>\r
+  <td>152</td>\r
+  <td>2985</td>\r
+  <td>3378</td>\r
+  <td>3988</td>\r
+  <td>5240</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kyrgyzstan</td>\r
+  <td>1740</td>\r
+  <td>5482</td>\r
+  <td>5877</td>\r
+  <td>6378</td>\r
+  <td>6882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lao People's Dem. Republic</td>\r
+  <td>1666</td>\r
+  <td>6320</td>\r
+  <td>7028</td>\r
+  <td>8273</td>\r
+  <td>10744</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Latvia</td>\r
+  <td>1949</td>\r
+  <td>2249</td>\r
+  <td>2197</td>\r
+  <td>2101</td>\r
+  <td>1854</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lebanon</td>\r
+  <td>1443</td>\r
+  <td>4224</td>\r
+  <td>4426</td>\r
+  <td>4736</td>\r
+  <td>5033</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lesotho</td>\r
+  <td>734</td>\r
+  <td>2067</td>\r
+  <td>2168</td>\r
+  <td>2306</td>\r
+  <td>2491</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liberia</td>\r
+  <td>824</td>\r
+  <td>3955</td>\r
+  <td>4665</td>\r
+  <td>5858</td>\r
+  <td>8841</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Libyan Arab Jamahiriya</td>\r
+  <td>1029</td>\r
+  <td>6420</td>\r
+  <td>7158</td>\r
+  <td>8144</td>\r
+  <td>9819</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liechtenstein</td>\r
+  <td>14</td>\r
+  <td>36</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+  <td>45</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lithuania</td>\r
+  <td>2567</td>\r
+  <td>3287</td>\r
+  <td>3143</td>\r
+  <td>2985</td>\r
+  <td>2579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Luxembourg</td>\r
+  <td>296</td>\r
+  <td>486</td>\r
+  <td>520</td>\r
+  <td>582</td>\r
+  <td>733</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Madagascar</td>\r
+  <td>4084</td>\r
+  <td>19625</td>\r
+  <td>22853</td>\r
+  <td>28595</td>\r
+  <td>42693</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malawi</td>\r
+  <td>2881</td>\r
+  <td>15263</td>\r
+  <td>17998</td>\r
+  <td>23194</td>\r
+  <td>36575</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malaysia</td>\r
+  <td>6110</td>\r
+  <td>27468</td>\r
+  <td>30041</td>\r
+  <td>33770</td>\r
+  <td>39664</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Maldives</td>\r
+  <td>82</td>\r
+  <td>309</td>\r
+  <td>338</td>\r
+  <td>384</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mali</td>\r
+  <td>4268</td>\r
+  <td>13010</td>\r
+  <td>14993</td>\r
+  <td>18603</td>\r
+  <td>28260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malta</td>\r
+  <td>312</td>\r
+  <td>409</td>\r
+  <td>417</td>\r
+  <td>426</td>\r
+  <td>413</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Marshall Islands</td>\r
+  <td>13</td>\r
+  <td>62</td>\r
+  <td>70</td>\r
+  <td>79</td>\r
+  <td>92</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Martinique</td>\r
+  <td>222</td>\r
+  <td>405</td>\r
+  <td>411</td>\r
+  <td>418</td>\r
+  <td>393</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritania</td>\r
+  <td>651</td>\r
+  <td>3291</td>\r
+  <td>3732</td>\r
+  <td>4443</td>\r
+  <td>6061</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritius</td>\r
+  <td>493</td>\r
+  <td>1288</td>\r
+  <td>1337</td>\r
+  <td>1400</td>\r
+  <td>1426</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mayotte</td>\r
+  <td>15</td>\r
+  <td>194</td>\r
+  <td>224</td>\r
+  <td>277</td>\r
+  <td>386</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mexico</td>\r
+  <td>27741</td>\r
+  <td>109610</td>\r
+  <td>115528</td>\r
+  <td>123366</td>\r
+  <td>128964</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Micronesia (Fed. States of)</td>\r
+  <td>32</td>\r
+  <td>111</td>\r
+  <td>114</td>\r
+  <td>122</td>\r
+  <td>128</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Moldova (Republic of)</td>\r
+  <td>2341</td>\r
+  <td>3604</td>\r
+  <td>3462</td>\r
+  <td>3291</td>\r
+  <td>2734</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Monaco</td>\r
+  <td>20</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mongolia</td>\r
+  <td>761</td>\r
+  <td>2671</td>\r
+  <td>2855</td>\r
+  <td>3134</td>\r
+  <td>3446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montenegro</td>\r
+  <td>399</td>\r
+  <td>624</td>\r
+  <td>627</td>\r
+  <td>633</td>\r
+  <td>618</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montserrat</td>\r
+  <td>14</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>7</td>\r
+  <td>7</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Morocco</td>\r
+  <td>8953</td>\r
+  <td>31993</td>\r
+  <td>34330</td>\r
+  <td>37865</td>\r
+  <td>42583</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mozambique</td>\r
+  <td>6442</td>\r
+  <td>22894</td>\r
+  <td>25957</td>\r
+  <td>31190</td>\r
+  <td>44148</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Myanmar</td>\r
+  <td>17158</td>\r
+  <td>50020</td>\r
+  <td>53087</td>\r
+  <td>57585</td>\r
+  <td>63373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Namibia</td>\r
+  <td>485</td>\r
+  <td>2171</td>\r
+  <td>2412</td>\r
+  <td>2810</td>\r
+  <td>3588</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nauru</td>\r
+  <td>3</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nepal</td>\r
+  <td>8126</td>\r
+  <td>29331</td>\r
+  <td>32503</td>\r
+  <td>38031</td>\r
+  <td>49028</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands</td>\r
+  <td>10114</td>\r
+  <td>16592</td>\r
+  <td>16915</td>\r
+  <td>17348</td>\r
+  <td>17399</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands Antilles</td>\r
+  <td>112</td>\r
+  <td>198</td>\r
+  <td>207</td>\r
+  <td>210</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Caledonia</td>\r
+  <td>65</td>\r
+  <td>250</td>\r
+  <td>271</td>\r
+  <td>304</td>\r
+  <td>362</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Zealand</td>\r
+  <td>1908</td>\r
+  <td>4266</td>\r
+  <td>4492</td>\r
+  <td>4831</td>\r
+  <td>5349</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nicaragua</td>\r
+  <td>1295</td>\r
+  <td>5743</td>\r
+  <td>6265</td>\r
+  <td>7058</td>\r
+  <td>8143</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niger</td>\r
+  <td>2462</td>\r
+  <td>15290</td>\r
+  <td>19150</td>\r
+  <td>27388</td>\r
+  <td>58216</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nigeria</td>\r
+  <td>36680</td>\r
+  <td>154729</td>\r
+  <td>175928</td>\r
+  <td>210057</td>\r
+  <td>289083</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niue</td>\r
+  <td>5</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Northern Mariana Islands</td>\r
+  <td>7</td>\r
+  <td>87</td>\r
+  <td>96</td>\r
+  <td>111</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Norway</td>\r
+  <td>3265</td>\r
+  <td>4812</td>\r
+  <td>5036</td>\r
+  <td>5365</td>\r
+  <td>5947</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Occupied Palestinian Territory</td>\r
+  <td>1005</td>\r
+  <td>4277</td>\r
+  <td>5090</td>\r
+  <td>6553</td>\r
+  <td>10265</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Oman</td>\r
+  <td>456</td>\r
+  <td>2845</td>\r
+  <td>3198</td>\r
+  <td>3782</td>\r
+  <td>4878</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pakistan</td>\r
+  <td>41177</td>\r
+  <td>180808</td>\r
+  <td>205504</td>\r
+  <td>246286</td>\r
+  <td>335195</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Palau</td>\r
+  <td>7</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>23</td>\r
+  <td>26</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Panama</td>\r
+  <td>860</td>\r
+  <td>3454</td>\r
+  <td>3773</td>\r
+  <td>4267</td>\r
+  <td>5092</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Papua New Guinea</td>\r
+  <td>1798</td>\r
+  <td>6732</td>\r
+  <td>7678</td>\r
+  <td>9265</td>\r
+  <td>12871</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Paraguay</td>\r
+  <td>1473</td>\r
+  <td>6349</td>\r
+  <td>7007</td>\r
+  <td>8026</td>\r
+  <td>9867</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Peru</td>\r
+  <td>7632</td>\r
+  <td>29165</td>\r
+  <td>31197</td>\r
+  <td>34528</td>\r
+  <td>39776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Philippines</td>\r
+  <td>19996</td>\r
+  <td>91983</td>\r
+  <td>101734</td>\r
+  <td>117270</td>\r
+  <td>146156</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pitcairn</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Poland</td>\r
+  <td>24824</td>\r
+  <td>38074</td>\r
+  <td>37788</td>\r
+  <td>36964</td>\r
+  <td>32013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Portugal</td>\r
+  <td>8405</td>\r
+  <td>10707</td>\r
+  <td>10787</td>\r
+  <td>10706</td>\r
+  <td>10015</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Puerto Rico</td>\r
+  <td>2218</td>\r
+  <td>3982</td>\r
+  <td>4074</td>\r
+  <td>4176</td>\r
+  <td>4103</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Qatar</td>\r
+  <td>25</td>\r
+  <td>1409</td>\r
+  <td>1630</td>\r
+  <td>1848</td>\r
+  <td>2316</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Republic of Korea</td>\r
+  <td>19211</td>\r
+  <td>48333</td>\r
+  <td>49153</td>\r
+  <td>49484</td>\r
+  <td>44077</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Réunion</td>\r
+  <td>248</td>\r
+  <td>827</td>\r
+  <td>886</td>\r
+  <td>973</td>\r
+  <td>1096</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Romania</td>\r
+  <td>16311</td>\r
+  <td>21275</td>\r
+  <td>20787</td>\r
+  <td>19961</td>\r
+  <td>17279</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Russian Federation</td>\r
+  <td>102702</td>\r
+  <td>140874</td>\r
+  <td>137983</td>\r
+  <td>132345</td>\r
+  <td>116097</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Rwanda</td>\r
+  <td>2162</td>\r
+  <td>9998</td>\r
+  <td>11743</td>\r
+  <td>14676</td>\r
+  <td>22082</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Helena</td>\r
+  <td>5</td>\r
+  <td>4</td>\r
+  <td>4</td>\r
+  <td>5</td>\r
+  <td>5</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Kitts and Nevis</td>\r
+  <td>46</td>\r
+  <td>52</td>\r
+  <td>56</td>\r
+  <td>61</td>\r
+  <td>69</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Lucia</td>\r
+  <td>83</td>\r
+  <td>172</td>\r
+  <td>182</td>\r
+  <td>198</td>\r
+  <td>217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Pierre and Miquelon</td>\r
+  <td>5</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+ </tr>\r
+ <tr>\r
+  <td>St. Vincent and the Grenadines</td>\r
+  <td>67</td>\r
+  <td>109</td>\r
+  <td>110</td>\r
+  <td>111</td>\r
+  <td>119</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Samoa</td>\r
+  <td>82</td>\r
+  <td>179</td>\r
+  <td>181</td>\r
+  <td>188</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>San Marino</td>\r
+  <td>13</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sao Tome and Principe</td>\r
+  <td>60</td>\r
+  <td>163</td>\r
+  <td>180</td>\r
+  <td>216</td>\r
+  <td>296</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saudi Arabia</td>\r
+  <td>3201</td>\r
+  <td>25721</td>\r
+  <td>28933</td>\r
+  <td>34176</td>\r
+  <td>43658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Senegal</td>\r
+  <td>2416</td>\r
+  <td>12534</td>\r
+  <td>14526</td>\r
+  <td>17861</td>\r
+  <td>26102</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Serbia</td>\r
+  <td>6732</td>\r
+  <td>9850</td>\r
+  <td>9828</td>\r
+  <td>9720</td>\r
+  <td>9193</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Seychelles</td>\r
+  <td>36</td>\r
+  <td>84</td>\r
+  <td>86</td>\r
+  <td>91</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sierra Leone</td>\r
+  <td>1944</td>\r
+  <td>5696</td>\r
+  <td>6557</td>\r
+  <td>8112</td>\r
+  <td>12446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Singapore</td>\r
+  <td>1022</td>\r
+  <td>4737</td>\r
+  <td>5059</td>\r
+  <td>5362</td>\r
+  <td>5221</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovakia</td>\r
+  <td>3463</td>\r
+  <td>5406</td>\r
+  <td>5437</td>\r
+  <td>5413</td>\r
+  <td>4917</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovenia</td>\r
+  <td>1473</td>\r
+  <td>2020</td>\r
+  <td>2044</td>\r
+  <td>2050</td>\r
+  <td>1954</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Solomon Islands</td>\r
+  <td>90</td>\r
+  <td>523</td>\r
+  <td>599</td>\r
+  <td>725</td>\r
+  <td>1007</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Somalia</td>\r
+  <td>2264</td>\r
+  <td>9133</td>\r
+  <td>10731</td>\r
+  <td>13922</td>\r
+  <td>23522</td>\r
+ </tr>\r
+ <tr>\r
+  <td>South Africa</td>\r
+  <td>13683</td>\r
+  <td>50110</td>\r
+  <td>51684</td>\r
+  <td>53766</td>\r
+  <td>56802</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Spain</td>\r
+  <td>28009</td>\r
+  <td>44904</td>\r
+  <td>47203</td>\r
+  <td>49265</td>\r
+  <td>51260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sri Lanka</td>\r
+  <td>8241</td>\r
+  <td>20238</td>\r
+  <td>21167</td>\r
+  <td>22033</td>\r
+  <td>21705</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sudan</td>\r
+  <td>9190</td>\r
+  <td>42272</td>\r
+  <td>47730</td>\r
+  <td>56688</td>\r
+  <td>75884</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Suriname</td>\r
+  <td>215</td>\r
+  <td>520</td>\r
+  <td>547</td>\r
+  <td>586</td>\r
+  <td>619</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Swaziland</td>\r
+  <td>273</td>\r
+  <td>1185</td>\r
+  <td>1287</td>\r
+  <td>1455</td>\r
+  <td>1749</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sweden</td>\r
+  <td>7014</td>\r
+  <td>9249</td>\r
+  <td>9498</td>\r
+  <td>9915</td>\r
+  <td>10571</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Switzerland</td>\r
+  <td>4693</td>\r
+  <td>7568</td>\r
+  <td>7736</td>\r
+  <td>8020</td>\r
+  <td>8514</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Syrian Arab Republic</td>\r
+  <td>3536</td>\r
+  <td>21906</td>\r
+  <td>24494</td>\r
+  <td>28592</td>\r
+  <td>36911</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tajikistan</td>\r
+  <td>1532</td>\r
+  <td>6952</td>\r
+  <td>7761</td>\r
+  <td>9075</td>\r
+  <td>11111</td>\r
+ </tr>\r
+ <tr>\r
+  <td>TFYR Macedonia</td>\r
+  <td>1230</td>\r
+  <td>2042</td>\r
+  <td>2045</td>\r
+  <td>2037</td>\r
+  <td>1857</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Thailand</td>\r
+  <td>20607</td>\r
+  <td>67764</td>\r
+  <td>69939</td>\r
+  <td>72628</td>\r
+  <td>73361</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Timor-Leste</td>\r
+  <td>433</td>\r
+  <td>1134</td>\r
+  <td>1385</td>\r
+  <td>1869</td>\r
+  <td>3217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Togo</td>\r
+  <td>1329</td>\r
+  <td>6619</td>\r
+  <td>7607</td>\r
+  <td>9282</td>\r
+  <td>13196</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tokelau</td>\r
+  <td>2</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tonga</td>\r
+  <td>47</td>\r
+  <td>104</td>\r
+  <td>105</td>\r
+  <td>112</td>\r
+  <td>123</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Trinidad and Tobago</td>\r
+  <td>636</td>\r
+  <td>1339</td>\r
+  <td>1368</td>\r
+  <td>1388</td>\r
+  <td>1278</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tunisia</td>\r
+  <td>3530</td>\r
+  <td>10272</td>\r
+  <td>10884</td>\r
+  <td>11797</td>\r
+  <td>12711</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkey</td>\r
+  <td>21484</td>\r
+  <td>74816</td>\r
+  <td>79966</td>\r
+  <td>87364</td>\r
+  <td>97389</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkmenistan</td>\r
+  <td>1211</td>\r
+  <td>5110</td>\r
+  <td>5509</td>\r
+  <td>6072</td>\r
+  <td>6796</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turks and Caicos Islands</td>\r
+  <td>5</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tuvalu</td>\r
+  <td>5</td>\r
+  <td>10</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uganda</td>\r
+  <td>5158</td>\r
+  <td>32710</td>\r
+  <td>39710</td>\r
+  <td>53406</td>\r
+  <td>91271</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ukraine</td>\r
+  <td>37298</td>\r
+  <td>45708</td>\r
+  <td>44165</td>\r
+  <td>41617</td>\r
+  <td>35026</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Arab Emirates</td>\r
+  <td>70</td>\r
+  <td>4599</td>\r
+  <td>5193</td>\r
+  <td>6109</td>\r
+  <td>8253</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Kingdom</td>\r
+  <td>50616</td>\r
+  <td>61565</td>\r
+  <td>63528</td>\r
+  <td>66601</td>\r
+  <td>72365</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Republic of Tanzania</td>\r
+  <td>7650</td>\r
+  <td>43739</td>\r
+  <td>52109</td>\r
+  <td>67394</td>\r
+  <td>109450</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States of America</td>\r
+  <td>157813</td>\r
+  <td>314659</td>\r
+  <td>332334</td>\r
+  <td>358735</td>\r
+  <td>403932</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States Virgin Islands</td>\r
+  <td>27</td>\r
+  <td>110</td>\r
+  <td>108</td>\r
+  <td>103</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uruguay</td>\r
+  <td>2239</td>\r
+  <td>3361</td>\r
+  <td>3430</td>\r
+  <td>3546</td>\r
+  <td>3637</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uzbekistan</td>\r
+  <td>6314</td>\r
+  <td>27488</td>\r
+  <td>29456</td>\r
+  <td>32715</td>\r
+  <td>36439</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Vanuatu</td>\r
+  <td>48</td>\r
+  <td>240</td>\r
+  <td>276</td>\r
+  <td>338</td>\r
+  <td>482</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Venezuela (Bolivarian Republic of)</td>\r
+  <td>5094</td>\r
+  <td>28583</td>\r
+  <td>31292</td>\r
+  <td>35370</td>\r
+  <td>42042</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Viet Nam</td>\r
+  <td>27367</td>\r
+  <td>88069</td>\r
+  <td>93647</td>\r
+  <td>102054</td>\r
+  <td>111666</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Wallis and Futuna Islands</td>\r
+  <td>7</td>\r
+  <td>15</td>\r
+  <td>16</td>\r
+  <td>17</td>\r
+  <td>17</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Western Sahara</td>\r
+  <td>14</td>\r
+  <td>513</td>\r
+  <td>625</td>\r
+  <td>775</td>\r
+  <td>938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Yemen</td>\r
+  <td>4316</td>\r
+  <td>23580</td>\r
+  <td>27819</td>\r
+  <td>35509</td>\r
+  <td>53689</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zambia</td>\r
+  <td>2340</td>\r
+  <td>12935</td>\r
+  <td>14980</td>\r
+  <td>18890</td>\r
+  <td>28957</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zimbabwe</td>\r
+  <td>2747</td>\r
+  <td>12523</td>\r
+  <td>14029</td>\r
+  <td>16780</td>\r
+  <td>22178</td>\r
+ </tr>\r
+</tbody>\r
+</table>\r
+\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/asp/ex2editfilter.asp b/examples/asp/ex2editfilter.asp
new file mode 100644 (file)
index 0000000..90a9c51
--- /dev/null
@@ -0,0 +1,134 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<% Response.CacheControl = "no-cache" %>\r
+<% Response.AddHeader "Pragma", "no-cache" %> \r
+<% Response.Expires = -1 %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2 (editable)</title>\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoLiveGridForms.vbs" --> \r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridForms','Calendar','Tree');\r
+\r
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.\r
+\r
+function orders_FormInit() {\r
+  var cal=new Rico.CalendarControl("Cal");\r
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');\r
+  \r
+  var CustTree=new Rico.TreeControl("CustomerTree","CustTree.asp");\r
+  Rico.EditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');\r
+}\r
+</script>\r
+<style type="text/css">\r
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {\r
+       height:1.5em;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<%\r
+'************************************************************************************************************\r
+'  LiveGrid Plus-Edit Example\r
+'************************************************************************************************************\r
+'  Matt Brown\r
+'************************************************************************************************************\r
+\r
+if OpenGridForm(empty,"Orders") then\r
+  if oForm.action="table" then DisplayHeading\r
+  DefineFields\r
+end if\r
+CloseApp\r
+\r
+\r
+sub DisplayHeading()\r
+  response.write vbLf & "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>"\r
+  response.write vbLf & "Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>"\r
+  response.write vbLf & "<hr>The data on this grid can be edited using pop-up forms. "\r
+  response.write vbLf & "Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. "\r
+  response.write vbLf & "The Add and Edit forms are automatically generated by LiveGrid. "\r
+  response.write vbLf & "Notice on the Add form how you use the Rico Tree control to select the customer. "\r
+  response.write vbLf & "Notice on the Edit form how the Rico Calendar is used to change dates. "\r
+  response.write vbLf & "Updates are disabled on the database, so you will get an error message if you try to save."\r
+  response.write vbLf & "</td><td>"\r
+  response.write vbLf & "<script type='text/javascript'><!--"\r
+  response.write vbLf & "google_ad_client = 'pub-7218597156507462';"\r
+  response.write vbLf & "/* 125x125, created 5/11/09 */"\r
+  response.write vbLf & "google_ad_slot = '9298106441';"\r
+  response.write vbLf & "google_ad_width = 125;"\r
+  response.write vbLf & "google_ad_height = 125;"\r
+  response.write vbLf & "//-->"\r
+  response.write vbLf & "</script>"\r
+  response.write vbLf & "<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>"\r
+  response.write vbLf & "</td></tr></table>"\r
+  response.write vbLf & "<p><strong>Orders Table</strong></p>"\r
+end sub\r
+\r
+\r
+sub DefineFields()\r
+  dim colnum,LookupSQL\r
+  'oForm.options("showSaveMsg")="full"\r
+  'oForm.DebugFlag=true\r
+  oForm.options("FilterLocation")=-1\r
+  oForm.options("panelWidth")=500\r
+  oForm.options("frozenColumns")=1\r
+  oForm.options("menuEvent")="click"\r
+  oForm.options("highlightElem")="cursorRow"\r
+  \r
+  oForm.AddPanel "Basic Info"\r
+  oForm.AddEntryFieldW "OrderID","Order ID","B","<auto>",50\r
+  oForm.ConfirmDeleteColumn\r
+  oForm.SortAsc\r
+\r
+  LookupSQL="select CustomerID,CompanyName from Customers order by CompanyName"\r
+  oForm.AddLookupField "CustomerID",empty,"CustID","Customer","CL","",LookupSQL\r
+  oForm.LookupField("SelectCtl")="CustomerTree"\r
+  oForm.LookupField("InsertOnly")=true   ' do not allow customer to be changed once an order is entered\r
+  oForm.CurrentField("width")=160\r
+  oForm.CurrentField("filterUI")="t"\r
+\r
+  LookupSQL="select EmployeeID," & oDB.concat(Array("LastName","', '","FirstName"),false) & " from Employees order by LastName,FirstName"\r
+  oForm.AddLookupField "EmployeeID",empty,"EmployeeID","Sales Person","SL","",LookupSQL\r
+  oForm.CurrentField("width")=140\r
+  oForm.CurrentField("filterUI")="m"\r
+\r
+  oForm.AddEntryFieldW "OrderDate","Order Date","D",Date(),90\r
+  oForm.CurrentField("SelectCtl")="Cal"\r
+  oForm.AddEntryFieldW "RequiredDate","Required Date","D",Date(),90\r
+  oForm.CurrentField("SelectCtl")="Cal"\r
+  oForm.AddCalculatedField "select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID","Net Sale"\r
+  oForm.CurrentField("format")="DOLLAR"\r
+  oForm.CurrentField("width")=80\r
+\r
+  oForm.AddPanel "Ship To"\r
+  oForm.AddEntryFieldW "ShipName","Name","B","",140\r
+  oForm.AddEntryFieldW "ShipAddress","Address","B","",140\r
+  oForm.AddEntryFieldW "ShipCity","City","B","",120\r
+  oForm.CurrentField("filterUI")="m"\r
+  oForm.AddEntryFieldW "ShipRegion","Region","T","",60\r
+  oForm.AddEntryFieldW "ShipPostalCode","Postal Code","T","",100\r
+  \r
+  ' display ShipCountry with a link to wikipedia\r
+  colnum=oForm.AddEntryFieldW("ShipCountry","Country","N","",100)\r
+  oForm.CurrentField("control")="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{" & colnum & "}','_blank')"\r
+  oForm.CurrentField("filterUI")="s"\r
+\r
+  'oForm.AutoInit=false\r
+  oForm.DisplayPage\r
+end sub\r
+\r
+%>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/asp/ex2editfilterKW.asp b/examples/asp/ex2editfilterKW.asp
new file mode 100644 (file)
index 0000000..f63d8cc
--- /dev/null
@@ -0,0 +1,134 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<% Response.CacheControl = "no-cache" %>\r
+<% Response.AddHeader "Pragma", "no-cache" %> \r
+<% Response.Expires = -1 %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2 (editable)</title>\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoLiveGridForms.vbs" --> \r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridForms','Calendar','SearchBox');\r
+\r
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.\r
+\r
+function orders_FormInit() {\r
+  var cal=new Rico.CalendarControl("Cal");\r
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');\r
+  \r
+  var kwSearch=new Rico.KeywordSearch("CustomerSearch");\r
+  Rico.EditControls.register(kwSearch, Rico.imgDir+'dotbutton.gif');\r
+}\r
+</script>\r
+<style type="text/css">\r
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {\r
+       height:1.5em;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<%\r
+'************************************************************************************************************\r
+'  LiveGrid Plus-Edit Example\r
+'************************************************************************************************************\r
+'  Matt Brown\r
+'************************************************************************************************************\r
+\r
+if OpenGridForm(empty,"Orders") then\r
+  if oForm.action="table" then DisplayHeading\r
+  DefineFields\r
+end if\r
+CloseApp\r
+\r
+\r
+sub DisplayHeading()\r
+  response.write vbLf & "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>"\r
+  response.write vbLf & "Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>"\r
+  response.write vbLf & "<hr>The data on this grid can be edited using pop-up forms. "\r
+  response.write vbLf & "Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. "\r
+  response.write vbLf & "The Add and Edit forms are automatically generated by LiveGrid. "\r
+  response.write vbLf & "Notice on the Add form how you use the Rico Tree control to select the customer. "\r
+  response.write vbLf & "Notice on the Edit form how the Rico Calendar is used to change dates. "\r
+  response.write vbLf & "Updates are disabled on the database, so you will get an error message if you try to save."\r
+  response.write vbLf & "</td><td>"\r
+  response.write vbLf & "<script type='text/javascript'><!--"\r
+  response.write vbLf & "google_ad_client = 'pub-7218597156507462';"\r
+  response.write vbLf & "/* 125x125, created 5/11/09 */"\r
+  response.write vbLf & "google_ad_slot = '9298106441';"\r
+  response.write vbLf & "google_ad_width = 125;"\r
+  response.write vbLf & "google_ad_height = 125;"\r
+  response.write vbLf & "//-->"\r
+  response.write vbLf & "</script>"\r
+  response.write vbLf & "<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>"\r
+  response.write vbLf & "</td></tr></table>"\r
+  response.write vbLf & "<p><strong>Orders Table</strong></p>"\r
+end sub\r
+\r
+\r
+sub DefineFields()\r
+  dim colnum,LookupSQL\r
+  'oForm.options("showSaveMsg")="full"\r
+  'oForm.DebugFlag=true\r
+  oForm.options("FilterLocation")=-1\r
+  oForm.options("panelWidth")=500\r
+  oForm.options("frozenColumns")=1\r
+  oForm.options("menuEvent")="click"\r
+  oForm.options("highlightElem")="cursorRow"\r
+  \r
+  oForm.AddPanel "Basic Info"\r
+  oForm.AddEntryFieldW "OrderID","Order ID","B","<auto>",50\r
+  oForm.ConfirmDeleteColumn\r
+  oForm.SortAsc\r
+\r
+  LookupSQL="select CustomerID,CompanyName from Customers order by CompanyName"\r
+  oForm.AddLookupField "CustomerID",empty,"CustID","Customer","CL","",LookupSQL\r
+  oForm.LookupField("SelectCtl")="CustomerSearch"\r
+  oForm.LookupField("InsertOnly")=true   ' do not allow customer to be changed once an order is entered\r
+  oForm.CurrentField("width")=160\r
+  oForm.CurrentField("filterUI")="t"\r
+\r
+  LookupSQL="select EmployeeID," & oDB.concat(Array("LastName","', '","FirstName"),false) & " from Employees order by LastName,FirstName"\r
+  oForm.AddLookupField "EmployeeID",empty,"EmployeeID","Sales Person","SL","",LookupSQL\r
+  oForm.CurrentField("width")=140\r
+  oForm.CurrentField("filterUI")="m"\r
+\r
+  oForm.AddEntryFieldW "OrderDate","Order Date","D",Date(),90\r
+  oForm.CurrentField("SelectCtl")="Cal"\r
+  oForm.AddEntryFieldW "RequiredDate","Required Date","D",Date(),90\r
+  oForm.CurrentField("SelectCtl")="Cal"\r
+  oForm.AddCalculatedField "select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID","Net Sale"\r
+  oForm.CurrentField("format")="DOLLAR"\r
+  oForm.CurrentField("width")=80\r
+\r
+  oForm.AddPanel "Ship To"\r
+  oForm.AddEntryFieldW "ShipName","Name","B","",140\r
+  oForm.AddEntryFieldW "ShipAddress","Address","B","",140\r
+  oForm.AddEntryFieldW "ShipCity","City","B","",120\r
+  oForm.CurrentField("filterUI")="s"\r
+  oForm.AddEntryFieldW "ShipRegion","Region","T","",60\r
+  oForm.AddEntryFieldW "ShipPostalCode","Postal Code","T","",100\r
+  \r
+  ' display ShipCountry with a link to wikipedia\r
+  colnum=oForm.AddEntryFieldW("ShipCountry","Country","N","",100)\r
+  oForm.CurrentField("control")="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{" & colnum & "}','_blank')"\r
+  oForm.CurrentField("filterUI")="s"\r
+\r
+  'oForm.AutoInit=false\r
+  oForm.DisplayPage\r
+end sub\r
+\r
+%>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/asp/ex2json.asp b/examples/asp/ex2json.asp
new file mode 100644 (file)
index 0000000..bd8ecd5
--- /dev/null
@@ -0,0 +1,105 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2</title>\r
+\r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+<%\r
+Session.Timeout=60\r
+dim id\r
+id=trim(request.querystring("id"))\r
+sqltext="select OrderID,CustomerID,ShipName,ShipCity,ShipCountry,OrderDate,ShippedDate from orders order by OrderID"\r
+if len(id)=5 then sqltext=sqltext & " where CustomerID='" & id & "'"\r
+session.contents("ex2")=sqltext\r
+%>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var orderGrid,buffer;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs   : [,,,,,{type:'date'},{type:'date'}]\r
+  };\r
+  buffer=new Rico.Buffer.AjaxSQL('ricoQuery.asp', {fmt:'json', TimeOut:<%=Session.Timeout%>});\r
+  orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);\r
+  orderGrid.menu = new Rico.GridMenu({});\r
+});\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example uses AJAX to fetch order data, as required, from the server. \r
+Notice how the number of visible rows is set automatically based\r
+on the size of the window. Try the different grid styles that\r
+are available. \r
+Click on a cell to see available actions.\r
+<a href='ricoQuery.asp?id=ex2&offset=0&page_size=10&_fmt=json'>View the AJAX response (JSON)</a>\r
+(requires JSONview or similar extension in FF).\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id='ex2_timer' class='ricoSessionTimer'></span><span id="ex2_bookmark">&nbsp;</span></p>\r
+<table id="ex2" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+<colgroup>\r
+<col style='width:40px;' >\r
+<col style='width:60px;' >\r
+<col style='width:150px;'>\r
+<col style='width:80px;' >\r
+<col style='width:90px;' >\r
+<col style='width:100px;'>\r
+<col style='width:100px;'>\r
+</colgroup>\r
+  <tr id='ex2_main'>\r
+         <th>Order#</th>\r
+         <th>Customer#</th>\r
+         <th>Ship Name</th>\r
+         <th>Ship City</th>\r
+         <th>Ship Country</th>\r
+         <th>Order Date</th>\r
+         <th>Ship Date</th>\r
+  </tr>\r
+</table>\r
+<!--\r
+<textarea id='ex2_debugmsgs' rows='5' cols='80'></textarea>\r
+<script type='text/javascript'>\r
+Rico.setDebugArea('ex2_debugmsgs');\r
+</script>\r
+-->\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/asp/ex2nosession.asp b/examples/asp/ex2nosession.asp
new file mode 100644 (file)
index 0000000..7144bd0
--- /dev/null
@@ -0,0 +1,153 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<% Response.CacheControl = "no-cache" %>\r
+<% Response.AddHeader "Pragma", "no-cache" %> \r
+<% Response.Expires = -1 %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2 (editable)</title>\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoLiveGridForms.vbs" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoResponse.vbs" --> \r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<%\r
+'************************************************************************************************************\r
+'  LiveGrid Forms Example, without using session variables\r
+'************************************************************************************************************\r
+'  Matt Brown\r
+'************************************************************************************************************\r
+dim oXmlResp\r
+\r
+if OpenGridForm(empty,"Orders") then\r
+  select case oForm.action\r
+    case "table":\r
+      ' let rest of script be processed\r
+    case "query":\r
+      DefineFields\r
+      set oXmlResp=new ricoXmlResponse\r
+      oXmlResp.ProcessQuery oForm.gridID, oForm.SqlSelectData, Empty\r
+      set oXmlResp=Nothing\r
+      response.end\r
+    case else:\r
+      DefineFields\r
+      oForm.DisplayPage\r
+      response.end\r
+  end select\r
+end if\r
+%>\r
+\r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridForms','Calendar','Tree');\r
+\r
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.\r
+\r
+function orders_FormInit() {\r
+  var cal=new Rico.CalendarControl("Cal");\r
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');\r
+  \r
+  var CustTree=new Rico.TreeControl("CustomerTree","CustTree.asp");\r
+  Rico.EditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');\r
+}\r
+</script>\r
+<style type="text/css">\r
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {\r
+       height:1.5em;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>\r
+<hr>The data on this grid can be edited using pop-up forms. \r
+Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. \r
+The Add and Edit forms are automatically generated by LiveGrid. \r
+Notice on the Add form how you use the Rico Tree control to select the customer. \r
+Notice on the Edit form how the Rico Calendar is used to change dates. \r
+Updates are disabled on the database, so you will get an error message if you try to save.\r
+</td><td>\r
+<script type='text/javascript'><!--\r
+google_ad_client = 'pub-7218597156507462';\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = '9298106441';\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>\r
+</td></tr></table>\r
+\r
+<p><strong>Orders Table</strong></p>\r
+\r
+<%\r
+DefineFields\r
+oForm.DisplayPage\r
+'response.write "<p><textarea id='orders_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>"\r
+CloseApp\r
+\r
+\r
+sub DefineFields()\r
+  dim colnum,LookupSQL\r
+  'oForm.options("showSaveMsg")="full"\r
+  oForm.options("FilterLocation")=-1\r
+  'oForm.DebugFlag=true\r
+  oForm.options("panelWidth")=500\r
+  oForm.options("frozenColumns")=1\r
+  oForm.options("menuEvent")="click"\r
+  oForm.options("highlightElem")="cursorRow"\r
+  oForm.options("XMLprovider")=Request.ServerVariables("SCRIPT_NAME")\r
+  oForm.sessions=false\r
+  \r
+  oForm.AddPanel "Basic Info"\r
+  oForm.AddEntryFieldW "OrderID","Order ID","B","<auto>",50\r
+  oForm.ConfirmDeleteColumn\r
+  oForm.SortAsc\r
+\r
+  LookupSQL="select CustomerID,CompanyName from Customers order by CompanyName"\r
+  oForm.AddLookupField "CustomerID",empty,"CustID","Customer","CL","",LookupSQL\r
+  oForm.LookupField("SelectCtl")="CustomerTree"\r
+  oForm.LookupField("InsertOnly")=true   ' do not allow customer to be changed once an order is entered\r
+  oForm.CurrentField("width")=160\r
+  oForm.CurrentField("filterUI")="t"\r
+\r
+  LookupSQL="select EmployeeID," & oDB.concat(Array("LastName","', '","FirstName"),false) & " from Employees order by LastName,FirstName"\r
+  oForm.AddLookupField "EmployeeID",empty,"EmployeeID","Sales Person","SL","",LookupSQL\r
+  oForm.CurrentField("width")=140\r
+  oForm.CurrentField("filterUI")="m"\r
+\r
+  oForm.AddEntryFieldW "OrderDate","Order Date","D",Date(),90\r
+  oForm.CurrentField("SelectCtl")="Cal"\r
+  oForm.AddEntryFieldW "RequiredDate","Required Date","D",Date(),90\r
+  oForm.CurrentField("SelectCtl")="Cal"\r
+  oForm.AddCalculatedField "select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID","Net Sale"\r
+  oForm.CurrentField("format")="DOLLAR"\r
+  oForm.CurrentField("width")=80\r
+\r
+  oForm.AddPanel "Ship To"\r
+  oForm.AddEntryFieldW "ShipName","Name","B","",140\r
+  oForm.AddEntryFieldW "ShipAddress","Address","B","",140\r
+  oForm.AddEntryFieldW "ShipCity","City","B","",120\r
+  oForm.CurrentField("filterUI")="s"\r
+  oForm.AddEntryFieldW "ShipRegion","Region","T","",60\r
+  oForm.AddEntryFieldW "ShipPostalCode","Postal Code","T","",100\r
+  \r
+  ' display ShipCountry with a link to wikipedia\r
+  colnum=oForm.AddEntryFieldW("ShipCountry","Country","N","",100)\r
+  oForm.CurrentField("control")="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{" & colnum & "}','_blank')"\r
+  oForm.CurrentField("filterUI")="s"\r
+end sub\r
+\r
+%>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/asp/ex2xml.asp b/examples/asp/ex2xml.asp
new file mode 100644 (file)
index 0000000..ac60039
--- /dev/null
@@ -0,0 +1,104 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2</title>\r
+\r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+<%\r
+Session.Timeout=60\r
+dim id\r
+id=trim(request.querystring("id"))\r
+sqltext="select OrderID,CustomerID,ShipName,ShipCity,ShipCountry,OrderDate,ShippedDate from orders order by OrderID"\r
+if len(id)=5 then sqltext=sqltext & " where CustomerID='" & id & "'"\r
+session.contents("ex2")=sqltext\r
+%>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var orderGrid,buffer;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs   : [,,,,,{type:'date'},{type:'date'}]\r
+  };\r
+  buffer=new Rico.Buffer.AjaxSQL('ricoQuery.asp', {TimeOut:<%=Session.Timeout%>});\r
+  orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);\r
+  orderGrid.menu = new Rico.GridMenu({});\r
+});\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example uses AJAX to fetch order data, as required, from the server. \r
+Notice how the number of visible rows is set automatically based\r
+on the size of the window. Try the different grid styles that\r
+are available. \r
+Click on a cell to see available actions.\r
+<a href='ricoQuery.asp?id=ex2&offset=0&page_size=10&get_total=true'>View the AJAX response (XML)</a>.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id='ex2_timer' class='ricoSessionTimer'></span><span id="ex2_bookmark">&nbsp;</span></p>\r
+<table id="ex2" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+<colgroup>\r
+<col style='width:40px;' >\r
+<col style='width:60px;' >\r
+<col style='width:150px;'>\r
+<col style='width:80px;' >\r
+<col style='width:90px;' >\r
+<col style='width:100px;'>\r
+<col style='width:100px;'>\r
+</colgroup>\r
+  <tr id='ex2_main'>\r
+         <th>Order#</th>\r
+         <th>Customer#</th>\r
+         <th>Ship Name</th>\r
+         <th>Ship City</th>\r
+         <th>Ship Country</th>\r
+         <th>Order Date</th>\r
+         <th>Ship Date</th>\r
+  </tr>\r
+</table>\r
+<!--\r
+<textarea id='ex2_debugmsgs' rows='5' cols='80'></textarea>\r
+<script type='text/javascript'>\r
+Rico.setDebugArea('ex2_debugmsgs');\r
+</script>\r
+-->\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/asp/index.html b/examples/asp/index.html
new file mode 100644 (file)
index 0000000..14080b7
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\r
+<html>\r
+<HEAD>\r
+<title>Rico 3.0 ASP Examples</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+</HEAD>\r
+<frameset cols="300, *">\r
+  <frame name="menu" src="menu.html">\r
+  <frame name="content" src="../welcome.html" scrolling="yes">\r
+</frameset>\r
+</html>\r
diff --git a/examples/asp/menu.html b/examples/asp/menu.html
new file mode 100644 (file)
index 0000000..912856e
--- /dev/null
@@ -0,0 +1,188 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
+<html>\r
+<head>\r
+<title>Rico 3.0</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<base target="content">\r
+\r
+<script src="../../ricoClient/js/baselibs/prototype.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico2Proto.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<link href="../../ricoClient/css/rico.css" type="text/css" rel="stylesheet" />\r
+\r
+<script src="../menu.js" type="text/javascript"></script>\r
+<link href="../menu.css" type="text/css" rel="stylesheet">\r
+\r
+<!--[if lt IE 7]>\r
+  <style type="text/css">\r
+ul li {
+   height: 1%;\r
+}
+ </style>\r
+<![endif]-->\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<div id="menuheader">
+<p>Rico <span id='RicoVersion'></span> <span id='RicoDir'></span> Demo</p>\r
+</div>
+\r
+<div class='top'>\r
+<form action='' method='get' id='form1'>\r
+<ul>\r
+<li id='demolist'>Example: <span id='demospan'></span>\r
+<li>Theme: <span id='themespan'></span><input type='hidden' name='theme' id='theme' value=''>\r
+<li>Base Lib: <span id='libspan'></span><input type='hidden' name='lib' id='lib' value=''>\r
+<li><input type='checkbox' name='log'>&nbsp; Enable logging\r
+</ul>\r
+</form>\r
+</div>\r
+\r
+\r
+<div id="accordion1">\r
+\r
+<div>\r
+  <div>Choose the Example</div>\r
+  <div>\r
+<ul>\r
+<li><a id="demo_widgets.asp">Rico Widget Overview</a>\r
+<li><a id="demo_ex1.asp">LiveGrid sourced from HTML table</a>\r
+<li><a id="demo_ex2xml.asp">LiveGrid sourced from SQL database (xml)</a>\r
+<li><a id="demo_ex2json.asp">LiveGrid sourced from SQL database (json)</a>\r
+<li><a id="demo_ShipperEdit.asp">Editable LiveGrid (Shippers)</a>\r
+<li><a id="demo_ex2editfilter.asp">Editable LiveGrid (Orders)</a> - select customer on new order via tree\r
+<li><a id="demo_ex2editfilterKW.asp">Editable LiveGrid (Orders)</a> - select customer on new order via search box\r
+<li><a id="demo_ex2nosession.asp">Editable LiveGrid without session vars</a>\r
+<!--\r
+<li><a id="demo_photos.asp">LiveGrid sourced from flickr</a>\r
+-->\r
+<li><a id="demo_simplegrid.asp">SimpleGrid</a>\r
+<li><a id="demo_tree1.asp">Tree control</a>\r
+<li><a id="demo_RicoDbViewer.asp">Northwind data browser</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Theme</div>\r
+  <div>\r
+  <table border='0'>\r
+  <tr>\r
+  <td>Themeroller<br>Themes</td><td>Rico<br>Themes</td>\r
+  </tr>\r
+  <tr valign='top'>\r
+  <td>\r
+\r
+<ul>\r
+\r
+<li><a id="theme_j-ui-lightness"><img src="../images/themeroller/theme_30_ui_light.png" alt="UI Lightness" title="UI Lightness" />\r
+<br><span class="themeName">UI lightness</span></a></li>\r
+\r
+<li><a id="theme_j-ui-darkness"><img src="../images/themeroller/theme_30_ui_dark.png" alt="UI Darkness" title="UI Darkness" />\r
+<br><span class="themeName">UI darkness</span></a></li>\r
+\r
+<li><a id="theme_j-smoothness"><img src="../images/themeroller/theme_30_smoothness.png" alt="Smoothness" title="Smoothness" />\r
+<br><span class="themeName">Smoothness</span></a></li>\r
+\r
+<li><a id="theme_j-start"><img src="../images/themeroller/theme_30_start_menu.png" alt="Start" title="Start" />\r
+<br><span class="themeName">Start</span></a></li>\r
+\r
+<li><a id="theme_j-redmond"><img src="../images/themeroller/theme_30_windoze.png" alt="Redmond" title="Redmond" />\r
+<br><span class="themeName">Redmond</span></a></li>\r
+\r
+<li><a id="theme_j-sunny"><img src="../images/themeroller/theme_30_sunny.png" alt="Sunny" title="Sunny" />\r
+<br><span class="themeName">Sunny</span></a></li>\r
+\r
+<li><a  id="theme_j-overcast"><img src="../images/themeroller/theme_30_overcast.png" alt="Overcast" title="Overcast" />\r
+<br><span class="themeName">Overcast</span></a></li>\r
+\r
+<li><a  id="theme_j-le-frog"><img src="../images/themeroller/theme_30_le_frog.png" alt="Le Frog" title="Le Frog" />\r
+<br><span class="themeName">Le Frog</span></a></li>\r
+\r
+<li><a  id="theme_j-flick"><img src="../images/themeroller/theme_30_flick.png" alt="Flick" title="Flick" />\r
+<br><span class="themeName">Flick</span></a></li>\r
+\r
+<li><a  id="theme_j-pepper-grinder"><img src="../images/themeroller/theme_30_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" />\r
+<br><span class="themeName">Pepper Grinder</span></a></li>\r
+\r
+<li><a  id="theme_j-eggplant"><img src="../images/themeroller/theme_30_eggplant.png" alt="Eggplant" title="Eggplant" />\r
+<br><span class="themeName">Eggplant</span></a></li>\r
+\r
+<li><a  id="theme_j-dark-hive"><img src="../images/themeroller/theme_30_dark_hive.png" alt="Dark Hive" title="Dark Hive" />\r
+<br><span class="themeName">Dark Hive</span></a></li>\r
+\r
+<li><a  id="theme_j-cupertino"><img src="../images/themeroller/theme_30_cupertino.png" alt="Cupertino" title="Cupertino" />\r
+<br><span class="themeName">Cupertino</span></a></li>\r
+\r
+<li><a  id="theme_j-south-street"><img src="../images/themeroller/theme_30_south_street.png" alt="South St" title="South St" />\r
+<br><span class="themeName">South Street</span></a></li>\r
+\r
+<li><a  id="theme_j-blitzer"><img src="../images/themeroller/theme_30_blitzer.png" alt="Blitzer" title="Blitzer" />\r
+<br><span class="themeName">Blitzer</span></a></li>    \r
+\r
+<li><a  id="theme_j-humanity"><img src="../images/themeroller/theme_30_humanity.png" alt="Humanity" title="Humanity" />\r
+<br><span class="themeName">Humanity</span></a></li>\r
+\r
+<li><a  id="theme_j-hot-sneaks"><img src="../images/themeroller/theme_30_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" />\r
+<br><span class="themeName">Hot sneaks</span></a></li>\r
+\r
+<li><a  id="theme_j-excite-bike"><img src="../images/themeroller/theme_30_excite_bike.png" alt="Excite Bike" title="Excite Bike" />\r
+<br><span class="themeName">Excite Bike</span></a></li>\r
+\r
+<li><a  id="theme_j-vader"><img src="../images/themeroller/theme_30_black_matte.png" alt="Vader" title="Vader" />\r
+<br><span class="themeName">Vader</span></a></li>\r
+\r
+<li><a  id="theme_j-dot-luv"><img src="../images/themeroller/theme_30_dot_luv.png" alt="Dot Luv" title="Dot Luv" />\r
+<br><span class="themeName">Dot Luv</span></a></li>\r
+\r
+<li><a  id="theme_j-mint-choc"><img src="../images/themeroller/theme_30_mint_choco.png" alt="Mint Choc" title="Mint Choc" />\r
+<br><span class="themeName">Mint Choc</span></a></li>\r
+\r
+<li><a  id="theme_j-black-tie"><img src="../images/themeroller/theme_30_black_tie.png" alt="Black Tie" title="Black Tie" />\r
+<br><span class="themeName">Black Tie</span></a></li>\r
+\r
+<li><a  id="theme_j-trontastic"><img src="../images/themeroller/theme_30_trontastic.png" alt="Trontastic" title="Trontastic" />\r
+<br><span class="themeName">Trontastic</span></a></li>\r
+\r
+<li><a  id="theme_j-swanky-purse"><img src="../images/themeroller/theme_30_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" />\r
+<br><span class="themeName">Swanky Purse</span></a></li>\r
+\r
+</ul>\r
+\r
+    </td><td>\r
+\r
+    <ul>\r
+  <li><a id='theme_r-greenHdg'>Green Heading</a></li>\r
+  <li><a id='theme_r-warmfall'>Warm Fall</a></li>\r
+  <li><a id='theme_r-seaglass'>Sea Glass</a></li>\r
+  <li><a id='theme_r-coffee-with-milk'>Coffee with milk</a></li>\r
+  <li><a id='theme_r-grayedout'>Grayed out</a></li>\r
+    </ul>\r
+\r
+  </td>\r
+  </tr>\r
+  </table>\r
+\r
+\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Base Library</div>\r
+  <div>\r
+<ul>\r
+<li><a id='lib_proto'>Prototype</a>\r
+<li><a id='lib_jquery'>jQuery</a>\r
+<li><a id='lib_moo'>MooTools</a>\r
+<li><a id='lib_dojo'>dojo</a>\r
+<li><a id='lib_ext'>Ext</a>\r
+<li><a id='lib_glow'>Glow</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+</div>\r
+</body></html>\r
diff --git a/examples/asp/ricoQuery.asp b/examples/asp/ricoQuery.asp
new file mode 100644 (file)
index 0000000..65c902a
--- /dev/null
@@ -0,0 +1,22 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<% Session.Codepage=65001  ' ensure QueryString is interpreted as UTF-8 %>\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/ricoResponse.vbs" --> \r
+<%\r
+dim oXmlResp,id\r
+\r
+id=trim(Request.QueryString("id"))\r
+set oXmlResp=new ricoXmlResponse\r
+if IsEmpty(session.contents(id)) then\r
+  oXmlResp.ErrorResponse "Your connection with the server was idle for too long and timed out. Please refresh this page and try again."\r
+elseif not OpenDB then\r
+  oXmlResp.ErrorResponse server.htmlencode(oDB.LastErrorMsg)\r
+else\r
+  oXmlResp.SetDbConn oDB\r
+  oXmlResp.sendDebugMsgs=true\r
+  oXmlResp.ProcessQuery id, session.contents(id), session.contents(id & ".filters")\r
+end if\r
+CloseApp\r
+set oXmlResp=Nothing\r
+\r
+%>\r
diff --git a/examples/asp/simplegrid.asp b/examples/asp/simplegrid.asp
new file mode 100644 (file)
index 0000000..cc69d50
--- /dev/null
@@ -0,0 +1,195 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico SimpleGrid-Example 1</title>\r
+\r
+<!-- #INCLUDE FILE = "dbConnect.asp" --> \r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/SimpleGrid.vbs" -->\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('SimpleGrid');\r
+\r
+var ex1;\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    columnSpecs   : [{width:200},'specQty','specQty','specQty','specQty']\r
+  };\r
+  ex1=new Rico.SimpleGrid ('ex1', opts);\r
+  if (!Rico.isIE) document.getElementById('owc').disabled=true;\r
+});\r
+\r
+function ExportGridClient(ExportType) {\r
+  ex1.printVisible(ExportType);\r
+}\r
+\r
+function ExportGridServer(ExportType) {\r
+  if (Prototype.Browser.IE) {\r
+    location.href+='&fmt='+ExportType;\r
+  } else {\r
+    window.open(location.href+'&fmt='+ExportType);\r
+  }\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+.CatHead {\r
+  background:blue;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+.Subtotal {\r
+  background:#888;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+.GrandTotal {\r
+  background:black;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p><strong>Rico: SimpleGrid</strong></p>\r
+<p>Rico's SimpleGrid is an unbuffered grid - all data exists in the DOM.\r
+It shares many of the same characteristics as Rico's better known LiveGrid.\r
+SimpleGrids have resizable columns, frozen columns on the left, and can use the\r
+same CSS styling as LiveGrids. Sorting and filtering can also be enabled\r
+at the developer's discretion. Unlike LiveGrids, each cell in a SimpleGrid\r
+can be formatted individually.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<div>\r
+<button onclick="ExportGridClient('plain')">Export from client<br>to HTML Table</button>\r
+<button onclick="ExportGridClient('owc')" id="owc">Export from client<br>to OWC spreadsheet</button>\r
+<button onclick="ExportGridServer('xl')">Export from server<br>to Excel</button>\r
+<button onclick="ExportGridServer('csv')">Export from server<br>to CSV</button>\r
+</div>\r
+\r
+\r
+<%\r
+dim grid\r
+\r
+if not OpenDB then\r
+  response.write "<p>ERROR opening database!"\r
+else\r
+  set grid=new SimpleGrid  ' create instance of class\r
+  FillGrid\r
+  select case lcase(Request.QueryString("fmt"))\r
+    case "xl":  grid.RenderExcel "rico.xls"\r
+    case "csv": grid.RenderDelimited "rico.csv", ",", ""\r
+    case else:  grid.Render "ex1", 1   ' output html\r
+  end select\r
+  set grid=Nothing       ' clean up\r
+end if\r
+\r
+\r
+sub FillGrid()\r
+  dim rsMain,sqltext,category,lastCategory,Discounts,Gross,subtotals(1),grandtotals(1),i\r
\r
+  for i=0 to 1\r
+    grandtotals(i)=0\r
+  next\r
+\r
+  ' define heading\r
+  grid.AddHeadingRow true\r
+  grid.AddCell "Product"\r
+  grid.AddCell "Gross Sales"\r
+  grid.AddCell "Discounts"\r
+  grid.AddCell "Net Sales"\r
+  grid.AddCell "Avg Discount"\r
+\r
+  sqltext="select CategoryName,ProductName, " & _\r
+    "SUM(od.UnitPrice*Quantity) as GrossSales, " & _\r
+    "SUM(od.UnitPrice*Quantity*Discount) as Discounts " & _\r
+    "from ((Order_Details od " & _\r
+    "inner join Products p on p.ProductID=od.ProductID) " & _\r
+    "inner join Categories c on p.CategoryID=c.CategoryID) " & _\r
+    "group by CategoryName,ProductName " & _\r
+    "order by CategoryName,ProductName"\r
+  set rsMain = oDB.RunQuery(sqltext)\r
+  while not rsMain.eof\r
+    category=rsMain("CategoryName")\r
+    Gross=rsMain("GrossSales")\r
+    Discounts=rsMain("Discounts")\r
+    if category<>lastCategory then\r
+      if not IsEmpty(lastCategory) then\r
+        AddRow "Subtotal",subtotals(0),subtotals(1)\r
+        grid.SetRowAttr "class","Subtotal"\r
+      end if\r
+      grid.AddDataRow\r
+      grid.SetRowAttr "class","CatHead"\r
+      grid.AddCell category\r
+      grid.AddCell ""\r
+      grid.AddCell ""\r
+      grid.AddCell ""\r
+      grid.AddCell ""\r
+      for i=0 to 1\r
+        subtotals(i)=0\r
+      next\r
+      lastCategory=category\r
+    end if\r
+    subtotals(0)=subtotals(0)+Gross\r
+    grandtotals(0)=grandtotals(0)+Gross\r
+    subtotals(1)=subtotals(1)+Discounts\r
+    grandtotals(1)=grandtotals(1)+Discounts\r
+    AddRow rsMain("ProductName"),Gross,Discounts\r
+    rsMain.movenext\r
+  wend\r
+  oDB.rsClose rsMain\r
+  if not IsEmpty(lastCategory) then\r
+    AddRow "Subtotal",subtotals(0),subtotals(1)\r
+    grid.SetRowAttr "class","Subtotal"\r
+  end if\r
+  AddRow "Grand Total",grandtotals(0),grandtotals(1)\r
+  grid.SetRowAttr "class","GrandTotal"\r
+end sub\r
+\r
+\r
+sub AddRow(ProductName,Gross,Discounts)\r
+  grid.AddDataRow\r
+  grid.AddCell Server.HTMLencode(ProductName)\r
+  grid.AddCell "$" & FormatNumber(Gross,0,-1,0,-1)\r
+  grid.AddCell "$" & FormatNumber(Discounts,0,-1,0,-1)\r
+  grid.AddCell "$" & FormatNumber(Gross-Discounts,0,-1,0,-1)\r
+  grid.AddCell round(Discounts/Gross*100.0) & "%"\r
+end sub\r
+\r
+%>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/asp/tree1.asp b/examples/asp/tree1.asp
new file mode 100644 (file)
index 0000000..5d0bd1c
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico-Tree Control</title>\r
+
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Tree');\r
+var tree1;\r
+\r
+// initialize tree\r
+Rico.onLoad( function() {\r
+  tree1=new Rico.TreeControl("tree1", "CustTree.asp");\r
+  tree1.atLoad();\r
+  tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
+  Rico.eventBind('TreeButton1', 'click', Rico.eventHandle(window,'TreeClick1'));\r
+});\r
+\r
+function TreeClick1(e) {\r
+  if (Rico.visible(tree1.container)) {\r
+    tree1.close();\r
+  } else {\r
+    Rico.positionCtlOverIcon(tree1.container,Rico.$('TreeButton1'));\r
+    tree1.open();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+</script>\r
+
+</head>\r
+\r
+<body>
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p>This example demonstrates a basic, pop-up tree control where the tree nodes are loaded via AJAX.\r
+Only one item is selected from the tree at a time.\r
+Data is from the Northwind customer table.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<p><button id='TreeButton1'>Show Tree</button>\r
+<p><input type='text' id='TreeValue1' size='6'> (selected customer id)\r
+\r
+<pre style='border:1px solid black;padding:3px;font-size:8pt;'>\r
+Rico.onLoad( function() {\r
+  tree1=new Rico.TreeControl("tree1", "CustTree.asp");\r
+  tree1.atLoad();\r
+  tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
+});\r
+</pre>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/asp/widgets.asp b/examples/asp/widgets.asp
new file mode 100644 (file)
index 0000000..0574830
--- /dev/null
@@ -0,0 +1,2072 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\r
+<title>Rico widgets styled user-selectable themes</title>\r
+\r
+<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+\r
+<script>\r
+Rico.loadModule('LiveGridBasic','LiveGridMenu','Calendar');\r
+\r
+var dialog;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {\r
+    defaultWidth : 90,\r
+    useUnformattedColWidth: false,\r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    visibleRows   : 6,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs  : [{width:200},'specQty','specQty','specQty','specQty','specQty']\r
+  };\r
+  var ex1=new Rico.LiveGrid ('population', new Rico.Buffer.Base(document.getElementById('population').tBodies[0]), opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+  new Rico.Accordion( 'accExample', {panelHeight:160});\r
+  new Rico.TabbedPanel( 'tabsExample', {panelHeight:160});\r
+  var cal=new Rico.CalendarControl("ricoCal",{position:'relative'});\r
+  cal.atLoad();\r
+  cal.selectNow();\r
+  cal.openPopup();\r
+  var links=Rico.select('#themeGallery a');\r
+  for (var i=0; i<links.length; i++) {\r
+    links[i].onclick=themeClick;\r
+  }\r
+  dialog=new Rico.Window('',{height:'250px',width:'300px',overflow:'auto'}, 'dialog');\r
+});\r
+\r
+function openWindow(btn) {\r
+  dialog.openPopup();\r
+  Rico.positionCtlOverIcon(dialog.container,btn);\r
+}\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#accExample {\r
+  width: 350px;\r
+}\r
+#tabsExample {\r
+  width: 450px;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body style="font-size:80%;">\r
+  \r
+<table id='explanation' border='0' cellpadding='5' cellspacing='0' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example displays some of the widgets that come with Rico. \r
+The widgets are compatible with all base libraries and themes.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2 style='margin-bottom:1px;'>Rico LiveGrid</h2>\r
+<p style='margin-top:1px;'>Click on a cell to see available actions</p>\r
+\r
+<p class="ricoBookmark"><span id="population_bookmark">&nbsp;</span></p>\r
+<table class="ricoLiveGrid" id="population">\r
+<thead>\r
+ <tr>\r
+  <td class='ricoFrozen'></td>\r
+  <td colspan=5>Population (thousands)</td>\r
+ </tr>\r
+ <tr>\r
+  <td class='ricoFrozen'>Country or area</td>\r
+  <td>1950</td>\r
+  <td>2009</td>\r
+  <td>2015</td>\r
+  <td>2025</td>\r
+  <td>2050</td>\r
+ </tr>\r
+</thead>\r
+<tbody>\r
+ <tr>\r
+  <td>Afghanistan</td>\r
+  <td>8151</td>\r
+  <td>28150</td>\r
+  <td>34246</td>\r
+  <td>44970</td>\r
+  <td>73938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Albania</td>\r
+  <td>1215</td>\r
+  <td>3155</td>\r
+  <td>3256</td>\r
+  <td>3395</td>\r
+  <td>3303</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Algeria</td>\r
+  <td>8753</td>\r
+  <td>34895</td>\r
+  <td>38088</td>\r
+  <td>42882</td>\r
+  <td>49610</td>\r
+ </tr>\r
+ <tr>\r
+  <td>American Samoa</td>\r
+  <td>19</td>\r
+  <td>67</td>\r
+  <td>74</td>\r
+  <td>86</td>\r
+  <td>107</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Andorra</td>\r
+  <td>6</td>\r
+  <td>86</td>\r
+  <td>93</td>\r
+  <td>107</td>\r
+  <td>137</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Angola</td>\r
+  <td>4148</td>\r
+  <td>18498</td>\r
+  <td>21690</td>\r
+  <td>27441</td>\r
+  <td>42267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Anguilla</td>\r
+  <td>5</td>\r
+  <td>15</td>\r
+  <td>17</td>\r
+  <td>18</td>\r
+  <td>20</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Antigua and Barbuda</td>\r
+  <td>46</td>\r
+  <td>88</td>\r
+  <td>93</td>\r
+  <td>101</td>\r
+  <td>112</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Argentina</td>\r
+  <td>17150</td>\r
+  <td>40276</td>\r
+  <td>42548</td>\r
+  <td>45883</td>\r
+  <td>50943</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Armenia</td>\r
+  <td>1354</td>\r
+  <td>3083</td>\r
+  <td>3139</td>\r
+  <td>3181</td>\r
+  <td>3018</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Aruba</td>\r
+  <td>38</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>112</td>\r
+  <td>106</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Australia</td>\r
+  <td>8219</td>\r
+  <td>21293</td>\r
+  <td>22607</td>\r
+  <td>24703</td>\r
+  <td>28724</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Austria</td>\r
+  <td>6936</td>\r
+  <td>8364</td>\r
+  <td>8467</td>\r
+  <td>8600</td>\r
+  <td>8515</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Azerbaijan</td>\r
+  <td>2896</td>\r
+  <td>8832</td>\r
+  <td>9426</td>\r
+  <td>10128</td>\r
+  <td>10579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahamas</td>\r
+  <td>79</td>\r
+  <td>342</td>\r
+  <td>366</td>\r
+  <td>402</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahrain</td>\r
+  <td>116</td>\r
+  <td>791</td>\r
+  <td>882</td>\r
+  <td>1021</td>\r
+  <td>1277</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bangladesh</td>\r
+  <td>43595</td>\r
+  <td>162221</td>\r
+  <td>175217</td>\r
+  <td>195012</td>\r
+  <td>222495</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Barbados</td>\r
+  <td>211</td>\r
+  <td>256</td>\r
+  <td>260</td>\r
+  <td>262</td>\r
+  <td>237</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belarus</td>\r
+  <td>7745</td>\r
+  <td>9634</td>\r
+  <td>9355</td>\r
+  <td>8851</td>\r
+  <td>7275</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belgium</td>\r
+  <td>8628</td>\r
+  <td>10647</td>\r
+  <td>10878</td>\r
+  <td>11191</td>\r
+  <td>11493</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belize</td>\r
+  <td>69</td>\r
+  <td>307</td>\r
+  <td>344</td>\r
+  <td>404</td>\r
+  <td>506</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Benin</td>\r
+  <td>2050</td>\r
+  <td>8935</td>\r
+  <td>10647</td>\r
+  <td>13767</td>\r
+  <td>21982</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bermuda</td>\r
+  <td>37</td>\r
+  <td>65</td>\r
+  <td>65</td>\r
+  <td>66</td>\r
+  <td>63</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bhutan</td>\r
+  <td>168</td>\r
+  <td>697</td>\r
+  <td>770</td>\r
+  <td>865</td>\r
+  <td>1013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bolivia</td>\r
+  <td>2714</td>\r
+  <td>9863</td>\r
+  <td>10854</td>\r
+  <td>12368</td>\r
+  <td>14908</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bosnia and Herzegovina</td>\r
+  <td>2661</td>\r
+  <td>3767</td>\r
+  <td>3727</td>\r
+  <td>3608</td>\r
+  <td>3008</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Botswana</td>\r
+  <td>413</td>\r
+  <td>1950</td>\r
+  <td>2106</td>\r
+  <td>2337</td>\r
+  <td>2758</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brazil</td>\r
+  <td>53975</td>\r
+  <td>193734</td>\r
+  <td>202866</td>\r
+  <td>213802</td>\r
+  <td>218512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>British Virgin Islands</td>\r
+  <td>7</td>\r
+  <td>23</td>\r
+  <td>24</td>\r
+  <td>26</td>\r
+  <td>28</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brunei Darussalam</td>\r
+  <td>48</td>\r
+  <td>400</td>\r
+  <td>443</td>\r
+  <td>513</td>\r
+  <td>658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bulgaria</td>\r
+  <td>7251</td>\r
+  <td>7545</td>\r
+  <td>7263</td>\r
+  <td>6752</td>\r
+  <td>5392</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burkina Faso</td>\r
+  <td>4080</td>\r
+  <td>15757</td>\r
+  <td>19013</td>\r
+  <td>24837</td>\r
+  <td>40830</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burundi</td>\r
+  <td>2456</td>\r
+  <td>8303</td>\r
+  <td>9413</td>\r
+  <td>11161</td>\r
+  <td>14846</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cambodia</td>\r
+  <td>4346</td>\r
+  <td>14805</td>\r
+  <td>16357</td>\r
+  <td>18973</td>\r
+  <td>23795</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cameroon</td>\r
+  <td>4466</td>\r
+  <td>19522</td>\r
+  <td>22169</td>\r
+  <td>26478</td>\r
+  <td>36736</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Canada</td>\r
+  <td>13737</td>\r
+  <td>33573</td>\r
+  <td>35493</td>\r
+  <td>38659</td>\r
+  <td>44414</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cape Verde</td>\r
+  <td>146</td>\r
+  <td>506</td>\r
+  <td>548</td>\r
+  <td>616</td>\r
+  <td>703</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cayman Islands</td>\r
+  <td>7</td>\r
+  <td>56</td>\r
+  <td>59</td>\r
+  <td>63</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Central African Republic</td>\r
+  <td>1327</td>\r
+  <td>4422</td>\r
+  <td>4927</td>\r
+  <td>5747</td>\r
+  <td>7603</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chad</td>\r
+  <td>2429</td>\r
+  <td>11206</td>\r
+  <td>13120</td>\r
+  <td>16906</td>\r
+  <td>27776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Channel Islands</td>\r
+  <td>102</td>\r
+  <td>150</td>\r
+  <td>151</td>\r
+  <td>152</td>\r
+  <td>144</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chile</td>\r
+  <td>6082</td>\r
+  <td>16970</td>\r
+  <td>17926</td>\r
+  <td>19266</td>\r
+  <td>20657</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China</td>\r
+  <td>544951</td>\r
+  <td>1345751</td>\r
+  <td>1395998</td>\r
+  <td>1453140</td>\r
+  <td>1417045</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Hong Kong SAR</td>\r
+  <td>1974</td>\r
+  <td>7022</td>\r
+  <td>7398</td>\r
+  <td>7969</td>\r
+  <td>8623</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Macao SAR</td>\r
+  <td>190</td>\r
+  <td>538</td>\r
+  <td>568</td>\r
+  <td>603</td>\r
+  <td>593</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Colombia</td>\r
+  <td>12000</td>\r
+  <td>45660</td>\r
+  <td>49385</td>\r
+  <td>54920</td>\r
+  <td>62877</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Comoros</td>\r
+  <td>156</td>\r
+  <td>676</td>\r
+  <td>767</td>\r
+  <td>907</td>\r
+  <td>1226</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Congo</td>\r
+  <td>808</td>\r
+  <td>3683</td>\r
+  <td>4225</td>\r
+  <td>5094</td>\r
+  <td>6863</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cook Islands</td>\r
+  <td>15</td>\r
+  <td>20</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>24</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Costa Rica</td>\r
+  <td>966</td>\r
+  <td>4579</td>\r
+  <td>4957</td>\r
+  <td>5521</td>\r
+  <td>6373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Côte d'Ivoire</td>\r
+  <td>2505</td>\r
+  <td>21075</td>\r
+  <td>24210</td>\r
+  <td>29738</td>\r
+  <td>43373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Croatia</td>\r
+  <td>3850</td>\r
+  <td>4416</td>\r
+  <td>4370</td>\r
+  <td>4254</td>\r
+  <td>3825</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cuba</td>\r
+  <td>5920</td>\r
+  <td>11204</td>\r
+  <td>11213</td>\r
+  <td>11148</td>\r
+  <td>9725</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cyprus</td>\r
+  <td>494</td>\r
+  <td>871</td>\r
+  <td>925</td>\r
+  <td>1014</td>\r
+  <td>1175</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Czech Republic</td>\r
+  <td>8925</td>\r
+  <td>10369</td>\r
+  <td>10510</td>\r
+  <td>10573</td>\r
+  <td>10294</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. People's Rep. of Korea</td>\r
+  <td>9737</td>\r
+  <td>23906</td>\r
+  <td>24399</td>\r
+  <td>25128</td>\r
+  <td>24562</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. Republic of the Congo</td>\r
+  <td>12184</td>\r
+  <td>66020</td>\r
+  <td>77419</td>\r
+  <td>98123</td>\r
+  <td>147512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Denmark</td>\r
+  <td>4271</td>\r
+  <td>5470</td>\r
+  <td>5523</td>\r
+  <td>5590</td>\r
+  <td>5551</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Djibouti</td>\r
+  <td>62</td>\r
+  <td>864</td>\r
+  <td>953</td>\r
+  <td>1111</td>\r
+  <td>1469</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominica</td>\r
+  <td>51</td>\r
+  <td>67</td>\r
+  <td>67</td>\r
+  <td>68</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominican Republic</td>\r
+  <td>2427</td>\r
+  <td>10090</td>\r
+  <td>10867</td>\r
+  <td>11973</td>\r
+  <td>13441</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ecuador</td>\r
+  <td>3387</td>\r
+  <td>13625</td>\r
+  <td>14596</td>\r
+  <td>16074</td>\r
+  <td>17989</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Egypt</td>\r
+  <td>21514</td>\r
+  <td>82999</td>\r
+  <td>91778</td>\r
+  <td>104970</td>\r
+  <td>129533</td>\r
+ </tr>\r
+ <tr>\r
+  <td>El Salvador</td>\r
+  <td>2200</td>\r
+  <td>6163</td>\r
+  <td>6383</td>\r
+  <td>6895</td>\r
+  <td>7882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Equatorial Guinea</td>\r
+  <td>226</td>\r
+  <td>676</td>\r
+  <td>781</td>\r
+  <td>971</td>\r
+  <td>1445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Eritrea</td>\r
+  <td>1141</td>\r
+  <td>5073</td>\r
+  <td>6009</td>\r
+  <td>7404</td>\r
+  <td>10787</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Estonia</td>\r
+  <td>1101</td>\r
+  <td>1340</td>\r
+  <td>1337</td>\r
+  <td>1321</td>\r
+  <td>1233</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ethiopia</td>\r
+  <td>18434</td>\r
+  <td>82825</td>\r
+  <td>96237</td>\r
+  <td>119822</td>\r
+  <td>173811</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Faeroe Islands</td>\r
+  <td>32</td>\r
+  <td>50</td>\r
+  <td>52</td>\r
+  <td>55</td>\r
+  <td>58</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Falkland Islands (Malvinas)</td>\r
+  <td>2</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Fiji</td>\r
+  <td>289</td>\r
+  <td>849</td>\r
+  <td>874</td>\r
+  <td>905</td>\r
+  <td>910</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Finland</td>\r
+  <td>4009</td>\r
+  <td>5326</td>\r
+  <td>5432</td>\r
+  <td>5533</td>\r
+  <td>5445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>France</td>\r
+  <td>41832</td>\r
+  <td>62343</td>\r
+  <td>63900</td>\r
+  <td>65769</td>\r
+  <td>67668</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Guiana</td>\r
+  <td>25</td>\r
+  <td>226</td>\r
+  <td>261</td>\r
+  <td>323</td>\r
+  <td>462</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Polynesia</td>\r
+  <td>61</td>\r
+  <td>269</td>\r
+  <td>289</td>\r
+  <td>318</td>\r
+  <td>354</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gabon</td>\r
+  <td>469</td>\r
+  <td>1475</td>\r
+  <td>1639</td>\r
+  <td>1915</td>\r
+  <td>2471</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gambia</td>\r
+  <td>258</td>\r
+  <td>1705</td>\r
+  <td>1985</td>\r
+  <td>2478</td>\r
+  <td>3763</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Georgia</td>\r
+  <td>3527</td>\r
+  <td>4260</td>\r
+  <td>4084</td>\r
+  <td>3888</td>\r
+  <td>3267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Germany</td>\r
+  <td>68376</td>\r
+  <td>82167</td>\r
+  <td>81346</td>\r
+  <td>79258</td>\r
+  <td>70504</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ghana</td>\r
+  <td>4981</td>\r
+  <td>23837</td>\r
+  <td>26925</td>\r
+  <td>32233</td>\r
+  <td>45213</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gibraltar</td>\r
+  <td>20</td>\r
+  <td>31</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>30</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greece</td>\r
+  <td>7566</td>\r
+  <td>11161</td>\r
+  <td>11261</td>\r
+  <td>11274</td>\r
+  <td>10939</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greenland</td>\r
+  <td>23</td>\r
+  <td>57</td>\r
+  <td>57</td>\r
+  <td>56</td>\r
+  <td>50</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Grenada</td>\r
+  <td>77</td>\r
+  <td>104</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guadeloupe</td>\r
+  <td>210</td>\r
+  <td>465</td>\r
+  <td>476</td>\r
+  <td>489</td>\r
+  <td>477</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guam</td>\r
+  <td>60</td>\r
+  <td>178</td>\r
+  <td>191</td>\r
+  <td>211</td>\r
+  <td>242</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guatemala</td>\r
+  <td>3146</td>\r
+  <td>14027</td>\r
+  <td>16227</td>\r
+  <td>19927</td>\r
+  <td>27480</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea</td>\r
+  <td>2619</td>\r
+  <td>10069</td>\r
+  <td>11844</td>\r
+  <td>15158</td>\r
+  <td>23975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea-Bissau</td>\r
+  <td>518</td>\r
+  <td>1611</td>\r
+  <td>1848</td>\r
+  <td>2296</td>\r
+  <td>3555</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guyana</td>\r
+  <td>423</td>\r
+  <td>762</td>\r
+  <td>754</td>\r
+  <td>732</td>\r
+  <td>558</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Haiti</td>\r
+  <td>3221</td>\r
+  <td>10033</td>\r
+  <td>10957</td>\r
+  <td>12476</td>\r
+  <td>15485</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Holy See</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Honduras</td>\r
+  <td>1487</td>\r
+  <td>7466</td>\r
+  <td>8386</td>\r
+  <td>9844</td>\r
+  <td>12402</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Hungary</td>\r
+  <td>9338</td>\r
+  <td>9993</td>\r
+  <td>9874</td>\r
+  <td>9647</td>\r
+  <td>8934</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iceland</td>\r
+  <td>143</td>\r
+  <td>323</td>\r
+  <td>353</td>\r
+  <td>384</td>\r
+  <td>407</td>\r
+ </tr>\r
+ <tr>\r
+  <td>India</td>\r
+  <td>371857</td>\r
+  <td>1198003</td>\r
+  <td>1294192</td>\r
+  <td>1431272</td>\r
+  <td>1613800</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Indonesia</td>\r
+  <td>77152</td>\r
+  <td>229965</td>\r
+  <td>244191</td>\r
+  <td>263287</td>\r
+  <td>288110</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iran (Islamic Republic of)</td>\r
+  <td>16913</td>\r
+  <td>74196</td>\r
+  <td>79454</td>\r
+  <td>87134</td>\r
+  <td>96975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iraq</td>\r
+  <td>5719</td>\r
+  <td>30747</td>\r
+  <td>35884</td>\r
+  <td>44692</td>\r
+  <td>63995</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ireland</td>\r
+  <td>2969</td>\r
+  <td>4515</td>\r
+  <td>4886</td>\r
+  <td>5370</td>\r
+  <td>6295</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Isle of Man</td>\r
+  <td>55</td>\r
+  <td>80</td>\r
+  <td>81</td>\r
+  <td>80</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Israel</td>\r
+  <td>1258</td>\r
+  <td>7170</td>\r
+  <td>7823</td>\r
+  <td>8769</td>\r
+  <td>10649</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Italy</td>\r
+  <td>46367</td>\r
+  <td>59870</td>\r
+  <td>60604</td>\r
+  <td>60018</td>\r
+  <td>57066</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jamaica</td>\r
+  <td>1403</td>\r
+  <td>2719</td>\r
+  <td>2786</td>\r
+  <td>2866</td>\r
+  <td>2683</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Japan</td>\r
+  <td>82824</td>\r
+  <td>127156</td>\r
+  <td>125791</td>\r
+  <td>120793</td>\r
+  <td>101659</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jordan</td>\r
+  <td>472</td>\r
+  <td>6316</td>\r
+  <td>6957</td>\r
+  <td>8088</td>\r
+  <td>10241</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kazakhstan</td>\r
+  <td>6703</td>\r
+  <td>15637</td>\r
+  <td>16289</td>\r
+  <td>17025</td>\r
+  <td>17848</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kenya</td>\r
+  <td>6077</td>\r
+  <td>39802</td>\r
+  <td>46433</td>\r
+  <td>57573</td>\r
+  <td>85410</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kiribati</td>\r
+  <td>26</td>\r
+  <td>98</td>\r
+  <td>107</td>\r
+  <td>123</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kuwait</td>\r
+  <td>152</td>\r
+  <td>2985</td>\r
+  <td>3378</td>\r
+  <td>3988</td>\r
+  <td>5240</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kyrgyzstan</td>\r
+  <td>1740</td>\r
+  <td>5482</td>\r
+  <td>5877</td>\r
+  <td>6378</td>\r
+  <td>6882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lao People's Dem. Republic</td>\r
+  <td>1666</td>\r
+  <td>6320</td>\r
+  <td>7028</td>\r
+  <td>8273</td>\r
+  <td>10744</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Latvia</td>\r
+  <td>1949</td>\r
+  <td>2249</td>\r
+  <td>2197</td>\r
+  <td>2101</td>\r
+  <td>1854</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lebanon</td>\r
+  <td>1443</td>\r
+  <td>4224</td>\r
+  <td>4426</td>\r
+  <td>4736</td>\r
+  <td>5033</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lesotho</td>\r
+  <td>734</td>\r
+  <td>2067</td>\r
+  <td>2168</td>\r
+  <td>2306</td>\r
+  <td>2491</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liberia</td>\r
+  <td>824</td>\r
+  <td>3955</td>\r
+  <td>4665</td>\r
+  <td>5858</td>\r
+  <td>8841</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Libyan Arab Jamahiriya</td>\r
+  <td>1029</td>\r
+  <td>6420</td>\r
+  <td>7158</td>\r
+  <td>8144</td>\r
+  <td>9819</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liechtenstein</td>\r
+  <td>14</td>\r
+  <td>36</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+  <td>45</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lithuania</td>\r
+  <td>2567</td>\r
+  <td>3287</td>\r
+  <td>3143</td>\r
+  <td>2985</td>\r
+  <td>2579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Luxembourg</td>\r
+  <td>296</td>\r
+  <td>486</td>\r
+  <td>520</td>\r
+  <td>582</td>\r
+  <td>733</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Madagascar</td>\r
+  <td>4084</td>\r
+  <td>19625</td>\r
+  <td>22853</td>\r
+  <td>28595</td>\r
+  <td>42693</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malawi</td>\r
+  <td>2881</td>\r
+  <td>15263</td>\r
+  <td>17998</td>\r
+  <td>23194</td>\r
+  <td>36575</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malaysia</td>\r
+  <td>6110</td>\r
+  <td>27468</td>\r
+  <td>30041</td>\r
+  <td>33770</td>\r
+  <td>39664</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Maldives</td>\r
+  <td>82</td>\r
+  <td>309</td>\r
+  <td>338</td>\r
+  <td>384</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mali</td>\r
+  <td>4268</td>\r
+  <td>13010</td>\r
+  <td>14993</td>\r
+  <td>18603</td>\r
+  <td>28260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malta</td>\r
+  <td>312</td>\r
+  <td>409</td>\r
+  <td>417</td>\r
+  <td>426</td>\r
+  <td>413</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Marshall Islands</td>\r
+  <td>13</td>\r
+  <td>62</td>\r
+  <td>70</td>\r
+  <td>79</td>\r
+  <td>92</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Martinique</td>\r
+  <td>222</td>\r
+  <td>405</td>\r
+  <td>411</td>\r
+  <td>418</td>\r
+  <td>393</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritania</td>\r
+  <td>651</td>\r
+  <td>3291</td>\r
+  <td>3732</td>\r
+  <td>4443</td>\r
+  <td>6061</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritius</td>\r
+  <td>493</td>\r
+  <td>1288</td>\r
+  <td>1337</td>\r
+  <td>1400</td>\r
+  <td>1426</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mayotte</td>\r
+  <td>15</td>\r
+  <td>194</td>\r
+  <td>224</td>\r
+  <td>277</td>\r
+  <td>386</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mexico</td>\r
+  <td>27741</td>\r
+  <td>109610</td>\r
+  <td>115528</td>\r
+  <td>123366</td>\r
+  <td>128964</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Micronesia (Fed. States of)</td>\r
+  <td>32</td>\r
+  <td>111</td>\r
+  <td>114</td>\r
+  <td>122</td>\r
+  <td>128</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Moldova (Republic of)</td>\r
+  <td>2341</td>\r
+  <td>3604</td>\r
+  <td>3462</td>\r
+  <td>3291</td>\r
+  <td>2734</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Monaco</td>\r
+  <td>20</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mongolia</td>\r
+  <td>761</td>\r
+  <td>2671</td>\r
+  <td>2855</td>\r
+  <td>3134</td>\r
+  <td>3446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montenegro</td>\r
+  <td>399</td>\r
+  <td>624</td>\r
+  <td>627</td>\r
+  <td>633</td>\r
+  <td>618</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montserrat</td>\r
+  <td>14</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>7</td>\r
+  <td>7</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Morocco</td>\r
+  <td>8953</td>\r
+  <td>31993</td>\r
+  <td>34330</td>\r
+  <td>37865</td>\r
+  <td>42583</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mozambique</td>\r
+  <td>6442</td>\r
+  <td>22894</td>\r
+  <td>25957</td>\r
+  <td>31190</td>\r
+  <td>44148</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Myanmar</td>\r
+  <td>17158</td>\r
+  <td>50020</td>\r
+  <td>53087</td>\r
+  <td>57585</td>\r
+  <td>63373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Namibia</td>\r
+  <td>485</td>\r
+  <td>2171</td>\r
+  <td>2412</td>\r
+  <td>2810</td>\r
+  <td>3588</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nauru</td>\r
+  <td>3</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nepal</td>\r
+  <td>8126</td>\r
+  <td>29331</td>\r
+  <td>32503</td>\r
+  <td>38031</td>\r
+  <td>49028</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands</td>\r
+  <td>10114</td>\r
+  <td>16592</td>\r
+  <td>16915</td>\r
+  <td>17348</td>\r
+  <td>17399</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands Antilles</td>\r
+  <td>112</td>\r
+  <td>198</td>\r
+  <td>207</td>\r
+  <td>210</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Caledonia</td>\r
+  <td>65</td>\r
+  <td>250</td>\r
+  <td>271</td>\r
+  <td>304</td>\r
+  <td>362</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Zealand</td>\r
+  <td>1908</td>\r
+  <td>4266</td>\r
+  <td>4492</td>\r
+  <td>4831</td>\r
+  <td>5349</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nicaragua</td>\r
+  <td>1295</td>\r
+  <td>5743</td>\r
+  <td>6265</td>\r
+  <td>7058</td>\r
+  <td>8143</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niger</td>\r
+  <td>2462</td>\r
+  <td>15290</td>\r
+  <td>19150</td>\r
+  <td>27388</td>\r
+  <td>58216</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nigeria</td>\r
+  <td>36680</td>\r
+  <td>154729</td>\r
+  <td>175928</td>\r
+  <td>210057</td>\r
+  <td>289083</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niue</td>\r
+  <td>5</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Northern Mariana Islands</td>\r
+  <td>7</td>\r
+  <td>87</td>\r
+  <td>96</td>\r
+  <td>111</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Norway</td>\r
+  <td>3265</td>\r
+  <td>4812</td>\r
+  <td>5036</td>\r
+  <td>5365</td>\r
+  <td>5947</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Occupied Palestinian Territory</td>\r
+  <td>1005</td>\r
+  <td>4277</td>\r
+  <td>5090</td>\r
+  <td>6553</td>\r
+  <td>10265</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Oman</td>\r
+  <td>456</td>\r
+  <td>2845</td>\r
+  <td>3198</td>\r
+  <td>3782</td>\r
+  <td>4878</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pakistan</td>\r
+  <td>41177</td>\r
+  <td>180808</td>\r
+  <td>205504</td>\r
+  <td>246286</td>\r
+  <td>335195</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Palau</td>\r
+  <td>7</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>23</td>\r
+  <td>26</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Panama</td>\r
+  <td>860</td>\r
+  <td>3454</td>\r
+  <td>3773</td>\r
+  <td>4267</td>\r
+  <td>5092</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Papua New Guinea</td>\r
+  <td>1798</td>\r
+  <td>6732</td>\r
+  <td>7678</td>\r
+  <td>9265</td>\r
+  <td>12871</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Paraguay</td>\r
+  <td>1473</td>\r
+  <td>6349</td>\r
+  <td>7007</td>\r
+  <td>8026</td>\r
+  <td>9867</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Peru</td>\r
+  <td>7632</td>\r
+  <td>29165</td>\r
+  <td>31197</td>\r
+  <td>34528</td>\r
+  <td>39776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Philippines</td>\r
+  <td>19996</td>\r
+  <td>91983</td>\r
+  <td>101734</td>\r
+  <td>117270</td>\r
+  <td>146156</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pitcairn</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Poland</td>\r
+  <td>24824</td>\r
+  <td>38074</td>\r
+  <td>37788</td>\r
+  <td>36964</td>\r
+  <td>32013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Portugal</td>\r
+  <td>8405</td>\r
+  <td>10707</td>\r
+  <td>10787</td>\r
+  <td>10706</td>\r
+  <td>10015</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Puerto Rico</td>\r
+  <td>2218</td>\r
+  <td>3982</td>\r
+  <td>4074</td>\r
+  <td>4176</td>\r
+  <td>4103</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Qatar</td>\r
+  <td>25</td>\r
+  <td>1409</td>\r
+  <td>1630</td>\r
+  <td>1848</td>\r
+  <td>2316</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Republic of Korea</td>\r
+  <td>19211</td>\r
+  <td>48333</td>\r
+  <td>49153</td>\r
+  <td>49484</td>\r
+  <td>44077</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Réunion</td>\r
+  <td>248</td>\r
+  <td>827</td>\r
+  <td>886</td>\r
+  <td>973</td>\r
+  <td>1096</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Romania</td>\r
+  <td>16311</td>\r
+  <td>21275</td>\r
+  <td>20787</td>\r
+  <td>19961</td>\r
+  <td>17279</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Russian Federation</td>\r
+  <td>102702</td>\r
+  <td>140874</td>\r
+  <td>137983</td>\r
+  <td>132345</td>\r
+  <td>116097</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Rwanda</td>\r
+  <td>2162</td>\r
+  <td>9998</td>\r
+  <td>11743</td>\r
+  <td>14676</td>\r
+  <td>22082</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Helena</td>\r
+  <td>5</td>\r
+  <td>4</td>\r
+  <td>4</td>\r
+  <td>5</td>\r
+  <td>5</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Kitts and Nevis</td>\r
+  <td>46</td>\r
+  <td>52</td>\r
+  <td>56</td>\r
+  <td>61</td>\r
+  <td>69</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Lucia</td>\r
+  <td>83</td>\r
+  <td>172</td>\r
+  <td>182</td>\r
+  <td>198</td>\r
+  <td>217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Pierre and Miquelon</td>\r
+  <td>5</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+ </tr>\r
+ <tr>\r
+  <td>St. Vincent and the Grenadines</td>\r
+  <td>67</td>\r
+  <td>109</td>\r
+  <td>110</td>\r
+  <td>111</td>\r
+  <td>119</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Samoa</td>\r
+  <td>82</td>\r
+  <td>179</td>\r
+  <td>181</td>\r
+  <td>188</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>San Marino</td>\r
+  <td>13</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sao Tome and Principe</td>\r
+  <td>60</td>\r
+  <td>163</td>\r
+  <td>180</td>\r
+  <td>216</td>\r
+  <td>296</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saudi Arabia</td>\r
+  <td>3201</td>\r
+  <td>25721</td>\r
+  <td>28933</td>\r
+  <td>34176</td>\r
+  <td>43658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Senegal</td>\r
+  <td>2416</td>\r
+  <td>12534</td>\r
+  <td>14526</td>\r
+  <td>17861</td>\r
+  <td>26102</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Serbia</td>\r
+  <td>6732</td>\r
+  <td>9850</td>\r
+  <td>9828</td>\r
+  <td>9720</td>\r
+  <td>9193</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Seychelles</td>\r
+  <td>36</td>\r
+  <td>84</td>\r
+  <td>86</td>\r
+  <td>91</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sierra Leone</td>\r
+  <td>1944</td>\r
+  <td>5696</td>\r
+  <td>6557</td>\r
+  <td>8112</td>\r
+  <td>12446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Singapore</td>\r
+  <td>1022</td>\r
+  <td>4737</td>\r
+  <td>5059</td>\r
+  <td>5362</td>\r
+  <td>5221</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovakia</td>\r
+  <td>3463</td>\r
+  <td>5406</td>\r
+  <td>5437</td>\r
+  <td>5413</td>\r
+  <td>4917</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovenia</td>\r
+  <td>1473</td>\r
+  <td>2020</td>\r
+  <td>2044</td>\r
+  <td>2050</td>\r
+  <td>1954</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Solomon Islands</td>\r
+  <td>90</td>\r
+  <td>523</td>\r
+  <td>599</td>\r
+  <td>725</td>\r
+  <td>1007</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Somalia</td>\r
+  <td>2264</td>\r
+  <td>9133</td>\r
+  <td>10731</td>\r
+  <td>13922</td>\r
+  <td>23522</td>\r
+ </tr>\r
+ <tr>\r
+  <td>South Africa</td>\r
+  <td>13683</td>\r
+  <td>50110</td>\r
+  <td>51684</td>\r
+  <td>53766</td>\r
+  <td>56802</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Spain</td>\r
+  <td>28009</td>\r
+  <td>44904</td>\r
+  <td>47203</td>\r
+  <td>49265</td>\r
+  <td>51260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sri Lanka</td>\r
+  <td>8241</td>\r
+  <td>20238</td>\r
+  <td>21167</td>\r
+  <td>22033</td>\r
+  <td>21705</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sudan</td>\r
+  <td>9190</td>\r
+  <td>42272</td>\r
+  <td>47730</td>\r
+  <td>56688</td>\r
+  <td>75884</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Suriname</td>\r
+  <td>215</td>\r
+  <td>520</td>\r
+  <td>547</td>\r
+  <td>586</td>\r
+  <td>619</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Swaziland</td>\r
+  <td>273</td>\r
+  <td>1185</td>\r
+  <td>1287</td>\r
+  <td>1455</td>\r
+  <td>1749</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sweden</td>\r
+  <td>7014</td>\r
+  <td>9249</td>\r
+  <td>9498</td>\r
+  <td>9915</td>\r
+  <td>10571</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Switzerland</td>\r
+  <td>4693</td>\r
+  <td>7568</td>\r
+  <td>7736</td>\r
+  <td>8020</td>\r
+  <td>8514</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Syrian Arab Republic</td>\r
+  <td>3536</td>\r
+  <td>21906</td>\r
+  <td>24494</td>\r
+  <td>28592</td>\r
+  <td>36911</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tajikistan</td>\r
+  <td>1532</td>\r
+  <td>6952</td>\r
+  <td>7761</td>\r
+  <td>9075</td>\r
+  <td>11111</td>\r
+ </tr>\r
+ <tr>\r
+  <td>TFYR Macedonia</td>\r
+  <td>1230</td>\r
+  <td>2042</td>\r
+  <td>2045</td>\r
+  <td>2037</td>\r
+  <td>1857</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Thailand</td>\r
+  <td>20607</td>\r
+  <td>67764</td>\r
+  <td>69939</td>\r
+  <td>72628</td>\r
+  <td>73361</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Timor-Leste</td>\r
+  <td>433</td>\r
+  <td>1134</td>\r
+  <td>1385</td>\r
+  <td>1869</td>\r
+  <td>3217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Togo</td>\r
+  <td>1329</td>\r
+  <td>6619</td>\r
+  <td>7607</td>\r
+  <td>9282</td>\r
+  <td>13196</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tokelau</td>\r
+  <td>2</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tonga</td>\r
+  <td>47</td>\r
+  <td>104</td>\r
+  <td>105</td>\r
+  <td>112</td>\r
+  <td>123</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Trinidad and Tobago</td>\r
+  <td>636</td>\r
+  <td>1339</td>\r
+  <td>1368</td>\r
+  <td>1388</td>\r
+  <td>1278</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tunisia</td>\r
+  <td>3530</td>\r
+  <td>10272</td>\r
+  <td>10884</td>\r
+  <td>11797</td>\r
+  <td>12711</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkey</td>\r
+  <td>21484</td>\r
+  <td>74816</td>\r
+  <td>79966</td>\r
+  <td>87364</td>\r
+  <td>97389</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkmenistan</td>\r
+  <td>1211</td>\r
+  <td>5110</td>\r
+  <td>5509</td>\r
+  <td>6072</td>\r
+  <td>6796</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turks and Caicos Islands</td>\r
+  <td>5</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tuvalu</td>\r
+  <td>5</td>\r
+  <td>10</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uganda</td>\r
+  <td>5158</td>\r
+  <td>32710</td>\r
+  <td>39710</td>\r
+  <td>53406</td>\r
+  <td>91271</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ukraine</td>\r
+  <td>37298</td>\r
+  <td>45708</td>\r
+  <td>44165</td>\r
+  <td>41617</td>\r
+  <td>35026</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Arab Emirates</td>\r
+  <td>70</td>\r
+  <td>4599</td>\r
+  <td>5193</td>\r
+  <td>6109</td>\r
+  <td>8253</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Kingdom</td>\r
+  <td>50616</td>\r
+  <td>61565</td>\r
+  <td>63528</td>\r
+  <td>66601</td>\r
+  <td>72365</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Republic of Tanzania</td>\r
+  <td>7650</td>\r
+  <td>43739</td>\r
+  <td>52109</td>\r
+  <td>67394</td>\r
+  <td>109450</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States of America</td>\r
+  <td>157813</td>\r
+  <td>314659</td>\r
+  <td>332334</td>\r
+  <td>358735</td>\r
+  <td>403932</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States Virgin Islands</td>\r
+  <td>27</td>\r
+  <td>110</td>\r
+  <td>108</td>\r
+  <td>103</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uruguay</td>\r
+  <td>2239</td>\r
+  <td>3361</td>\r
+  <td>3430</td>\r
+  <td>3546</td>\r
+  <td>3637</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uzbekistan</td>\r
+  <td>6314</td>\r
+  <td>27488</td>\r
+  <td>29456</td>\r
+  <td>32715</td>\r
+  <td>36439</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Vanuatu</td>\r
+  <td>48</td>\r
+  <td>240</td>\r
+  <td>276</td>\r
+  <td>338</td>\r
+  <td>482</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Venezuela (Bolivarian Republic of)</td>\r
+  <td>5094</td>\r
+  <td>28583</td>\r
+  <td>31292</td>\r
+  <td>35370</td>\r
+  <td>42042</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Viet Nam</td>\r
+  <td>27367</td>\r
+  <td>88069</td>\r
+  <td>93647</td>\r
+  <td>102054</td>\r
+  <td>111666</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Wallis and Futuna Islands</td>\r
+  <td>7</td>\r
+  <td>15</td>\r
+  <td>16</td>\r
+  <td>17</td>\r
+  <td>17</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Western Sahara</td>\r
+  <td>14</td>\r
+  <td>513</td>\r
+  <td>625</td>\r
+  <td>775</td>\r
+  <td>938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Yemen</td>\r
+  <td>4316</td>\r
+  <td>23580</td>\r
+  <td>27819</td>\r
+  <td>35509</td>\r
+  <td>53689</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zambia</td>\r
+  <td>2340</td>\r
+  <td>12935</td>\r
+  <td>14980</td>\r
+  <td>18890</td>\r
+  <td>28957</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zimbabwe</td>\r
+  <td>2747</td>\r
+  <td>12523</td>\r
+  <td>14029</td>\r
+  <td>16780</td>\r
+  <td>22178</td>\r
+ </tr>\r
+</tbody>\r
+</table>\r
+\r
+<p style='font-size:smaller;'>Data source: <a href="http://www.un.org/esa/population/unpop.htm">Population Division of the \r
+Department of Economic and Social Affairs of the United Nations Secretariat</a> (2009). \r
+<em>World Population Prospects: The 2008 Revision. Highlights.</em> New York: United Nations.  </p>                            \r
+\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Accordion</h2>\r
+\r
+<div id="accExample">\r
+\r
+   <div>\r
+     <div>Stanza 1</div>\r
+     <div>\r
+<p>Two roads diverged in a yellow wood,\r
+<br>And sorry I could not travel both\r
+<br>And be one traveler, long I stood\r
+<br>And looked down one as far as I could\r
+<br>To where it bent in the undergrowth.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 2</div>\r
+     <div>\r
+<p>Then took the other, as just as fair,\r
+<br>And having perhaps the better claim,\r
+<br>Because it was grassy and wanted wear;\r
+<br>Though as for that the passing there\r
+<br>Had worn them really about the same.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 3</div>\r
+     <div>\r
+<p>And both that morning equally lay\r
+<br>In leaves no step had trodden black.\r
+<br>Oh, I kept the first for another day!\r
+<br>Yet knowing how way leads on to way,\r
+<br>I doubted if I should ever come back.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 4</div>\r
+     <div>\r
+<p>I shall be telling this with a sigh\r
+<br>Somewhere ages and ages hence:\r
+<br>Two roads diverged in a wood, and I--\r
+<br>I took the one less traveled by,\r
+<br>And that has made all the difference.\r
+<p style='font-size:9pt;'><strong>Robert Frost: The Road Not Taken (1915)</strong>\r
+     </div>\r
+  </div>\r
+\r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Tabbed Panel</h2>\r
+\r
+<div id="tabsExample">\r
+   <ul>\r
+     <li>Stanza 1</li>\r
+     <li>Stanza 2</li>\r
+     <li>Stanza 3</li>\r
+     <li>Stanza 4</li>\r
+   </ul>\r
+\r
+   <div>\r
+     <div>\r
+<p>Two roads diverged in a yellow wood,\r
+<br>And sorry I could not travel both\r
+<br>And be one traveler, long I stood\r
+<br>And looked down one as far as I could\r
+<br>To where it bent in the undergrowth.\r
+     </div>\r
+     <div>\r
+<p>Then took the other, as just as fair,\r
+<br>And having perhaps the better claim,\r
+<br>Because it was grassy and wanted wear;\r
+<br>Though as for that the passing there\r
+<br>Had worn them really about the same.\r
+     </div>\r
+     <div>\r
+<p>And both that morning equally lay\r
+<br>In leaves no step had trodden black.\r
+<br>Oh, I kept the first for another day!\r
+<br>Yet knowing how way leads on to way,\r
+<br>I doubted if I should ever come back.\r
+     </div>\r
+     <div>\r
+<p>I shall be telling this with a sigh\r
+<br>Somewhere ages and ages hence:\r
+<br>Two roads diverged in a wood, and I--\r
+<br>I took the one less traveled by,\r
+<br>And that has made all the difference.\r
+<p style='font-size:9pt;'><strong>Robert Frost: The Road Not Taken (1915)</strong>\r
+     </div>\r
+  </div>\r
+\r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Dialog Window</h2>\r
+\r
+<p><button onclick='openWindow(this)'>Open Dialog Window</button>\r
+<div id='dialog' title='The Gettysburg Address'>\r
+<p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. \r
+<p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. \r
+<p>But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. \r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Calendar</h2>\r
+\r
+<div id="ricoCal"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/browserdetect.html b/examples/browserdetect.html
new file mode 100644 (file)
index 0000000..1f4efcf
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<title>Rico Browser Detection</title>
+
+<script src='ricoClient/js/rico.js' type='text/javascript'></script>
+
+<link href="demo.css" type="text/css" rel="stylesheet" />
+</head>
+
+<body>
+
+<div id='explanation'>
+<h1>Rico: Browser detection</h1>
+<hr>
+<p><script type='text/javascript'>
+document.write(navigator.userAgent);
+</script>
+<p>isIE: <script type='text/javascript'>
+document.write(Rico.isIE);
+</script>
+<p>ieVersion: <script type='text/javascript'>
+document.write(Rico.ieVersion);
+</script>
+<p>isOpera: <script type='text/javascript'>
+document.write(Rico.isOpera);
+</script>
+<p>isWebKit: <script type='text/javascript'>
+document.write(Rico.isWebKit);
+</script>
+<p>isGecko: <script type='text/javascript'>
+document.write(Rico.isGecko);
+</script>
+</div>
+
+
+</body>
+</html>
diff --git a/examples/data/ORA-EXPDAT.DMP b/examples/data/ORA-EXPDAT.DMP
new file mode 100644 (file)
index 0000000..379b46d
Binary files /dev/null and b/examples/data/ORA-EXPDAT.DMP differ
diff --git a/examples/data/Readme.txt b/examples/data/Readme.txt
new file mode 100644 (file)
index 0000000..33f6649
--- /dev/null
@@ -0,0 +1,13 @@
+This directory contains data needed to run the Rico LiveGrid ASP, .net, and PHP examples.\r
+\r
+Data is available in 4 formats:\r
+\r
+1) northwind.mdb - this is the standard Northwind database provided by Microsoft, with the exception that the [Order Details] table has been renamed to Order_Details\r
+\r
+2) mysql-northwind.sql - a backup file for MySQL (created using MySQL version 4.1)\r
+\r
+3) mysql-northwind-dblquote.sql - same as above, except all instances of \' have been changed to '' (recommended for MySQL version 5+)\r
+\r
+4) ORA-EXPDAT.DMP - an Oracle export file for the Northwind schema -- generated using the "exp" utility in Oracle XE. The password for this schema is "password".\r
+\r
+A version for MS SQL Server 2005 is available as a free download from msdn.microsoft.com. After installing it, you will need to either rename the [Order Details] table  to Order_Details, or create a view named Order_Details that contains "select * from [Order Details]".\r
diff --git a/examples/data/mysql-northwind-dblquote.sql b/examples/data/mysql-northwind-dblquote.sql
new file mode 100644 (file)
index 0000000..29f7a64
--- /dev/null
@@ -0,0 +1,3678 @@
+-- MySQL Administrator dump 1.4
+--
+-- ------------------------------------------------------
+-- Server version      4.1.21-community-nt
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+
+
+--
+-- Create schema northwind
+--
+
+CREATE DATABASE IF NOT EXISTS northwind;
+USE northwind;
+
+--
+-- Definition of table `northwind`.`categories`
+--
+
+DROP TABLE IF EXISTS `northwind`.`categories`;
+CREATE TABLE  `northwind`.`categories` (
+  `CategoryID` int(11) NOT NULL auto_increment,
+  `CategoryName` varchar(15) default NULL,
+  `Description` text,
+  `Picture` varchar(40) default NULL,
+  PRIMARY KEY  (`CategoryID`)
+) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`categories`
+--
+
+/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
+INSERT INTO `northwind`.`categories` (`CategoryID`,`CategoryName`,`Description`,`Picture`) VALUES 
+ (1,'Beverages','Soft drinks, coffees, teas, beers, and ales',NULL),
+ (2,'Condiments','Sweet and savory sauces, relishes, spreads, and seasonings',''),
+ (3,'Confections','Desserts, candies, and sweet breads',''),
+ (4,'Dairy Products','Cheeses',''),
+ (5,'Grains/Cereals','Breads, crackers, pasta, and cereal',''),
+ (6,'Meat/Poultry','Prepared meats',''),
+ (7,'Produce','Dried fruit and bean curd',''),
+ (8,'Seafood','Seaweed and fish','');
+/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`customers`
+--
+
+DROP TABLE IF EXISTS `northwind`.`customers`;
+CREATE TABLE  `northwind`.`customers` (
+  `CustomerID` varchar(5) NOT NULL default '',
+  `CompanyName` varchar(40) NOT NULL default '',
+  `ContactName` varchar(30) default NULL,
+  `ContactTitle` varchar(30) default NULL,
+  `Address` varchar(60) default NULL,
+  `City` varchar(15) default NULL,
+  `Region` varchar(15) default NULL,
+  `PostalCode` varchar(10) default NULL,
+  `Country` varchar(15) default NULL,
+  `Phone` varchar(24) default NULL,
+  `Fax` varchar(24) default NULL,
+  PRIMARY KEY  (`CustomerID`),
+  UNIQUE KEY `CustomerID` (`CustomerID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`customers`
+--
+
+/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('ALFKI','Alfreds Futterkiste','Maria Anders','Sales Representative','Obere Str. 57','Berlin',NULL,'12209','Germany','030-0074321','030-0076545'),
+ ('ANATR','Ana Trujillo Emparedados y helados','Ana Trujillo','Owner','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico','(5) 555-4729','(5) 555-3745'),
+ ('ANTON','Antonio Moreno Taquería','Antonio Moreno','Owner','Mataderos  2312','México D.F.',NULL,'05023','Mexico','(5) 555-3932',NULL),
+ ('AROUT','Around the Horn','Thomas Hardy','Sales Representative','120 Hanover Sq.','London',NULL,'WA1 1DP','UK','(171) 555-7788','(171) 555-6750'),
+ ('BERGS','Berglunds snabbköp','Christina Berglund','Order Administrator','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden','0921-12 34 65','0921-12 34 67'),
+ ('BLAUS','Blauer See Delikatessen','Hanna Moos','Sales Representative','Forsterstr. 57','Mannheim',NULL,'68306','Germany','0621-08460','0621-08924'),
+ ('BLONP','Blondesddsl père et fils','Frédérique Citeaux','Marketing Manager','24, place Kléber','Strasbourg',NULL,'67000','France','88.60.15.31','88.60.15.32');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('BOLID','Bólido Comidas preparadas','Martín Sommer','Owner','C/ Araquil, 67','Madrid',NULL,'28023','Spain','(91) 555 22 82','(91) 555 91 99'),
+ ('BONAP','Bon app''','Laurence Lebihan','Owner','12, rue des Bouchers','Marseille',NULL,'13008','France','91.24.45.40','91.24.45.41'),
+ ('BOTTM','Bottom-Dollar Markets','Elizabeth Lincoln','Accounting Manager','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada','(604) 555-4729','(604) 555-3745'),
+ ('BSBEV','B''s Beverages','Victoria Ashworth','Sales Representative','Fauntleroy Circus','London',NULL,'EC2 5NT','UK','(171) 555-1212',NULL),
+ ('CACTU','Cactus Comidas para llevar','Patricio Simpson','Sales Agent','Cerrito 333','Buenos Aires',NULL,'1010','Argentina','(1) 135-5555','(1) 135-4892'),
+ ('CENTC','Centro comercial Moctezuma','Francisco Chang','Marketing Manager','Sierras de Granada 9993','México D.F.',NULL,'05022','Mexico','(5) 555-3392','(5) 555-7293'),
+ ('CHOPS','Chop-suey Chinese','Yang Wang','Owner','Hauptstr. 29','Bern',NULL,'3012','Switzerland','0452-076545',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('COMMI','Comércio Mineiro','Pedro Afonso','Sales Associate','Av. dos Lusíadas, 23','Sao Paulo','SP','05432-043','Brazil','(11) 555-7647',NULL),
+ ('CONSH','Consolidated Holdings','Elizabeth Brown','Sales Representative','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK','(171) 555-2282','(171) 555-9199'),
+ ('DRACD','Drachenblut Delikatessen','Sven Ottlieb','Order Administrator','Walserweg 21','Aachen',NULL,'52066','Germany','0241-039123','0241-059428'),
+ ('DUMON','Du monde entier','Janine Labrune','Owner','67, rue des Cinquante Otages','Nantes',NULL,'44000','France','40.67.88.88','40.67.89.89'),
+ ('EASTC','Eastern Connection','Ann Devon','Sales Agent','35 King George','London',NULL,'WX3 6FW','UK','(171) 555-0297','(171) 555-3373'),
+ ('ERNSH','Ernst Handel','Roland Mendel','Sales Manager','Kirchgasse 6','Graz',NULL,'8010','Austria','7675-3425','7675-3426'),
+ ('FAMIA','Familia Arquibaldo','Aria Cruz','Marketing Assistant','Rua Orós, 92','Sao Paulo','SP','05442-030','Brazil','(11) 555-9857',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('FISSA','FISSA Fabrica Inter. Salchichas S.A.','Diego Roel','Accounting Manager','C/ Moralzarzal, 86','Madrid',NULL,'28034','Spain','(91) 555 94 44','(91) 555 55 93'),
+ ('FOLIG','Folies gourmandes','Martine Rancé','Assistant Sales Agent','184, chaussée de Tournai','Lille',NULL,'59000','France','20.16.10.16','20.16.10.17'),
+ ('FOLKO','Folk och fä HB','Maria Larsson','Owner','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden','0695-34 67 21',NULL),
+ ('FRANK','Frankenversand','Peter Franken','Marketing Manager','Berliner Platz 43','München',NULL,'80805','Germany','089-0877310','089-0877451'),
+ ('FRANR','France restauration','Carine Schmitt','Marketing Manager','54, rue Royale','Nantes',NULL,'44000','France','40.32.21.21','40.32.21.20'),
+ ('FRANS','Franchi S.p.A.','Paolo Accorti','Sales Representative','Via Monte Bianco 34','Torino',NULL,'10100','Italy','011-4988260','011-4988261'),
+ ('FURIB','Furia Bacalhau e Frutos do Mar','Lino Rodriguez','Sales Manager','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal','(1) 354-2534','(1) 354-2535');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('GALED','Galería del gastrónomo','Eduardo Saavedra','Marketing Manager','Rambla de Cataluña, 23','Barcelona',NULL,'08022','Spain','(93) 203 4560','(93) 203 4561'),
+ ('GODOS','Godos Cocina Típica','José Pedro Freyre','Sales Manager','C/ Romero, 33','Sevilla',NULL,'41101','Spain','(95) 555 82 82',NULL),
+ ('GOURL','Gourmet Lanchonetes','André Fonseca','Sales Associate','Av. Brasil, 442','Campinas','SP','04876-786','Brazil','(11) 555-9482',NULL),
+ ('GREAL','Great Lakes Food Market','Howard Snyder','Marketing Manager','2732 Baker Blvd.','Eugene','OR','97403','USA','(503) 555-7555',NULL),
+ ('GROSR','GROSELLA-Restaurante','Manuel Pereira','Owner','5ª Ave. Los Palos Grandes','Caracas','DF','1081','Venezuela','(2) 283-2951','(2) 283-3397'),
+ ('HANAR','Hanari Carnes','Mario Pontes','Accounting Manager','Rua do Paço, 67','Rio de Janeiro','RJ','05454-876','Brazil','(21) 555-0091','(21) 555-8765'),
+ ('HILAA','HILARION-Abastos','Carlos Hernández','Sales Representative','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela','(5) 555-1340','(5) 555-1948');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('HUNGC','Hungry Coyote Import Store','Yoshi Latimer','Sales Representative','City Center Plaza 516 Main St.','Elgin','OR','97827','USA','(503) 555-6874','(503) 555-2376'),
+ ('HUNGO','Hungry Owl All-Night Grocers','Patricia McKenna','Sales Associate','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland','2967 542','2967 3333'),
+ ('ISLAT','Island Trading','Helen Bennett','Marketing Manager','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK','(198) 555-8888',NULL),
+ ('KOENE','Königlich Essen','Philip Cramer','Sales Associate','Maubelstr. 90','Brandenburg',NULL,'14776','Germany','0555-09876',NULL),
+ ('LACOR','La corne d''abondance','Daniel Tonini','Sales Representative','67, avenue de l''Europe','Versailles',NULL,'78000','France','30.59.84.10','30.59.85.11'),
+ ('LAMAI','La maison d''Asie','Annette Roulet','Sales Manager','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France','61.77.61.10','61.77.61.11'),
+ ('LAUGB','Laughing Bacchus Wine Cellars','Yoshi Tannamuri','Marketing Assistant','1900 Oak St.','Vancouver','BC','V3F 2K1','Canada','(604) 555-3392','(604) 555-7293');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('LAZYK','Lazy K Kountry Store','John Steel','Marketing Manager','12 Orchestra Terrace','Walla Walla','WA','99362','USA','(509) 555-7969','(509) 555-6221'),
+ ('LEHMS','Lehmanns Marktstand','Renate Messner','Sales Representative','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany','069-0245984','069-0245874'),
+ ('LETSS','Let''s Stop N Shop','Jaime Yorres','Owner','87 Polk St. Suite 5','San Francisco','CA','94117','USA','(415) 555-5938',NULL),
+ ('LILAS','LILA-Supermercado','Carlos González','Accounting Manager','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela','(9) 331-6954','(9) 331-7256'),
+ ('LINOD','LINO-Delicateses','Felipe Izquierdo','Owner','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela','(8) 34-56-12','(8) 34-93-93'),
+ ('LONEP','Lonesome Pine Restaurant','Fran Wilson','Sales Manager','89 Chiaroscuro Rd.','Portland','OR','97219','USA','(503) 555-9573','(503) 555-9646'),
+ ('MAGAA','Magazzini Alimentari Riuniti','Giovanni Rovelli','Marketing Manager','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy','035-640230','035-640231');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('MAISD','Maison Dewey','Catherine Dewey','Sales Agent','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium','(02) 201 24 67','(02) 201 24 68'),
+ ('MEREP','Mère Paillarde','Jean Fresnière','Marketing Assistant','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada','(514) 555-8054','(514) 555-8055'),
+ ('MORGK','Morgenstern Gesundkost','Alexander Feuer','Marketing Assistant','Heerstr. 22','Leipzig',NULL,'04179','Germany','0342-023176',NULL),
+ ('NORTS','North/South','Simon Crowther','Sales Associate','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK','(171) 555-7733','(171) 555-2530'),
+ ('OCEAN','Océano Atlántico Ltda.','Yvonne Moncada','Sales Agent','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina','(1) 135-5333','(1) 135-5535'),
+ ('OLDWO','Old World Delicatessen','Rene Phillips','Sales Representative','2743 Bering St.','Anchorage','AK','99508','USA','(907) 555-7584','(907) 555-2880'),
+ ('OTTIK','Ottilies Käseladen','Henriette Pfalzheim','Owner','Mehrheimerstr. 369','Köln',NULL,'50739','Germany','0221-0644327','0221-0765721');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('PARIS','Paris spécialités','Marie Bertrand','Owner','265, boulevard Charonne','Paris',NULL,'75012','France','(1) 42.34.22.66','(1) 42.34.22.77'),
+ ('PERIC','Pericles Comidas clásicas','Guillermo Fernández','Sales Representative','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico','(5) 552-3745','(5) 545-3745'),
+ ('PICCO','Piccolo und mehr','Georg Pipps','Sales Manager','Geislweg 14','Salzburg',NULL,'5020','Austria','6562-9722','6562-9723'),
+ ('PRINI','Princesa Isabel Vinhos','Isabel de Castro','Sales Representative','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal','(1) 356-5634',NULL),
+ ('QUEDE','Que Delícia','Bernardo Batista','Accounting Manager','Rua da Panificadora, 12','Rio de Janeiro','RJ','02389-673','Brazil','(21) 555-4252','(21) 555-4545'),
+ ('QUEEN','Queen Cozinha','Lúcia Carvalho','Marketing Assistant','Alameda dos Canàrios, 891','Sao Paulo','SP','05487-020','Brazil','(11) 555-1189',NULL),
+ ('QUICK','QUICK-Stop','Horst Kloss','Accounting Manager','Taucherstraße 10','Cunewalde',NULL,'01307','Germany','0372-035188',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('RANCH','Rancho grande','Sergio Gutiérrez','Sales Representative','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina','(1) 123-5555','(1) 123-5556'),
+ ('RATTC','Rattlesnake Canyon Grocery','Paula Wilson','Assistant Sales Representative','2817 Milton Dr.','Albuquerque','NM','87110','USA','(505) 555-5939','(505) 555-3620'),
+ ('REGGC','Reggiani Caseifici','Maurizio Moroni','Sales Associate','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy','0522-556721','0522-556722'),
+ ('RICAR','Ricardo Adocicados','Janete Limeira','Assistant Sales Agent','Av. Copacabana, 267','Rio de Janeiro','RJ','02389-890','Brazil','(21) 555-3412',NULL),
+ ('RICSU','Richter Supermarkt','Michael Holz','Sales Manager','Grenzacherweg 237','Genève',NULL,'1203','Switzerland','0897-034214',NULL),
+ ('ROMEY','Romero y tomillo','Alejandra Camino','Accounting Manager','Gran Vía, 1','Madrid',NULL,'28001','Spain','(91) 745 6200','(91) 745 6210'),
+ ('SANTG','Santé Gourmet','Jonas Bergulfsen','Owner','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway','07-98 92 35','07-98 92 47');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('SAVEA','Save-a-lot Markets','Jose Pavarotti','Sales Representative','187 Suffolk Ln.','Boise','ID','83720','USA','(208) 555-8097',NULL),
+ ('SEVES','Seven Seas Imports','Hari Kumar','Sales Manager','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK','(171) 555-1717','(171) 555-5646'),
+ ('SIMOB','Simons bistro','Jytte Petersen','Owner','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark','31 12 34 56','31 13 35 57'),
+ ('SPECD','Spécialités du monde','Dominique Perrier','Marketing Manager','25, rue Lauriston','Paris',NULL,'75016','France','(1) 47.55.60.10','(1) 47.55.60.20'),
+ ('SPLIR','Split Rail Beer & Ale','Art Braunschweiger','Sales Manager','P.O. Box 555','Lander','WY','82520','USA','(307) 555-4680','(307) 555-6525'),
+ ('SUPRD','Suprêmes délices','Pascale Cartrain','Accounting Manager','Boulevard Tirou, 255','Charleroi',NULL,'B-6000','Belgium','(071) 23 67 22 20','(071) 23 67 22 21'),
+ ('THEBI','The Big Cheese','Liz Nixon','Marketing Manager','89 Jefferson Way Suite 2','Portland','OR','97201','USA','(503) 555-3612',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('THECR','The Cracker Box','Liu Wong','Marketing Assistant','55 Grizzly Peak Rd.','Butte','MT','59801','USA','(406) 555-5834','(406) 555-8083'),
+ ('TOMSP','Toms Spezialitäten','Karin Josephs','Marketing Manager','Luisenstr. 48','Münster',NULL,'44087','Germany','0251-031259','0251-035695'),
+ ('TORTU','Tortuga Restaurante','Miguel Angel Paolino','Owner','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico','(5) 555-2933',NULL),
+ ('TRADH','Tradição Hipermercados','Anabela Domingues','Sales Representative','Av. Inês de Castro, 414','Sao Paulo','SP','05634-030','Brazil','(11) 555-2167','(11) 555-2168'),
+ ('TRAIH','Trail''s Head Gourmet Provisioners','Helvetius Nagy','Sales Associate','722 DaVinci Blvd.','Kirkland','WA','98034','USA','(206) 555-8257','(206) 555-2174'),
+ ('VAFFE','Vaffeljernet','Palle Ibsen','Sales Manager','Smagsloget 45','Århus',NULL,'8200','Denmark','86 21 32 43','86 22 33 44'),
+ ('VICTE','Victuailles en stock','Mary Saveley','Sales Agent','2, rue du Commerce','Lyon',NULL,'69004','France','78.32.54.86','78.32.54.87');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('VINET','Vins et alcools Chevalier','Paul Henriot','Accounting Manager','59 rue de l''Abbaye','Reims',NULL,'51100','France','26.47.15.10','26.47.15.11'),
+ ('WANDK','Die Wandernde Kuh','Rita Müller','Sales Representative','Adenauerallee 900','Stuttgart',NULL,'70563','Germany','0711-020361','0711-035428'),
+ ('WARTH','Wartian Herkku','Pirkko Koskitalo','Accounting Manager','Torikatu 38','Oulu',NULL,'90110','Finland','981-443655','981-443655'),
+ ('WELLI','Wellington Importadora','Paula Parente','Sales Manager','Rua do Mercado, 12','Resende','SP','08737-363','Brazil','(14) 555-8122',NULL),
+ ('WHITC','White Clover Markets','Karl Jablonski','Owner','305 - 14th Ave. S. Suite 3B','Seattle','WA','98128','USA','(206) 555-4112','(206) 555-4115'),
+ ('WILMK','Wilman Kala','Matti Karttunen','Owner/Marketing Assistant','Keskuskatu 45','Helsinki',NULL,'21240','Finland','90-224 8858','90-224 8858'),
+ ('WOLZA','Wolski  Zajazd','Zbyszek Piestrzeniewicz','Owner','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland','(26) 642-7012','(26) 642-7012');
+/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`employees`
+--
+
+DROP TABLE IF EXISTS `northwind`.`employees`;
+CREATE TABLE  `northwind`.`employees` (
+  `EmployeeID` int(11) NOT NULL default '0',
+  `LastName` varchar(20) NOT NULL default '',
+  `FirstName` varchar(10) NOT NULL default '',
+  `Title` varchar(30) default NULL,
+  `TitleOfCourtesy` varchar(25) default NULL,
+  `BirthDate` date default NULL,
+  `HireDate` date default NULL,
+  `Address` varchar(60) default NULL,
+  `City` varchar(15) default NULL,
+  `Region` varchar(15) default NULL,
+  `PostalCode` varchar(10) default NULL,
+  `Country` varchar(15) default NULL,
+  `HomePhone` varchar(24) default NULL,
+  `Extension` varchar(4) default NULL,
+  `Notes` text,
+  `ReportsTo` int(11) default NULL,
+  `PhotoFileName` varchar(255) default NULL,
+  PRIMARY KEY  (`EmployeeID`),
+  UNIQUE KEY `EmployeeID` (`EmployeeID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`employees`
+--
+
+/*!40000 ALTER TABLE `employees` DISABLE KEYS */;
+INSERT INTO `northwind`.`employees` (`EmployeeID`,`LastName`,`FirstName`,`Title`,`TitleOfCourtesy`,`BirthDate`,`HireDate`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`HomePhone`,`Extension`,`Notes`,`ReportsTo`,`PhotoFileName`) VALUES 
+ (1,'Davolio','Nancy','Sales Representative','Ms.','1948-12-08','1992-05-01','507 - 20th Ave. E.  Apt. 2A','Seattle','WA','98122','USA','(206) 555-9857','5467','Education includes a BA in psychology from Colorado State University in 1970.  She also completed \"The Art of the Cold Call.\"  Nancy is a member of Toastmasters International.',2,'http://accweb/emmployees/davolio.bmp'),
+ (2,'Fuller','Andrew','Vice President of Sales','Dr.','1952-02-19','1992-08-14','908 W. Capital Way','Tacoma','WA','98401','USA','(206) 555-9482','3457','Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981.  He is fluent in French and Italian and reads German.  He joined the company as a sales representative; was promoted to sales manager i',0,'http://accweb/emmployees/fuller.bmp'),
+ (3,'Leverling','Janet','Sales Representative','Ms.','1963-08-30','1992-04-01','722 Moss Bay Blvd.','Kirkland','WA','98033','USA','(206) 555-3412','3355','Janet has a BS degree in chemistry from Boston College (1984).  She has also completed a certificate program in food retailing management.  Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992.',2,'http://accweb/emmployees/leverling.bmp');
+INSERT INTO `northwind`.`employees` (`EmployeeID`,`LastName`,`FirstName`,`Title`,`TitleOfCourtesy`,`BirthDate`,`HireDate`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`HomePhone`,`Extension`,`Notes`,`ReportsTo`,`PhotoFileName`) VALUES 
+ (4,'Peacock','Margaret','Sales Representative','Mrs.','1937-09-19','1993-05-03','4110 Old Redmond Rd.','Redmond','WA','98052','USA','(206) 555-8122','5176','Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966).  She was assigned to the London office temporarily from July through November 1992.',2,'http://accweb/emmployees/peacock.bmp'),
+ (5,'Buchanan','Steven','Sales Manager','Mr.','1955-03-04','1993-10-17','14 Garrett Hill','London',NULL,'SW1 8JR','UK','(71) 555-4848','3453','Steven Buchanan graduated from St. Andrews University (Scotland) with a BSC degree in 1976.  Upon joining the company as a sales representative in 1992. He spent 6 months in an orientation program at the Seattle office and then returned to his permanent po',2,'http://accweb/emmployees/buchanan.bmp'),
+ (6,'Suyama','Michael','Sales Representative','Mr.','1963-07-02','1993-10-17','Coventry House  Miner Rd.','London',NULL,'EC2 7JR','UK','(71) 555-7773','428','Michael is a graduate of Sussex University (MA economics 1983) and the University of California at Los Angeles (MBA marketing 1986).  He has also taken the courses \"Multi-Cultural Selling\" and \"Time Management for the Sales Professional.\"  He is fluent',5,'http://accweb/emmployees/davolio.bmp');
+INSERT INTO `northwind`.`employees` (`EmployeeID`,`LastName`,`FirstName`,`Title`,`TitleOfCourtesy`,`BirthDate`,`HireDate`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`HomePhone`,`Extension`,`Notes`,`ReportsTo`,`PhotoFileName`) VALUES 
+ (7,'King','Robert','Sales Representative','Mr.','1960-05-29','1994-01-02','Edgeham Hollow  Winchester Way','London',NULL,'RG1 9SP','UK','(71) 555-5598','465','Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992; the year he joined the company.  After completing a course entitled \"Selling in Europe\" he was transferred to the',5,'http://accweb/emmployees/davolio.bmp'),
+ (8,'Callahan','Laura','Inside Sales Coordinator','Ms.','1958-01-09','1994-03-05','4726 - 11th Ave. N.E.','Seattle','WA','98105','USA','(206) 555-1189','2344','Laura received a BA in psychology from the University of Washington.  She has also completed a course in business French.  She reads and writes French.',2,'http://accweb/emmployees/davolio.bmp'),
+ (9,'Dodsworth','Anne','Sales Representative','Ms.','1966-01-27','1994-11-15','7 Houndstooth Rd.','London',NULL,'WG2 7LT','UK','(71) 555-4444','452','Anne has a BA degree in English from St. Lawrence College.  She is fluent in French and German.',5,'http://accweb/emmployees/davolio.bmp');
+/*!40000 ALTER TABLE `employees` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`order_details`
+--
+
+DROP TABLE IF EXISTS `northwind`.`order_details`;
+CREATE TABLE  `northwind`.`order_details` (
+  `OrderID` int(11) NOT NULL default '0',
+  `ProductID` int(11) NOT NULL default '0',
+  `UnitPrice` decimal(9,2) unsigned NOT NULL default '0.00',
+  `Quantity` smallint(5) unsigned NOT NULL default '1',
+  `Discount` double NOT NULL default '0',
+  PRIMARY KEY  (`OrderID`,`ProductID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`order_details`
+--
+
+/*!40000 ALTER TABLE `order_details` DISABLE KEYS */;
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10248,11,'14.00',12,0),
+ (10248,42,'9.80',10,0),
+ (10248,72,'34.80',5,0),
+ (10249,14,'18.60',9,0),
+ (10249,51,'42.40',40,0),
+ (10250,41,'7.70',10,0),
+ (10250,51,'42.40',35,0.15),
+ (10250,65,'16.80',15,0.15),
+ (10251,22,'16.80',6,0.05),
+ (10251,57,'15.60',15,0.05),
+ (10251,65,'16.80',20,0),
+ (10252,20,'64.80',40,0.05),
+ (10252,33,'2.00',25,0.05),
+ (10252,60,'27.20',40,0),
+ (10253,31,'10.00',20,0),
+ (10253,39,'14.40',42,0),
+ (10253,49,'16.00',40,0),
+ (10254,24,'3.60',15,0.15),
+ (10254,55,'19.20',21,0.15),
+ (10254,74,'8.00',21,0),
+ (10255,2,'15.20',20,0),
+ (10255,16,'13.90',35,0),
+ (10255,36,'15.20',25,0),
+ (10255,59,'44.00',30,0),
+ (10256,53,'26.20',15,0),
+ (10256,77,'10.40',12,0),
+ (10257,27,'35.10',25,0),
+ (10257,39,'14.40',6,0),
+ (10257,77,'10.40',15,0),
+ (10258,2,'15.20',50,0.2),
+ (10258,5,'17.00',65,0.2),
+ (10258,32,'25.60',6,0.2),
+ (10259,21,'8.00',10,0),
+ (10259,37,'20.80',1,0),
+ (10260,41,'7.70',16,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10260,57,'15.60',50,0),
+ (10260,62,'39.40',15,0.25),
+ (10260,70,'12.00',21,0.25),
+ (10261,21,'8.00',20,0),
+ (10261,35,'14.40',20,0),
+ (10262,5,'17.00',12,0.2),
+ (10262,7,'24.00',15,0),
+ (10262,56,'30.40',2,0),
+ (10263,16,'13.90',60,0.25),
+ (10263,24,'3.60',28,0),
+ (10263,30,'20.70',60,0.25),
+ (10263,74,'8.00',36,0.25),
+ (10264,2,'15.20',35,0),
+ (10264,41,'7.70',25,0.15),
+ (10265,17,'31.20',30,0),
+ (10265,70,'12.00',20,0),
+ (10266,12,'30.40',12,0.05),
+ (10267,40,'14.70',50,0),
+ (10267,59,'44.00',70,0.15),
+ (10267,76,'14.40',15,0.15),
+ (10268,29,'99.00',10,0),
+ (10268,72,'27.80',4,0),
+ (10269,33,'2.00',60,0.05),
+ (10269,72,'27.80',20,0.05),
+ (10270,36,'15.20',30,0),
+ (10270,43,'36.80',25,0),
+ (10271,33,'2.00',24,0),
+ (10272,20,'64.80',6,0),
+ (10272,31,'10.00',40,0),
+ (10272,72,'27.80',24,0),
+ (10273,10,'24.80',24,0.05),
+ (10273,31,'10.00',15,0.05),
+ (10273,33,'2.00',20,0),
+ (10273,40,'14.70',60,0.05),
+ (10273,76,'14.40',33,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10274,71,'17.20',20,0),
+ (10274,72,'27.80',7,0),
+ (10275,24,'3.60',12,0.05),
+ (10275,59,'44.00',6,0.05),
+ (10276,10,'24.80',15,0),
+ (10276,13,'4.80',10,0),
+ (10277,28,'36.40',20,0),
+ (10277,62,'39.40',12,0),
+ (10278,44,'15.50',16,0),
+ (10278,59,'44.00',15,0),
+ (10278,63,'35.10',8,0),
+ (10278,73,'12.00',25,0),
+ (10279,17,'31.20',15,0.25),
+ (10280,24,'3.60',12,0),
+ (10280,55,'19.20',20,0),
+ (10280,75,'6.20',30,0),
+ (10281,19,'7.30',1,0),
+ (10281,24,'3.60',6,0),
+ (10281,35,'14.40',4,0),
+ (10282,30,'20.70',6,0),
+ (10282,57,'15.60',2,0),
+ (10283,15,'12.40',20,0),
+ (10283,19,'7.30',18,0),
+ (10283,60,'27.20',35,0),
+ (10283,72,'27.80',3,0),
+ (10284,27,'35.10',15,0.25),
+ (10284,44,'15.50',21,0),
+ (10284,60,'27.20',20,0.25),
+ (10284,67,'11.20',5,0.25),
+ (10285,1,'14.40',45,0.2),
+ (10285,40,'14.70',40,0.2),
+ (10285,53,'26.20',36,0.2),
+ (10286,35,'14.40',100,0),
+ (10286,62,'39.40',40,0),
+ (10287,16,'13.90',40,0.15),
+ (10287,34,'11.20',20,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10287,46,'9.60',15,0.15),
+ (10288,54,'5.90',10,0.1),
+ (10288,68,'10.00',3,0.1),
+ (10289,3,'8.00',30,0),
+ (10289,64,'26.60',9,0),
+ (10290,5,'17.00',20,0),
+ (10290,29,'99.00',15,0),
+ (10290,49,'16.00',15,0),
+ (10290,77,'10.40',10,0),
+ (10291,13,'4.80',20,0.1),
+ (10291,44,'15.50',24,0.1),
+ (10291,51,'42.40',2,0.1),
+ (10292,20,'64.80',20,0),
+ (10293,18,'50.00',12,0),
+ (10293,24,'3.60',10,0),
+ (10293,63,'35.10',5,0),
+ (10293,75,'6.20',6,0),
+ (10294,1,'14.40',18,0),
+ (10294,17,'31.20',15,0),
+ (10294,43,'36.80',15,0),
+ (10294,60,'27.20',21,0),
+ (10294,75,'6.20',6,0),
+ (10295,56,'30.40',4,0),
+ (10296,11,'16.80',12,0),
+ (10296,16,'13.90',30,0),
+ (10296,69,'28.80',15,0),
+ (10297,39,'14.40',60,0),
+ (10297,72,'27.80',20,0),
+ (10298,2,'15.20',40,0),
+ (10298,36,'15.20',40,0.25),
+ (10298,59,'44.00',30,0.25),
+ (10298,62,'39.40',15,0),
+ (10299,19,'7.30',15,0),
+ (10299,70,'12.00',20,0),
+ (10300,66,'13.60',30,0),
+ (10300,68,'10.00',20,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10301,40,'14.70',10,0),
+ (10301,56,'30.40',20,0),
+ (10302,17,'31.20',40,0),
+ (10302,28,'36.40',28,0),
+ (10302,43,'36.80',12,0),
+ (10303,40,'14.70',40,0.1),
+ (10303,65,'16.80',30,0.1),
+ (10303,68,'10.00',15,0.1),
+ (10304,49,'16.00',30,0),
+ (10304,59,'44.00',10,0),
+ (10304,71,'17.20',2,0),
+ (10305,18,'50.00',25,0.1),
+ (10305,29,'99.00',25,0.1),
+ (10305,39,'14.40',30,0.1),
+ (10306,30,'20.70',10,0),
+ (10306,53,'26.20',10,0),
+ (10306,54,'5.90',5,0),
+ (10307,62,'39.40',10,0),
+ (10307,68,'10.00',3,0),
+ (10308,69,'28.80',1,0),
+ (10308,70,'12.00',5,0),
+ (10309,4,'17.60',20,0),
+ (10309,6,'20.00',30,0),
+ (10309,42,'11.20',2,0),
+ (10309,43,'36.80',20,0),
+ (10309,71,'17.20',3,0),
+ (10310,16,'13.90',10,0),
+ (10310,62,'39.40',5,0),
+ (10311,42,'11.20',6,0),
+ (10311,69,'28.80',7,0),
+ (10312,28,'36.40',4,0),
+ (10312,43,'36.80',24,0),
+ (10312,53,'26.20',20,0),
+ (10312,75,'6.20',10,0),
+ (10313,36,'15.20',12,0),
+ (10314,32,'25.60',40,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10314,58,'10.60',30,0.1),
+ (10314,62,'39.40',25,0.1),
+ (10315,34,'11.20',14,0),
+ (10315,70,'12.00',30,0),
+ (10316,41,'7.70',10,0),
+ (10316,62,'39.40',70,0),
+ (10317,1,'14.40',20,0),
+ (10318,41,'7.70',20,0),
+ (10318,76,'14.40',6,0),
+ (10319,17,'31.20',8,0),
+ (10319,28,'36.40',14,0),
+ (10319,76,'14.40',30,0),
+ (10320,71,'17.20',30,0),
+ (10321,35,'14.40',10,0),
+ (10322,52,'5.60',20,0),
+ (10323,15,'12.40',5,0),
+ (10323,25,'11.20',4,0),
+ (10323,39,'14.40',4,0),
+ (10324,16,'13.90',21,0.15),
+ (10324,35,'14.40',70,0.15),
+ (10324,46,'9.60',30,0),
+ (10324,59,'44.00',40,0.15),
+ (10324,63,'35.10',80,0.15),
+ (10325,6,'20.00',6,0),
+ (10325,13,'4.80',12,0),
+ (10325,14,'18.60',9,0),
+ (10325,31,'10.00',4,0),
+ (10325,72,'27.80',40,0),
+ (10326,4,'17.60',24,0),
+ (10326,57,'15.60',16,0),
+ (10326,75,'6.20',50,0),
+ (10327,2,'15.20',25,0.2),
+ (10327,11,'16.80',50,0.2),
+ (10327,30,'20.70',35,0.2),
+ (10327,58,'10.60',30,0.2),
+ (10328,59,'44.00',9,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10328,65,'16.80',40,0),
+ (10328,68,'10.00',10,0),
+ (10329,19,'7.30',10,0.05),
+ (10329,30,'20.70',8,0.05),
+ (10329,38,'210.80',20,0.05),
+ (10329,56,'30.40',12,0.05),
+ (10330,26,'24.90',50,0.15),
+ (10330,72,'27.80',25,0.15),
+ (10331,54,'5.90',15,0),
+ (10332,18,'50.00',40,0.2),
+ (10332,42,'11.20',10,0.2),
+ (10332,47,'7.60',16,0.2),
+ (10333,14,'18.60',10,0),
+ (10333,21,'8.00',10,0.1),
+ (10333,71,'17.20',40,0.1),
+ (10334,52,'5.60',8,0),
+ (10334,68,'10.00',10,0),
+ (10335,2,'15.20',7,0.2),
+ (10335,31,'10.00',25,0.2),
+ (10335,32,'25.60',6,0.2),
+ (10335,51,'42.40',48,0.2),
+ (10336,4,'17.60',18,0.1),
+ (10337,23,'7.20',40,0),
+ (10337,26,'24.90',24,0),
+ (10337,36,'15.20',20,0),
+ (10337,37,'20.80',28,0),
+ (10337,72,'27.80',25,0),
+ (10338,17,'31.20',20,0),
+ (10338,30,'20.70',15,0),
+ (10339,4,'17.60',10,0),
+ (10339,17,'31.20',70,0.05),
+ (10339,62,'39.40',28,0),
+ (10340,18,'50.00',20,0.05),
+ (10340,41,'7.70',12,0.05),
+ (10340,43,'36.80',40,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10341,33,'2.00',8,0),
+ (10341,59,'44.00',9,0.15),
+ (10342,2,'15.20',24,0.2),
+ (10342,31,'10.00',56,0.2),
+ (10342,36,'15.20',40,0.2),
+ (10342,55,'19.20',40,0.2),
+ (10343,64,'26.60',50,0),
+ (10343,68,'10.00',4,0.05),
+ (10343,76,'14.40',15,0),
+ (10344,4,'17.60',35,0),
+ (10344,8,'32.00',70,0.25),
+ (10345,8,'32.00',70,0),
+ (10345,19,'7.30',80,0),
+ (10345,42,'11.20',9,0),
+ (10346,17,'31.20',36,0.1),
+ (10346,56,'30.40',20,0),
+ (10347,25,'11.20',10,0),
+ (10347,39,'14.40',50,0.15),
+ (10347,40,'14.70',4,0),
+ (10347,75,'6.20',6,0.15),
+ (10348,1,'14.40',15,0.15),
+ (10348,23,'7.20',25,0),
+ (10349,54,'5.90',24,0),
+ (10350,50,'13.00',15,0.1),
+ (10350,69,'28.80',18,0.1),
+ (10351,38,'210.80',20,0.05),
+ (10351,41,'7.70',13,0),
+ (10351,44,'15.50',77,0.05),
+ (10351,65,'16.80',10,0.05),
+ (10352,24,'3.60',10,0),
+ (10352,54,'5.90',20,0.15),
+ (10353,11,'16.80',12,0.2),
+ (10353,38,'210.80',50,0.2),
+ (10354,1,'14.40',12,0),
+ (10354,29,'99.00',4,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10355,24,'3.60',25,0),
+ (10355,57,'15.60',25,0),
+ (10356,31,'10.00',30,0),
+ (10356,55,'19.20',12,0),
+ (10356,69,'28.80',20,0),
+ (10357,10,'24.80',30,0.2),
+ (10357,26,'24.90',16,0),
+ (10357,60,'27.20',8,0.2),
+ (10358,24,'3.60',10,0.05),
+ (10358,34,'11.20',10,0.05),
+ (10358,36,'15.20',20,0.05),
+ (10359,16,'13.90',56,0.05),
+ (10359,31,'10.00',70,0.05),
+ (10359,60,'27.20',80,0.05),
+ (10360,28,'36.40',30,0),
+ (10360,29,'99.00',35,0),
+ (10360,38,'210.80',10,0),
+ (10360,49,'16.00',35,0),
+ (10360,54,'5.90',28,0),
+ (10361,39,'14.40',54,0.1),
+ (10361,60,'27.20',55,0.1),
+ (10362,25,'11.20',50,0),
+ (10362,51,'42.40',20,0),
+ (10362,54,'5.90',24,0),
+ (10363,31,'10.00',20,0),
+ (10363,75,'6.20',12,0),
+ (10363,76,'14.40',12,0),
+ (10364,69,'28.80',30,0),
+ (10364,71,'17.20',5,0),
+ (10365,11,'16.80',24,0),
+ (10366,65,'16.80',5,0),
+ (10366,77,'10.40',5,0),
+ (10367,34,'11.20',36,0),
+ (10367,54,'5.90',18,0),
+ (10367,65,'16.80',15,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10367,77,'10.40',7,0),
+ (10368,21,'8.00',5,0.1),
+ (10368,28,'36.40',13,0.1),
+ (10368,57,'15.60',25,0),
+ (10368,64,'26.60',35,0.1),
+ (10369,29,'99.00',20,0),
+ (10369,56,'30.40',18,0.25),
+ (10370,1,'14.40',15,0.15),
+ (10370,64,'26.60',30,0),
+ (10370,74,'8.00',20,0.15),
+ (10371,36,'15.20',6,0.2),
+ (10372,20,'64.80',12,0.25),
+ (10372,38,'210.80',40,0.25),
+ (10372,60,'27.20',70,0.25),
+ (10372,72,'27.80',42,0.25),
+ (10373,58,'10.60',80,0.2),
+ (10373,71,'17.20',50,0.2),
+ (10374,31,'10.00',30,0),
+ (10374,58,'10.60',15,0),
+ (10375,14,'18.60',15,0),
+ (10375,54,'5.90',10,0),
+ (10376,31,'10.00',42,0.05),
+ (10377,28,'36.40',20,0.15),
+ (10377,39,'14.40',20,0.15),
+ (10378,71,'17.20',6,0),
+ (10379,41,'7.70',8,0.1),
+ (10379,63,'35.10',16,0.1),
+ (10379,65,'16.80',20,0.1),
+ (10380,30,'20.70',18,0.1),
+ (10380,53,'26.20',20,0.1),
+ (10380,60,'27.20',6,0.1),
+ (10380,70,'12.00',30,0),
+ (10381,74,'8.00',14,0),
+ (10382,5,'17.00',32,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10382,18,'50.00',9,0),
+ (10382,29,'99.00',14,0),
+ (10382,33,'2.00',60,0),
+ (10382,74,'8.00',50,0),
+ (10383,13,'4.80',20,0),
+ (10383,50,'13.00',15,0),
+ (10383,56,'30.40',20,0),
+ (10384,20,'64.80',28,0),
+ (10384,60,'27.20',15,0),
+ (10385,7,'24.00',10,0.2),
+ (10385,60,'27.20',20,0.2),
+ (10385,68,'10.00',8,0.2),
+ (10386,24,'3.60',15,0),
+ (10386,34,'11.20',10,0),
+ (10387,24,'3.60',15,0),
+ (10387,28,'36.40',6,0),
+ (10387,59,'44.00',12,0),
+ (10387,71,'17.20',15,0),
+ (10388,45,'7.60',15,0.2),
+ (10388,52,'5.60',20,0.2),
+ (10388,53,'26.20',40,0),
+ (10389,10,'24.80',16,0),
+ (10389,55,'19.20',15,0),
+ (10389,62,'39.40',20,0),
+ (10389,70,'12.00',30,0),
+ (10390,31,'10.00',60,0.1),
+ (10390,35,'14.40',40,0.1),
+ (10390,46,'9.60',45,0),
+ (10390,72,'27.80',24,0.1),
+ (10391,13,'4.80',18,0),
+ (10392,69,'28.80',50,0),
+ (10393,2,'15.20',25,0.25),
+ (10393,14,'18.60',42,0.25),
+ (10393,25,'11.20',7,0.25),
+ (10393,26,'24.90',70,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10393,31,'10.00',32,0),
+ (10394,13,'4.80',10,0),
+ (10394,62,'39.40',10,0),
+ (10395,46,'9.60',28,0.1),
+ (10395,53,'26.20',70,0.1),
+ (10395,69,'28.80',8,0),
+ (10396,23,'7.20',40,0),
+ (10396,71,'17.20',60,0),
+ (10396,72,'27.80',21,0),
+ (10397,21,'8.00',10,0.15),
+ (10397,51,'42.40',18,0.15),
+ (10398,35,'14.40',30,0),
+ (10398,55,'19.20',120,0.1),
+ (10399,68,'10.00',60,0),
+ (10399,71,'17.20',30,0),
+ (10399,76,'14.40',35,0),
+ (10399,77,'10.40',14,0),
+ (10400,29,'99.00',21,0),
+ (10400,35,'14.40',35,0),
+ (10400,49,'16.00',30,0),
+ (10401,30,'20.70',18,0),
+ (10401,56,'30.40',70,0),
+ (10401,65,'16.80',20,0),
+ (10401,71,'17.20',60,0),
+ (10402,23,'7.20',60,0),
+ (10402,63,'35.10',65,0),
+ (10403,16,'13.90',21,0.15),
+ (10403,48,'10.20',70,0.15),
+ (10404,26,'24.90',30,0.05),
+ (10404,42,'11.20',40,0.05),
+ (10404,49,'16.00',30,0.05),
+ (10405,3,'8.00',50,0),
+ (10406,1,'14.40',10,0),
+ (10406,21,'8.00',30,0.1),
+ (10406,28,'36.40',42,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10406,36,'15.20',5,0.1),
+ (10406,40,'14.70',2,0.1),
+ (10407,11,'16.80',30,0),
+ (10407,69,'28.80',15,0),
+ (10407,71,'17.20',15,0),
+ (10408,37,'20.80',10,0),
+ (10408,54,'5.90',6,0),
+ (10408,62,'39.40',35,0),
+ (10409,14,'18.60',12,0),
+ (10409,21,'8.00',12,0),
+ (10410,33,'2.00',49,0),
+ (10410,59,'44.00',16,0),
+ (10411,41,'7.70',25,0.2),
+ (10411,44,'15.50',40,0.2),
+ (10411,59,'44.00',9,0.2),
+ (10412,14,'18.60',20,0.1),
+ (10413,1,'14.40',24,0),
+ (10413,62,'39.40',40,0),
+ (10413,76,'14.40',14,0),
+ (10414,19,'7.30',18,0.05),
+ (10414,33,'2.00',50,0),
+ (10415,17,'31.20',2,0),
+ (10415,33,'2.00',20,0),
+ (10416,19,'7.30',20,0),
+ (10416,53,'26.20',10,0),
+ (10416,57,'15.60',20,0),
+ (10417,38,'210.80',50,0),
+ (10417,46,'9.60',2,0.25),
+ (10417,68,'10.00',36,0.25),
+ (10417,77,'10.40',35,0),
+ (10418,2,'15.20',60,0),
+ (10418,47,'7.60',55,0),
+ (10418,61,'22.80',16,0),
+ (10418,74,'8.00',15,0),
+ (10419,60,'27.20',60,0.05),
+ (10419,69,'28.80',20,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10420,9,'77.60',20,0.1),
+ (10420,13,'4.80',2,0.1),
+ (10420,70,'12.00',8,0.1),
+ (10420,73,'12.00',20,0.1),
+ (10421,19,'7.30',4,0.15),
+ (10421,26,'24.90',30,0),
+ (10421,53,'26.20',15,0.15),
+ (10421,77,'10.40',10,0.15),
+ (10422,26,'24.90',2,0),
+ (10423,31,'10.00',14,0),
+ (10423,59,'44.00',20,0),
+ (10424,35,'14.40',60,0.2),
+ (10424,38,'210.80',49,0.2),
+ (10424,68,'10.00',30,0.2),
+ (10425,55,'19.20',10,0.25),
+ (10425,76,'14.40',20,0.25),
+ (10426,56,'30.40',5,0),
+ (10426,64,'26.60',7,0),
+ (10427,14,'18.60',35,0),
+ (10428,46,'9.60',20,0),
+ (10429,50,'13.00',40,0),
+ (10429,63,'35.10',35,0.25),
+ (10430,17,'31.20',45,0.2),
+ (10430,21,'8.00',50,0),
+ (10430,56,'30.40',30,0),
+ (10430,59,'44.00',70,0.2),
+ (10431,17,'31.20',50,0.25),
+ (10431,40,'14.70',50,0.25),
+ (10431,47,'7.60',30,0.25),
+ (10432,26,'24.90',10,0),
+ (10432,54,'5.90',40,0),
+ (10433,56,'30.40',28,0),
+ (10434,11,'16.80',6,0),
+ (10434,76,'14.40',18,0.15),
+ (10435,2,'15.20',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10435,22,'16.80',12,0),
+ (10435,72,'27.80',10,0),
+ (10436,46,'9.60',5,0),
+ (10436,56,'30.40',40,0.1),
+ (10436,64,'26.60',30,0.1),
+ (10436,75,'6.20',24,0.1),
+ (10437,53,'26.20',15,0),
+ (10438,19,'7.30',15,0.2),
+ (10438,34,'11.20',20,0.2),
+ (10438,57,'15.60',15,0.2),
+ (10439,12,'30.40',15,0),
+ (10439,16,'13.90',16,0),
+ (10439,64,'26.60',6,0),
+ (10439,74,'8.00',30,0),
+ (10440,2,'15.20',45,0.15),
+ (10440,16,'13.90',49,0.15),
+ (10440,29,'99.00',24,0.15),
+ (10440,61,'22.80',90,0.15),
+ (10441,27,'35.10',50,0),
+ (10442,11,'16.80',30,0),
+ (10442,54,'5.90',80,0),
+ (10442,66,'13.60',60,0),
+ (10443,11,'16.80',6,0.2),
+ (10443,28,'36.40',12,0),
+ (10444,17,'31.20',10,0),
+ (10444,26,'24.90',15,0),
+ (10444,35,'14.40',8,0),
+ (10444,41,'7.70',30,0),
+ (10445,39,'14.40',6,0),
+ (10445,54,'5.90',15,0),
+ (10446,19,'7.30',12,0.1),
+ (10446,24,'3.60',20,0.1),
+ (10446,31,'10.00',3,0.1),
+ (10446,52,'5.60',15,0.1),
+ (10447,19,'7.30',40,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10447,65,'16.80',35,0),
+ (10447,71,'17.20',2,0),
+ (10448,26,'24.90',6,0),
+ (10448,40,'14.70',20,0),
+ (10449,10,'24.80',14,0),
+ (10449,52,'5.60',20,0),
+ (10449,62,'39.40',35,0),
+ (10450,10,'24.80',20,0.2),
+ (10450,54,'5.90',6,0.2),
+ (10451,55,'19.20',120,0.1),
+ (10451,64,'26.60',35,0.1),
+ (10451,65,'16.80',28,0.1),
+ (10451,77,'10.40',55,0.1),
+ (10452,28,'36.40',15,0),
+ (10452,44,'15.50',100,0.05),
+ (10453,48,'10.20',15,0.1),
+ (10453,70,'12.00',25,0.1),
+ (10454,16,'13.90',20,0.2),
+ (10454,33,'2.00',20,0.2),
+ (10454,46,'9.60',10,0.2),
+ (10455,39,'14.40',20,0),
+ (10455,53,'26.20',50,0),
+ (10455,61,'22.80',25,0),
+ (10455,71,'17.20',30,0),
+ (10456,21,'8.00',40,0.15),
+ (10456,49,'16.00',21,0.15),
+ (10457,59,'44.00',36,0),
+ (10458,26,'24.90',30,0),
+ (10458,28,'36.40',30,0),
+ (10458,43,'36.80',20,0),
+ (10458,56,'30.40',15,0),
+ (10458,71,'17.20',50,0),
+ (10459,7,'24.00',16,0.05),
+ (10459,46,'9.60',20,0.05),
+ (10459,72,'27.80',40,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10460,68,'10.00',21,0.25),
+ (10460,75,'6.20',4,0.25),
+ (10461,21,'8.00',40,0.25),
+ (10461,30,'20.70',28,0.25),
+ (10461,55,'19.20',60,0.25),
+ (10462,13,'4.80',1,0),
+ (10462,23,'7.20',21,0),
+ (10463,19,'7.30',21,0),
+ (10463,42,'11.20',50,0),
+ (10464,4,'17.60',16,0.2),
+ (10464,43,'36.80',3,0),
+ (10464,56,'30.40',30,0.2),
+ (10464,60,'27.20',20,0),
+ (10465,24,'3.60',25,0),
+ (10465,29,'99.00',18,0.1),
+ (10465,40,'14.70',20,0),
+ (10465,45,'7.60',30,0.1),
+ (10465,50,'13.00',25,0),
+ (10466,11,'16.80',10,0),
+ (10466,46,'9.60',5,0),
+ (10467,24,'3.60',28,0),
+ (10467,25,'11.20',12,0),
+ (10468,30,'20.70',8,0),
+ (10468,43,'36.80',15,0),
+ (10469,2,'15.20',40,0.15),
+ (10469,16,'13.90',35,0.15),
+ (10469,44,'15.50',2,0.15),
+ (10470,18,'50.00',30,0),
+ (10470,23,'7.20',15,0),
+ (10470,64,'26.60',8,0),
+ (10471,7,'24.00',30,0),
+ (10471,56,'30.40',20,0),
+ (10472,24,'3.60',80,0.05),
+ (10472,51,'42.40',18,0),
+ (10473,33,'2.00',12,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10473,71,'17.20',12,0),
+ (10474,14,'18.60',12,0),
+ (10474,28,'36.40',18,0),
+ (10474,40,'14.70',21,0),
+ (10474,75,'6.20',10,0),
+ (10475,31,'10.00',35,0.15),
+ (10475,66,'13.60',60,0.15),
+ (10475,76,'14.40',42,0.15),
+ (10476,55,'19.20',2,0.05),
+ (10476,70,'12.00',12,0),
+ (10477,1,'14.40',15,0),
+ (10477,21,'8.00',21,0.25),
+ (10477,39,'14.40',20,0.25),
+ (10478,10,'24.80',20,0.05),
+ (10479,38,'210.80',30,0),
+ (10479,53,'26.20',28,0),
+ (10479,59,'44.00',60,0),
+ (10479,64,'26.60',30,0),
+ (10480,47,'7.60',30,0),
+ (10480,59,'44.00',12,0),
+ (10481,49,'16.00',24,0),
+ (10481,60,'27.20',40,0),
+ (10482,40,'14.70',10,0),
+ (10483,34,'11.20',35,0.05),
+ (10483,77,'10.40',30,0.05),
+ (10484,21,'8.00',14,0),
+ (10484,40,'14.70',10,0),
+ (10484,51,'42.40',3,0),
+ (10485,2,'15.20',20,0.1),
+ (10485,3,'8.00',20,0.1),
+ (10485,55,'19.20',30,0.1),
+ (10485,70,'12.00',60,0.1),
+ (10486,11,'16.80',5,0),
+ (10486,51,'42.40',25,0),
+ (10486,74,'8.00',16,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10487,19,'7.30',5,0),
+ (10487,26,'24.90',30,0),
+ (10487,54,'5.90',24,0.25),
+ (10488,59,'44.00',30,0),
+ (10488,73,'12.00',20,0.2),
+ (10489,11,'16.80',15,0.25),
+ (10489,16,'13.90',18,0),
+ (10490,59,'44.00',60,0),
+ (10490,68,'10.00',30,0),
+ (10490,75,'6.20',36,0),
+ (10491,44,'15.50',15,0.15),
+ (10491,77,'10.40',7,0.15),
+ (10492,25,'11.20',60,0.05),
+ (10492,42,'11.20',20,0.05),
+ (10493,65,'16.80',15,0.1),
+ (10493,66,'13.60',10,0.1),
+ (10493,69,'28.80',10,0.1),
+ (10494,56,'30.40',30,0),
+ (10495,23,'7.20',10,0),
+ (10495,41,'7.70',20,0),
+ (10495,77,'10.40',5,0),
+ (10496,31,'10.00',20,0.05),
+ (10497,56,'30.40',14,0),
+ (10497,72,'27.80',25,0),
+ (10497,77,'10.40',25,0),
+ (10498,24,'4.50',14,0),
+ (10498,40,'18.40',5,0),
+ (10498,42,'14.00',30,0),
+ (10499,28,'45.60',20,0),
+ (10499,49,'20.00',25,0),
+ (10500,15,'15.50',12,0.05),
+ (10500,28,'45.60',8,0.05),
+ (10501,54,'7.45',20,0),
+ (10502,45,'9.50',21,0),
+ (10502,53,'32.80',6,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10502,67,'14.00',30,0),
+ (10503,14,'23.25',70,0),
+ (10503,65,'21.05',20,0),
+ (10504,2,'19.00',12,0),
+ (10504,21,'10.00',12,0),
+ (10504,53,'32.80',10,0),
+ (10504,61,'28.50',25,0),
+ (10505,62,'49.30',3,0),
+ (10506,25,'14.00',18,0.1),
+ (10506,70,'15.00',14,0.1),
+ (10507,43,'46.00',15,0.15),
+ (10507,48,'12.75',15,0.15),
+ (10508,13,'6.00',10,0),
+ (10508,39,'18.00',10,0),
+ (10509,28,'45.60',3,0),
+ (10510,29,'123.79',36,0),
+ (10510,75,'7.75',36,0.1),
+ (10511,4,'22.00',50,0.15),
+ (10511,7,'30.00',50,0.15),
+ (10511,8,'40.00',10,0.15),
+ (10512,24,'4.50',10,0.15),
+ (10512,46,'12.00',9,0.15),
+ (10512,47,'9.50',6,0.15),
+ (10512,60,'34.00',12,0.15),
+ (10513,21,'10.00',40,0.2),
+ (10513,32,'32.00',50,0.2),
+ (10513,61,'28.50',15,0.2),
+ (10514,20,'81.00',39,0),
+ (10514,28,'45.60',35,0),
+ (10514,56,'38.00',70,0),
+ (10514,65,'21.05',39,0),
+ (10514,75,'7.75',50,0),
+ (10515,9,'97.00',16,0.15),
+ (10515,16,'17.45',50,0),
+ (10515,27,'43.90',120,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10515,33,'2.50',16,0.15),
+ (10515,60,'34.00',84,0.15),
+ (10516,18,'62.50',25,0.1),
+ (10516,41,'9.65',80,0.1),
+ (10516,42,'14.00',20,0),
+ (10517,52,'7.00',6,0),
+ (10517,59,'55.00',4,0),
+ (10517,70,'15.00',6,0),
+ (10518,24,'4.50',5,0),
+ (10518,38,'263.50',15,0),
+ (10518,44,'19.45',9,0),
+ (10519,10,'31.00',16,0.05),
+ (10519,56,'38.00',40,0),
+ (10519,60,'34.00',10,0.05),
+ (10520,24,'4.50',8,0),
+ (10520,53,'32.80',5,0),
+ (10521,35,'18.00',3,0),
+ (10521,41,'9.65',10,0),
+ (10521,68,'12.50',6,0),
+ (10522,1,'18.00',40,0.2),
+ (10522,8,'40.00',24,0),
+ (10522,30,'25.89',20,0.2),
+ (10522,40,'18.40',25,0.2),
+ (10523,17,'39.00',25,0.1),
+ (10523,20,'81.00',15,0.1),
+ (10523,37,'26.00',18,0.1),
+ (10523,41,'9.65',6,0.1),
+ (10524,10,'31.00',2,0),
+ (10524,30,'25.89',10,0),
+ (10524,43,'46.00',60,0),
+ (10524,54,'7.45',15,0),
+ (10525,36,'19.00',30,0),
+ (10525,40,'18.40',15,0.1),
+ (10526,1,'18.00',8,0.15),
+ (10526,13,'6.00',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10526,56,'38.00',30,0.15),
+ (10527,4,'22.00',50,0.1),
+ (10527,36,'19.00',30,0.1),
+ (10528,11,'21.00',3,0),
+ (10528,33,'2.50',8,0.2),
+ (10528,72,'34.80',9,0),
+ (10529,55,'24.00',14,0),
+ (10529,68,'12.50',20,0),
+ (10529,69,'36.00',10,0),
+ (10530,17,'39.00',40,0),
+ (10530,43,'46.00',25,0),
+ (10530,61,'28.50',20,0),
+ (10530,76,'18.00',50,0),
+ (10531,59,'55.00',2,0),
+ (10532,30,'25.89',15,0),
+ (10532,66,'17.00',24,0),
+ (10533,4,'22.00',50,0.05),
+ (10533,72,'34.80',24,0),
+ (10533,73,'15.00',24,0.05),
+ (10534,30,'25.89',10,0),
+ (10534,40,'18.40',10,0.2),
+ (10534,54,'7.45',10,0.2),
+ (10535,11,'21.00',50,0.1),
+ (10535,40,'18.40',10,0.1),
+ (10535,57,'19.50',5,0.1),
+ (10535,59,'55.00',15,0.1),
+ (10536,12,'38.00',15,0.25),
+ (10536,31,'12.50',20,0),
+ (10536,33,'2.50',30,0),
+ (10536,60,'34.00',35,0.25),
+ (10537,31,'12.50',30,0),
+ (10537,51,'53.00',6,0),
+ (10537,58,'13.25',20,0),
+ (10537,72,'34.80',21,0),
+ (10537,73,'15.00',9,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10538,70,'15.00',7,0),
+ (10538,72,'34.80',1,0),
+ (10539,13,'6.00',8,0),
+ (10539,21,'10.00',15,0),
+ (10539,33,'2.50',15,0),
+ (10539,49,'20.00',6,0),
+ (10540,3,'10.00',60,0),
+ (10540,26,'31.23',40,0),
+ (10540,38,'263.50',30,0),
+ (10540,68,'12.50',35,0),
+ (10541,24,'4.50',35,0.1),
+ (10541,38,'263.50',4,0.1),
+ (10541,65,'21.05',36,0.1),
+ (10541,71,'21.50',9,0.1),
+ (10542,11,'21.00',15,0.05),
+ (10542,54,'7.45',24,0.05),
+ (10543,12,'38.00',30,0.15),
+ (10543,23,'9.00',70,0.15),
+ (10544,28,'45.60',7,0),
+ (10544,67,'14.00',7,0),
+ (10545,11,'21.00',10,0),
+ (10546,7,'30.00',10,0),
+ (10546,35,'18.00',30,0),
+ (10546,62,'49.30',40,0),
+ (10547,32,'32.00',24,0.15),
+ (10547,36,'19.00',60,0),
+ (10548,34,'14.00',10,0.25),
+ (10548,41,'9.65',14,0),
+ (10549,31,'12.50',55,0.15),
+ (10549,45,'9.50',100,0.15),
+ (10549,51,'53.00',48,0.15),
+ (10550,17,'39.00',8,0.1),
+ (10550,19,'9.20',10,0),
+ (10550,21,'10.00',6,0.1),
+ (10550,61,'28.50',10,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10551,16,'17.45',40,0.15),
+ (10551,35,'18.00',20,0.15),
+ (10551,44,'19.45',40,0),
+ (10552,69,'36.00',18,0),
+ (10552,75,'7.75',30,0),
+ (10553,11,'21.00',15,0),
+ (10553,16,'17.45',14,0),
+ (10553,22,'21.00',24,0),
+ (10553,31,'12.50',30,0),
+ (10553,35,'18.00',6,0),
+ (10554,16,'17.45',30,0.05),
+ (10554,23,'9.00',20,0.05),
+ (10554,62,'49.30',20,0.05),
+ (10554,77,'13.00',10,0.05),
+ (10555,14,'23.25',30,0.2),
+ (10555,19,'9.20',35,0.2),
+ (10555,24,'4.50',18,0.2),
+ (10555,51,'53.00',20,0.2),
+ (10555,56,'38.00',40,0.2),
+ (10556,72,'34.80',24,0),
+ (10557,64,'33.25',30,0),
+ (10557,75,'7.75',20,0),
+ (10558,47,'9.50',25,0),
+ (10558,51,'53.00',20,0),
+ (10558,52,'7.00',30,0),
+ (10558,53,'32.80',18,0),
+ (10558,73,'15.00',3,0),
+ (10559,41,'9.65',12,0.05),
+ (10559,55,'24.00',18,0.05),
+ (10560,30,'25.89',20,0),
+ (10560,62,'49.30',15,0.25),
+ (10561,44,'19.45',10,0),
+ (10561,51,'53.00',50,0),
+ (10562,33,'2.50',20,0.1),
+ (10562,62,'49.30',10,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10563,36,'19.00',25,0),
+ (10563,52,'7.00',70,0),
+ (10564,17,'39.00',16,0.05),
+ (10564,31,'12.50',6,0.05),
+ (10564,55,'24.00',25,0.05),
+ (10565,24,'4.50',25,0.1),
+ (10565,64,'33.25',18,0.1),
+ (10566,11,'21.00',35,0.15),
+ (10566,18,'62.50',18,0.15),
+ (10566,76,'18.00',10,0),
+ (10567,31,'12.50',60,0.2),
+ (10567,51,'53.00',3,0),
+ (10567,59,'55.00',40,0.2),
+ (10568,10,'31.00',5,0),
+ (10569,31,'12.50',35,0.2),
+ (10569,76,'18.00',30,0),
+ (10570,11,'21.00',15,0.05),
+ (10570,56,'38.00',60,0.05),
+ (10571,14,'23.25',11,0.15),
+ (10571,42,'14.00',28,0.15),
+ (10572,16,'17.45',12,0.1),
+ (10572,32,'32.00',10,0.1),
+ (10572,40,'18.40',50,0),
+ (10572,75,'7.75',15,0.1),
+ (10573,17,'39.00',18,0),
+ (10573,34,'14.00',40,0),
+ (10573,53,'32.80',25,0),
+ (10574,33,'2.50',14,0),
+ (10574,40,'18.40',2,0),
+ (10574,62,'49.30',10,0),
+ (10574,64,'33.25',6,0),
+ (10575,59,'55.00',12,0),
+ (10575,63,'43.90',6,0),
+ (10575,72,'34.80',30,0),
+ (10575,76,'18.00',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10576,1,'18.00',10,0),
+ (10576,31,'12.50',20,0),
+ (10576,44,'19.45',21,0),
+ (10577,39,'18.00',10,0),
+ (10577,75,'7.75',20,0),
+ (10577,77,'13.00',18,0),
+ (10578,35,'18.00',20,0),
+ (10578,57,'19.50',6,0),
+ (10579,15,'15.50',10,0),
+ (10579,75,'7.75',21,0),
+ (10580,14,'23.25',15,0.05),
+ (10580,41,'9.65',9,0.05),
+ (10580,65,'21.05',30,0.05),
+ (10581,75,'7.75',50,0.2),
+ (10582,57,'19.50',4,0),
+ (10582,76,'18.00',14,0),
+ (10583,29,'123.79',10,0),
+ (10583,60,'34.00',24,0.15),
+ (10583,69,'36.00',10,0.15),
+ (10584,31,'12.50',50,0.05),
+ (10585,47,'9.50',15,0),
+ (10586,52,'7.00',4,0.15),
+ (10587,26,'31.23',6,0),
+ (10587,35,'18.00',20,0),
+ (10587,77,'13.00',20,0),
+ (10588,18,'62.50',40,0.2),
+ (10588,42,'14.00',100,0.2),
+ (10589,35,'18.00',4,0),
+ (10590,1,'18.00',20,0),
+ (10590,77,'13.00',60,0.05),
+ (10591,3,'10.00',14,0),
+ (10591,7,'30.00',10,0),
+ (10591,54,'7.45',50,0),
+ (10592,15,'15.50',25,0.05),
+ (10592,26,'31.23',5,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10593,20,'81.00',21,0.2),
+ (10593,69,'36.00',20,0.2),
+ (10593,76,'18.00',4,0.2),
+ (10594,52,'7.00',24,0),
+ (10594,58,'13.25',30,0),
+ (10595,35,'18.00',30,0.25),
+ (10595,61,'28.50',120,0.25),
+ (10595,69,'36.00',65,0.25),
+ (10596,56,'38.00',5,0.2),
+ (10596,63,'43.90',24,0.2),
+ (10596,75,'7.75',30,0.2),
+ (10597,24,'4.50',35,0.2),
+ (10597,57,'19.50',20,0),
+ (10597,65,'21.05',12,0.2),
+ (10598,27,'43.90',50,0),
+ (10598,71,'21.50',9,0),
+ (10599,62,'49.30',10,0),
+ (10600,54,'7.45',4,0),
+ (10600,73,'15.00',30,0),
+ (10601,13,'6.00',60,0),
+ (10601,59,'55.00',35,0),
+ (10602,77,'13.00',5,0.25),
+ (10603,22,'21.00',48,0),
+ (10603,49,'20.00',25,0.05),
+ (10604,48,'12.75',6,0.1),
+ (10604,76,'18.00',10,0.1),
+ (10605,16,'17.45',30,0.05),
+ (10605,59,'55.00',20,0.05),
+ (10605,60,'34.00',70,0.05),
+ (10605,71,'21.50',15,0.05),
+ (10606,4,'22.00',20,0.2),
+ (10606,55,'24.00',20,0.2),
+ (10606,62,'49.30',10,0.2),
+ (10607,7,'30.00',45,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10607,17,'39.00',100,0),
+ (10607,33,'2.50',14,0),
+ (10607,40,'18.40',42,0),
+ (10607,72,'34.80',12,0),
+ (10608,56,'38.00',28,0),
+ (10609,1,'18.00',3,0),
+ (10609,10,'31.00',10,0),
+ (10609,21,'10.00',6,0),
+ (10610,36,'19.00',21,0.25),
+ (10611,1,'18.00',6,0),
+ (10611,2,'19.00',10,0),
+ (10611,60,'34.00',15,0),
+ (10612,10,'31.00',70,0),
+ (10612,36,'19.00',55,0),
+ (10612,49,'20.00',18,0),
+ (10612,60,'34.00',40,0),
+ (10612,76,'18.00',80,0),
+ (10613,13,'6.00',8,0.1),
+ (10613,75,'7.75',40,0),
+ (10614,11,'21.00',14,0),
+ (10614,21,'10.00',8,0),
+ (10614,39,'18.00',5,0),
+ (10615,55,'24.00',5,0),
+ (10616,38,'263.50',15,0.05),
+ (10616,56,'38.00',14,0),
+ (10616,70,'15.00',15,0.05),
+ (10616,71,'21.50',15,0.05),
+ (10617,59,'55.00',30,0.15),
+ (10618,6,'25.00',70,0),
+ (10618,56,'38.00',20,0),
+ (10618,68,'12.50',15,0),
+ (10619,21,'10.00',42,0),
+ (10619,22,'21.00',40,0),
+ (10620,24,'4.50',5,0),
+ (10620,52,'7.00',5,0),
+ (10621,19,'9.20',5,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10621,23,'9.00',10,0),
+ (10621,70,'15.00',20,0),
+ (10621,71,'21.50',15,0),
+ (10622,2,'19.00',20,0),
+ (10622,68,'12.50',18,0.2),
+ (10623,14,'23.25',21,0),
+ (10623,19,'9.20',15,0.1),
+ (10623,21,'10.00',25,0.1),
+ (10623,24,'4.50',3,0),
+ (10623,35,'18.00',30,0.1),
+ (10624,28,'45.60',10,0),
+ (10624,29,'123.79',6,0),
+ (10624,44,'19.45',10,0),
+ (10625,14,'23.25',3,0),
+ (10625,42,'14.00',5,0),
+ (10625,60,'34.00',10,0),
+ (10626,53,'32.80',12,0),
+ (10626,60,'34.00',20,0),
+ (10626,71,'21.50',20,0),
+ (10627,62,'49.30',15,0),
+ (10627,73,'15.00',35,0.15),
+ (10628,1,'18.00',25,0),
+ (10629,29,'123.79',20,0),
+ (10629,64,'33.25',9,0),
+ (10630,55,'24.00',12,0.05),
+ (10630,76,'18.00',35,0),
+ (10631,75,'7.75',8,0.1),
+ (10632,2,'19.00',30,0.05),
+ (10632,33,'2.50',20,0.05),
+ (10633,12,'38.00',36,0.15),
+ (10633,13,'6.00',13,0.15),
+ (10633,26,'31.23',35,0.15),
+ (10633,62,'49.30',80,0.15),
+ (10634,7,'30.00',35,0),
+ (10634,18,'62.50',50,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10634,51,'53.00',15,0),
+ (10634,75,'7.75',2,0),
+ (10635,4,'22.00',10,0.1),
+ (10635,5,'21.35',15,0.1),
+ (10635,22,'21.00',40,0),
+ (10636,4,'22.00',25,0),
+ (10636,58,'13.25',6,0),
+ (10637,11,'21.00',10,0),
+ (10637,50,'16.25',25,0.05),
+ (10637,56,'38.00',60,0.05),
+ (10638,45,'9.50',20,0),
+ (10638,65,'21.05',21,0),
+ (10638,72,'34.80',60,0),
+ (10639,18,'62.50',8,0),
+ (10640,69,'36.00',20,0.25),
+ (10640,70,'15.00',15,0.25),
+ (10641,2,'19.00',50,0),
+ (10641,40,'18.40',60,0),
+ (10642,21,'10.00',30,0.2),
+ (10642,61,'28.50',20,0.2),
+ (10643,28,'45.60',15,0.25),
+ (10643,39,'18.00',21,0.25),
+ (10643,46,'12.00',2,0.25),
+ (10644,18,'62.50',4,0.1),
+ (10644,43,'46.00',20,0),
+ (10644,46,'12.00',21,0.1),
+ (10645,18,'62.50',20,0),
+ (10645,36,'19.00',15,0),
+ (10646,1,'18.00',15,0.25),
+ (10646,10,'31.00',18,0.25),
+ (10646,71,'21.50',30,0.25),
+ (10646,77,'13.00',35,0.25),
+ (10647,19,'9.20',30,0),
+ (10647,39,'18.00',20,0),
+ (10648,22,'21.00',15,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10648,24,'4.50',15,0.15),
+ (10649,28,'45.60',20,0),
+ (10649,72,'34.80',15,0),
+ (10650,30,'25.89',30,0),
+ (10650,53,'32.80',25,0.05),
+ (10650,54,'7.45',30,0),
+ (10651,19,'9.20',12,0.25),
+ (10651,22,'21.00',20,0.25),
+ (10652,30,'25.89',2,0.25),
+ (10652,42,'14.00',20,0),
+ (10653,16,'17.45',30,0.1),
+ (10653,60,'34.00',20,0.1),
+ (10654,4,'22.00',12,0.1),
+ (10654,39,'18.00',20,0.1),
+ (10654,54,'7.45',6,0.1),
+ (10655,41,'9.65',20,0.2),
+ (10656,14,'23.25',3,0.1),
+ (10656,44,'19.45',28,0.1),
+ (10656,47,'9.50',6,0.1),
+ (10657,15,'15.50',50,0),
+ (10657,41,'9.65',24,0),
+ (10657,46,'12.00',45,0),
+ (10657,47,'9.50',10,0),
+ (10657,56,'38.00',45,0),
+ (10657,60,'34.00',30,0),
+ (10658,21,'10.00',60,0),
+ (10658,40,'18.40',70,0.05),
+ (10658,60,'34.00',55,0.05),
+ (10658,77,'13.00',70,0.05),
+ (10659,31,'12.50',20,0.05),
+ (10659,40,'18.40',24,0.05),
+ (10659,70,'15.00',40,0.05),
+ (10660,20,'81.00',21,0),
+ (10661,39,'18.00',3,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10661,58,'13.25',49,0.2),
+ (10662,68,'12.50',10,0),
+ (10663,40,'18.40',30,0.05),
+ (10663,42,'14.00',30,0.05),
+ (10663,51,'53.00',20,0.05),
+ (10664,10,'31.00',24,0.15),
+ (10664,56,'38.00',12,0.15),
+ (10664,65,'21.05',15,0.15),
+ (10665,51,'53.00',20,0),
+ (10665,59,'55.00',1,0),
+ (10665,76,'18.00',10,0),
+ (10666,29,'123.79',36,0),
+ (10666,65,'21.05',10,0),
+ (10667,69,'36.00',45,0.2),
+ (10667,71,'21.50',14,0.2),
+ (10668,31,'12.50',8,0.1),
+ (10668,55,'24.00',4,0.1),
+ (10668,64,'33.25',15,0.1),
+ (10669,36,'19.00',30,0),
+ (10670,23,'9.00',32,0),
+ (10670,46,'12.00',60,0),
+ (10670,67,'14.00',25,0),
+ (10670,73,'15.00',50,0),
+ (10670,75,'7.75',25,0),
+ (10671,16,'17.45',10,0),
+ (10671,62,'49.30',10,0),
+ (10671,65,'21.05',12,0),
+ (10672,38,'263.50',15,0.1),
+ (10672,71,'21.50',12,0),
+ (10673,16,'17.45',3,0),
+ (10673,42,'14.00',6,0),
+ (10673,43,'46.00',6,0),
+ (10674,23,'9.00',5,0),
+ (10675,14,'23.25',30,0),
+ (10675,53,'32.80',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10675,58,'13.25',30,0),
+ (10676,10,'31.00',2,0),
+ (10676,19,'9.20',7,0),
+ (10676,44,'19.45',21,0),
+ (10677,26,'31.23',30,0.15),
+ (10677,33,'2.50',8,0.15),
+ (10678,12,'38.00',100,0),
+ (10678,33,'2.50',30,0),
+ (10678,41,'9.65',120,0),
+ (10678,54,'7.45',30,0),
+ (10679,59,'55.00',12,0),
+ (10680,16,'17.45',50,0.25),
+ (10680,31,'12.50',20,0.25),
+ (10680,42,'14.00',40,0.25),
+ (10681,19,'9.20',30,0.1),
+ (10681,21,'10.00',12,0.1),
+ (10681,64,'33.25',28,0),
+ (10682,33,'2.50',30,0),
+ (10682,66,'17.00',4,0),
+ (10682,75,'7.75',30,0),
+ (10683,52,'7.00',9,0),
+ (10684,40,'18.40',20,0),
+ (10684,47,'9.50',40,0),
+ (10684,60,'34.00',30,0),
+ (10685,10,'31.00',20,0),
+ (10685,41,'9.65',4,0),
+ (10685,47,'9.50',15,0),
+ (10686,17,'39.00',30,0.2),
+ (10686,26,'31.23',15,0),
+ (10687,9,'97.00',50,0.25),
+ (10687,29,'123.79',10,0),
+ (10687,36,'19.00',6,0.25),
+ (10688,10,'31.00',18,0.1),
+ (10688,28,'45.60',60,0.1),
+ (10688,34,'14.00',14,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10689,1,'18.00',35,0.25),
+ (10690,56,'38.00',20,0.25),
+ (10690,77,'13.00',30,0.25),
+ (10691,1,'18.00',30,0),
+ (10691,29,'123.79',40,0),
+ (10691,43,'46.00',40,0),
+ (10691,44,'19.45',24,0),
+ (10691,62,'49.30',48,0),
+ (10692,63,'43.90',20,0),
+ (10693,9,'97.00',6,0),
+ (10693,54,'7.45',60,0.15),
+ (10693,69,'36.00',30,0.15),
+ (10693,73,'15.00',15,0.15),
+ (10694,7,'30.00',90,0),
+ (10694,59,'55.00',25,0),
+ (10694,70,'15.00',50,0),
+ (10695,8,'40.00',10,0),
+ (10695,12,'38.00',4,0),
+ (10695,24,'4.50',20,0),
+ (10696,17,'39.00',20,0),
+ (10696,46,'12.00',18,0),
+ (10697,19,'9.20',7,0.25),
+ (10697,35,'18.00',9,0.25),
+ (10697,58,'13.25',30,0.25),
+ (10697,70,'15.00',30,0.25),
+ (10698,11,'21.00',15,0),
+ (10698,17,'39.00',8,0.05),
+ (10698,29,'123.79',12,0.05),
+ (10698,65,'21.05',65,0.05),
+ (10698,70,'15.00',8,0.05),
+ (10699,47,'9.50',12,0),
+ (10700,1,'18.00',5,0.2),
+ (10700,34,'14.00',12,0.2),
+ (10700,68,'12.50',40,0.2),
+ (10700,71,'21.50',60,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10701,59,'55.00',42,0.15),
+ (10701,71,'21.50',20,0.15),
+ (10701,76,'18.00',35,0.15),
+ (10702,3,'10.00',6,0),
+ (10702,76,'18.00',15,0),
+ (10703,2,'19.00',5,0),
+ (10703,59,'55.00',35,0),
+ (10703,73,'15.00',35,0),
+ (10704,4,'22.00',6,0),
+ (10704,24,'4.50',35,0),
+ (10704,48,'12.75',24,0),
+ (10705,31,'12.50',20,0),
+ (10705,32,'32.00',4,0),
+ (10706,16,'17.45',20,0),
+ (10706,43,'46.00',24,0),
+ (10706,59,'55.00',8,0),
+ (10707,55,'24.00',21,0),
+ (10707,57,'19.50',40,0),
+ (10707,70,'15.00',28,0.15),
+ (10708,5,'21.35',4,0),
+ (10708,36,'19.00',5,0),
+ (10709,8,'40.00',40,0),
+ (10709,51,'53.00',28,0),
+ (10709,60,'34.00',10,0),
+ (10710,19,'9.20',5,0),
+ (10710,47,'9.50',5,0),
+ (10711,19,'9.20',12,0),
+ (10711,41,'9.65',42,0),
+ (10711,53,'32.80',120,0),
+ (10712,53,'32.80',3,0.05),
+ (10712,56,'38.00',30,0),
+ (10713,10,'31.00',18,0),
+ (10713,26,'31.23',30,0),
+ (10713,45,'9.50',110,0),
+ (10713,46,'12.00',24,0),
+ (10714,2,'19.00',30,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10714,17,'39.00',27,0.25),
+ (10714,47,'9.50',50,0.25),
+ (10714,56,'38.00',18,0.25),
+ (10714,58,'13.25',12,0.25),
+ (10715,10,'31.00',21,0),
+ (10715,71,'21.50',30,0),
+ (10716,21,'10.00',5,0),
+ (10716,51,'53.00',7,0),
+ (10716,61,'28.50',10,0),
+ (10717,21,'10.00',32,0.05),
+ (10717,54,'7.45',15,0),
+ (10717,69,'36.00',25,0.05),
+ (10718,12,'38.00',36,0),
+ (10718,16,'17.45',20,0),
+ (10718,36,'19.00',40,0),
+ (10718,62,'49.30',20,0),
+ (10719,18,'62.50',12,0.25),
+ (10719,30,'25.89',3,0.25),
+ (10719,54,'7.45',40,0.25),
+ (10720,35,'18.00',21,0),
+ (10720,71,'21.50',8,0),
+ (10721,44,'19.45',50,0.05),
+ (10722,2,'19.00',3,0),
+ (10722,31,'12.50',50,0),
+ (10722,68,'12.50',45,0),
+ (10722,75,'7.75',42,0),
+ (10723,26,'31.23',15,0),
+ (10724,10,'31.00',16,0),
+ (10724,61,'28.50',5,0),
+ (10725,41,'9.65',12,0),
+ (10725,52,'7.00',4,0),
+ (10725,55,'24.00',6,0),
+ (10726,4,'22.00',25,0),
+ (10726,11,'21.00',5,0),
+ (10727,17,'39.00',20,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10727,56,'38.00',10,0.05),
+ (10727,59,'55.00',10,0.05),
+ (10728,30,'25.89',15,0),
+ (10728,40,'18.40',6,0),
+ (10728,55,'24.00',12,0),
+ (10728,60,'34.00',15,0),
+ (10729,1,'18.00',50,0),
+ (10729,21,'10.00',30,0),
+ (10729,50,'16.25',40,0),
+ (10730,16,'17.45',15,0.05),
+ (10730,31,'12.50',3,0.05),
+ (10730,65,'21.05',10,0.05),
+ (10731,21,'10.00',40,0.05),
+ (10731,51,'53.00',30,0.05),
+ (10732,76,'18.00',20,0),
+ (10733,14,'23.25',16,0),
+ (10733,28,'45.60',20,0),
+ (10733,52,'7.00',25,0),
+ (10734,6,'25.00',30,0),
+ (10734,30,'25.89',15,0),
+ (10734,76,'18.00',20,0),
+ (10735,61,'28.50',20,0.1),
+ (10735,77,'13.00',2,0.1),
+ (10736,65,'21.05',40,0),
+ (10736,75,'7.75',20,0),
+ (10737,13,'6.00',4,0),
+ (10737,41,'9.65',12,0),
+ (10738,16,'17.45',3,0),
+ (10739,36,'19.00',6,0),
+ (10739,52,'7.00',18,0),
+ (10740,28,'45.60',5,0.2),
+ (10740,35,'18.00',35,0.2),
+ (10740,45,'9.50',40,0.2),
+ (10740,56,'38.00',14,0.2),
+ (10741,2,'19.00',15,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10742,3,'10.00',20,0),
+ (10742,60,'34.00',50,0),
+ (10742,72,'34.80',35,0),
+ (10743,46,'12.00',28,0.05),
+ (10744,40,'18.40',50,0.2),
+ (10745,18,'62.50',24,0),
+ (10745,44,'19.45',16,0),
+ (10745,59,'55.00',45,0),
+ (10745,72,'34.80',7,0),
+ (10746,13,'6.00',6,0),
+ (10746,42,'14.00',28,0),
+ (10746,62,'49.30',9,0),
+ (10746,69,'36.00',40,0),
+ (10747,31,'12.50',8,0),
+ (10747,41,'9.65',35,0),
+ (10747,63,'43.90',9,0),
+ (10747,69,'36.00',30,0),
+ (10748,23,'9.00',44,0),
+ (10748,40,'18.40',40,0),
+ (10748,56,'38.00',28,0),
+ (10749,56,'38.00',15,0),
+ (10749,59,'55.00',6,0),
+ (10749,76,'18.00',10,0),
+ (10750,14,'23.25',5,0.15),
+ (10750,45,'9.50',40,0.15),
+ (10750,59,'55.00',25,0.15),
+ (10751,26,'31.23',12,0.1),
+ (10751,30,'25.89',30,0),
+ (10751,50,'16.25',20,0.1),
+ (10751,73,'15.00',15,0),
+ (10752,1,'18.00',8,0),
+ (10752,69,'36.00',3,0),
+ (10753,45,'9.50',4,0),
+ (10753,74,'10.00',5,0),
+ (10754,40,'18.40',3,0),
+ (10755,47,'9.50',30,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10755,56,'38.00',30,0.25),
+ (10755,57,'19.50',14,0.25),
+ (10755,69,'36.00',25,0.25),
+ (10756,18,'62.50',21,0.2),
+ (10756,36,'19.00',20,0.2),
+ (10756,68,'12.50',6,0.2),
+ (10756,69,'36.00',20,0.2),
+ (10757,34,'14.00',30,0),
+ (10757,59,'55.00',7,0),
+ (10757,62,'49.30',30,0),
+ (10757,64,'33.25',24,0),
+ (10758,26,'31.23',20,0),
+ (10758,52,'7.00',60,0),
+ (10758,70,'15.00',40,0),
+ (10759,32,'32.00',10,0),
+ (10760,25,'14.00',12,0.25),
+ (10760,27,'43.90',40,0),
+ (10760,43,'46.00',30,0.25),
+ (10761,25,'14.00',35,0.25),
+ (10761,75,'7.75',18,0),
+ (10762,39,'18.00',16,0),
+ (10762,47,'9.50',30,0),
+ (10762,51,'53.00',28,0),
+ (10762,56,'38.00',60,0),
+ (10763,21,'10.00',40,0),
+ (10763,22,'21.00',6,0),
+ (10763,24,'4.50',20,0),
+ (10764,3,'10.00',20,0.1),
+ (10764,39,'18.00',130,0.1),
+ (10765,65,'21.05',80,0.1),
+ (10766,2,'19.00',40,0),
+ (10766,7,'30.00',35,0),
+ (10766,68,'12.50',40,0),
+ (10767,42,'14.00',2,0),
+ (10768,22,'21.00',4,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10768,31,'12.50',50,0),
+ (10768,60,'34.00',15,0),
+ (10768,71,'21.50',12,0),
+ (10769,41,'9.65',30,0.05),
+ (10769,52,'7.00',15,0.05),
+ (10769,61,'28.50',20,0),
+ (10769,62,'49.30',15,0),
+ (10770,11,'21.00',15,0.25),
+ (10771,71,'21.50',16,0),
+ (10772,29,'123.79',18,0),
+ (10772,59,'55.00',25,0),
+ (10773,17,'39.00',33,0),
+ (10773,31,'12.50',70,0.2),
+ (10773,75,'7.75',7,0.2),
+ (10774,31,'12.50',2,0.25),
+ (10774,66,'17.00',50,0),
+ (10775,10,'31.00',6,0),
+ (10775,67,'14.00',3,0),
+ (10776,31,'12.50',16,0.05),
+ (10776,42,'14.00',12,0.05),
+ (10776,45,'9.50',27,0.05),
+ (10776,51,'53.00',120,0.05),
+ (10777,42,'14.00',20,0.2),
+ (10778,41,'9.65',10,0),
+ (10779,16,'17.45',20,0),
+ (10779,62,'49.30',20,0),
+ (10780,70,'15.00',35,0),
+ (10780,77,'13.00',15,0),
+ (10781,54,'7.45',3,0.2),
+ (10781,56,'38.00',20,0.2),
+ (10781,74,'10.00',35,0),
+ (10782,31,'12.50',1,0),
+ (10783,31,'12.50',10,0),
+ (10783,38,'263.50',5,0),
+ (10784,36,'19.00',30,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10784,39,'18.00',2,0.15),
+ (10784,72,'34.80',30,0.15),
+ (10785,10,'31.00',10,0),
+ (10785,75,'7.75',10,0),
+ (10786,8,'40.00',30,0.2),
+ (10786,30,'25.89',15,0.2),
+ (10786,75,'7.75',42,0.2),
+ (10787,2,'19.00',15,0.05),
+ (10787,29,'123.79',20,0.05),
+ (10788,19,'9.20',50,0.05),
+ (10788,75,'7.75',40,0.05),
+ (10789,18,'62.50',30,0),
+ (10789,35,'18.00',15,0),
+ (10789,63,'43.90',30,0),
+ (10789,68,'12.50',18,0),
+ (10790,7,'30.00',3,0.15),
+ (10790,56,'38.00',20,0.15),
+ (10791,29,'123.79',14,0.05),
+ (10791,41,'9.65',20,0.05),
+ (10792,2,'19.00',10,0),
+ (10792,54,'7.45',3,0),
+ (10792,68,'12.50',15,0),
+ (10793,41,'9.65',14,0),
+ (10793,52,'7.00',8,0),
+ (10794,14,'23.25',15,0.2),
+ (10794,54,'7.45',6,0.2),
+ (10795,16,'17.45',65,0),
+ (10795,17,'39.00',35,0.25),
+ (10796,26,'31.23',21,0.2),
+ (10796,44,'19.45',10,0),
+ (10796,64,'33.25',35,0.2),
+ (10796,69,'36.00',24,0.2),
+ (10797,11,'21.00',20,0),
+ (10798,62,'49.30',2,0),
+ (10798,72,'34.80',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10799,13,'6.00',20,0.15),
+ (10799,24,'4.50',20,0.15),
+ (10799,59,'55.00',25,0),
+ (10800,11,'21.00',50,0.1),
+ (10800,51,'53.00',10,0.1),
+ (10800,54,'7.45',7,0.1),
+ (10801,17,'39.00',40,0.25),
+ (10801,29,'123.79',20,0.25),
+ (10802,30,'25.89',25,0.25),
+ (10802,51,'53.00',30,0.25),
+ (10802,55,'24.00',60,0.25),
+ (10802,62,'49.30',5,0.25),
+ (10803,19,'9.20',24,0.05),
+ (10803,25,'14.00',15,0.05),
+ (10803,59,'55.00',15,0.05),
+ (10804,10,'31.00',36,0),
+ (10804,28,'45.60',24,0),
+ (10804,49,'20.00',4,0.15),
+ (10805,34,'14.00',10,0),
+ (10805,38,'263.50',10,0),
+ (10806,2,'19.00',20,0.25),
+ (10806,65,'21.05',2,0),
+ (10806,74,'10.00',15,0.25),
+ (10807,40,'18.40',1,0),
+ (10808,56,'38.00',20,0.15),
+ (10808,76,'18.00',50,0.15),
+ (10809,52,'7.00',20,0),
+ (10810,13,'6.00',7,0),
+ (10810,25,'14.00',5,0),
+ (10810,70,'15.00',5,0),
+ (10811,19,'9.20',15,0),
+ (10811,23,'9.00',18,0),
+ (10811,40,'18.40',30,0),
+ (10812,31,'12.50',16,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10812,72,'34.80',40,0.1),
+ (10812,77,'13.00',20,0),
+ (10813,2,'19.00',12,0.2),
+ (10813,46,'12.00',35,0),
+ (10814,41,'9.65',20,0),
+ (10814,43,'46.00',20,0.15),
+ (10814,48,'12.75',8,0.15),
+ (10814,61,'28.50',30,0.15),
+ (10815,33,'2.50',16,0),
+ (10816,38,'263.50',30,0.05),
+ (10816,62,'49.30',20,0.05),
+ (10817,26,'31.23',40,0.15),
+ (10817,38,'263.50',30,0),
+ (10817,40,'18.40',60,0.15),
+ (10817,62,'49.30',25,0.15),
+ (10818,32,'32.00',20,0),
+ (10818,41,'9.65',20,0),
+ (10819,43,'46.00',7,0),
+ (10819,75,'7.75',20,0),
+ (10820,56,'38.00',30,0),
+ (10821,35,'18.00',20,0),
+ (10821,51,'53.00',6,0),
+ (10822,62,'49.30',3,0),
+ (10822,70,'15.00',6,0),
+ (10823,11,'21.00',20,0.1),
+ (10823,57,'19.50',15,0),
+ (10823,59,'55.00',40,0.1),
+ (10823,77,'13.00',15,0.1),
+ (10824,41,'9.65',12,0),
+ (10824,70,'15.00',9,0),
+ (10825,26,'31.23',12,0),
+ (10825,53,'32.80',20,0),
+ (10826,31,'12.50',35,0),
+ (10826,57,'19.50',15,0),
+ (10827,10,'31.00',15,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10827,39,'18.00',21,0),
+ (10828,20,'81.00',5,0),
+ (10828,38,'263.50',2,0),
+ (10829,2,'19.00',10,0),
+ (10829,8,'40.00',20,0),
+ (10829,13,'6.00',10,0),
+ (10829,60,'34.00',21,0),
+ (10830,6,'25.00',6,0),
+ (10830,39,'18.00',28,0),
+ (10830,60,'34.00',30,0),
+ (10830,68,'12.50',24,0),
+ (10831,19,'9.20',2,0),
+ (10831,35,'18.00',8,0),
+ (10831,38,'263.50',8,0),
+ (10831,43,'46.00',9,0),
+ (10832,13,'6.00',3,0.2),
+ (10832,25,'14.00',10,0.2),
+ (10832,44,'19.45',16,0.2),
+ (10832,64,'33.25',3,0),
+ (10833,7,'30.00',20,0.1),
+ (10833,31,'12.50',9,0.1),
+ (10833,53,'32.80',9,0.1),
+ (10834,29,'123.79',8,0.05),
+ (10834,30,'25.89',20,0.05),
+ (10835,59,'55.00',15,0),
+ (10835,77,'13.00',2,0.2),
+ (10836,22,'21.00',52,0),
+ (10836,35,'18.00',6,0),
+ (10836,57,'19.50',24,0),
+ (10836,60,'34.00',60,0),
+ (10836,64,'33.25',30,0),
+ (10837,13,'6.00',6,0),
+ (10837,40,'18.40',25,0),
+ (10837,47,'9.50',40,0.25),
+ (10837,76,'18.00',21,0.25),
+ (10838,1,'18.00',4,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10838,18,'62.50',25,0.25),
+ (10838,36,'19.00',50,0.25),
+ (10839,58,'13.25',30,0.1),
+ (10839,72,'34.80',15,0.1),
+ (10840,25,'14.00',6,0.2),
+ (10840,39,'18.00',10,0.2),
+ (10841,10,'31.00',16,0),
+ (10841,56,'38.00',30,0),
+ (10841,59,'55.00',50,0),
+ (10841,77,'13.00',15,0),
+ (10842,11,'21.00',15,0),
+ (10842,43,'46.00',5,0),
+ (10842,68,'12.50',20,0),
+ (10842,70,'15.00',12,0),
+ (10843,51,'53.00',4,0.25),
+ (10844,22,'21.00',35,0),
+ (10845,23,'9.00',70,0.1),
+ (10845,35,'18.00',25,0.1),
+ (10845,42,'14.00',42,0.1),
+ (10845,58,'13.25',60,0.1),
+ (10845,64,'33.25',48,0),
+ (10846,4,'22.00',21,0),
+ (10846,70,'15.00',30,0),
+ (10846,74,'10.00',20,0),
+ (10847,1,'18.00',80,0.2),
+ (10847,19,'9.20',12,0.2),
+ (10847,37,'26.00',60,0.2),
+ (10847,45,'9.50',36,0.2),
+ (10847,60,'34.00',45,0.2),
+ (10847,71,'21.50',55,0.2),
+ (10848,5,'21.35',30,0),
+ (10848,9,'97.00',3,0),
+ (10849,3,'10.00',49,0),
+ (10849,26,'31.23',18,0.15),
+ (10850,25,'14.00',20,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10850,33,'2.50',4,0.15),
+ (10850,70,'15.00',30,0.15),
+ (10851,2,'19.00',5,0.05),
+ (10851,25,'14.00',10,0.05),
+ (10851,57,'19.50',10,0.05),
+ (10851,59,'55.00',42,0.05),
+ (10852,2,'19.00',15,0),
+ (10852,17,'39.00',6,0),
+ (10852,62,'49.30',50,0),
+ (10853,18,'62.50',10,0),
+ (10854,10,'31.00',100,0.15),
+ (10854,13,'6.00',65,0.15),
+ (10855,16,'17.45',50,0),
+ (10855,31,'12.50',14,0),
+ (10855,56,'38.00',24,0),
+ (10855,65,'21.05',15,0.15),
+ (10856,2,'19.00',20,0),
+ (10856,42,'14.00',20,0),
+ (10857,3,'10.00',30,0),
+ (10857,26,'31.23',35,0.25),
+ (10857,29,'123.79',10,0.25),
+ (10858,7,'30.00',5,0),
+ (10858,27,'43.90',10,0),
+ (10858,70,'15.00',4,0),
+ (10859,24,'4.50',40,0.25),
+ (10859,54,'7.45',35,0.25),
+ (10859,64,'33.25',30,0.25),
+ (10860,51,'53.00',3,0),
+ (10860,76,'18.00',20,0),
+ (10861,17,'39.00',42,0),
+ (10861,18,'62.50',20,0),
+ (10861,21,'10.00',40,0),
+ (10861,33,'2.50',35,0),
+ (10861,62,'49.30',3,0),
+ (10862,11,'21.00',25,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10862,52,'7.00',8,0),
+ (10863,1,'18.00',20,0.15),
+ (10863,58,'13.25',12,0.15),
+ (10864,35,'18.00',4,0),
+ (10864,67,'14.00',15,0),
+ (10865,38,'263.50',60,0.05),
+ (10865,39,'18.00',80,0.05),
+ (10866,2,'19.00',21,0.25),
+ (10866,24,'4.50',6,0.25),
+ (10866,30,'25.89',40,0.25),
+ (10867,53,'32.80',3,0),
+ (10868,26,'31.23',20,0),
+ (10868,35,'18.00',30,0),
+ (10868,49,'20.00',42,0.1),
+ (10869,1,'18.00',40,0),
+ (10869,11,'21.00',10,0),
+ (10869,23,'9.00',50,0),
+ (10869,68,'12.50',20,0),
+ (10870,35,'18.00',3,0),
+ (10870,51,'53.00',2,0),
+ (10871,6,'25.00',50,0.05),
+ (10871,16,'17.45',12,0.05),
+ (10871,17,'39.00',16,0.05),
+ (10872,55,'24.00',10,0.05),
+ (10872,62,'49.30',20,0.05),
+ (10872,64,'33.25',15,0.05),
+ (10872,65,'21.05',21,0.05),
+ (10873,21,'10.00',20,0),
+ (10873,28,'45.60',3,0),
+ (10874,10,'31.00',10,0),
+ (10875,19,'9.20',25,0),
+ (10875,47,'9.50',21,0.1),
+ (10875,49,'20.00',15,0),
+ (10876,46,'12.00',21,0),
+ (10876,64,'33.25',20,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10877,16,'17.45',30,0.25),
+ (10877,18,'62.50',25,0),
+ (10878,20,'81.00',20,0.05),
+ (10879,40,'18.40',12,0),
+ (10879,65,'21.05',10,0),
+ (10879,76,'18.00',10,0),
+ (10880,23,'9.00',30,0.2),
+ (10880,61,'28.50',30,0.2),
+ (10880,70,'15.00',50,0.2),
+ (10881,73,'15.00',10,0),
+ (10882,42,'14.00',25,0),
+ (10882,49,'20.00',20,0.15),
+ (10882,54,'7.45',32,0.15),
+ (10883,24,'4.50',8,0),
+ (10884,21,'10.00',40,0.05),
+ (10884,56,'38.00',21,0.05),
+ (10884,65,'21.05',12,0.05),
+ (10885,2,'19.00',20,0),
+ (10885,24,'4.50',12,0),
+ (10885,70,'15.00',30,0),
+ (10885,77,'13.00',25,0),
+ (10886,10,'31.00',70,0),
+ (10886,31,'12.50',35,0),
+ (10886,77,'13.00',40,0),
+ (10887,25,'14.00',5,0),
+ (10888,2,'19.00',20,0),
+ (10888,68,'12.50',18,0),
+ (10889,11,'21.00',40,0),
+ (10889,38,'263.50',40,0),
+ (10890,17,'39.00',15,0),
+ (10890,34,'14.00',10,0),
+ (10890,41,'9.65',14,0),
+ (10891,30,'25.89',15,0.05),
+ (10892,59,'55.00',40,0.05),
+ (10893,8,'40.00',30,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10893,24,'4.50',10,0),
+ (10893,29,'123.79',24,0),
+ (10893,30,'25.89',35,0),
+ (10893,36,'19.00',20,0),
+ (10894,13,'6.00',28,0.05),
+ (10894,69,'36.00',50,0.05),
+ (10894,75,'7.75',120,0.05),
+ (10895,24,'4.50',110,0),
+ (10895,39,'18.00',45,0),
+ (10895,40,'18.40',91,0),
+ (10895,60,'34.00',100,0),
+ (10896,45,'9.50',15,0),
+ (10896,56,'38.00',16,0),
+ (10897,29,'123.79',80,0),
+ (10897,30,'25.89',36,0),
+ (10898,13,'6.00',5,0),
+ (10899,39,'18.00',8,0.15),
+ (10900,70,'15.00',3,0.25),
+ (10901,41,'9.65',30,0),
+ (10901,71,'21.50',30,0),
+ (10902,55,'24.00',30,0.15),
+ (10902,62,'49.30',6,0.15),
+ (10903,13,'6.00',40,0),
+ (10903,65,'21.05',21,0),
+ (10903,68,'12.50',20,0),
+ (10904,58,'13.25',15,0),
+ (10904,62,'49.30',35,0),
+ (10905,1,'18.00',20,0.05),
+ (10906,61,'28.50',15,0),
+ (10907,75,'7.75',14,0),
+ (10908,7,'30.00',20,0.05),
+ (10908,52,'7.00',14,0.05),
+ (10909,7,'30.00',12,0),
+ (10909,16,'17.45',15,0),
+ (10909,41,'9.65',5,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10910,19,'9.20',12,0),
+ (10910,49,'20.00',10,0),
+ (10910,61,'28.50',5,0),
+ (10911,1,'18.00',10,0),
+ (10911,17,'39.00',12,0),
+ (10911,67,'14.00',15,0),
+ (10912,11,'21.00',40,0.25),
+ (10912,29,'123.79',60,0.25),
+ (10913,4,'22.00',30,0.25),
+ (10913,33,'2.50',40,0.25),
+ (10913,58,'13.25',15,0),
+ (10914,71,'21.50',25,0),
+ (10915,17,'39.00',10,0),
+ (10915,33,'2.50',30,0),
+ (10915,54,'7.45',10,0),
+ (10916,16,'17.45',6,0),
+ (10916,32,'32.00',6,0),
+ (10916,57,'19.50',20,0),
+ (10917,30,'25.89',1,0),
+ (10917,60,'34.00',10,0),
+ (10918,1,'18.00',60,0.25),
+ (10918,60,'34.00',25,0.25),
+ (10919,16,'17.45',24,0),
+ (10919,25,'14.00',24,0),
+ (10919,40,'18.40',20,0),
+ (10920,50,'16.25',24,0),
+ (10921,35,'18.00',10,0),
+ (10921,63,'43.90',40,0),
+ (10922,17,'39.00',15,0),
+ (10922,24,'4.50',35,0),
+ (10923,42,'14.00',10,0.2),
+ (10923,43,'46.00',10,0.2),
+ (10923,67,'14.00',24,0.2),
+ (10924,10,'31.00',20,0.1),
+ (10924,28,'45.60',30,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10924,75,'7.75',6,0),
+ (10925,36,'19.00',25,0.15),
+ (10925,52,'7.00',12,0.15),
+ (10926,11,'21.00',2,0),
+ (10926,13,'6.00',10,0),
+ (10926,19,'9.20',7,0),
+ (10926,72,'34.80',10,0),
+ (10927,20,'81.00',5,0),
+ (10927,52,'7.00',5,0),
+ (10927,76,'18.00',20,0),
+ (10928,47,'9.50',5,0),
+ (10928,76,'18.00',5,0),
+ (10929,21,'10.00',60,0),
+ (10929,75,'7.75',49,0),
+ (10929,77,'13.00',15,0),
+ (10930,21,'10.00',36,0),
+ (10930,27,'43.90',25,0),
+ (10930,55,'24.00',25,0.2),
+ (10930,58,'13.25',30,0.2),
+ (10931,13,'6.00',42,0.15),
+ (10931,57,'19.50',30,0),
+ (10932,16,'17.45',30,0.1),
+ (10932,62,'49.30',14,0.1),
+ (10932,72,'34.80',16,0),
+ (10932,75,'7.75',20,0.1),
+ (10933,53,'32.80',2,0),
+ (10933,61,'28.50',30,0),
+ (10934,6,'25.00',20,0),
+ (10935,1,'18.00',21,0),
+ (10935,18,'62.50',4,0.25),
+ (10935,23,'9.00',8,0.25),
+ (10936,36,'19.00',30,0.2),
+ (10937,28,'45.60',8,0),
+ (10937,34,'14.00',20,0),
+ (10938,13,'6.00',20,0.25),
+ (10938,43,'46.00',24,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10938,60,'34.00',49,0.25),
+ (10938,71,'21.50',35,0.25),
+ (10939,2,'19.00',10,0.15),
+ (10939,67,'14.00',40,0.15),
+ (10940,7,'30.00',8,0),
+ (10940,13,'6.00',20,0),
+ (10941,31,'12.50',44,0.25),
+ (10941,62,'49.30',30,0.25),
+ (10941,68,'12.50',80,0.25),
+ (10941,72,'34.80',50,0),
+ (10942,49,'20.00',28,0),
+ (10943,13,'6.00',15,0),
+ (10943,22,'21.00',21,0),
+ (10943,46,'12.00',15,0),
+ (10944,11,'21.00',5,0.25),
+ (10944,44,'19.45',18,0.25),
+ (10944,56,'38.00',18,0),
+ (10945,13,'6.00',20,0),
+ (10945,31,'12.50',10,0),
+ (10946,10,'31.00',25,0),
+ (10946,24,'4.50',25,0),
+ (10946,77,'13.00',40,0),
+ (10947,59,'55.00',4,0),
+ (10948,50,'16.25',9,0),
+ (10948,51,'53.00',40,0),
+ (10948,55,'24.00',4,0),
+ (10949,6,'25.00',12,0),
+ (10949,10,'31.00',30,0),
+ (10949,17,'39.00',6,0),
+ (10949,62,'49.30',60,0),
+ (10950,4,'22.00',5,0),
+ (10951,33,'2.50',15,0.05),
+ (10951,41,'9.65',6,0.05),
+ (10951,75,'7.75',50,0.05),
+ (10952,6,'25.00',16,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10952,28,'45.60',2,0),
+ (10953,20,'81.00',50,0.05),
+ (10953,31,'12.50',50,0.05),
+ (10954,16,'17.45',28,0.15),
+ (10954,31,'12.50',25,0.15),
+ (10954,45,'9.50',30,0),
+ (10954,60,'34.00',24,0.15),
+ (10955,75,'7.75',12,0.2),
+ (10956,21,'10.00',12,0),
+ (10956,47,'9.50',14,0),
+ (10956,51,'53.00',8,0),
+ (10957,30,'25.89',30,0),
+ (10957,35,'18.00',40,0),
+ (10957,64,'33.25',8,0),
+ (10958,5,'21.35',20,0),
+ (10958,7,'30.00',6,0),
+ (10958,72,'34.80',5,0),
+ (10959,75,'7.75',20,0.15),
+ (10960,24,'4.50',10,0.25),
+ (10960,41,'9.65',24,0),
+ (10961,52,'7.00',6,0.05),
+ (10961,76,'18.00',60,0),
+ (10962,7,'30.00',45,0),
+ (10962,13,'6.00',77,0),
+ (10962,53,'32.80',20,0),
+ (10962,69,'36.00',9,0),
+ (10962,76,'18.00',44,0),
+ (10963,60,'34.00',2,0.15),
+ (10964,18,'62.50',6,0),
+ (10964,38,'263.50',5,0),
+ (10964,69,'36.00',10,0),
+ (10965,51,'53.00',16,0),
+ (10966,37,'26.00',8,0),
+ (10966,56,'38.00',12,0.15),
+ (10966,62,'49.30',12,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10967,19,'9.20',12,0),
+ (10967,49,'20.00',40,0),
+ (10968,12,'38.00',30,0),
+ (10968,24,'4.50',30,0),
+ (10968,64,'33.25',4,0),
+ (10969,46,'12.00',9,0),
+ (10970,52,'7.00',40,0.2),
+ (10971,29,'123.79',14,0),
+ (10972,17,'39.00',6,0),
+ (10972,33,'2.50',7,0),
+ (10973,26,'31.23',5,0),
+ (10973,41,'9.65',6,0),
+ (10973,75,'7.75',10,0),
+ (10974,63,'43.90',10,0),
+ (10975,8,'40.00',16,0),
+ (10975,75,'7.75',10,0),
+ (10976,28,'45.60',20,0),
+ (10977,39,'18.00',30,0),
+ (10977,47,'9.50',30,0),
+ (10977,51,'53.00',10,0),
+ (10977,63,'43.90',20,0),
+ (10978,8,'40.00',20,0.15),
+ (10978,21,'10.00',40,0.15),
+ (10978,40,'18.40',10,0),
+ (10978,44,'19.45',6,0.15),
+ (10979,7,'30.00',18,0),
+ (10979,12,'38.00',20,0),
+ (10979,24,'4.50',80,0),
+ (10979,27,'43.90',30,0),
+ (10979,31,'12.50',24,0),
+ (10979,63,'43.90',35,0),
+ (10980,75,'7.75',40,0.2),
+ (10981,38,'263.50',60,0),
+ (10982,7,'30.00',20,0),
+ (10982,43,'46.00',9,0),
+ (10983,13,'6.00',84,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10983,57,'19.50',15,0),
+ (10984,16,'17.45',55,0),
+ (10984,24,'4.50',20,0),
+ (10984,36,'19.00',40,0),
+ (10985,16,'17.45',36,0.1),
+ (10985,18,'62.50',8,0.1),
+ (10985,32,'32.00',35,0.1),
+ (10986,11,'21.00',30,0),
+ (10986,20,'81.00',15,0),
+ (10986,76,'18.00',10,0),
+ (10986,77,'13.00',15,0),
+ (10987,7,'30.00',60,0),
+ (10987,43,'46.00',6,0),
+ (10987,72,'34.80',20,0),
+ (10988,7,'30.00',60,0),
+ (10988,62,'49.30',40,0.1),
+ (10989,6,'25.00',40,0),
+ (10989,11,'21.00',15,0),
+ (10989,41,'9.65',4,0),
+ (10990,21,'10.00',65,0),
+ (10990,34,'14.00',60,0.15),
+ (10990,55,'24.00',65,0.15),
+ (10990,61,'28.50',66,0.15),
+ (10991,2,'19.00',50,0.2),
+ (10991,70,'15.00',20,0.2),
+ (10991,76,'18.00',90,0.2),
+ (10992,72,'34.80',2,0),
+ (10993,29,'123.79',50,0.25),
+ (10993,41,'9.65',35,0.25),
+ (10994,59,'55.00',18,0.05),
+ (10995,51,'53.00',20,0),
+ (10995,60,'34.00',4,0),
+ (10996,42,'14.00',40,0),
+ (10997,32,'32.00',50,0),
+ (10997,46,'12.00',20,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10997,52,'7.00',20,0.25),
+ (10998,24,'4.50',12,0),
+ (10998,61,'28.50',7,0),
+ (10998,74,'10.00',20,0),
+ (10998,75,'7.75',30,0),
+ (10999,41,'9.65',20,0.05),
+ (10999,51,'53.00',15,0.05),
+ (10999,77,'13.00',21,0.05),
+ (11000,4,'22.00',25,0.25),
+ (11000,24,'4.50',30,0.25),
+ (11000,77,'13.00',30,0),
+ (11001,7,'30.00',60,0),
+ (11001,22,'21.00',25,0),
+ (11001,46,'12.00',25,0),
+ (11001,55,'24.00',6,0),
+ (11002,13,'6.00',56,0),
+ (11002,35,'18.00',15,0.15),
+ (11002,42,'14.00',24,0.15),
+ (11002,55,'24.00',40,0),
+ (11003,1,'18.00',4,0),
+ (11003,40,'18.40',10,0),
+ (11003,52,'7.00',10,0),
+ (11004,26,'31.23',6,0),
+ (11004,76,'18.00',6,0),
+ (11005,1,'18.00',2,0),
+ (11005,59,'55.00',10,0),
+ (11006,1,'18.00',8,0),
+ (11006,29,'123.79',2,0.25),
+ (11007,8,'40.00',30,0),
+ (11007,29,'123.79',10,0),
+ (11007,42,'14.00',14,0),
+ (11008,28,'45.60',70,0.05),
+ (11008,34,'14.00',90,0.05),
+ (11008,71,'21.50',21,0),
+ (11009,24,'4.50',12,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11009,36,'19.00',18,0.25),
+ (11009,60,'34.00',9,0),
+ (11010,7,'30.00',20,0),
+ (11010,24,'4.50',10,0),
+ (11011,58,'13.25',40,0.05),
+ (11011,71,'21.50',20,0),
+ (11012,19,'9.20',50,0.05),
+ (11012,60,'34.00',36,0.05),
+ (11012,71,'21.50',60,0.05),
+ (11013,23,'9.00',10,0),
+ (11013,42,'14.00',4,0),
+ (11013,45,'9.50',20,0),
+ (11013,68,'12.50',2,0),
+ (11014,41,'9.65',28,0.1),
+ (11015,30,'25.89',15,0),
+ (11015,77,'13.00',18,0),
+ (11016,31,'12.50',15,0),
+ (11016,36,'19.00',16,0),
+ (11017,3,'10.00',25,0),
+ (11017,59,'55.00',110,0),
+ (11017,70,'15.00',30,0),
+ (11018,12,'38.00',20,0),
+ (11018,18,'62.50',10,0),
+ (11018,56,'38.00',5,0),
+ (11019,46,'12.00',3,0),
+ (11019,49,'20.00',2,0),
+ (11020,10,'31.00',24,0.15),
+ (11021,2,'19.00',11,0.25),
+ (11021,20,'81.00',15,0),
+ (11021,26,'31.23',63,0),
+ (11021,51,'53.00',44,0.25),
+ (11021,72,'34.80',35,0),
+ (11022,19,'9.20',35,0),
+ (11022,69,'36.00',30,0),
+ (11023,7,'30.00',4,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11023,43,'46.00',30,0),
+ (11024,26,'31.23',12,0),
+ (11024,33,'2.50',30,0),
+ (11024,65,'21.05',21,0),
+ (11024,71,'21.50',50,0),
+ (11025,1,'18.00',10,0.1),
+ (11025,13,'6.00',20,0.1),
+ (11026,18,'62.50',8,0),
+ (11026,51,'53.00',10,0),
+ (11027,24,'4.50',30,0.25),
+ (11027,62,'49.30',21,0.25),
+ (11028,55,'24.00',35,0),
+ (11028,59,'55.00',24,0),
+ (11029,56,'38.00',20,0),
+ (11029,63,'43.90',12,0),
+ (11030,2,'19.00',100,0.25),
+ (11030,5,'21.35',70,0),
+ (11030,29,'123.79',60,0.25),
+ (11030,59,'55.00',100,0.25),
+ (11031,1,'18.00',45,0),
+ (11031,13,'6.00',80,0),
+ (11031,24,'4.50',21,0),
+ (11031,64,'33.25',20,0),
+ (11031,71,'21.50',16,0),
+ (11032,36,'19.00',35,0),
+ (11032,38,'263.50',25,0),
+ (11032,59,'55.00',30,0),
+ (11033,53,'32.80',70,0.1),
+ (11033,69,'36.00',36,0.1),
+ (11034,21,'10.00',15,0.1),
+ (11034,44,'19.45',12,0),
+ (11034,61,'28.50',6,0),
+ (11035,1,'18.00',10,0),
+ (11035,35,'18.00',60,0),
+ (11035,42,'14.00',30,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11035,54,'7.45',10,0),
+ (11036,13,'6.00',7,0),
+ (11036,59,'55.00',30,0),
+ (11037,70,'15.00',4,0),
+ (11038,40,'18.40',5,0.2),
+ (11038,52,'7.00',2,0),
+ (11038,71,'21.50',30,0),
+ (11039,28,'45.60',20,0),
+ (11039,35,'18.00',24,0),
+ (11039,49,'20.00',60,0),
+ (11039,57,'19.50',28,0),
+ (11040,21,'10.00',20,0),
+ (11041,2,'19.00',30,0.2),
+ (11041,63,'43.90',30,0),
+ (11042,44,'19.45',15,0),
+ (11042,61,'28.50',4,0),
+ (11043,11,'21.00',10,0),
+ (11044,62,'49.30',12,0),
+ (11045,33,'2.50',15,0),
+ (11045,51,'53.00',24,0),
+ (11046,12,'38.00',20,0.05),
+ (11046,32,'32.00',15,0.05),
+ (11046,35,'18.00',18,0.05),
+ (11047,1,'18.00',25,0.25),
+ (11047,5,'21.35',30,0.25),
+ (11048,68,'12.50',42,0),
+ (11049,2,'19.00',10,0.2),
+ (11049,12,'38.00',4,0.2),
+ (11050,76,'18.00',50,0.1),
+ (11051,24,'4.50',10,0.2),
+ (11052,43,'46.00',30,0.2),
+ (11052,61,'28.50',10,0.2),
+ (11053,18,'62.50',35,0.2),
+ (11053,32,'32.00',20,0),
+ (11053,64,'33.25',25,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11054,33,'2.50',10,0),
+ (11054,67,'14.00',20,0),
+ (11055,24,'4.50',15,0),
+ (11055,25,'14.00',15,0),
+ (11055,51,'53.00',20,0),
+ (11055,57,'19.50',20,0),
+ (11056,7,'30.00',40,0),
+ (11056,55,'24.00',35,0),
+ (11056,60,'34.00',50,0),
+ (11057,70,'15.00',3,0),
+ (11058,21,'10.00',3,0),
+ (11058,60,'34.00',21,0),
+ (11058,61,'28.50',4,0),
+ (11059,13,'6.00',30,0),
+ (11059,17,'39.00',12,0),
+ (11059,60,'34.00',35,0),
+ (11060,60,'34.00',4,0),
+ (11060,77,'13.00',10,0),
+ (11061,60,'34.00',15,0),
+ (11062,53,'32.80',10,0.2),
+ (11062,70,'15.00',12,0.2),
+ (11063,34,'14.00',30,0),
+ (11063,40,'18.40',40,0.1),
+ (11063,41,'9.65',30,0.1),
+ (11064,17,'39.00',77,0.1),
+ (11064,41,'9.65',12,0),
+ (11064,53,'32.80',25,0.1),
+ (11064,55,'24.00',4,0.1),
+ (11064,68,'12.50',55,0),
+ (11065,30,'25.89',4,0.25),
+ (11065,54,'7.45',20,0.25),
+ (11066,16,'17.45',3,0),
+ (11066,19,'9.20',42,0),
+ (11066,34,'14.00',35,0),
+ (11067,41,'9.65',9,0),
+ (11068,28,'45.60',8,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11068,43,'46.00',36,0.15),
+ (11068,77,'13.00',28,0.15),
+ (11069,39,'18.00',20,0),
+ (11070,1,'18.00',40,0.15),
+ (11070,2,'19.00',20,0.15),
+ (11070,16,'17.45',30,0.15),
+ (11070,31,'12.50',20,0),
+ (11071,7,'30.00',15,0.05),
+ (11071,13,'6.00',10,0.05),
+ (11072,2,'19.00',8,0),
+ (11072,41,'9.65',40,0),
+ (11072,50,'16.25',22,0),
+ (11072,64,'33.25',130,0),
+ (11073,11,'21.00',10,0),
+ (11073,24,'4.50',20,0),
+ (11074,16,'17.45',14,0.05),
+ (11075,2,'19.00',10,0.15),
+ (11075,46,'12.00',30,0.15),
+ (11075,76,'18.00',2,0.15),
+ (11076,6,'25.00',20,0.25),
+ (11076,14,'23.25',20,0.25),
+ (11076,19,'9.20',10,0.25),
+ (11077,2,'19.00',24,0.2),
+ (11077,3,'10.00',4,0),
+ (11077,4,'22.00',1,0),
+ (11077,6,'25.00',1,0.02),
+ (11077,7,'30.00',1,0.05),
+ (11077,8,'40.00',2,0.1),
+ (11077,10,'31.00',1,0),
+ (11077,12,'38.00',2,0.05),
+ (11077,13,'6.00',4,0),
+ (11077,14,'23.25',1,0.03),
+ (11077,16,'17.45',2,0.03),
+ (11077,20,'81.00',1,0.04),
+ (11077,23,'9.00',2,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11077,32,'32.00',1,0),
+ (11077,39,'18.00',2,0.05),
+ (11077,41,'9.65',3,0),
+ (11077,46,'12.00',3,0.02),
+ (11077,52,'7.00',2,0),
+ (11077,55,'24.00',2,0),
+ (11077,60,'34.00',2,0.06),
+ (11077,64,'33.25',2,0.03),
+ (11077,66,'17.00',1,0),
+ (11077,73,'15.00',2,0.01),
+ (11077,75,'7.75',4,0),
+ (11077,77,'13.00',2,0);
+/*!40000 ALTER TABLE `order_details` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`orders`
+--
+
+DROP TABLE IF EXISTS `northwind`.`orders`;
+CREATE TABLE  `northwind`.`orders` (
+  `OrderID` int(11) NOT NULL auto_increment,
+  `CustomerID` varchar(5) default NULL,
+  `EmployeeID` int(11) default NULL,
+  `OrderDate` datetime default NULL,
+  `RequiredDate` datetime default NULL,
+  `ShippedDate` datetime default NULL,
+  `ShipVia` int(11) default NULL,
+  `Freight` decimal(9,2) default '0.00',
+  `ShipName` varchar(40) default NULL,
+  `ShipAddress` varchar(60) default NULL,
+  `ShipCity` varchar(15) default NULL,
+  `ShipRegion` varchar(15) default NULL,
+  `ShipPostalCode` varchar(10) default NULL,
+  `ShipCountry` varchar(15) default NULL,
+  PRIMARY KEY  (`OrderID`)
+) ENGINE=MyISAM AUTO_INCREMENT=11078 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`orders`
+--
+
+/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10248,'VINET',5,'1996-07-04 00:00:00','1996-08-01 00:00:00','1996-07-16 00:00:00',3,'32.38','Vins et alcools Chevalier','59 rue de l''Abbaye','Reims',NULL,'51100','France'),
+ (10249,'TOMSP',6,'1996-07-05 00:00:00','1996-08-16 00:00:00','1996-07-10 00:00:00',1,'11.61','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10250,'HANAR',4,'1996-07-08 00:00:00','1996-08-05 00:00:00','1996-07-12 00:00:00',2,'65.83','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10251,'VICTE',3,'1996-07-08 00:00:00','1996-08-05 00:00:00','1996-07-15 00:00:00',1,'41.34','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10252,'SUPRD',4,'1996-07-09 00:00:00','1996-08-06 00:00:00','1996-07-11 00:00:00',2,'51.30','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10253,'HANAR',3,'1996-07-10 00:00:00','1996-07-24 00:00:00','1996-07-16 00:00:00',2,'58.17','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10254,'CHOPS',5,'1996-07-11 00:00:00','1996-08-08 00:00:00','1996-07-23 00:00:00',2,'22.98','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10255,'RICSU',9,'1996-07-12 00:00:00','1996-08-09 00:00:00','1996-07-15 00:00:00',3,'148.33','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10256,'WELLI',3,'1996-07-15 00:00:00','1996-08-12 00:00:00','1996-07-17 00:00:00',2,'13.97','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10257,'HILAA',4,'1996-07-16 00:00:00','1996-08-13 00:00:00','1996-07-22 00:00:00',3,'81.91','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10258,'ERNSH',1,'1996-07-17 00:00:00','1996-08-14 00:00:00','1996-07-23 00:00:00',1,'140.51','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10259,'CENTC',4,'1996-07-18 00:00:00','1996-08-15 00:00:00','1996-07-25 00:00:00',3,'3.25','Centro comercial Moctezuma','Sierras de Granada 9993','México D.F.',NULL,'05022','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10260,'OTTIK',4,'1996-07-19 00:00:00','1996-08-16 00:00:00','1996-07-29 00:00:00',1,'55.09','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10261,'QUEDE',4,'1996-07-19 00:00:00','1996-08-16 00:00:00','1996-07-30 00:00:00',2,'3.05','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10262,'RATTC',8,'1996-07-22 00:00:00','1996-08-19 00:00:00','1996-07-25 00:00:00',3,'48.29','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10263,'ERNSH',9,'1996-07-23 00:00:00','1996-08-20 00:00:00','1996-07-31 00:00:00',3,'146.06','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10264,'FOLKO',6,'1996-07-24 00:00:00','1996-08-21 00:00:00','1996-08-23 00:00:00',3,'3.67','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10265,'BLONP',2,'1996-07-25 00:00:00','1996-08-22 00:00:00','1996-08-12 00:00:00',1,'55.28','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10266,'WARTH',3,'1996-07-26 00:00:00','1996-09-06 00:00:00','1996-07-31 00:00:00',3,'25.73','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10267,'FRANK',4,'1996-07-29 00:00:00','1996-08-26 00:00:00','1996-08-06 00:00:00',1,'208.58','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10268,'GROSR',8,'1996-07-30 00:00:00','1996-08-27 00:00:00','1996-08-02 00:00:00',3,'66.29','GROSELLA-Restaurante','5ª Ave. Los Palos Grandes','Caracas','DF','1081','Venezuela'),
+ (10269,'WHITC',5,'1996-07-31 00:00:00','1996-08-14 00:00:00','1996-08-09 00:00:00',1,'4.56','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10270,'WARTH',1,'1996-08-01 00:00:00','1996-08-29 00:00:00','1996-08-02 00:00:00',1,'136.54','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10271,'SPLIR',6,'1996-08-01 00:00:00','1996-08-29 00:00:00','1996-08-30 00:00:00',2,'4.54','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10272,'RATTC',6,'1996-08-02 00:00:00','1996-08-30 00:00:00','1996-08-06 00:00:00',2,'98.03','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10273,'QUICK',3,'1996-08-05 00:00:00','1996-09-02 00:00:00','1996-08-12 00:00:00',3,'76.07','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10274,'VINET',6,'1996-08-06 00:00:00','1996-09-03 00:00:00','1996-08-16 00:00:00',1,'6.01','Vins et alcools Chevalier','59 rue de l''Abbaye','Reims',NULL,'51100','France'),
+ (10275,'MAGAA',1,'1996-08-07 00:00:00','1996-09-04 00:00:00','1996-08-09 00:00:00',1,'26.93','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10276,'TORTU',8,'1996-08-08 00:00:00','1996-08-22 00:00:00','1996-08-14 00:00:00',3,'13.84','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10277,'MORGK',2,'1996-08-09 00:00:00','1996-09-06 00:00:00','1996-08-13 00:00:00',3,'125.77','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10278,'BERGS',8,'1996-08-12 00:00:00','1996-09-09 00:00:00','1996-08-16 00:00:00',2,'92.69','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10279,'LEHMS',8,'1996-08-13 00:00:00','1996-09-10 00:00:00','1996-08-16 00:00:00',2,'25.83','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10280,'BERGS',2,'1996-08-14 00:00:00','1996-09-11 00:00:00','1996-09-12 00:00:00',1,'8.98','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10281,'ROMEY',4,'1996-08-14 00:00:00','1996-08-28 00:00:00','1996-08-21 00:00:00',1,'2.94','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10282,'ROMEY',4,'1996-08-15 00:00:00','1996-09-12 00:00:00','1996-08-21 00:00:00',1,'12.69','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10283,'LILAS',3,'1996-08-16 00:00:00','1996-09-13 00:00:00','1996-08-23 00:00:00',3,'84.81','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10284,'LEHMS',4,'1996-08-19 00:00:00','1996-09-16 00:00:00','1996-08-27 00:00:00',1,'76.56','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10285,'QUICK',1,'1996-08-20 00:00:00','1996-09-17 00:00:00','1996-08-26 00:00:00',2,'76.83','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10286,'QUICK',8,'1996-08-21 00:00:00','1996-09-18 00:00:00','1996-08-30 00:00:00',3,'229.24','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10287,'RICAR',8,'1996-08-22 00:00:00','1996-09-19 00:00:00','1996-08-28 00:00:00',3,'12.76','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10288,'REGGC',4,'1996-08-23 00:00:00','1996-09-20 00:00:00','1996-09-03 00:00:00',1,'7.45','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10289,'BSBEV',7,'1996-08-26 00:00:00','1996-09-23 00:00:00','1996-08-28 00:00:00',3,'22.77','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10290,'COMMI',8,'1996-08-27 00:00:00','1996-09-24 00:00:00','1996-09-03 00:00:00',1,'79.70','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10291,'QUEDE',6,'1996-08-27 00:00:00','1996-09-24 00:00:00','1996-09-04 00:00:00',2,'6.40','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10292,'TRADH',1,'1996-08-28 00:00:00','1996-09-25 00:00:00','1996-09-02 00:00:00',2,'1.35','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10293,'TORTU',1,'1996-08-29 00:00:00','1996-09-26 00:00:00','1996-09-11 00:00:00',3,'21.18','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10294,'RATTC',4,'1996-08-30 00:00:00','1996-09-27 00:00:00','1996-09-05 00:00:00',2,'147.26','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10295,'VINET',2,'1996-09-02 00:00:00','1996-09-30 00:00:00','1996-09-10 00:00:00',2,'1.15','Vins et alcools Chevalier','59 rue de l''Abbaye','Reims',NULL,'51100','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10296,'LILAS',6,'1996-09-03 00:00:00','1996-10-01 00:00:00','1996-09-11 00:00:00',1,'0.12','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10297,'BLONP',5,'1996-09-04 00:00:00','1996-10-16 00:00:00','1996-09-10 00:00:00',2,'5.74','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10298,'HUNGO',6,'1996-09-05 00:00:00','1996-10-03 00:00:00','1996-09-11 00:00:00',2,'168.22','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10299,'RICAR',4,'1996-09-06 00:00:00','1996-10-04 00:00:00','1996-09-13 00:00:00',2,'29.76','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10300,'MAGAA',2,'1996-09-09 00:00:00','1996-10-07 00:00:00','1996-09-18 00:00:00',2,'17.68','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10301,'WANDK',8,'1996-09-09 00:00:00','1996-10-07 00:00:00','1996-09-17 00:00:00',2,'45.08','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10302,'SUPRD',4,'1996-09-10 00:00:00','1996-10-08 00:00:00','1996-10-09 00:00:00',2,'6.27','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10303,'GODOS',7,'1996-09-11 00:00:00','1996-10-09 00:00:00','1996-09-18 00:00:00',2,'107.83','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10304,'TORTU',1,'1996-09-12 00:00:00','1996-10-10 00:00:00','1996-09-17 00:00:00',2,'63.79','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10305,'OLDWO',8,'1996-09-13 00:00:00','1996-10-11 00:00:00','1996-10-09 00:00:00',3,'257.62','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10306,'ROMEY',1,'1996-09-16 00:00:00','1996-10-14 00:00:00','1996-09-23 00:00:00',3,'7.56','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10307,'LONEP',2,'1996-09-17 00:00:00','1996-10-15 00:00:00','1996-09-25 00:00:00',2,'0.56','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10308,'ANATR',7,'1996-09-18 00:00:00','1996-10-16 00:00:00','1996-09-24 00:00:00',3,'1.61','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico'),
+ (10309,'HUNGO',3,'1996-09-19 00:00:00','1996-10-17 00:00:00','1996-10-23 00:00:00',1,'47.30','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10310,'THEBI',8,'1996-09-20 00:00:00','1996-10-18 00:00:00','1996-09-27 00:00:00',2,'17.52','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA'),
+ (10311,'DUMON',1,'1996-09-20 00:00:00','1996-10-04 00:00:00','1996-09-26 00:00:00',3,'24.69','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10312,'WANDK',2,'1996-09-23 00:00:00','1996-10-21 00:00:00','1996-10-03 00:00:00',2,'40.26','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10313,'QUICK',2,'1996-09-24 00:00:00','1996-10-22 00:00:00','1996-10-04 00:00:00',2,'1.96','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10314,'RATTC',1,'1996-09-25 00:00:00','1996-10-23 00:00:00','1996-10-04 00:00:00',2,'74.16','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10315,'ISLAT',4,'1996-09-26 00:00:00','1996-10-24 00:00:00','1996-10-03 00:00:00',2,'41.76','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10316,'RATTC',1,'1996-09-27 00:00:00','1996-10-25 00:00:00','1996-10-08 00:00:00',3,'150.15','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10317,'LONEP',6,'1996-09-30 00:00:00','1996-10-28 00:00:00','1996-10-10 00:00:00',1,'12.69','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10318,'ISLAT',8,'1996-10-01 00:00:00','1996-10-29 00:00:00','1996-10-04 00:00:00',2,'4.73','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10319,'TORTU',7,'1996-10-02 00:00:00','1996-10-30 00:00:00','1996-10-11 00:00:00',3,'64.50','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10320,'WARTH',5,'1996-10-03 00:00:00','1996-10-17 00:00:00','1996-10-18 00:00:00',3,'34.57','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10321,'ISLAT',3,'1996-10-03 00:00:00','1996-10-31 00:00:00','1996-10-11 00:00:00',2,'3.43','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10322,'PERIC',7,'1996-10-04 00:00:00','1996-11-01 00:00:00','1996-10-23 00:00:00',3,'0.40','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10323,'KOENE',4,'1996-10-07 00:00:00','1996-11-04 00:00:00','1996-10-14 00:00:00',1,'4.88','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10324,'SAVEA',9,'1996-10-08 00:00:00','1996-11-05 00:00:00','1996-10-10 00:00:00',1,'214.27','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10325,'KOENE',1,'1996-10-09 00:00:00','1996-10-23 00:00:00','1996-10-14 00:00:00',3,'64.86','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10326,'BOLID',4,'1996-10-10 00:00:00','1996-11-07 00:00:00','1996-10-14 00:00:00',2,'77.92','Bólido Comidas preparadas','C/ Araquil 67','Madrid',NULL,'28023','Spain'),
+ (10327,'FOLKO',2,'1996-10-11 00:00:00','1996-11-08 00:00:00','1996-10-14 00:00:00',1,'63.36','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10328,'FURIB',4,'1996-10-14 00:00:00','1996-11-11 00:00:00','1996-10-17 00:00:00',3,'87.03','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10329,'SPLIR',4,'1996-10-15 00:00:00','1996-11-26 00:00:00','1996-10-23 00:00:00',2,'191.67','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10330,'LILAS',3,'1996-10-16 00:00:00','1996-11-13 00:00:00','1996-10-28 00:00:00',1,'12.75','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10331,'BONAP',9,'1996-10-16 00:00:00','1996-11-27 00:00:00','1996-10-21 00:00:00',1,'10.19','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10332,'MEREP',3,'1996-10-17 00:00:00','1996-11-28 00:00:00','1996-10-21 00:00:00',2,'52.84','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10333,'WARTH',5,'1996-10-18 00:00:00','1996-11-15 00:00:00','1996-10-25 00:00:00',3,'0.59','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10334,'VICTE',8,'1996-10-21 00:00:00','1996-11-18 00:00:00','1996-10-28 00:00:00',2,'8.56','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10335,'HUNGO',7,'1996-10-22 00:00:00','1996-11-19 00:00:00','1996-10-24 00:00:00',2,'42.11','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10336,'PRINI',7,'1996-10-23 00:00:00','1996-11-20 00:00:00','1996-10-25 00:00:00',2,'15.51','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal'),
+ (10337,'FRANK',4,'1996-10-24 00:00:00','1996-11-21 00:00:00','1996-10-29 00:00:00',3,'108.26','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10338,'OLDWO',4,'1996-10-25 00:00:00','1996-11-22 00:00:00','1996-10-29 00:00:00',3,'84.21','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10339,'MEREP',2,'1996-10-28 00:00:00','1996-11-25 00:00:00','1996-11-04 00:00:00',2,'15.66','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10340,'BONAP',1,'1996-10-29 00:00:00','1996-11-26 00:00:00','1996-11-08 00:00:00',3,'166.31','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10341,'SIMOB',7,'1996-10-29 00:00:00','1996-11-26 00:00:00','1996-11-05 00:00:00',3,'26.78','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10342,'FRANK',4,'1996-10-30 00:00:00','1996-11-13 00:00:00','1996-11-04 00:00:00',2,'54.83','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10343,'LEHMS',4,'1996-10-31 00:00:00','1996-11-28 00:00:00','1996-11-06 00:00:00',1,'110.37','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10344,'WHITC',4,'1996-11-01 00:00:00','1996-11-29 00:00:00','1996-11-05 00:00:00',2,'23.29','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10345,'QUICK',2,'1996-11-04 00:00:00','1996-12-02 00:00:00','1996-11-11 00:00:00',2,'249.06','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10346,'RATTC',3,'1996-11-05 00:00:00','1996-12-17 00:00:00','1996-11-08 00:00:00',3,'142.08','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10347,'FAMIA',4,'1996-11-06 00:00:00','1996-12-04 00:00:00','1996-11-08 00:00:00',3,'3.10','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10348,'WANDK',4,'1996-11-07 00:00:00','1996-12-05 00:00:00','1996-11-15 00:00:00',2,'0.78','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10349,'SPLIR',7,'1996-11-08 00:00:00','1996-12-06 00:00:00','1996-11-15 00:00:00',1,'8.63','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10350,'LAMAI',6,'1996-11-11 00:00:00','1996-12-09 00:00:00','1996-12-03 00:00:00',2,'64.19','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10351,'ERNSH',1,'1996-11-11 00:00:00','1996-12-09 00:00:00','1996-11-20 00:00:00',1,'162.33','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10352,'FURIB',3,'1996-11-12 00:00:00','1996-11-26 00:00:00','1996-11-18 00:00:00',3,'1.30','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10353,'PICCO',7,'1996-11-13 00:00:00','1996-12-11 00:00:00','1996-11-25 00:00:00',3,'360.63','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10354,'PERIC',8,'1996-11-14 00:00:00','1996-12-12 00:00:00','1996-11-20 00:00:00',3,'53.80','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10355,'AROUT',6,'1996-11-15 00:00:00','1996-12-13 00:00:00','1996-11-20 00:00:00',1,'41.95','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10356,'WANDK',6,'1996-11-18 00:00:00','1996-12-16 00:00:00','1996-11-27 00:00:00',2,'36.71','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10357,'LILAS',1,'1996-11-19 00:00:00','1996-12-17 00:00:00','1996-12-02 00:00:00',3,'34.88','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10358,'LAMAI',5,'1996-11-20 00:00:00','1996-12-18 00:00:00','1996-11-27 00:00:00',1,'19.64','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10359,'SEVES',5,'1996-11-21 00:00:00','1996-12-19 00:00:00','1996-11-26 00:00:00',3,'288.43','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10360,'BLONP',4,'1996-11-22 00:00:00','1996-12-20 00:00:00','1996-12-02 00:00:00',3,'131.70','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10361,'QUICK',1,'1996-11-22 00:00:00','1996-12-20 00:00:00','1996-12-03 00:00:00',2,'183.17','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10362,'BONAP',3,'1996-11-25 00:00:00','1996-12-23 00:00:00','1996-11-28 00:00:00',1,'96.04','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10363,'DRACD',4,'1996-11-26 00:00:00','1996-12-24 00:00:00','1996-12-04 00:00:00',3,'30.54','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (10364,'EASTC',1,'1996-11-26 00:00:00','1997-01-07 00:00:00','1996-12-04 00:00:00',1,'71.97','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10365,'ANTON',3,'1996-11-27 00:00:00','1996-12-25 00:00:00','1996-12-02 00:00:00',2,'22.00','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10366,'GALED',8,'1996-11-28 00:00:00','1997-01-09 00:00:00','1996-12-30 00:00:00',2,'10.14','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10367,'VAFFE',7,'1996-11-28 00:00:00','1996-12-26 00:00:00','1996-12-02 00:00:00',3,'13.55','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10368,'ERNSH',2,'1996-11-29 00:00:00','1996-12-27 00:00:00','1996-12-02 00:00:00',2,'101.95','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10369,'SPLIR',8,'1996-12-02 00:00:00','1996-12-30 00:00:00','1996-12-09 00:00:00',2,'195.68','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10370,'CHOPS',6,'1996-12-03 00:00:00','1996-12-31 00:00:00','1996-12-27 00:00:00',2,'1.17','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10371,'LAMAI',1,'1996-12-03 00:00:00','1996-12-31 00:00:00','1996-12-24 00:00:00',1,'0.45','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10372,'QUEEN',5,'1996-12-04 00:00:00','1997-01-01 00:00:00','1996-12-09 00:00:00',2,'890.78','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10373,'HUNGO',4,'1996-12-05 00:00:00','1997-01-02 00:00:00','1996-12-11 00:00:00',3,'124.12','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10374,'WOLZA',1,'1996-12-05 00:00:00','1997-01-02 00:00:00','1996-12-09 00:00:00',3,'3.94','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10375,'HUNGC',3,'1996-12-06 00:00:00','1997-01-03 00:00:00','1996-12-09 00:00:00',2,'20.12','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10376,'MEREP',1,'1996-12-09 00:00:00','1997-01-06 00:00:00','1996-12-13 00:00:00',2,'20.39','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10377,'SEVES',1,'1996-12-09 00:00:00','1997-01-06 00:00:00','1996-12-13 00:00:00',3,'22.21','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10378,'FOLKO',5,'1996-12-10 00:00:00','1997-01-07 00:00:00','1996-12-19 00:00:00',3,'5.44','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10379,'QUEDE',2,'1996-12-11 00:00:00','1997-01-08 00:00:00','1996-12-13 00:00:00',1,'45.03','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10380,'HUNGO',8,'1996-12-12 00:00:00','1997-01-09 00:00:00','1997-01-16 00:00:00',3,'35.03','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10381,'LILAS',3,'1996-12-12 00:00:00','1997-01-09 00:00:00','1996-12-13 00:00:00',3,'7.99','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10382,'ERNSH',4,'1996-12-13 00:00:00','1997-01-10 00:00:00','1996-12-16 00:00:00',1,'94.77','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10383,'AROUT',8,'1996-12-16 00:00:00','1997-01-13 00:00:00','1996-12-18 00:00:00',3,'34.24','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10384,'BERGS',3,'1996-12-16 00:00:00','1997-01-13 00:00:00','1996-12-20 00:00:00',3,'168.64','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10385,'SPLIR',1,'1996-12-17 00:00:00','1997-01-14 00:00:00','1996-12-23 00:00:00',2,'30.96','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10386,'FAMIA',9,'1996-12-18 00:00:00','1997-01-01 00:00:00','1996-12-25 00:00:00',3,'13.99','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10387,'SANTG',1,'1996-12-18 00:00:00','1997-01-15 00:00:00','1996-12-20 00:00:00',2,'93.63','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10388,'SEVES',2,'1996-12-19 00:00:00','1997-01-16 00:00:00','1996-12-20 00:00:00',1,'34.86','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10389,'BOTTM',4,'1996-12-20 00:00:00','1997-01-17 00:00:00','1996-12-24 00:00:00',2,'47.42','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10390,'ERNSH',6,'1996-12-23 00:00:00','1997-01-20 00:00:00','1996-12-26 00:00:00',1,'126.38','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10391,'DRACD',3,'1996-12-23 00:00:00','1997-01-20 00:00:00','1996-12-31 00:00:00',3,'5.45','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10392,'PICCO',2,'1996-12-24 00:00:00','1997-01-21 00:00:00','1997-01-01 00:00:00',3,'122.46','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10393,'SAVEA',1,'1996-12-25 00:00:00','1997-01-22 00:00:00','1997-01-03 00:00:00',3,'126.56','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10394,'HUNGC',1,'1996-12-25 00:00:00','1997-01-22 00:00:00','1997-01-03 00:00:00',3,'30.34','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10395,'HILAA',6,'1996-12-26 00:00:00','1997-01-23 00:00:00','1997-01-03 00:00:00',1,'184.41','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10396,'FRANK',1,'1996-12-27 00:00:00','1997-01-10 00:00:00','1997-01-06 00:00:00',3,'135.35','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10397,'PRINI',5,'1996-12-27 00:00:00','1997-01-24 00:00:00','1997-01-02 00:00:00',1,'60.26','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10398,'SAVEA',2,'1996-12-30 00:00:00','1997-01-27 00:00:00','1997-01-09 00:00:00',3,'89.16','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10399,'VAFFE',8,'1996-12-31 00:00:00','1997-01-14 00:00:00','1997-01-08 00:00:00',3,'27.36','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10400,'EASTC',1,'1997-01-01 00:00:00','1997-01-29 00:00:00','1997-01-16 00:00:00',3,'83.93','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10401,'RATTC',1,'1997-01-01 00:00:00','1997-01-29 00:00:00','1997-01-10 00:00:00',1,'12.51','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10402,'ERNSH',8,'1997-01-02 00:00:00','1997-02-13 00:00:00','1997-01-10 00:00:00',2,'67.88','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10403,'ERNSH',4,'1997-01-03 00:00:00','1997-01-31 00:00:00','1997-01-09 00:00:00',3,'73.79','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10404,'MAGAA',2,'1997-01-03 00:00:00','1997-01-31 00:00:00','1997-01-08 00:00:00',1,'155.97','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10405,'LINOD',1,'1997-01-06 00:00:00','1997-02-03 00:00:00','1997-01-22 00:00:00',1,'34.82','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10406,'QUEEN',7,'1997-01-07 00:00:00','1997-02-18 00:00:00','1997-01-13 00:00:00',1,'108.04','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10407,'OTTIK',2,'1997-01-07 00:00:00','1997-02-04 00:00:00','1997-01-30 00:00:00',2,'91.48','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10408,'FOLIG',8,'1997-01-08 00:00:00','1997-02-05 00:00:00','1997-01-14 00:00:00',1,'11.26','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10409,'OCEAN',3,'1997-01-09 00:00:00','1997-02-06 00:00:00','1997-01-14 00:00:00',1,'29.83','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10410,'BOTTM',3,'1997-01-10 00:00:00','1997-02-07 00:00:00','1997-01-15 00:00:00',3,'2.40','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10411,'BOTTM',9,'1997-01-10 00:00:00','1997-02-07 00:00:00','1997-01-21 00:00:00',3,'23.65','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10412,'WARTH',8,'1997-01-13 00:00:00','1997-02-10 00:00:00','1997-01-15 00:00:00',2,'3.77','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10413,'LAMAI',3,'1997-01-14 00:00:00','1997-02-11 00:00:00','1997-01-16 00:00:00',2,'95.66','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10414,'FAMIA',2,'1997-01-14 00:00:00','1997-02-11 00:00:00','1997-01-17 00:00:00',3,'21.48','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10415,'HUNGC',3,'1997-01-15 00:00:00','1997-02-12 00:00:00','1997-01-24 00:00:00',1,'0.20','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10416,'WARTH',8,'1997-01-16 00:00:00','1997-02-13 00:00:00','1997-01-27 00:00:00',3,'22.72','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10417,'SIMOB',4,'1997-01-16 00:00:00','1997-02-13 00:00:00','1997-01-28 00:00:00',3,'70.29','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10418,'QUICK',4,'1997-01-17 00:00:00','1997-02-14 00:00:00','1997-01-24 00:00:00',1,'17.55','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10419,'RICSU',4,'1997-01-20 00:00:00','1997-02-17 00:00:00','1997-01-30 00:00:00',2,'137.35','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10420,'WELLI',3,'1997-01-21 00:00:00','1997-02-18 00:00:00','1997-01-27 00:00:00',1,'44.12','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10421,'QUEDE',8,'1997-01-21 00:00:00','1997-03-04 00:00:00','1997-01-27 00:00:00',1,'99.23','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10422,'FRANS',2,'1997-01-22 00:00:00','1997-02-19 00:00:00','1997-01-31 00:00:00',1,'3.02','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10423,'GOURL',6,'1997-01-23 00:00:00','1997-02-06 00:00:00','1997-02-24 00:00:00',3,'24.50','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10424,'MEREP',7,'1997-01-23 00:00:00','1997-02-20 00:00:00','1997-01-27 00:00:00',2,'370.61','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10425,'LAMAI',6,'1997-01-24 00:00:00','1997-02-21 00:00:00','1997-02-14 00:00:00',2,'7.93','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10426,'GALED',4,'1997-01-27 00:00:00','1997-02-24 00:00:00','1997-02-06 00:00:00',1,'18.69','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10427,'PICCO',4,'1997-01-27 00:00:00','1997-02-24 00:00:00','1997-03-03 00:00:00',2,'31.29','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10428,'REGGC',7,'1997-01-28 00:00:00','1997-02-25 00:00:00','1997-02-04 00:00:00',1,'11.09','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10429,'HUNGO',3,'1997-01-29 00:00:00','1997-03-12 00:00:00','1997-02-07 00:00:00',2,'56.63','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10430,'ERNSH',4,'1997-01-30 00:00:00','1997-02-13 00:00:00','1997-02-03 00:00:00',1,'458.78','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10431,'BOTTM',4,'1997-01-30 00:00:00','1997-02-13 00:00:00','1997-02-07 00:00:00',2,'44.17','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10432,'SPLIR',3,'1997-01-31 00:00:00','1997-02-14 00:00:00','1997-02-07 00:00:00',2,'4.34','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10433,'PRINI',3,'1997-02-03 00:00:00','1997-03-03 00:00:00','1997-03-04 00:00:00',3,'73.83','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10434,'FOLKO',3,'1997-02-03 00:00:00','1997-03-03 00:00:00','1997-02-13 00:00:00',2,'17.92','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10435,'CONSH',8,'1997-02-04 00:00:00','1997-03-18 00:00:00','1997-02-07 00:00:00',2,'9.21','Consolidated Holdings','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK'),
+ (10436,'BLONP',3,'1997-02-05 00:00:00','1997-03-05 00:00:00','1997-02-11 00:00:00',2,'156.66','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10437,'WARTH',8,'1997-02-05 00:00:00','1997-03-05 00:00:00','1997-02-12 00:00:00',1,'19.97','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10438,'TOMSP',3,'1997-02-06 00:00:00','1997-03-06 00:00:00','1997-02-14 00:00:00',2,'8.24','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10439,'MEREP',6,'1997-02-07 00:00:00','1997-03-07 00:00:00','1997-02-10 00:00:00',3,'4.07','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10440,'SAVEA',4,'1997-02-10 00:00:00','1997-03-10 00:00:00','1997-02-28 00:00:00',2,'86.53','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10441,'OLDWO',3,'1997-02-10 00:00:00','1997-03-24 00:00:00','1997-03-14 00:00:00',2,'73.02','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10442,'ERNSH',3,'1997-02-11 00:00:00','1997-03-11 00:00:00','1997-02-18 00:00:00',2,'47.94','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10443,'REGGC',8,'1997-02-12 00:00:00','1997-03-12 00:00:00','1997-02-14 00:00:00',1,'13.95','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10444,'BERGS',3,'1997-02-12 00:00:00','1997-03-12 00:00:00','1997-02-21 00:00:00',3,'3.50','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10445,'BERGS',3,'1997-02-13 00:00:00','1997-03-13 00:00:00','1997-02-20 00:00:00',1,'9.30','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10446,'TOMSP',6,'1997-02-14 00:00:00','1997-03-14 00:00:00','1997-02-19 00:00:00',1,'14.68','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10447,'RICAR',4,'1997-02-14 00:00:00','1997-03-14 00:00:00','1997-03-07 00:00:00',2,'68.66','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10448,'RANCH',4,'1997-02-17 00:00:00','1997-03-17 00:00:00','1997-02-24 00:00:00',2,'38.82','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10449,'BLONP',3,'1997-02-18 00:00:00','1997-03-18 00:00:00','1997-02-27 00:00:00',2,'53.30','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10450,'VICTE',8,'1997-02-19 00:00:00','1997-03-19 00:00:00','1997-03-11 00:00:00',2,'7.23','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10451,'QUICK',4,'1997-02-19 00:00:00','1997-03-05 00:00:00','1997-03-12 00:00:00',3,'189.09','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10452,'SAVEA',8,'1997-02-20 00:00:00','1997-03-20 00:00:00','1997-02-26 00:00:00',1,'140.26','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10453,'AROUT',1,'1997-02-21 00:00:00','1997-03-21 00:00:00','1997-02-26 00:00:00',2,'25.36','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10454,'LAMAI',4,'1997-02-21 00:00:00','1997-03-21 00:00:00','1997-02-25 00:00:00',3,'2.74','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10455,'WARTH',8,'1997-02-24 00:00:00','1997-04-07 00:00:00','1997-03-03 00:00:00',2,'180.45','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10456,'KOENE',8,'1997-02-25 00:00:00','1997-04-08 00:00:00','1997-02-28 00:00:00',2,'8.12','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10457,'KOENE',2,'1997-02-25 00:00:00','1997-03-25 00:00:00','1997-03-03 00:00:00',1,'11.57','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10458,'SUPRD',7,'1997-02-26 00:00:00','1997-03-26 00:00:00','1997-03-04 00:00:00',3,'147.06','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10459,'VICTE',4,'1997-02-27 00:00:00','1997-03-27 00:00:00','1997-02-28 00:00:00',2,'25.09','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10460,'FOLKO',8,'1997-02-28 00:00:00','1997-03-28 00:00:00','1997-03-03 00:00:00',1,'16.27','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10461,'LILAS',1,'1997-02-28 00:00:00','1997-03-28 00:00:00','1997-03-05 00:00:00',3,'148.61','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10462,'CONSH',2,'1997-03-03 00:00:00','1997-03-31 00:00:00','1997-03-18 00:00:00',1,'6.17','Consolidated Holdings','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK'),
+ (10463,'SUPRD',5,'1997-03-04 00:00:00','1997-04-01 00:00:00','1997-03-06 00:00:00',3,'14.78','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10464,'FURIB',4,'1997-03-04 00:00:00','1997-04-01 00:00:00','1997-03-14 00:00:00',2,'89.00','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10465,'VAFFE',1,'1997-03-05 00:00:00','1997-04-02 00:00:00','1997-03-14 00:00:00',3,'145.04','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10466,'COMMI',4,'1997-03-06 00:00:00','1997-04-03 00:00:00','1997-03-13 00:00:00',1,'11.93','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10467,'MAGAA',8,'1997-03-06 00:00:00','1997-04-03 00:00:00','1997-03-11 00:00:00',2,'4.93','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10468,'KOENE',3,'1997-03-07 00:00:00','1997-04-04 00:00:00','1997-03-12 00:00:00',3,'44.12','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10469,'WHITC',1,'1997-03-10 00:00:00','1997-04-07 00:00:00','1997-03-14 00:00:00',1,'60.18','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10470,'BONAP',4,'1997-03-11 00:00:00','1997-04-08 00:00:00','1997-03-14 00:00:00',2,'64.56','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10471,'BSBEV',2,'1997-03-11 00:00:00','1997-04-08 00:00:00','1997-03-18 00:00:00',3,'45.59','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10472,'SEVES',8,'1997-03-12 00:00:00','1997-04-09 00:00:00','1997-03-19 00:00:00',1,'4.20','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10473,'ISLAT',1,'1997-03-13 00:00:00','1997-03-27 00:00:00','1997-03-21 00:00:00',3,'16.37','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10474,'PERIC',5,'1997-03-13 00:00:00','1997-04-10 00:00:00','1997-03-21 00:00:00',2,'83.49','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10475,'SUPRD',9,'1997-03-14 00:00:00','1997-04-11 00:00:00','1997-04-04 00:00:00',1,'68.52','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10476,'HILAA',8,'1997-03-17 00:00:00','1997-04-14 00:00:00','1997-03-24 00:00:00',3,'4.41','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10477,'PRINI',5,'1997-03-17 00:00:00','1997-04-14 00:00:00','1997-03-25 00:00:00',2,'13.02','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal'),
+ (10478,'VICTE',2,'1997-03-18 00:00:00','1997-04-01 00:00:00','1997-03-26 00:00:00',3,'4.81','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10479,'RATTC',3,'1997-03-19 00:00:00','1997-04-16 00:00:00','1997-03-21 00:00:00',3,'708.95','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10480,'FOLIG',6,'1997-03-20 00:00:00','1997-04-17 00:00:00','1997-03-24 00:00:00',2,'1.35','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10481,'RICAR',8,'1997-03-20 00:00:00','1997-04-17 00:00:00','1997-03-25 00:00:00',2,'64.33','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10482,'LAZYK',1,'1997-03-21 00:00:00','1997-04-18 00:00:00','1997-04-10 00:00:00',3,'7.48','Lazy K Kountry Store','12 Orchestra Terrace','Walla Walla','WA','99362','USA'),
+ (10483,'WHITC',7,'1997-03-24 00:00:00','1997-04-21 00:00:00','1997-04-25 00:00:00',2,'15.28','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10484,'BSBEV',3,'1997-03-24 00:00:00','1997-04-21 00:00:00','1997-04-01 00:00:00',3,'6.88','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10485,'LINOD',4,'1997-03-25 00:00:00','1997-04-08 00:00:00','1997-03-31 00:00:00',2,'64.45','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10486,'HILAA',1,'1997-03-26 00:00:00','1997-04-23 00:00:00','1997-04-02 00:00:00',2,'30.53','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10487,'QUEEN',2,'1997-03-26 00:00:00','1997-04-23 00:00:00','1997-03-28 00:00:00',2,'71.07','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10488,'FRANK',8,'1997-03-27 00:00:00','1997-04-24 00:00:00','1997-04-02 00:00:00',2,'4.93','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10489,'PICCO',6,'1997-03-28 00:00:00','1997-04-25 00:00:00','1997-04-09 00:00:00',2,'5.29','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10490,'HILAA',7,'1997-03-31 00:00:00','1997-04-28 00:00:00','1997-04-03 00:00:00',2,'210.19','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10491,'FURIB',8,'1997-03-31 00:00:00','1997-04-28 00:00:00','1997-04-08 00:00:00',3,'16.96','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10492,'BOTTM',3,'1997-04-01 00:00:00','1997-04-29 00:00:00','1997-04-11 00:00:00',1,'62.89','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10493,'LAMAI',4,'1997-04-02 00:00:00','1997-04-30 00:00:00','1997-04-10 00:00:00',3,'10.64','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10494,'COMMI',4,'1997-04-02 00:00:00','1997-04-30 00:00:00','1997-04-09 00:00:00',2,'65.99','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10495,'LAUGB',3,'1997-04-03 00:00:00','1997-05-01 00:00:00','1997-04-11 00:00:00',3,'4.65','Laughing Bacchus Wine Cellars','2319 Elm St.','Vancouver','BC','V3F 2K1','Canada'),
+ (10496,'TRADH',7,'1997-04-04 00:00:00','1997-05-02 00:00:00','1997-04-07 00:00:00',2,'46.77','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10497,'LEHMS',7,'1997-04-04 00:00:00','1997-05-02 00:00:00','1997-04-07 00:00:00',1,'36.21','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10498,'HILAA',8,'1997-04-07 00:00:00','1997-05-05 00:00:00','1997-04-11 00:00:00',2,'29.75','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10499,'LILAS',4,'1997-04-08 00:00:00','1997-05-06 00:00:00','1997-04-16 00:00:00',2,'102.02','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10500,'LAMAI',6,'1997-04-09 00:00:00','1997-05-07 00:00:00','1997-04-17 00:00:00',1,'42.68','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10501,'BLAUS',9,'1997-04-09 00:00:00','1997-05-07 00:00:00','1997-04-16 00:00:00',3,'8.85','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10502,'PERIC',2,'1997-04-10 00:00:00','1997-05-08 00:00:00','1997-04-29 00:00:00',1,'69.32','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10503,'HUNGO',6,'1997-04-11 00:00:00','1997-05-09 00:00:00','1997-04-16 00:00:00',2,'16.74','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10504,'WHITC',4,'1997-04-11 00:00:00','1997-05-09 00:00:00','1997-04-18 00:00:00',3,'59.13','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10505,'MEREP',3,'1997-04-14 00:00:00','1997-05-12 00:00:00','1997-04-21 00:00:00',3,'7.13','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10506,'KOENE',9,'1997-04-15 00:00:00','1997-05-13 00:00:00','1997-05-02 00:00:00',2,'21.19','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10507,'ANTON',7,'1997-04-15 00:00:00','1997-05-13 00:00:00','1997-04-22 00:00:00',1,'47.45','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10508,'OTTIK',1,'1997-04-16 00:00:00','1997-05-14 00:00:00','1997-05-13 00:00:00',2,'4.99','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10509,'BLAUS',4,'1997-04-17 00:00:00','1997-05-15 00:00:00','1997-04-29 00:00:00',1,'0.15','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10510,'SAVEA',6,'1997-04-18 00:00:00','1997-05-16 00:00:00','1997-04-28 00:00:00',3,'367.63','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10511,'BONAP',4,'1997-04-18 00:00:00','1997-05-16 00:00:00','1997-04-21 00:00:00',3,'350.64','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10512,'FAMIA',7,'1997-04-21 00:00:00','1997-05-19 00:00:00','1997-04-24 00:00:00',2,'3.53','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10513,'WANDK',7,'1997-04-22 00:00:00','1997-06-03 00:00:00','1997-04-28 00:00:00',1,'105.65','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10514,'ERNSH',3,'1997-04-22 00:00:00','1997-05-20 00:00:00','1997-05-16 00:00:00',2,'789.95','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10515,'QUICK',2,'1997-04-23 00:00:00','1997-05-07 00:00:00','1997-05-23 00:00:00',1,'204.47','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10516,'HUNGO',2,'1997-04-24 00:00:00','1997-05-22 00:00:00','1997-05-01 00:00:00',3,'62.78','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10517,'NORTS',3,'1997-04-24 00:00:00','1997-05-22 00:00:00','1997-04-29 00:00:00',3,'32.07','North/South','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10518,'TORTU',4,'1997-04-25 00:00:00','1997-05-09 00:00:00','1997-05-05 00:00:00',2,'218.15','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10519,'CHOPS',6,'1997-04-28 00:00:00','1997-05-26 00:00:00','1997-05-01 00:00:00',3,'91.76','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10520,'SANTG',7,'1997-04-29 00:00:00','1997-05-27 00:00:00','1997-05-01 00:00:00',1,'13.37','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10521,'CACTU',8,'1997-04-29 00:00:00','1997-05-27 00:00:00','1997-05-02 00:00:00',2,'17.22','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10522,'LEHMS',4,'1997-04-30 00:00:00','1997-05-28 00:00:00','1997-05-06 00:00:00',1,'45.33','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10523,'SEVES',7,'1997-05-01 00:00:00','1997-05-29 00:00:00','1997-05-30 00:00:00',2,'77.63','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10524,'BERGS',1,'1997-05-01 00:00:00','1997-05-29 00:00:00','1997-05-07 00:00:00',2,'244.79','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10525,'BONAP',1,'1997-05-02 00:00:00','1997-05-30 00:00:00','1997-05-23 00:00:00',2,'11.06','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10526,'WARTH',4,'1997-05-05 00:00:00','1997-06-02 00:00:00','1997-05-15 00:00:00',2,'58.59','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10527,'QUICK',7,'1997-05-05 00:00:00','1997-06-02 00:00:00','1997-05-07 00:00:00',1,'41.90','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10528,'GREAL',6,'1997-05-06 00:00:00','1997-05-20 00:00:00','1997-05-09 00:00:00',2,'3.35','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10529,'MAISD',5,'1997-05-07 00:00:00','1997-06-04 00:00:00','1997-05-09 00:00:00',2,'66.69','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10530,'PICCO',3,'1997-05-08 00:00:00','1997-06-05 00:00:00','1997-05-12 00:00:00',2,'339.22','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10531,'OCEAN',7,'1997-05-08 00:00:00','1997-06-05 00:00:00','1997-05-19 00:00:00',1,'8.12','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10532,'EASTC',7,'1997-05-09 00:00:00','1997-06-06 00:00:00','1997-05-12 00:00:00',3,'74.46','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10533,'FOLKO',8,'1997-05-12 00:00:00','1997-06-09 00:00:00','1997-05-22 00:00:00',1,'188.04','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10534,'LEHMS',8,'1997-05-12 00:00:00','1997-06-09 00:00:00','1997-05-14 00:00:00',2,'27.94','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10535,'ANTON',4,'1997-05-13 00:00:00','1997-06-10 00:00:00','1997-05-21 00:00:00',1,'15.64','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10536,'LEHMS',3,'1997-05-14 00:00:00','1997-06-11 00:00:00','1997-06-06 00:00:00',2,'58.88','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10537,'RICSU',1,'1997-05-14 00:00:00','1997-05-28 00:00:00','1997-05-19 00:00:00',1,'78.85','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10538,'BSBEV',9,'1997-05-15 00:00:00','1997-06-12 00:00:00','1997-05-16 00:00:00',3,'4.87','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10539,'BSBEV',6,'1997-05-16 00:00:00','1997-06-13 00:00:00','1997-05-23 00:00:00',3,'12.36','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10540,'QUICK',3,'1997-05-19 00:00:00','1997-06-16 00:00:00','1997-06-13 00:00:00',3,'1007.64','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10541,'HANAR',2,'1997-05-19 00:00:00','1997-06-16 00:00:00','1997-05-29 00:00:00',1,'68.65','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10542,'KOENE',1,'1997-05-20 00:00:00','1997-06-17 00:00:00','1997-05-26 00:00:00',3,'10.95','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10543,'LILAS',8,'1997-05-21 00:00:00','1997-06-18 00:00:00','1997-05-23 00:00:00',2,'48.17','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10544,'LONEP',4,'1997-05-21 00:00:00','1997-06-18 00:00:00','1997-05-30 00:00:00',1,'24.91','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10545,'LAZYK',8,'1997-05-22 00:00:00','1997-06-19 00:00:00','1997-06-26 00:00:00',2,'11.92','Lazy K Kountry Store','12 Orchestra Terrace','Walla Walla','WA','99362','USA'),
+ (10546,'VICTE',1,'1997-05-23 00:00:00','1997-06-20 00:00:00','1997-05-27 00:00:00',3,'194.72','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10547,'SEVES',3,'1997-05-23 00:00:00','1997-06-20 00:00:00','1997-06-02 00:00:00',2,'178.43','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10548,'TOMSP',3,'1997-05-26 00:00:00','1997-06-23 00:00:00','1997-06-02 00:00:00',2,'1.43','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10549,'QUICK',5,'1997-05-27 00:00:00','1997-06-10 00:00:00','1997-05-30 00:00:00',1,'171.24','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10550,'GODOS',7,'1997-05-28 00:00:00','1997-06-25 00:00:00','1997-06-06 00:00:00',3,'4.32','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10551,'FURIB',4,'1997-05-28 00:00:00','1997-07-09 00:00:00','1997-06-06 00:00:00',3,'72.95','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10552,'HILAA',2,'1997-05-29 00:00:00','1997-06-26 00:00:00','1997-06-05 00:00:00',1,'83.22','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10553,'WARTH',2,'1997-05-30 00:00:00','1997-06-27 00:00:00','1997-06-03 00:00:00',2,'149.49','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10554,'OTTIK',4,'1997-05-30 00:00:00','1997-06-27 00:00:00','1997-06-05 00:00:00',3,'120.97','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10555,'SAVEA',6,'1997-06-02 00:00:00','1997-06-30 00:00:00','1997-06-04 00:00:00',3,'252.49','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10556,'SIMOB',2,'1997-06-03 00:00:00','1997-07-15 00:00:00','1997-06-13 00:00:00',1,'9.80','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10557,'LEHMS',9,'1997-06-03 00:00:00','1997-06-17 00:00:00','1997-06-06 00:00:00',2,'96.72','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10558,'AROUT',1,'1997-06-04 00:00:00','1997-07-02 00:00:00','1997-06-10 00:00:00',2,'72.97','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10559,'BLONP',6,'1997-06-05 00:00:00','1997-07-03 00:00:00','1997-06-13 00:00:00',1,'8.05','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10560,'FRANK',8,'1997-06-06 00:00:00','1997-07-04 00:00:00','1997-06-09 00:00:00',1,'36.65','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10561,'FOLKO',2,'1997-06-06 00:00:00','1997-07-04 00:00:00','1997-06-09 00:00:00',2,'242.21','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10562,'REGGC',1,'1997-06-09 00:00:00','1997-07-07 00:00:00','1997-06-12 00:00:00',1,'22.95','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10563,'RICAR',2,'1997-06-10 00:00:00','1997-07-22 00:00:00','1997-06-24 00:00:00',2,'60.43','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10564,'RATTC',4,'1997-06-10 00:00:00','1997-07-08 00:00:00','1997-06-16 00:00:00',3,'13.75','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10565,'MEREP',8,'1997-06-11 00:00:00','1997-07-09 00:00:00','1997-06-18 00:00:00',2,'7.15','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10566,'BLONP',9,'1997-06-12 00:00:00','1997-07-10 00:00:00','1997-06-18 00:00:00',1,'88.40','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10567,'HUNGO',1,'1997-06-12 00:00:00','1997-07-10 00:00:00','1997-06-17 00:00:00',1,'33.97','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10568,'GALED',3,'1997-06-13 00:00:00','1997-07-11 00:00:00','1997-07-09 00:00:00',3,'6.54','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10569,'RATTC',5,'1997-06-16 00:00:00','1997-07-14 00:00:00','1997-07-11 00:00:00',1,'58.98','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10570,'MEREP',3,'1997-06-17 00:00:00','1997-07-15 00:00:00','1997-06-19 00:00:00',3,'188.99','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10571,'ERNSH',8,'1997-06-17 00:00:00','1997-07-29 00:00:00','1997-07-04 00:00:00',3,'26.06','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10572,'BERGS',3,'1997-06-18 00:00:00','1997-07-16 00:00:00','1997-06-25 00:00:00',2,'116.43','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10573,'ANTON',7,'1997-06-19 00:00:00','1997-07-17 00:00:00','1997-06-20 00:00:00',3,'84.84','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10574,'TRAIH',4,'1997-06-19 00:00:00','1997-07-17 00:00:00','1997-06-30 00:00:00',2,'37.60','Trail''s Head Gourmet Provisioners','722 DaVinci Blvd.','Kirkland','WA','98034','USA'),
+ (10575,'MORGK',5,'1997-06-20 00:00:00','1997-07-04 00:00:00','1997-06-30 00:00:00',1,'127.34','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10576,'TORTU',3,'1997-06-23 00:00:00','1997-07-07 00:00:00','1997-06-30 00:00:00',3,'18.56','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10577,'TRAIH',9,'1997-06-23 00:00:00','1997-08-04 00:00:00','1997-06-30 00:00:00',2,'25.41','Trail''s Head Gourmet Provisioners','722 DaVinci Blvd.','Kirkland','WA','98034','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10578,'BSBEV',4,'1997-06-24 00:00:00','1997-07-22 00:00:00','1997-07-25 00:00:00',3,'29.60','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10579,'LETSS',1,'1997-06-25 00:00:00','1997-07-23 00:00:00','1997-07-04 00:00:00',2,'13.73','Let''s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10580,'OTTIK',4,'1997-06-26 00:00:00','1997-07-24 00:00:00','1997-07-01 00:00:00',3,'75.89','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10581,'FAMIA',3,'1997-06-26 00:00:00','1997-07-24 00:00:00','1997-07-02 00:00:00',1,'3.01','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10582,'BLAUS',3,'1997-06-27 00:00:00','1997-07-25 00:00:00','1997-07-14 00:00:00',2,'27.71','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10583,'WARTH',2,'1997-06-30 00:00:00','1997-07-28 00:00:00','1997-07-04 00:00:00',2,'7.28','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10584,'BLONP',4,'1997-06-30 00:00:00','1997-07-28 00:00:00','1997-07-04 00:00:00',1,'59.14','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10585,'WELLI',7,'1997-07-01 00:00:00','1997-07-29 00:00:00','1997-07-10 00:00:00',1,'13.41','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10586,'REGGC',9,'1997-07-02 00:00:00','1997-07-30 00:00:00','1997-07-09 00:00:00',1,'0.48','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10587,'QUEDE',1,'1997-07-02 00:00:00','1997-07-30 00:00:00','1997-07-09 00:00:00',1,'62.52','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10588,'QUICK',2,'1997-07-03 00:00:00','1997-07-31 00:00:00','1997-07-10 00:00:00',3,'194.67','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10589,'GREAL',8,'1997-07-04 00:00:00','1997-08-01 00:00:00','1997-07-14 00:00:00',2,'4.42','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10590,'MEREP',4,'1997-07-07 00:00:00','1997-08-04 00:00:00','1997-07-14 00:00:00',3,'44.77','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10591,'VAFFE',1,'1997-07-07 00:00:00','1997-07-21 00:00:00','1997-07-16 00:00:00',1,'55.92','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10592,'LEHMS',3,'1997-07-08 00:00:00','1997-08-05 00:00:00','1997-07-16 00:00:00',1,'32.10','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10593,'LEHMS',7,'1997-07-09 00:00:00','1997-08-06 00:00:00','1997-08-13 00:00:00',2,'174.20','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10594,'OLDWO',3,'1997-07-09 00:00:00','1997-08-06 00:00:00','1997-07-16 00:00:00',2,'5.24','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10595,'ERNSH',2,'1997-07-10 00:00:00','1997-08-07 00:00:00','1997-07-14 00:00:00',1,'96.78','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10596,'WHITC',8,'1997-07-11 00:00:00','1997-08-08 00:00:00','1997-08-12 00:00:00',1,'16.34','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10597,'PICCO',7,'1997-07-11 00:00:00','1997-08-08 00:00:00','1997-07-18 00:00:00',3,'35.12','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10598,'RATTC',1,'1997-07-14 00:00:00','1997-08-11 00:00:00','1997-07-18 00:00:00',3,'44.42','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10599,'BSBEV',6,'1997-07-15 00:00:00','1997-08-26 00:00:00','1997-07-21 00:00:00',3,'29.98','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10600,'HUNGC',4,'1997-07-16 00:00:00','1997-08-13 00:00:00','1997-07-21 00:00:00',1,'45.13','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10601,'HILAA',7,'1997-07-16 00:00:00','1997-08-27 00:00:00','1997-07-22 00:00:00',1,'58.30','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10602,'VAFFE',8,'1997-07-17 00:00:00','1997-08-14 00:00:00','1997-07-22 00:00:00',2,'2.92','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10603,'SAVEA',8,'1997-07-18 00:00:00','1997-08-15 00:00:00','1997-08-08 00:00:00',2,'48.77','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10604,'FURIB',1,'1997-07-18 00:00:00','1997-08-15 00:00:00','1997-07-29 00:00:00',1,'7.46','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10605,'MEREP',1,'1997-07-21 00:00:00','1997-08-18 00:00:00','1997-07-29 00:00:00',2,'379.13','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10606,'TRADH',4,'1997-07-22 00:00:00','1997-08-19 00:00:00','1997-07-31 00:00:00',3,'79.40','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10607,'SAVEA',5,'1997-07-22 00:00:00','1997-08-19 00:00:00','1997-07-25 00:00:00',1,'200.24','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10608,'TOMSP',4,'1997-07-23 00:00:00','1997-08-20 00:00:00','1997-08-01 00:00:00',2,'27.79','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10609,'DUMON',7,'1997-07-24 00:00:00','1997-08-21 00:00:00','1997-07-30 00:00:00',2,'1.85','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10610,'LAMAI',8,'1997-07-25 00:00:00','1997-08-22 00:00:00','1997-08-06 00:00:00',1,'26.78','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10611,'WOLZA',6,'1997-07-25 00:00:00','1997-08-22 00:00:00','1997-08-01 00:00:00',2,'80.65','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10612,'SAVEA',1,'1997-07-28 00:00:00','1997-08-25 00:00:00','1997-08-01 00:00:00',2,'544.08','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10613,'HILAA',4,'1997-07-29 00:00:00','1997-08-26 00:00:00','1997-08-01 00:00:00',2,'8.11','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10614,'BLAUS',8,'1997-07-29 00:00:00','1997-08-26 00:00:00','1997-08-01 00:00:00',3,'1.93','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10615,'WILMK',2,'1997-07-30 00:00:00','1997-08-27 00:00:00','1997-08-06 00:00:00',3,'0.75','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10616,'GREAL',1,'1997-07-31 00:00:00','1997-08-28 00:00:00','1997-08-05 00:00:00',2,'116.53','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10617,'GREAL',4,'1997-07-31 00:00:00','1997-08-28 00:00:00','1997-08-04 00:00:00',2,'18.53','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10618,'MEREP',1,'1997-08-01 00:00:00','1997-09-12 00:00:00','1997-08-08 00:00:00',1,'154.68','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10619,'MEREP',3,'1997-08-04 00:00:00','1997-09-01 00:00:00','1997-08-07 00:00:00',3,'91.05','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10620,'LAUGB',2,'1997-08-05 00:00:00','1997-09-02 00:00:00','1997-08-14 00:00:00',3,'0.94','Laughing Bacchus Wine Cellars','2319 Elm St.','Vancouver','BC','V3F 2K1','Canada'),
+ (10621,'ISLAT',4,'1997-08-05 00:00:00','1997-09-02 00:00:00','1997-08-11 00:00:00',2,'23.73','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10622,'RICAR',4,'1997-08-06 00:00:00','1997-09-03 00:00:00','1997-08-11 00:00:00',3,'50.97','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10623,'FRANK',8,'1997-08-07 00:00:00','1997-09-04 00:00:00','1997-08-12 00:00:00',2,'97.18','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10624,'THECR',4,'1997-08-07 00:00:00','1997-09-04 00:00:00','1997-08-19 00:00:00',2,'94.80','The Cracker Box','55 Grizzly Peak Rd.','Butte','MT','59801','USA'),
+ (10625,'ANATR',3,'1997-08-08 00:00:00','1997-09-05 00:00:00','1997-08-14 00:00:00',1,'43.90','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10626,'BERGS',1,'1997-08-11 00:00:00','1997-09-08 00:00:00','1997-08-20 00:00:00',2,'138.69','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10627,'SAVEA',8,'1997-08-11 00:00:00','1997-09-22 00:00:00','1997-08-21 00:00:00',3,'107.46','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10628,'BLONP',4,'1997-08-12 00:00:00','1997-09-09 00:00:00','1997-08-20 00:00:00',3,'30.36','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10629,'GODOS',4,'1997-08-12 00:00:00','1997-09-09 00:00:00','1997-08-20 00:00:00',3,'85.46','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10630,'KOENE',1,'1997-08-13 00:00:00','1997-09-10 00:00:00','1997-08-19 00:00:00',2,'32.35','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10631,'LAMAI',8,'1997-08-14 00:00:00','1997-09-11 00:00:00','1997-08-15 00:00:00',1,'0.87','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10632,'WANDK',8,'1997-08-14 00:00:00','1997-09-11 00:00:00','1997-08-19 00:00:00',1,'41.38','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10633,'ERNSH',7,'1997-08-15 00:00:00','1997-09-12 00:00:00','1997-08-18 00:00:00',3,'477.90','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10634,'FOLIG',4,'1997-08-15 00:00:00','1997-09-12 00:00:00','1997-08-21 00:00:00',3,'487.38','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10635,'MAGAA',8,'1997-08-18 00:00:00','1997-09-15 00:00:00','1997-08-21 00:00:00',3,'47.46','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10636,'WARTH',4,'1997-08-19 00:00:00','1997-09-16 00:00:00','1997-08-26 00:00:00',1,'1.15','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10637,'QUEEN',6,'1997-08-19 00:00:00','1997-09-16 00:00:00','1997-08-26 00:00:00',1,'201.29','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10638,'LINOD',3,'1997-08-20 00:00:00','1997-09-17 00:00:00','1997-09-01 00:00:00',1,'158.44','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10639,'SANTG',7,'1997-08-20 00:00:00','1997-09-17 00:00:00','1997-08-27 00:00:00',3,'38.64','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10640,'WANDK',4,'1997-08-21 00:00:00','1997-09-18 00:00:00','1997-08-28 00:00:00',1,'23.55','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10641,'HILAA',4,'1997-08-22 00:00:00','1997-09-19 00:00:00','1997-08-26 00:00:00',2,'179.61','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10642,'SIMOB',7,'1997-08-22 00:00:00','1997-09-19 00:00:00','1997-09-05 00:00:00',3,'41.89','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10643,'ALFKI',6,'1997-08-25 00:00:00','1997-09-22 00:00:00','1997-09-02 00:00:00',1,'29.46','Alfreds Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10644,'WELLI',3,'1997-08-25 00:00:00','1997-09-22 00:00:00','1997-09-01 00:00:00',2,'0.14','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10645,'HANAR',4,'1997-08-26 00:00:00','1997-09-23 00:00:00','1997-09-02 00:00:00',1,'12.41','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10646,'HUNGO',9,'1997-08-27 00:00:00','1997-10-08 00:00:00','1997-09-03 00:00:00',3,'142.33','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10647,'QUEDE',4,'1997-08-27 00:00:00','1997-09-10 00:00:00','1997-09-03 00:00:00',2,'45.54','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10648,'RICAR',5,'1997-08-28 00:00:00','1997-10-09 00:00:00','1997-09-09 00:00:00',2,'14.25','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10649,'MAISD',5,'1997-08-28 00:00:00','1997-09-25 00:00:00','1997-08-29 00:00:00',3,'6.20','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10650,'FAMIA',5,'1997-08-29 00:00:00','1997-09-26 00:00:00','1997-09-03 00:00:00',3,'176.81','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10651,'WANDK',8,'1997-09-01 00:00:00','1997-09-29 00:00:00','1997-09-11 00:00:00',2,'20.60','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10652,'GOURL',4,'1997-09-01 00:00:00','1997-09-29 00:00:00','1997-09-08 00:00:00',2,'7.14','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10653,'FRANK',1,'1997-09-02 00:00:00','1997-09-30 00:00:00','1997-09-19 00:00:00',1,'93.25','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10654,'BERGS',5,'1997-09-02 00:00:00','1997-09-30 00:00:00','1997-09-11 00:00:00',1,'55.26','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10655,'REGGC',1,'1997-09-03 00:00:00','1997-10-01 00:00:00','1997-09-11 00:00:00',2,'4.41','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10656,'GREAL',6,'1997-09-04 00:00:00','1997-10-02 00:00:00','1997-09-10 00:00:00',1,'57.15','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10657,'SAVEA',2,'1997-09-04 00:00:00','1997-10-02 00:00:00','1997-09-15 00:00:00',2,'352.69','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10658,'QUICK',4,'1997-09-05 00:00:00','1997-10-03 00:00:00','1997-09-08 00:00:00',1,'364.15','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10659,'QUEEN',7,'1997-09-05 00:00:00','1997-10-03 00:00:00','1997-09-10 00:00:00',2,'105.81','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10660,'HUNGC',8,'1997-09-08 00:00:00','1997-10-06 00:00:00','1997-10-15 00:00:00',1,'111.29','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10661,'HUNGO',7,'1997-09-09 00:00:00','1997-10-07 00:00:00','1997-09-15 00:00:00',3,'17.55','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10662,'LONEP',3,'1997-09-09 00:00:00','1997-10-07 00:00:00','1997-09-18 00:00:00',2,'1.28','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10663,'BONAP',2,'1997-09-10 00:00:00','1997-09-24 00:00:00','1997-10-03 00:00:00',2,'113.15','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10664,'FURIB',1,'1997-09-10 00:00:00','1997-10-08 00:00:00','1997-09-19 00:00:00',3,'1.27','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10665,'LONEP',1,'1997-09-11 00:00:00','1997-10-09 00:00:00','1997-09-17 00:00:00',2,'26.31','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10666,'RICSU',7,'1997-09-12 00:00:00','1997-10-10 00:00:00','1997-09-22 00:00:00',2,'232.42','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10667,'ERNSH',7,'1997-09-12 00:00:00','1997-10-10 00:00:00','1997-09-19 00:00:00',1,'78.09','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10668,'WANDK',1,'1997-09-15 00:00:00','1997-10-13 00:00:00','1997-09-23 00:00:00',2,'47.22','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10669,'SIMOB',2,'1997-09-15 00:00:00','1997-10-13 00:00:00','1997-09-22 00:00:00',1,'24.39','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10670,'FRANK',4,'1997-09-16 00:00:00','1997-10-14 00:00:00','1997-09-18 00:00:00',1,'203.48','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10671,'FRANR',1,'1997-09-17 00:00:00','1997-10-15 00:00:00','1997-09-24 00:00:00',1,'30.34','France restauration','54 rue Royale','Nantes',NULL,'44000','France'),
+ (10672,'BERGS',9,'1997-09-17 00:00:00','1997-10-01 00:00:00','1997-09-26 00:00:00',2,'95.75','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10673,'WILMK',2,'1997-09-18 00:00:00','1997-10-16 00:00:00','1997-09-19 00:00:00',1,'22.76','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10674,'ISLAT',4,'1997-09-18 00:00:00','1997-10-16 00:00:00','1997-09-30 00:00:00',2,'0.90','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10675,'FRANK',5,'1997-09-19 00:00:00','1997-10-17 00:00:00','1997-09-23 00:00:00',2,'31.85','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10676,'TORTU',2,'1997-09-22 00:00:00','1997-10-20 00:00:00','1997-09-29 00:00:00',2,'2.01','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10677,'ANTON',1,'1997-09-22 00:00:00','1997-10-20 00:00:00','1997-09-26 00:00:00',3,'4.03','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10678,'SAVEA',7,'1997-09-23 00:00:00','1997-10-21 00:00:00','1997-10-16 00:00:00',3,'388.98','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10679,'BLONP',8,'1997-09-23 00:00:00','1997-10-21 00:00:00','1997-09-30 00:00:00',3,'27.94','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10680,'OLDWO',1,'1997-09-24 00:00:00','1997-10-22 00:00:00','1997-09-26 00:00:00',1,'26.61','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10681,'GREAL',3,'1997-09-25 00:00:00','1997-10-23 00:00:00','1997-09-30 00:00:00',3,'76.13','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10682,'ANTON',3,'1997-09-25 00:00:00','1997-10-23 00:00:00','1997-10-01 00:00:00',2,'36.13','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10683,'DUMON',2,'1997-09-26 00:00:00','1997-10-24 00:00:00','1997-10-01 00:00:00',1,'4.40','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10684,'OTTIK',3,'1997-09-26 00:00:00','1997-10-24 00:00:00','1997-09-30 00:00:00',1,'145.63','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10685,'GOURL',4,'1997-09-29 00:00:00','1997-10-13 00:00:00','1997-10-03 00:00:00',2,'33.75','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10686,'PICCO',2,'1997-09-30 00:00:00','1997-10-28 00:00:00','1997-10-08 00:00:00',1,'96.50','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10687,'HUNGO',9,'1997-09-30 00:00:00','1997-10-28 00:00:00','1997-10-30 00:00:00',2,'296.43','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10688,'VAFFE',4,'1997-10-01 00:00:00','1997-10-15 00:00:00','1997-10-07 00:00:00',2,'299.09','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10689,'BERGS',1,'1997-10-01 00:00:00','1997-10-29 00:00:00','1997-10-07 00:00:00',2,'13.42','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10690,'HANAR',1,'1997-10-02 00:00:00','1997-10-30 00:00:00','1997-10-03 00:00:00',1,'15.80','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10691,'QUICK',2,'1997-10-03 00:00:00','1997-11-14 00:00:00','1997-10-22 00:00:00',2,'810.05','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10692,'ALFKI',4,'1997-10-03 00:00:00','1997-10-31 00:00:00','1997-10-13 00:00:00',2,'61.02','Alfred''s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (10693,'WHITC',3,'1997-10-06 00:00:00','1997-10-20 00:00:00','1997-10-10 00:00:00',3,'139.34','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10694,'QUICK',8,'1997-10-06 00:00:00','1997-11-03 00:00:00','1997-10-09 00:00:00',3,'398.36','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10695,'WILMK',7,'1997-10-07 00:00:00','1997-11-18 00:00:00','1997-10-14 00:00:00',1,'16.72','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10696,'WHITC',8,'1997-10-08 00:00:00','1997-11-19 00:00:00','1997-10-14 00:00:00',3,'102.55','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10697,'LINOD',3,'1997-10-08 00:00:00','1997-11-05 00:00:00','1997-10-14 00:00:00',1,'45.52','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10698,'ERNSH',4,'1997-10-09 00:00:00','1997-11-06 00:00:00','1997-10-17 00:00:00',1,'272.47','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10699,'MORGK',3,'1997-10-09 00:00:00','1997-11-06 00:00:00','1997-10-13 00:00:00',3,'0.58','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10700,'SAVEA',3,'1997-10-10 00:00:00','1997-11-07 00:00:00','1997-10-16 00:00:00',1,'65.10','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10701,'HUNGO',6,'1997-10-13 00:00:00','1997-10-27 00:00:00','1997-10-15 00:00:00',3,'220.31','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10702,'ALFKI',4,'1997-10-13 00:00:00','1997-11-24 00:00:00','1997-10-21 00:00:00',1,'23.94','Alfred''s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (10703,'FOLKO',6,'1997-10-14 00:00:00','1997-11-11 00:00:00','1997-10-20 00:00:00',2,'152.30','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10704,'QUEEN',6,'1997-10-14 00:00:00','1997-11-11 00:00:00','1997-11-07 00:00:00',1,'4.78','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10705,'HILAA',9,'1997-10-15 00:00:00','1997-11-12 00:00:00','1997-11-18 00:00:00',2,'3.52','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10706,'OLDWO',8,'1997-10-16 00:00:00','1997-11-13 00:00:00','1997-10-21 00:00:00',3,'135.63','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10707,'AROUT',4,'1997-10-16 00:00:00','1997-10-30 00:00:00','1997-10-23 00:00:00',3,'21.74','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10708,'THEBI',6,'1997-10-17 00:00:00','1997-11-28 00:00:00','1997-11-05 00:00:00',2,'2.96','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA'),
+ (10709,'GOURL',1,'1997-10-17 00:00:00','1997-11-14 00:00:00','1997-11-20 00:00:00',3,'210.80','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10710,'FRANS',1,'1997-10-20 00:00:00','1997-11-17 00:00:00','1997-10-23 00:00:00',1,'4.98','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10711,'SAVEA',5,'1997-10-21 00:00:00','1997-12-02 00:00:00','1997-10-29 00:00:00',2,'52.41','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10712,'HUNGO',3,'1997-10-21 00:00:00','1997-11-18 00:00:00','1997-10-31 00:00:00',1,'89.93','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10713,'SAVEA',1,'1997-10-22 00:00:00','1997-11-19 00:00:00','1997-10-24 00:00:00',1,'167.05','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10714,'SAVEA',5,'1997-10-22 00:00:00','1997-11-19 00:00:00','1997-10-27 00:00:00',3,'24.49','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10715,'BONAP',3,'1997-10-23 00:00:00','1997-11-06 00:00:00','1997-10-29 00:00:00',1,'63.20','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10716,'RANCH',4,'1997-10-24 00:00:00','1997-11-21 00:00:00','1997-10-27 00:00:00',2,'22.57','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10717,'FRANK',1,'1997-10-24 00:00:00','1997-11-21 00:00:00','1997-10-29 00:00:00',2,'59.25','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10718,'KOENE',1,'1997-10-27 00:00:00','1997-11-24 00:00:00','1997-10-29 00:00:00',3,'170.88','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10719,'LETSS',8,'1997-10-27 00:00:00','1997-11-24 00:00:00','1997-11-05 00:00:00',2,'51.44','Let''s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10720,'QUEDE',8,'1997-10-28 00:00:00','1997-11-11 00:00:00','1997-11-05 00:00:00',2,'9.53','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10721,'QUICK',5,'1997-10-29 00:00:00','1997-11-26 00:00:00','1997-10-31 00:00:00',3,'48.92','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10722,'SAVEA',8,'1997-10-29 00:00:00','1997-12-10 00:00:00','1997-11-04 00:00:00',1,'74.58','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10723,'WHITC',3,'1997-10-30 00:00:00','1997-11-27 00:00:00','1997-11-25 00:00:00',1,'21.72','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10724,'MEREP',8,'1997-10-30 00:00:00','1997-12-11 00:00:00','1997-11-05 00:00:00',2,'57.75','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10725,'FAMIA',4,'1997-10-31 00:00:00','1997-11-28 00:00:00','1997-11-05 00:00:00',3,'10.83','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10726,'EASTC',4,'1997-11-03 00:00:00','1997-11-17 00:00:00','1997-12-05 00:00:00',1,'16.56','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10727,'REGGC',2,'1997-11-03 00:00:00','1997-12-01 00:00:00','1997-12-05 00:00:00',1,'89.90','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10728,'QUEEN',4,'1997-11-04 00:00:00','1997-12-02 00:00:00','1997-11-11 00:00:00',2,'58.33','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10729,'LINOD',8,'1997-11-04 00:00:00','1997-12-16 00:00:00','1997-11-14 00:00:00',3,'141.06','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10730,'BONAP',5,'1997-11-05 00:00:00','1997-12-03 00:00:00','1997-11-14 00:00:00',1,'20.12','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10731,'CHOPS',7,'1997-11-06 00:00:00','1997-12-04 00:00:00','1997-11-14 00:00:00',1,'96.65','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10732,'BONAP',3,'1997-11-06 00:00:00','1997-12-04 00:00:00','1997-11-07 00:00:00',1,'16.97','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10733,'BERGS',1,'1997-11-07 00:00:00','1997-12-05 00:00:00','1997-11-10 00:00:00',3,'110.11','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10734,'GOURL',2,'1997-11-07 00:00:00','1997-12-05 00:00:00','1997-11-12 00:00:00',3,'1.63','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10735,'LETSS',6,'1997-11-10 00:00:00','1997-12-08 00:00:00','1997-11-21 00:00:00',2,'45.97','Let''s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10736,'HUNGO',9,'1997-11-11 00:00:00','1997-12-09 00:00:00','1997-11-21 00:00:00',2,'44.10','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10737,'VINET',2,'1997-11-11 00:00:00','1997-12-09 00:00:00','1997-11-18 00:00:00',2,'7.79','Vins et alcools Chevalier','59 rue de l''Abbaye','Reims',NULL,'51100','France'),
+ (10738,'SPECD',2,'1997-11-12 00:00:00','1997-12-10 00:00:00','1997-11-18 00:00:00',1,'2.91','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France'),
+ (10739,'VINET',3,'1997-11-12 00:00:00','1997-12-10 00:00:00','1997-11-17 00:00:00',3,'11.08','Vins et alcools Chevalier','59 rue de l''Abbaye','Reims',NULL,'51100','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10740,'WHITC',4,'1997-11-13 00:00:00','1997-12-11 00:00:00','1997-11-25 00:00:00',2,'81.88','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10741,'AROUT',4,'1997-11-14 00:00:00','1997-11-28 00:00:00','1997-11-18 00:00:00',3,'10.96','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10742,'BOTTM',3,'1997-11-14 00:00:00','1997-12-12 00:00:00','1997-11-18 00:00:00',3,'243.73','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10743,'AROUT',1,'1997-11-17 00:00:00','1997-12-15 00:00:00','1997-11-21 00:00:00',2,'23.72','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10744,'VAFFE',6,'1997-11-17 00:00:00','1997-12-15 00:00:00','1997-11-24 00:00:00',1,'69.19','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10745,'QUICK',9,'1997-11-18 00:00:00','1997-12-16 00:00:00','1997-11-27 00:00:00',1,'3.52','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10746,'CHOPS',1,'1997-11-19 00:00:00','1997-12-17 00:00:00','1997-11-21 00:00:00',3,'31.43','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10747,'PICCO',6,'1997-11-19 00:00:00','1997-12-17 00:00:00','1997-11-26 00:00:00',1,'117.33','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10748,'SAVEA',3,'1997-11-20 00:00:00','1997-12-18 00:00:00','1997-11-28 00:00:00',1,'232.55','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10749,'ISLAT',4,'1997-11-20 00:00:00','1997-12-18 00:00:00','1997-12-19 00:00:00',2,'61.53','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10750,'WARTH',9,'1997-11-21 00:00:00','1997-12-19 00:00:00','1997-11-24 00:00:00',1,'79.30','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10751,'RICSU',3,'1997-11-24 00:00:00','1997-12-22 00:00:00','1997-12-03 00:00:00',3,'130.79','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10752,'NORTS',2,'1997-11-24 00:00:00','1997-12-22 00:00:00','1997-11-28 00:00:00',3,'1.39','North/South','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK'),
+ (10753,'FRANS',3,'1997-11-25 00:00:00','1997-12-23 00:00:00','1997-11-27 00:00:00',1,'7.70','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10754,'MAGAA',6,'1997-11-25 00:00:00','1997-12-23 00:00:00','1997-11-27 00:00:00',3,'2.38','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10755,'BONAP',4,'1997-11-26 00:00:00','1997-12-24 00:00:00','1997-11-28 00:00:00',2,'16.71','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10756,'SPLIR',8,'1997-11-27 00:00:00','1997-12-25 00:00:00','1997-12-02 00:00:00',2,'73.21','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10757,'SAVEA',6,'1997-11-27 00:00:00','1997-12-25 00:00:00','1997-12-15 00:00:00',1,'8.19','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10758,'RICSU',3,'1997-11-28 00:00:00','1997-12-26 00:00:00','1997-12-04 00:00:00',3,'138.17','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10759,'ANATR',3,'1997-11-28 00:00:00','1997-12-26 00:00:00','1997-12-12 00:00:00',3,'11.99','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico'),
+ (10760,'MAISD',4,'1997-12-01 00:00:00','1997-12-29 00:00:00','1997-12-10 00:00:00',1,'155.64','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10761,'RATTC',5,'1997-12-02 00:00:00','1997-12-30 00:00:00','1997-12-08 00:00:00',2,'18.66','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10762,'FOLKO',3,'1997-12-02 00:00:00','1997-12-30 00:00:00','1997-12-09 00:00:00',1,'328.74','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10763,'FOLIG',3,'1997-12-03 00:00:00','1997-12-31 00:00:00','1997-12-08 00:00:00',3,'37.35','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10764,'ERNSH',6,'1997-12-03 00:00:00','1997-12-31 00:00:00','1997-12-08 00:00:00',3,'145.45','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10765,'QUICK',3,'1997-12-04 00:00:00','1998-01-01 00:00:00','1997-12-09 00:00:00',3,'42.74','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10766,'OTTIK',4,'1997-12-05 00:00:00','1998-01-02 00:00:00','1997-12-09 00:00:00',1,'157.55','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10767,'SUPRD',4,'1997-12-05 00:00:00','1998-01-02 00:00:00','1997-12-15 00:00:00',3,'1.59','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10768,'AROUT',3,'1997-12-08 00:00:00','1998-01-05 00:00:00','1997-12-15 00:00:00',2,'146.32','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10769,'VAFFE',3,'1997-12-08 00:00:00','1998-01-05 00:00:00','1997-12-12 00:00:00',1,'65.06','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10770,'HANAR',8,'1997-12-09 00:00:00','1998-01-06 00:00:00','1997-12-17 00:00:00',3,'5.32','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10771,'ERNSH',9,'1997-12-10 00:00:00','1998-01-07 00:00:00','1998-01-02 00:00:00',2,'11.19','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10772,'LEHMS',3,'1997-12-10 00:00:00','1998-01-07 00:00:00','1997-12-19 00:00:00',2,'91.28','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10773,'ERNSH',1,'1997-12-11 00:00:00','1998-01-08 00:00:00','1997-12-16 00:00:00',3,'96.43','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10774,'FOLKO',4,'1997-12-11 00:00:00','1997-12-25 00:00:00','1997-12-12 00:00:00',1,'48.20','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10775,'THECR',7,'1997-12-12 00:00:00','1998-01-09 00:00:00','1997-12-26 00:00:00',1,'20.25','The Cracker Box','55 Grizzly Peak Rd.','Butte','MT','59801','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10776,'ERNSH',1,'1997-12-15 00:00:00','1998-01-12 00:00:00','1997-12-18 00:00:00',3,'351.53','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10777,'GOURL',7,'1997-12-15 00:00:00','1997-12-29 00:00:00','1998-01-21 00:00:00',2,'3.01','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10778,'BERGS',3,'1997-12-16 00:00:00','1998-01-13 00:00:00','1997-12-24 00:00:00',1,'6.79','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10779,'MORGK',3,'1997-12-16 00:00:00','1998-01-13 00:00:00','1998-01-14 00:00:00',2,'58.13','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10780,'LILAS',2,'1997-12-16 00:00:00','1997-12-30 00:00:00','1997-12-25 00:00:00',1,'42.13','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10781,'WARTH',2,'1997-12-17 00:00:00','1998-01-14 00:00:00','1997-12-19 00:00:00',3,'73.16','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10782,'CACTU',9,'1997-12-17 00:00:00','1998-01-14 00:00:00','1997-12-22 00:00:00',3,'1.10','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10783,'HANAR',4,'1997-12-18 00:00:00','1998-01-15 00:00:00','1997-12-19 00:00:00',2,'124.98','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10784,'MAGAA',4,'1997-12-18 00:00:00','1998-01-15 00:00:00','1997-12-22 00:00:00',3,'70.09','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10785,'GROSR',1,'1997-12-18 00:00:00','1998-01-15 00:00:00','1997-12-24 00:00:00',3,'1.51','GROSELLA-Restaurante','5ª Ave. Los Palos Grandes','Caracas','DF','1081','Venezuela'),
+ (10786,'QUEEN',8,'1997-12-19 00:00:00','1998-01-16 00:00:00','1997-12-23 00:00:00',1,'110.87','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10787,'LAMAI',2,'1997-12-19 00:00:00','1998-01-02 00:00:00','1997-12-26 00:00:00',1,'249.93','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10788,'QUICK',1,'1997-12-22 00:00:00','1998-01-19 00:00:00','1998-01-19 00:00:00',2,'42.70','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10789,'FOLIG',1,'1997-12-22 00:00:00','1998-01-19 00:00:00','1997-12-31 00:00:00',2,'100.60','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10790,'GOURL',6,'1997-12-22 00:00:00','1998-01-19 00:00:00','1997-12-26 00:00:00',1,'28.23','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10791,'FRANK',6,'1997-12-23 00:00:00','1998-01-20 00:00:00','1998-01-01 00:00:00',2,'16.85','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10792,'WOLZA',1,'1997-12-23 00:00:00','1998-01-20 00:00:00','1997-12-31 00:00:00',3,'23.79','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10793,'AROUT',3,'1997-12-24 00:00:00','1998-01-21 00:00:00','1998-01-08 00:00:00',3,'4.52','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10794,'QUEDE',6,'1997-12-24 00:00:00','1998-01-21 00:00:00','1998-01-02 00:00:00',1,'21.49','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10795,'ERNSH',8,'1997-12-24 00:00:00','1998-01-21 00:00:00','1998-01-20 00:00:00',2,'126.66','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10796,'HILAA',3,'1997-12-25 00:00:00','1998-01-22 00:00:00','1998-01-14 00:00:00',1,'26.52','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10797,'DRACD',7,'1997-12-25 00:00:00','1998-01-22 00:00:00','1998-01-05 00:00:00',2,'33.35','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (10798,'ISLAT',2,'1997-12-26 00:00:00','1998-01-23 00:00:00','1998-01-05 00:00:00',1,'2.33','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10799,'KOENE',9,'1997-12-26 00:00:00','1998-02-06 00:00:00','1998-01-05 00:00:00',3,'30.76','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10800,'SEVES',1,'1997-12-26 00:00:00','1998-01-23 00:00:00','1998-01-05 00:00:00',3,'137.44','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10801,'BOLID',4,'1997-12-29 00:00:00','1998-01-26 00:00:00','1997-12-31 00:00:00',2,'97.09','Bólido Comidas preparadas','C/ Araquil 67','Madrid',NULL,'28023','Spain'),
+ (10802,'SIMOB',4,'1997-12-29 00:00:00','1998-01-26 00:00:00','1998-01-02 00:00:00',2,'257.26','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10803,'WELLI',4,'1997-12-30 00:00:00','1998-01-27 00:00:00','1998-01-06 00:00:00',1,'55.23','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10804,'SEVES',6,'1997-12-30 00:00:00','1998-01-27 00:00:00','1998-01-07 00:00:00',2,'27.33','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10805,'THEBI',2,'1997-12-30 00:00:00','1998-01-27 00:00:00','1998-01-09 00:00:00',3,'237.34','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10806,'VICTE',3,'1997-12-31 00:00:00','1998-01-28 00:00:00','1998-01-05 00:00:00',2,'22.11','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10807,'FRANS',4,'1997-12-31 00:00:00','1998-01-28 00:00:00','1998-01-30 00:00:00',1,'1.36','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10808,'OLDWO',2,'1998-01-01 00:00:00','1998-01-29 00:00:00','1998-01-09 00:00:00',3,'45.53','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10809,'WELLI',7,'1998-01-01 00:00:00','1998-01-29 00:00:00','1998-01-07 00:00:00',1,'4.87','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10810,'LAUGB',2,'1998-01-01 00:00:00','1998-01-29 00:00:00','1998-01-07 00:00:00',3,'4.33','Laughing Bacchus Wine Cellars','2319 Elm St.','Vancouver','BC','V3F 2K1','Canada'),
+ (10811,'LINOD',8,'1998-01-02 00:00:00','1998-01-30 00:00:00','1998-01-08 00:00:00',1,'31.22','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10812,'REGGC',5,'1998-01-02 00:00:00','1998-01-30 00:00:00','1998-01-12 00:00:00',1,'59.78','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10813,'RICAR',1,'1998-01-05 00:00:00','1998-02-02 00:00:00','1998-01-09 00:00:00',1,'47.38','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10814,'VICTE',3,'1998-01-05 00:00:00','1998-02-02 00:00:00','1998-01-14 00:00:00',3,'130.94','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10815,'SAVEA',2,'1998-01-05 00:00:00','1998-02-02 00:00:00','1998-01-14 00:00:00',3,'14.62','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10816,'GREAL',4,'1998-01-06 00:00:00','1998-02-03 00:00:00','1998-02-04 00:00:00',2,'719.78','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10817,'KOENE',3,'1998-01-06 00:00:00','1998-01-20 00:00:00','1998-01-13 00:00:00',2,'306.07','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10818,'MAGAA',7,'1998-01-07 00:00:00','1998-02-04 00:00:00','1998-01-12 00:00:00',3,'65.48','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10819,'CACTU',2,'1998-01-07 00:00:00','1998-02-04 00:00:00','1998-01-16 00:00:00',3,'19.76','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10820,'RATTC',3,'1998-01-07 00:00:00','1998-02-04 00:00:00','1998-01-13 00:00:00',2,'37.52','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10821,'SPLIR',1,'1998-01-08 00:00:00','1998-02-05 00:00:00','1998-01-15 00:00:00',1,'36.68','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10822,'TRAIH',6,'1998-01-08 00:00:00','1998-02-05 00:00:00','1998-01-16 00:00:00',3,'7.00','Trail''s Head Gourmet Provisioners','722 DaVinci Blvd.','Kirkland','WA','98034','USA'),
+ (10823,'LILAS',5,'1998-01-09 00:00:00','1998-02-06 00:00:00','1998-01-13 00:00:00',2,'163.97','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10824,'FOLKO',8,'1998-01-09 00:00:00','1998-02-06 00:00:00','1998-01-30 00:00:00',1,'1.23','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10825,'DRACD',1,'1998-01-09 00:00:00','1998-02-06 00:00:00','1998-01-14 00:00:00',1,'79.25','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (10826,'BLONP',6,'1998-01-12 00:00:00','1998-02-09 00:00:00','1998-02-06 00:00:00',1,'7.09','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10827,'BONAP',1,'1998-01-12 00:00:00','1998-01-26 00:00:00','1998-02-06 00:00:00',2,'63.54','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10828,'RANCH',9,'1998-01-13 00:00:00','1998-01-27 00:00:00','1998-02-04 00:00:00',1,'90.85','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10829,'ISLAT',9,'1998-01-13 00:00:00','1998-02-10 00:00:00','1998-01-23 00:00:00',1,'154.72','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10830,'TRADH',4,'1998-01-13 00:00:00','1998-02-24 00:00:00','1998-01-21 00:00:00',2,'81.83','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10831,'SANTG',3,'1998-01-14 00:00:00','1998-02-11 00:00:00','1998-01-23 00:00:00',2,'72.19','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10832,'LAMAI',2,'1998-01-14 00:00:00','1998-02-11 00:00:00','1998-01-19 00:00:00',2,'43.26','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10833,'OTTIK',6,'1998-01-15 00:00:00','1998-02-12 00:00:00','1998-01-23 00:00:00',2,'71.49','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10834,'TRADH',1,'1998-01-15 00:00:00','1998-02-12 00:00:00','1998-01-19 00:00:00',3,'29.78','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10835,'ALFKI',1,'1998-01-15 00:00:00','1998-02-12 00:00:00','1998-01-21 00:00:00',3,'69.53','Alfred''s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10836,'ERNSH',7,'1998-01-16 00:00:00','1998-02-13 00:00:00','1998-01-21 00:00:00',1,'411.88','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10837,'BERGS',9,'1998-01-16 00:00:00','1998-02-13 00:00:00','1998-01-23 00:00:00',3,'13.32','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10838,'LINOD',3,'1998-01-19 00:00:00','1998-02-16 00:00:00','1998-01-23 00:00:00',3,'59.28','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10839,'TRADH',3,'1998-01-19 00:00:00','1998-02-16 00:00:00','1998-01-22 00:00:00',3,'35.43','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10840,'LINOD',4,'1998-01-19 00:00:00','1998-03-02 00:00:00','1998-02-16 00:00:00',2,'2.71','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10841,'SUPRD',5,'1998-01-20 00:00:00','1998-02-17 00:00:00','1998-01-29 00:00:00',2,'424.30','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10842,'TORTU',1,'1998-01-20 00:00:00','1998-02-17 00:00:00','1998-01-29 00:00:00',3,'54.42','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10843,'VICTE',4,'1998-01-21 00:00:00','1998-02-18 00:00:00','1998-01-26 00:00:00',2,'9.26','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10844,'PICCO',8,'1998-01-21 00:00:00','1998-02-18 00:00:00','1998-01-26 00:00:00',2,'25.22','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10845,'QUICK',8,'1998-01-21 00:00:00','1998-02-04 00:00:00','1998-01-30 00:00:00',1,'212.98','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10846,'SUPRD',2,'1998-01-22 00:00:00','1998-03-05 00:00:00','1998-01-23 00:00:00',3,'56.46','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10847,'SAVEA',4,'1998-01-22 00:00:00','1998-02-05 00:00:00','1998-02-10 00:00:00',3,'487.57','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10848,'CONSH',7,'1998-01-23 00:00:00','1998-02-20 00:00:00','1998-01-29 00:00:00',2,'38.24','Consolidated Holdings','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK'),
+ (10849,'KOENE',9,'1998-01-23 00:00:00','1998-02-20 00:00:00','1998-01-30 00:00:00',2,'0.56','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10850,'VICTE',1,'1998-01-23 00:00:00','1998-03-06 00:00:00','1998-01-30 00:00:00',1,'49.19','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10851,'RICAR',5,'1998-01-26 00:00:00','1998-02-23 00:00:00','1998-02-02 00:00:00',1,'160.55','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10852,'RATTC',8,'1998-01-26 00:00:00','1998-02-09 00:00:00','1998-01-30 00:00:00',1,'174.05','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10853,'BLAUS',9,'1998-01-27 00:00:00','1998-02-24 00:00:00','1998-02-03 00:00:00',2,'53.83','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10854,'ERNSH',3,'1998-01-27 00:00:00','1998-02-24 00:00:00','1998-02-05 00:00:00',2,'100.22','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10855,'OLDWO',3,'1998-01-27 00:00:00','1998-02-24 00:00:00','1998-02-04 00:00:00',1,'170.97','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10856,'ANTON',3,'1998-01-28 00:00:00','1998-02-25 00:00:00','1998-02-10 00:00:00',2,'58.43','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10857,'BERGS',8,'1998-01-28 00:00:00','1998-02-25 00:00:00','1998-02-06 00:00:00',2,'188.85','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10858,'LACOR',2,'1998-01-29 00:00:00','1998-02-26 00:00:00','1998-02-03 00:00:00',1,'52.51','La corne d''abondance','67 avenue de l''Europe','Versailles',NULL,'78000','France'),
+ (10859,'FRANK',1,'1998-01-29 00:00:00','1998-02-26 00:00:00','1998-02-02 00:00:00',2,'76.10','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10860,'FRANR',3,'1998-01-29 00:00:00','1998-02-26 00:00:00','1998-02-04 00:00:00',3,'19.26','France restauration','54 rue Royale','Nantes',NULL,'44000','France'),
+ (10861,'WHITC',4,'1998-01-30 00:00:00','1998-02-27 00:00:00','1998-02-17 00:00:00',2,'14.93','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10862,'LEHMS',8,'1998-01-30 00:00:00','1998-03-13 00:00:00','1998-02-02 00:00:00',2,'53.23','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10863,'HILAA',4,'1998-02-02 00:00:00','1998-03-02 00:00:00','1998-02-17 00:00:00',2,'30.26','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10864,'AROUT',4,'1998-02-02 00:00:00','1998-03-02 00:00:00','1998-02-09 00:00:00',2,'3.04','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10865,'QUICK',2,'1998-02-02 00:00:00','1998-02-16 00:00:00','1998-02-12 00:00:00',1,'348.14','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10866,'BERGS',5,'1998-02-03 00:00:00','1998-03-03 00:00:00','1998-02-12 00:00:00',1,'109.11','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10867,'LONEP',6,'1998-02-03 00:00:00','1998-03-17 00:00:00','1998-02-11 00:00:00',1,'1.93','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10868,'QUEEN',7,'1998-02-04 00:00:00','1998-03-04 00:00:00','1998-02-23 00:00:00',2,'191.27','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10869,'SEVES',5,'1998-02-04 00:00:00','1998-03-04 00:00:00','1998-02-09 00:00:00',1,'143.28','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10870,'WOLZA',5,'1998-02-04 00:00:00','1998-03-04 00:00:00','1998-02-13 00:00:00',3,'12.04','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10871,'BONAP',9,'1998-02-05 00:00:00','1998-03-05 00:00:00','1998-02-10 00:00:00',2,'112.27','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10872,'GODOS',5,'1998-02-05 00:00:00','1998-03-05 00:00:00','1998-02-09 00:00:00',2,'175.32','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10873,'WILMK',4,'1998-02-06 00:00:00','1998-03-06 00:00:00','1998-02-09 00:00:00',1,'0.82','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10874,'GODOS',5,'1998-02-06 00:00:00','1998-03-06 00:00:00','1998-02-11 00:00:00',2,'19.58','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10875,'BERGS',4,'1998-02-06 00:00:00','1998-03-06 00:00:00','1998-03-03 00:00:00',2,'32.37','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10876,'BONAP',7,'1998-02-09 00:00:00','1998-03-09 00:00:00','1998-02-12 00:00:00',3,'60.42','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10877,'RICAR',1,'1998-02-09 00:00:00','1998-03-09 00:00:00','1998-02-19 00:00:00',1,'38.06','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10878,'QUICK',4,'1998-02-10 00:00:00','1998-03-10 00:00:00','1998-02-12 00:00:00',1,'46.69','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10879,'WILMK',3,'1998-02-10 00:00:00','1998-03-10 00:00:00','1998-02-12 00:00:00',3,'8.50','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10880,'FOLKO',7,'1998-02-10 00:00:00','1998-03-24 00:00:00','1998-02-18 00:00:00',1,'88.01','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10881,'CACTU',4,'1998-02-11 00:00:00','1998-03-11 00:00:00','1998-02-18 00:00:00',1,'2.84','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10882,'SAVEA',4,'1998-02-11 00:00:00','1998-03-11 00:00:00','1998-02-20 00:00:00',3,'23.10','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10883,'LONEP',8,'1998-02-12 00:00:00','1998-03-12 00:00:00','1998-02-20 00:00:00',3,'0.53','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10884,'LETSS',4,'1998-02-12 00:00:00','1998-03-12 00:00:00','1998-02-13 00:00:00',2,'90.97','Let''s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10885,'SUPRD',6,'1998-02-12 00:00:00','1998-03-12 00:00:00','1998-02-18 00:00:00',3,'5.64','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10886,'HANAR',1,'1998-02-13 00:00:00','1998-03-13 00:00:00','1998-03-02 00:00:00',1,'4.99','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10887,'GALED',8,'1998-02-13 00:00:00','1998-03-13 00:00:00','1998-02-16 00:00:00',3,'1.25','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10888,'GODOS',1,'1998-02-16 00:00:00','1998-03-16 00:00:00','1998-02-23 00:00:00',2,'51.87','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10889,'RATTC',9,'1998-02-16 00:00:00','1998-03-16 00:00:00','1998-02-23 00:00:00',3,'280.61','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10890,'DUMON',7,'1998-02-16 00:00:00','1998-03-16 00:00:00','1998-02-18 00:00:00',1,'32.76','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10891,'LEHMS',7,'1998-02-17 00:00:00','1998-03-17 00:00:00','1998-02-19 00:00:00',2,'20.37','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10892,'MAISD',4,'1998-02-17 00:00:00','1998-03-17 00:00:00','1998-02-19 00:00:00',2,'120.27','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10893,'KOENE',9,'1998-02-18 00:00:00','1998-03-18 00:00:00','1998-02-20 00:00:00',2,'77.78','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10894,'SAVEA',1,'1998-02-18 00:00:00','1998-03-18 00:00:00','1998-02-20 00:00:00',1,'116.13','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10895,'ERNSH',3,'1998-02-18 00:00:00','1998-03-18 00:00:00','1998-02-23 00:00:00',1,'162.75','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10896,'MAISD',7,'1998-02-19 00:00:00','1998-03-19 00:00:00','1998-02-27 00:00:00',3,'32.45','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10897,'HUNGO',3,'1998-02-19 00:00:00','1998-03-19 00:00:00','1998-02-25 00:00:00',2,'603.54','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10898,'OCEAN',4,'1998-02-20 00:00:00','1998-03-20 00:00:00','1998-03-06 00:00:00',2,'1.27','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10899,'LILAS',5,'1998-02-20 00:00:00','1998-03-20 00:00:00','1998-02-26 00:00:00',3,'1.21','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10900,'WELLI',1,'1998-02-20 00:00:00','1998-03-20 00:00:00','1998-03-04 00:00:00',2,'1.66','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10901,'HILAA',4,'1998-02-23 00:00:00','1998-03-23 00:00:00','1998-02-26 00:00:00',1,'62.09','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10902,'FOLKO',1,'1998-02-23 00:00:00','1998-03-23 00:00:00','1998-03-03 00:00:00',1,'44.15','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10903,'HANAR',3,'1998-02-24 00:00:00','1998-03-24 00:00:00','1998-03-04 00:00:00',3,'36.71','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10904,'WHITC',3,'1998-02-24 00:00:00','1998-03-24 00:00:00','1998-02-27 00:00:00',3,'162.95','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10905,'WELLI',9,'1998-02-24 00:00:00','1998-03-24 00:00:00','1998-03-06 00:00:00',2,'13.72','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10906,'WOLZA',4,'1998-02-25 00:00:00','1998-03-11 00:00:00','1998-03-03 00:00:00',3,'26.29','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10907,'SPECD',6,'1998-02-25 00:00:00','1998-03-25 00:00:00','1998-02-27 00:00:00',3,'9.19','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10908,'REGGC',4,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-06 00:00:00',2,'32.96','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10909,'SANTG',1,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-10 00:00:00',2,'53.05','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10910,'WILMK',1,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-04 00:00:00',3,'38.11','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10911,'GODOS',3,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-05 00:00:00',1,'38.19','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10912,'HUNGO',2,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-18 00:00:00',2,'580.91','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10913,'QUEEN',4,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-04 00:00:00',1,'33.05','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10914,'QUEEN',6,'1998-02-27 00:00:00','1998-03-27 00:00:00','1998-03-02 00:00:00',1,'21.19','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10915,'TORTU',2,'1998-02-27 00:00:00','1998-03-27 00:00:00','1998-03-02 00:00:00',2,'3.51','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10916,'RANCH',1,'1998-02-27 00:00:00','1998-03-27 00:00:00','1998-03-09 00:00:00',2,'63.77','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10917,'ROMEY',4,'1998-03-02 00:00:00','1998-03-30 00:00:00','1998-03-11 00:00:00',2,'8.29','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10918,'BOTTM',3,'1998-03-02 00:00:00','1998-03-30 00:00:00','1998-03-11 00:00:00',3,'48.83','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10919,'LINOD',2,'1998-03-02 00:00:00','1998-03-30 00:00:00','1998-03-04 00:00:00',2,'19.80','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10920,'AROUT',4,'1998-03-03 00:00:00','1998-03-31 00:00:00','1998-03-09 00:00:00',2,'29.61','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10921,'VAFFE',1,'1998-03-03 00:00:00','1998-04-14 00:00:00','1998-03-09 00:00:00',1,'176.48','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10922,'HANAR',5,'1998-03-03 00:00:00','1998-03-31 00:00:00','1998-03-05 00:00:00',3,'62.74','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10923,'LAMAI',7,'1998-03-03 00:00:00','1998-04-14 00:00:00','1998-03-13 00:00:00',3,'68.26','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10924,'BERGS',3,'1998-03-04 00:00:00','1998-04-01 00:00:00','1998-04-08 00:00:00',2,'151.52','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10925,'HANAR',3,'1998-03-04 00:00:00','1998-04-01 00:00:00','1998-03-13 00:00:00',1,'2.27','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10926,'ANATR',4,'1998-03-04 00:00:00','1998-04-01 00:00:00','1998-03-11 00:00:00',3,'39.92','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico'),
+ (10927,'LACOR',4,'1998-03-05 00:00:00','1998-04-02 00:00:00','1998-04-08 00:00:00',1,'19.79','La corne d''abondance','67 avenue de l''Europe','Versailles',NULL,'78000','France'),
+ (10928,'GALED',1,'1998-03-05 00:00:00','1998-04-02 00:00:00','1998-03-18 00:00:00',1,'1.36','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10929,'FRANK',6,'1998-03-05 00:00:00','1998-04-02 00:00:00','1998-03-12 00:00:00',1,'33.93','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10930,'SUPRD',4,'1998-03-06 00:00:00','1998-04-17 00:00:00','1998-03-18 00:00:00',3,'15.55','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10931,'RICSU',4,'1998-03-06 00:00:00','1998-03-20 00:00:00','1998-03-19 00:00:00',2,'13.60','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10932,'BONAP',8,'1998-03-06 00:00:00','1998-04-03 00:00:00','1998-03-24 00:00:00',1,'134.64','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10933,'ISLAT',6,'1998-03-06 00:00:00','1998-04-03 00:00:00','1998-03-16 00:00:00',3,'54.15','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10934,'LEHMS',3,'1998-03-09 00:00:00','1998-04-06 00:00:00','1998-03-12 00:00:00',3,'32.01','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10935,'WELLI',4,'1998-03-09 00:00:00','1998-04-06 00:00:00','1998-03-18 00:00:00',3,'47.59','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10936,'GREAL',3,'1998-03-09 00:00:00','1998-04-06 00:00:00','1998-03-18 00:00:00',2,'33.68','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10937,'CACTU',7,'1998-03-10 00:00:00','1998-03-24 00:00:00','1998-03-13 00:00:00',3,'31.51','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10938,'QUICK',3,'1998-03-10 00:00:00','1998-04-07 00:00:00','1998-03-16 00:00:00',2,'31.89','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10939,'MAGAA',2,'1998-03-10 00:00:00','1998-04-07 00:00:00','1998-03-13 00:00:00',2,'76.33','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10940,'BONAP',8,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-23 00:00:00',3,'19.77','Bon app''','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10941,'SAVEA',7,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-20 00:00:00',2,'400.81','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10942,'REGGC',9,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-18 00:00:00',3,'17.95','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10943,'BSBEV',4,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-19 00:00:00',2,'2.17','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10944,'BOTTM',6,'1998-03-12 00:00:00','1998-03-26 00:00:00','1998-03-13 00:00:00',3,'52.92','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10945,'MORGK',4,'1998-03-12 00:00:00','1998-04-09 00:00:00','1998-03-18 00:00:00',1,'10.22','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10946,'VAFFE',1,'1998-03-12 00:00:00','1998-04-09 00:00:00','1998-03-19 00:00:00',2,'27.20','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10947,'BSBEV',3,'1998-03-13 00:00:00','1998-04-10 00:00:00','1998-03-16 00:00:00',2,'3.26','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10948,'GODOS',3,'1998-03-13 00:00:00','1998-04-10 00:00:00','1998-03-19 00:00:00',3,'23.39','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10949,'BOTTM',2,'1998-03-13 00:00:00','1998-04-10 00:00:00','1998-03-17 00:00:00',3,'74.44','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10950,'MAGAA',1,'1998-03-16 00:00:00','1998-04-13 00:00:00','1998-03-23 00:00:00',2,'2.50','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10951,'RICSU',9,'1998-03-16 00:00:00','1998-04-27 00:00:00','1998-04-07 00:00:00',2,'30.85','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10952,'ALFKI',1,'1998-03-16 00:00:00','1998-04-27 00:00:00','1998-03-24 00:00:00',1,'40.42','Alfred''s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (10953,'AROUT',9,'1998-03-16 00:00:00','1998-03-30 00:00:00','1998-03-25 00:00:00',2,'23.72','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10954,'LINOD',5,'1998-03-17 00:00:00','1998-04-28 00:00:00','1998-03-20 00:00:00',1,'27.91','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10955,'FOLKO',8,'1998-03-17 00:00:00','1998-04-14 00:00:00','1998-03-20 00:00:00',2,'3.26','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10956,'BLAUS',6,'1998-03-17 00:00:00','1998-04-28 00:00:00','1998-03-20 00:00:00',2,'44.65','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10957,'HILAA',8,'1998-03-18 00:00:00','1998-04-15 00:00:00','1998-03-27 00:00:00',3,'105.36','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10958,'OCEAN',7,'1998-03-18 00:00:00','1998-04-15 00:00:00','1998-03-27 00:00:00',2,'49.56','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10959,'GOURL',6,'1998-03-18 00:00:00','1998-04-29 00:00:00','1998-03-23 00:00:00',2,'4.98','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10960,'HILAA',3,'1998-03-19 00:00:00','1998-04-02 00:00:00','1998-04-08 00:00:00',1,'2.08','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10961,'QUEEN',8,'1998-03-19 00:00:00','1998-04-16 00:00:00','1998-03-30 00:00:00',1,'104.47','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10962,'QUICK',8,'1998-03-19 00:00:00','1998-04-16 00:00:00','1998-03-23 00:00:00',2,'275.79','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10963,'FURIB',9,'1998-03-19 00:00:00','1998-04-16 00:00:00','1998-03-26 00:00:00',3,'2.70','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10964,'SPECD',3,'1998-03-20 00:00:00','1998-04-17 00:00:00','1998-03-24 00:00:00',2,'87.38','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France'),
+ (10965,'OLDWO',6,'1998-03-20 00:00:00','1998-04-17 00:00:00','1998-03-30 00:00:00',3,'144.38','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10966,'CHOPS',4,'1998-03-20 00:00:00','1998-04-17 00:00:00','1998-04-08 00:00:00',1,'27.19','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10967,'TOMSP',2,'1998-03-23 00:00:00','1998-04-20 00:00:00','1998-04-02 00:00:00',2,'62.22','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10968,'ERNSH',1,'1998-03-23 00:00:00','1998-04-20 00:00:00','1998-04-01 00:00:00',3,'74.60','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10969,'COMMI',1,'1998-03-23 00:00:00','1998-04-20 00:00:00','1998-03-30 00:00:00',2,'0.21','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10970,'BOLID',9,'1998-03-24 00:00:00','1998-04-07 00:00:00','1998-04-24 00:00:00',1,'16.16','Bólido Comidas preparadas','C/ Araquil 67','Madrid',NULL,'28023','Spain'),
+ (10971,'FRANR',2,'1998-03-24 00:00:00','1998-04-21 00:00:00','1998-04-02 00:00:00',2,'121.82','France restauration','54 rue Royale','Nantes',NULL,'44000','France'),
+ (10972,'LACOR',4,'1998-03-24 00:00:00','1998-04-21 00:00:00','1998-03-26 00:00:00',2,'0.02','La corne d''abondance','67 avenue de l''Europe','Versailles',NULL,'78000','France'),
+ (10973,'LACOR',6,'1998-03-24 00:00:00','1998-04-21 00:00:00','1998-03-27 00:00:00',2,'15.17','La corne d''abondance','67 avenue de l''Europe','Versailles',NULL,'78000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10974,'SPLIR',3,'1998-03-25 00:00:00','1998-04-08 00:00:00','1998-04-03 00:00:00',3,'12.96','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10975,'BOTTM',1,'1998-03-25 00:00:00','1998-04-22 00:00:00','1998-03-27 00:00:00',3,'32.27','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10976,'HILAA',1,'1998-03-25 00:00:00','1998-05-06 00:00:00','1998-04-03 00:00:00',1,'37.97','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10977,'FOLKO',8,'1998-03-26 00:00:00','1998-04-23 00:00:00','1998-04-10 00:00:00',3,'208.50','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10978,'MAISD',9,'1998-03-26 00:00:00','1998-04-23 00:00:00','1998-04-23 00:00:00',2,'32.82','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10979,'ERNSH',8,'1998-03-26 00:00:00','1998-04-23 00:00:00','1998-03-31 00:00:00',2,'353.07','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10980,'FOLKO',4,'1998-03-27 00:00:00','1998-05-08 00:00:00','1998-04-17 00:00:00',1,'1.26','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10981,'HANAR',1,'1998-03-27 00:00:00','1998-04-24 00:00:00','1998-04-02 00:00:00',2,'193.37','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10982,'BOTTM',2,'1998-03-27 00:00:00','1998-04-24 00:00:00','1998-04-08 00:00:00',1,'14.01','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10983,'SAVEA',2,'1998-03-27 00:00:00','1998-04-24 00:00:00','1998-04-06 00:00:00',2,'657.54','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10984,'SAVEA',1,'1998-03-30 00:00:00','1998-04-27 00:00:00','1998-04-03 00:00:00',3,'211.22','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10985,'HUNGO',2,'1998-03-30 00:00:00','1998-04-27 00:00:00','1998-04-02 00:00:00',1,'91.51','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10986,'OCEAN',8,'1998-03-30 00:00:00','1998-04-27 00:00:00','1998-04-21 00:00:00',2,'217.86','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10987,'EASTC',8,'1998-03-31 00:00:00','1998-04-28 00:00:00','1998-04-06 00:00:00',1,'185.48','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10988,'RATTC',3,'1998-03-31 00:00:00','1998-04-28 00:00:00','1998-04-10 00:00:00',2,'61.14','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10989,'QUEDE',2,'1998-03-31 00:00:00','1998-04-28 00:00:00','1998-04-02 00:00:00',1,'34.76','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10990,'ERNSH',2,'1998-04-01 00:00:00','1998-05-13 00:00:00','1998-04-07 00:00:00',3,'117.61','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10991,'QUICK',1,'1998-04-01 00:00:00','1998-04-29 00:00:00','1998-04-07 00:00:00',1,'38.51','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10992,'THEBI',1,'1998-04-01 00:00:00','1998-04-29 00:00:00','1998-04-03 00:00:00',3,'4.27','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA'),
+ (10993,'FOLKO',7,'1998-04-01 00:00:00','1998-04-29 00:00:00','1998-04-10 00:00:00',3,'8.81','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10994,'VAFFE',2,'1998-04-02 00:00:00','1998-04-16 00:00:00','1998-04-09 00:00:00',3,'65.53','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10995,'PERIC',1,'1998-04-02 00:00:00','1998-04-30 00:00:00','1998-04-06 00:00:00',3,'46.00','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10996,'QUICK',4,'1998-04-02 00:00:00','1998-04-30 00:00:00','1998-04-10 00:00:00',2,'1.12','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10997,'LILAS',8,'1998-04-03 00:00:00','1998-05-15 00:00:00','1998-04-13 00:00:00',2,'73.91','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10998,'WOLZA',8,'1998-04-03 00:00:00','1998-04-17 00:00:00','1998-04-17 00:00:00',2,'20.31','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10999,'OTTIK',6,'1998-04-03 00:00:00','1998-05-01 00:00:00','1998-04-10 00:00:00',2,'96.35','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (11000,'RATTC',2,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-14 00:00:00',3,'55.12','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (11001,'FOLKO',2,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-14 00:00:00',2,'197.30','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (11002,'SAVEA',4,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-16 00:00:00',1,'141.16','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11003,'THECR',3,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-08 00:00:00',3,'14.91','The Cracker Box','55 Grizzly Peak Rd.','Butte','MT','59801','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11004,'MAISD',3,'1998-04-07 00:00:00','1998-05-05 00:00:00','1998-04-20 00:00:00',1,'44.84','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (11005,'WILMK',2,'1998-04-07 00:00:00','1998-05-05 00:00:00','1998-04-10 00:00:00',1,'0.75','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (11006,'GREAL',3,'1998-04-07 00:00:00','1998-05-05 00:00:00','1998-04-15 00:00:00',2,'25.19','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (11007,'PRINI',8,'1998-04-08 00:00:00','1998-05-06 00:00:00','1998-04-13 00:00:00',2,'202.24','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal'),
+ (11008,'ERNSH',7,'1998-04-08 00:00:00','1998-05-06 00:00:00','0000-00-00 00:00:00',3,'79.46','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (11009,'GODOS',2,'1998-04-08 00:00:00','1998-05-06 00:00:00','1998-04-10 00:00:00',1,'59.11','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11010,'REGGC',2,'1998-04-09 00:00:00','1998-05-07 00:00:00','1998-04-21 00:00:00',2,'28.71','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (11011,'ALFKI',3,'1998-04-09 00:00:00','1998-05-07 00:00:00','1998-04-13 00:00:00',1,'1.21','Alfred''s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (11012,'FRANK',1,'1998-04-09 00:00:00','1998-04-23 00:00:00','1998-04-17 00:00:00',3,'242.95','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (11013,'ROMEY',2,'1998-04-09 00:00:00','1998-05-07 00:00:00','1998-04-10 00:00:00',1,'32.99','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (11014,'LINOD',2,'1998-04-10 00:00:00','1998-05-08 00:00:00','1998-04-15 00:00:00',3,'23.60','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (11015,'SANTG',2,'1998-04-10 00:00:00','1998-04-24 00:00:00','1998-04-20 00:00:00',2,'4.62','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11016,'AROUT',9,'1998-04-10 00:00:00','1998-05-08 00:00:00','1998-04-13 00:00:00',2,'33.80','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (11017,'ERNSH',9,'1998-04-13 00:00:00','1998-05-11 00:00:00','1998-04-20 00:00:00',2,'754.26','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (11018,'LONEP',4,'1998-04-13 00:00:00','1998-05-11 00:00:00','1998-04-16 00:00:00',2,'11.65','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (11019,'RANCH',6,'1998-04-13 00:00:00','1998-05-11 00:00:00','0000-00-00 00:00:00',3,'3.17','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (11020,'OTTIK',2,'1998-04-14 00:00:00','1998-05-12 00:00:00','1998-04-16 00:00:00',2,'43.30','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (11021,'QUICK',3,'1998-04-14 00:00:00','1998-05-12 00:00:00','1998-04-21 00:00:00',1,'297.18','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11022,'HANAR',9,'1998-04-14 00:00:00','1998-05-12 00:00:00','1998-05-04 00:00:00',2,'6.27','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (11023,'BSBEV',1,'1998-04-14 00:00:00','1998-04-28 00:00:00','1998-04-24 00:00:00',2,'123.83','B''s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (11024,'EASTC',4,'1998-04-15 00:00:00','1998-05-13 00:00:00','1998-04-20 00:00:00',1,'74.36','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (11025,'WARTH',6,'1998-04-15 00:00:00','1998-05-13 00:00:00','1998-04-24 00:00:00',3,'29.17','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (11026,'FRANS',4,'1998-04-15 00:00:00','1998-05-13 00:00:00','1998-04-28 00:00:00',1,'47.09','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (11027,'BOTTM',1,'1998-04-16 00:00:00','1998-05-14 00:00:00','1998-04-20 00:00:00',1,'52.52','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11028,'KOENE',2,'1998-04-16 00:00:00','1998-05-14 00:00:00','1998-04-22 00:00:00',1,'29.59','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (11029,'CHOPS',4,'1998-04-16 00:00:00','1998-05-14 00:00:00','1998-04-27 00:00:00',1,'47.84','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (11030,'SAVEA',7,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-27 00:00:00',2,'830.75','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11031,'SAVEA',6,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-24 00:00:00',2,'227.22','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11032,'WHITC',2,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-23 00:00:00',3,'606.19','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (11033,'RICSU',7,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-23 00:00:00',3,'84.74','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11034,'OLDWO',8,'1998-04-20 00:00:00','1998-06-01 00:00:00','1998-04-27 00:00:00',1,'40.32','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (11035,'SUPRD',2,'1998-04-20 00:00:00','1998-05-18 00:00:00','1998-04-24 00:00:00',2,'0.17','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (11036,'DRACD',8,'1998-04-20 00:00:00','1998-05-18 00:00:00','1998-04-22 00:00:00',3,'149.47','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (11037,'GODOS',7,'1998-04-21 00:00:00','1998-05-19 00:00:00','1998-04-27 00:00:00',1,'3.20','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (11038,'SUPRD',1,'1998-04-21 00:00:00','1998-05-19 00:00:00','1998-04-30 00:00:00',2,'29.59','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (11039,'LINOD',1,'1998-04-21 00:00:00','1998-05-19 00:00:00','0000-00-00 00:00:00',2,'65.00','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11040,'GREAL',4,'1998-04-22 00:00:00','1998-05-20 00:00:00','0000-00-00 00:00:00',3,'18.84','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (11041,'CHOPS',3,'1998-04-22 00:00:00','1998-05-20 00:00:00','1998-04-28 00:00:00',2,'48.22','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (11042,'COMMI',2,'1998-04-22 00:00:00','1998-05-06 00:00:00','1998-05-01 00:00:00',1,'29.99','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (11043,'SPECD',5,'1998-04-22 00:00:00','1998-05-20 00:00:00','1998-04-29 00:00:00',2,'8.80','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France'),
+ (11044,'WOLZA',4,'1998-04-23 00:00:00','1998-05-21 00:00:00','1998-05-01 00:00:00',1,'8.72','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (11045,'BOTTM',6,'1998-04-23 00:00:00','1998-05-21 00:00:00','0000-00-00 00:00:00',2,'70.58','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11046,'WANDK',8,'1998-04-23 00:00:00','1998-05-21 00:00:00','1998-04-24 00:00:00',2,'71.64','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (11047,'EASTC',7,'1998-04-24 00:00:00','1998-05-22 00:00:00','1998-05-01 00:00:00',3,'46.62','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (11048,'BOTTM',7,'1998-04-24 00:00:00','1998-05-22 00:00:00','1998-04-30 00:00:00',3,'24.12','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (11049,'GOURL',3,'1998-04-24 00:00:00','1998-05-22 00:00:00','1998-05-04 00:00:00',1,'8.34','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (11050,'FOLKO',8,'1998-04-27 00:00:00','1998-05-25 00:00:00','1998-05-05 00:00:00',2,'59.41','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (11051,'LAMAI',7,'1998-04-27 00:00:00','1998-05-25 00:00:00','0000-00-00 00:00:00',3,'2.79','La maison d''Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11052,'HANAR',3,'1998-04-27 00:00:00','1998-05-25 00:00:00','1998-05-01 00:00:00',1,'67.26','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (11053,'PICCO',2,'1998-04-27 00:00:00','1998-05-25 00:00:00','1998-04-29 00:00:00',2,'53.05','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (11054,'CACTU',8,'1998-04-28 00:00:00','1998-05-26 00:00:00','0000-00-00 00:00:00',1,'0.33','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (11055,'HILAA',7,'1998-04-28 00:00:00','1998-05-26 00:00:00','1998-05-05 00:00:00',2,'120.92','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (11056,'EASTC',8,'1998-04-28 00:00:00','1998-05-12 00:00:00','1998-05-01 00:00:00',2,'278.96','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (11057,'NORTS',3,'1998-04-29 00:00:00','1998-05-27 00:00:00','1998-05-01 00:00:00',3,'4.13','North/South','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11058,'BLAUS',9,'1998-04-29 00:00:00','1998-05-27 00:00:00','0000-00-00 00:00:00',3,'31.14','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (11059,'RICAR',2,'1998-04-29 00:00:00','1998-06-10 00:00:00','0000-00-00 00:00:00',2,'85.80','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (11060,'FRANS',2,'1998-04-30 00:00:00','1998-05-28 00:00:00','1998-05-04 00:00:00',2,'10.98','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (11061,'GREAL',4,'1998-04-30 00:00:00','1998-06-11 00:00:00','0000-00-00 00:00:00',3,'14.01','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (11062,'REGGC',4,'1998-04-30 00:00:00','1998-05-28 00:00:00','0000-00-00 00:00:00',2,'29.93','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (11063,'HUNGO',3,'1998-04-30 00:00:00','1998-05-28 00:00:00','1998-05-06 00:00:00',2,'81.73','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11064,'SAVEA',1,'1998-05-01 00:00:00','1998-05-29 00:00:00','1998-05-04 00:00:00',1,'30.09','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11065,'LILAS',8,'1998-05-01 00:00:00','1998-05-29 00:00:00','0000-00-00 00:00:00',1,'12.91','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (11066,'WHITC',7,'1998-05-01 00:00:00','1998-05-29 00:00:00','1998-05-04 00:00:00',2,'44.72','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (11067,'DRACD',1,'1998-05-04 00:00:00','1998-05-18 00:00:00','1998-05-06 00:00:00',2,'7.98','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (11068,'QUEEN',8,'1998-05-04 00:00:00','1998-06-01 00:00:00','0000-00-00 00:00:00',2,'81.75','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (11069,'TORTU',1,'1998-05-04 00:00:00','1998-06-01 00:00:00','1998-05-06 00:00:00',2,'15.67','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11070,'LEHMS',2,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',1,'136.00','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (11071,'LILAS',1,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',1,'0.93','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (11072,'ERNSH',4,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',2,'258.64','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (11073,'PERIC',2,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',2,'24.95','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (11074,'SIMOB',7,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'18.44','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (11075,'RICSU',8,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'6.19','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11076,'BONAP',4,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'38.28','Bon app`','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (11077,'RATTC',1,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'8.53','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA');
+/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`products`
+--
+
+DROP TABLE IF EXISTS `northwind`.`products`;
+CREATE TABLE  `northwind`.`products` (
+  `ProductID` int(11) NOT NULL auto_increment,
+  `ProductName` varchar(40) NOT NULL default '',
+  `SupplierID` int(11) default NULL,
+  `CategoryID` int(11) default NULL,
+  `QuantityPerUnit` varchar(20) default NULL,
+  `UnitPrice` decimal(9,2) default '0.00',
+  `UnitsInStock` smallint(6) default '0',
+  `UnitsOnOrder` smallint(6) default '0',
+  `ReorderLevel` smallint(6) default '0',
+  `Discontinued` char(1) default '0',
+  PRIMARY KEY  (`ProductID`)
+) ENGINE=MyISAM AUTO_INCREMENT=78 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`products`
+--
+
+/*!40000 ALTER TABLE `products` DISABLE KEYS */;
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (1,'Chai',1,1,'10 boxes x 20 bags','18.00',39,0,10,'0'),
+ (2,'Chang',1,1,'24 - 12 oz bottles','19.00',17,40,25,'0'),
+ (3,'Aniseed Syrup',1,2,'12 - 550 ml bottles','10.00',13,70,25,'0'),
+ (4,'Chef Anton''s Cajun Seasoning',2,2,'48 - 6 oz jars','22.00',53,0,0,'0'),
+ (5,'Chef Anton''s Gumbo Mix',2,2,'36 boxes','21.35',0,0,0,'1'),
+ (6,'Grandma''s Boysenberry Spread',3,2,'12 - 8 oz jars','25.00',120,0,25,'0'),
+ (7,'Uncle Bob''s Organic Dried Pears',3,7,'12 - 1 lb pkgs.','30.00',15,0,10,'0'),
+ (8,'Northwoods Cranberry Sauce',3,2,'12 - 12 oz jars','40.00',6,0,0,'0'),
+ (9,'Mishi Kobe Niku',4,6,'18 - 500 g pkgs.','97.00',29,0,0,'1'),
+ (10,'Ikura',4,8,'12 - 200 ml jars','31.00',31,0,0,'0'),
+ (11,'Queso Cabrales',5,4,'1 kg pkg.','21.00',22,30,30,'0'),
+ (12,'Queso Manchego La Pastora',5,4,'10 - 500 g pkgs.','38.00',86,0,0,'0'),
+ (13,'Konbu',6,8,'2 kg box','6.00',24,0,5,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (14,'Tofu',6,7,'40 - 100 g pkgs.','23.25',35,0,0,'0'),
+ (15,'Genen Shouyu',6,2,'24 - 250 ml bottles','15.50',39,0,5,'0'),
+ (16,'Pavlova',7,3,'32 - 500 g boxes','17.45',29,0,10,'0'),
+ (17,'Alice Mutton',7,6,'20 - 1 kg tins','39.00',0,0,0,'1'),
+ (18,'Carnarvon Tigers',7,8,'16 kg pkg.','62.50',42,0,0,'0'),
+ (19,'Teatime Chocolate Biscuits',8,3,'10 boxes x 12 pieces','9.20',25,0,5,'0'),
+ (20,'Sir Rodney''s Marmalade',8,3,'30 gift boxes','81.00',40,0,0,'0'),
+ (21,'Sir Rodney''s Scones',8,3,'24 pkgs. x 4 pieces','10.00',3,40,5,'0'),
+ (22,'Gustaf''s Knäckebröd',9,5,'24 - 500 g pkgs.','21.00',104,0,25,'0'),
+ (23,'Tunnbröd',9,5,'12 - 250 g pkgs.','9.00',61,0,25,'0'),
+ (24,'Guaraná Fantástica',10,1,'12 - 355 ml cans','4.50',20,0,0,'1'),
+ (25,'NuNuCa Nuß-Nougat-Creme',11,3,'20 - 450 g glasses','14.00',76,0,30,'0'),
+ (26,'Gumbär Gummibärchen',11,3,'100 - 250 g bags','31.23',15,0,0,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (27,'Schoggi Schokolade',11,3,'100 - 100 g pieces','43.90',49,0,30,'0'),
+ (28,'Rössle Sauerkraut',12,7,'25 - 825 g cans','45.60',26,0,0,'1'),
+ (29,'Thüringer Rostbratwurst',12,6,'50 bags x 30 sausgs.','123.79',0,0,0,'1'),
+ (30,'Nord-Ost Matjeshering',13,8,'10 - 200 g glasses','25.89',10,0,15,'0'),
+ (31,'Gorgonzola Telino',14,4,'12 - 100 g pkgs','12.50',0,70,20,'0'),
+ (32,'Mascarpone Fabioli',14,4,'24 - 200 g pkgs.','32.00',9,40,25,'0'),
+ (33,'Geitost',15,4,'500 g','2.50',112,0,20,'0'),
+ (34,'Sasquatch Ale',16,1,'24 - 12 oz bottles','14.00',111,0,15,'0'),
+ (35,'Steeleye Stout',16,1,'24 - 12 oz bottles','18.00',20,0,15,'0'),
+ (36,'Inlagd Sill',17,8,'24 - 250 g  jars','19.00',112,0,20,'0'),
+ (37,'Gravad lax',17,8,'12 - 500 g pkgs.','26.00',11,50,25,'0'),
+ (38,'Côte de Blaye',18,1,'12 - 75 cl bottles','263.50',17,0,15,'0'),
+ (39,'Chartreuse verte',18,1,'750 cc per bottle','18.00',69,0,5,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (40,'Boston Crab Meat',19,8,'24 - 4 oz tins','18.40',123,0,30,'0'),
+ (41,'Jack''s New England Clam Chowder',19,8,'12 - 12 oz cans','9.65',85,0,10,'0'),
+ (42,'Singaporean Hokkien Fried Mee',20,5,'32 - 1 kg pkgs.','14.00',26,0,0,'1'),
+ (43,'Ipoh Coffee',20,1,'16 - 500 g tins','46.00',17,10,25,'0'),
+ (44,'Gula Malacca',20,2,'20 - 2 kg bags','19.45',27,0,15,'0'),
+ (45,'Rogede sild',21,8,'1k pkg.','9.50',5,70,15,'0'),
+ (46,'Spegesild',21,8,'4 - 450 g glasses','12.00',95,0,0,'0'),
+ (47,'Zaanse koeken',22,3,'10 - 4 oz boxes','9.50',36,0,0,'0'),
+ (48,'Chocolade',22,3,'10 pkgs.','12.75',15,70,25,'0'),
+ (49,'Maxilaku',23,3,'24 - 50 g pkgs.','20.00',10,60,15,'0'),
+ (50,'Valkoinen suklaa',23,3,'12 - 100 g bars','16.25',65,0,30,'0'),
+ (51,'Manjimup Dried Apples',24,7,'50 - 300 g pkgs.','53.00',20,0,10,'0'),
+ (52,'Filo Mix',24,5,'16 - 2 kg boxes','7.00',38,0,25,'0'),
+ (53,'Perth Pasties',24,6,'48 pieces','32.80',0,0,0,'1');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (54,'Tourtière',25,6,'16 pies','7.45',21,0,10,'0'),
+ (55,'Pâté chinois',25,6,'24 boxes x 2 pies','24.00',115,0,20,'0'),
+ (56,'Gnocchi di nonna Alice',26,5,'24 - 250 g pkgs.','38.00',21,10,30,'0'),
+ (57,'Ravioli Angelo',26,5,'24 - 250 g pkgs.','19.50',36,0,20,'0'),
+ (58,'Escargots de Bourgogne',27,8,'24 pieces','13.25',62,0,20,'0'),
+ (59,'Raclette Courdavault',28,4,'5 kg pkg.','55.00',79,0,0,'0'),
+ (60,'Camembert Pierrot',28,4,'15 - 300 g rounds','34.00',19,0,0,'0'),
+ (61,'Sirop d''érable',29,2,'24 - 500 ml bottles','28.50',113,0,25,'0'),
+ (62,'Tarte au sucre',29,3,'48 pies','49.30',17,0,0,'0'),
+ (63,'Vegie-spread',7,2,'15 - 625 g jars','43.90',24,0,5,'0'),
+ (64,'Wimmers gute Semmelknödel',12,5,'20 bags x 4 pieces','33.25',22,80,30,'0'),
+ (65,'Louisiana Fiery Hot Pepper Sauce',2,2,'32 - 8 oz bottles','21.05',76,0,0,'0'),
+ (66,'Louisiana Hot Spiced Okra',2,2,'24 - 8 oz jars','17.00',4,100,20,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (67,'Laughing Lumberjack Lager',16,1,'24 - 12 oz bottles','14.00',52,0,10,'0'),
+ (68,'Scottish Longbreads',8,3,'10 boxes x 8 pieces','12.50',6,10,15,'0'),
+ (69,'Gudbrandsdalsost',15,4,'10 kg pkg.','36.00',26,0,15,'0'),
+ (70,'Outback Lager',7,1,'24 - 355 ml bottles','15.00',15,10,30,'0'),
+ (71,'Flotemysost',15,4,'10 - 500 g pkgs.','21.50',26,0,0,'0'),
+ (72,'Mozzarella di Giovanni',14,4,'24 - 200 g pkgs.','34.80',14,0,0,'0'),
+ (73,'Röd Kaviar',17,8,'24 - 150 g jars','15.00',101,0,5,'0'),
+ (74,'Longlife Tofu',4,7,'5 kg pkg.','10.00',4,20,5,'0'),
+ (75,'Rhönbräu Klosterbier',12,1,'24 - 0.5 l bottles','7.75',125,0,25,'0'),
+ (76,'Lakkalikööri',23,1,'500 ml','18.00',57,0,20,'0'),
+ (77,'Original Frankfurter grüne Soße',12,2,'12 boxes','13.00',32,0,15,'0');
+/*!40000 ALTER TABLE `products` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`shippers`
+--
+
+DROP TABLE IF EXISTS `northwind`.`shippers`;
+CREATE TABLE  `northwind`.`shippers` (
+  `ShipperID` int(11) NOT NULL auto_increment,
+  `CompanyName` varchar(40) NOT NULL default '',
+  `Phone` varchar(24) default NULL,
+  PRIMARY KEY  (`ShipperID`)
+) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`shippers`
+--
+
+/*!40000 ALTER TABLE `shippers` DISABLE KEYS */;
+INSERT INTO `northwind`.`shippers` (`ShipperID`,`CompanyName`,`Phone`) VALUES 
+ (1,'Speedy Express','(503) 555-9831'),
+ (2,'United Package','(503) 555-3199'),
+ (3,'Federal Shipping','(503) 555-9931');
+/*!40000 ALTER TABLE `shippers` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`suppliers`
+--
+
+DROP TABLE IF EXISTS `northwind`.`suppliers`;
+CREATE TABLE  `northwind`.`suppliers` (
+  `SupplierID` int(11) NOT NULL auto_increment,
+  `CompanyName` varchar(40) NOT NULL default '',
+  `ContactName` varchar(30) default NULL,
+  `ContactTitle` varchar(30) default NULL,
+  `Address` varchar(60) default NULL,
+  `City` varchar(15) default NULL,
+  `Region` varchar(15) default NULL,
+  `PostalCode` varchar(10) default NULL,
+  `Country` varchar(15) default NULL,
+  `Phone` varchar(24) default NULL,
+  `Fax` varchar(24) default NULL,
+  `HomePage` text,
+  PRIMARY KEY  (`SupplierID`)
+) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`suppliers`
+--
+
+/*!40000 ALTER TABLE `suppliers` DISABLE KEYS */;
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (1,'Exotic Liquids','Charlotte Cooper','Purchasing Manager','49 Gilbert St.','London',NULL,'EC1 4SD','UK','(171) 555-2222',NULL,NULL),
+ (2,'New Orleans Cajun Delights','Shelley Burke','Order Administrator','P.O. Box 78934','New Orleans','LA','70117','USA','(100) 555-4822',NULL,NULL),
+ (3,'Grandma Kelly''s Homestead','Regina Murphy','Sales Representative','707 Oxford Rd.','Ann Arbor','MI','48104','USA','(313) 555-5735','(313) 555-3349',NULL),
+ (4,'Tokyo Traders','Yoshi Nagase','Marketing Manager','9-8 Sekimai Musashino-shi','Tokyo',NULL,'100','Japan','(03) 3555-5011',NULL,NULL),
+ (5,'Cooperativa de Quesos ''Las Cabras''','Antonio del Valle Saavedra','Export Administrator','Calle del Rosal 4','Oviedo','Asturias','33007','Spain','(98) 598 76 54',NULL,NULL),
+ (6,'Mayumi''s','Mayumi Ohno','Marketing Representative','92 Setsuko Chuo-ku','Osaka',NULL,'545','Japan','(06) 431-7877',NULL,NULL),
+ (7,'Pavlova Ltd.','Ian Devling','Marketing Manager','74 Rose St. Moonie Ponds','Melbourne','Victoria','3058','Australia','(03) 444-2343','(03) 444-6588',NULL);
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (8,'Specialty Biscuits Ltd.','Peter Wilson','Sales Representative','29 King''s Way','Manchester',NULL,'M14 GSD','UK','(161) 555-4448',NULL,NULL),
+ (9,'PB Knäckebröd AB','Lars Peterson','Sales Agent','Kaloadagatan 13','Göteborg',NULL,'S-345 67','Sweden','031-987 65 43','031-987 65 91',NULL),
+ (10,'Refrescos Americanas LTDA','Carlos Diaz','Marketing Manager','Av. das Americanas 12.890','Sao Paulo',NULL,'5442','Brazil','(11) 555 4640',NULL,NULL),
+ (11,'Heli Süßwaren GmbH & Co. KG','Petra Winkler','Sales Manager','Tiergartenstraße 5','Berlin',NULL,'10785','Germany','(010) 9984510',NULL,NULL),
+ (12,'Plutzer Lebensmittelgroßmärkte AG','Martin Bein','International Marketing Mgr.','Bogenallee 51','Frankfurt',NULL,'60439','Germany','(069) 992755',NULL,NULL),
+ (13,'Nord-Ost-Fisch Handelsgesellschaft mbH','Sven Petersen','Coordinator Foreign Markets','Frahmredder 112a','Cuxhaven',NULL,'27478','Germany','(04721) 8713','(04721) 8714',NULL),
+ (14,'Formaggi Fortini s.r.l.','Elio Rossi','Sales Representative','Viale Dante 75','Ravenna',NULL,'48100','Italy','(0544) 60323','(0544) 60603',NULL);
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (15,'Norske Meierier','Beate Vileid','Marketing Manager','Hatlevegen 5','Sandvika',NULL,'1320','Norway','(0)2-953010',NULL,''),
+ (16,'Bigfoot Breweries','Cheryl Saylor','Regional Account Rep.','3400 - 8th Avenue Suite 210','Bend','OR','97101','USA','(503) 555-9931',NULL,''),
+ (17,'Svensk Sjöföda AB','Michael Björn','Sales Representative','Brovallavägen 231','Stockholm',NULL,'S-123 45','Sweden','08-123 45 67',NULL,''),
+ (18,'Aux joyeux ecclésiastiques','Guylène Nodier','Sales Manager','203 Rue des Francs-Bourgeois','Paris',NULL,'75004','France','(1) 03.83.00.68','(1) 03.83.00.62',''),
+ (19,'New England Seafood Cannery','Robb Merchant','Wholesale Account Agent','Order Processing Dept. 2100 Paul Revere Blvd.','Boston','MA','02134','USA','(617) 555-3267','(617) 555-3389',''),
+ (20,'Leka Trading','Chandra Leka','Owner','471 Serangoon Loop Suite #402','Singapore',NULL,'0512','Singapore','555-8787',NULL,''),
+ (21,'Lyngbysild','Niels Petersen','Sales Manager','Lyngbysild Fiskebakken 10','Lyngby',NULL,'2800','Denmark','43844108','43844115','');
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (22,'Zaanse Snoepfabriek','Dirk Luchte','Accounting Manager','Verkoop Rijnweg 22','Zaandam',NULL,'9999 ZZ','Netherlands','(12345) 1212','(12345) 1210',''),
+ (23,'Karkki Oy','Anne Heikkonen','Product Manager','Valtakatu 12','Lappeenranta',NULL,'53120','Finland','(953) 10956',NULL,''),
+ (24,'G''day Mate','Wendy Mackenzie','Sales Representative','170 Prince Edward Parade Hunter''s Hill','Sydney','NSW','2042','Australia','(02) 555-5914','(02) 555-4873','G''day Mate (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/gdaymate.htm#'),
+ (25,'Ma Maison','Jean-Guy Lauzon','Marketing Manager','2960 Rue St. Laurent','Montréal','Québec','H1J 1C3','Canada','(514) 555-9022',NULL,''),
+ (26,'Pasta Buttini s.r.l.','Giovanni Giudici','Order Administrator','Via dei Gelsomini 153','Salerno',NULL,'84100','Italy','(089) 6547665','(089) 6547667',''),
+ (27,'Escargots Nouveaux','Marie Delamare','Sales Manager','22 rue H. Voiron','Montceau',NULL,'71300','France','85.57.00.07',NULL,'');
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (28,'Gai pâturage','Eliane Noz','Sales Representative','Bat. B 3 rue des Alpes','Annecy',NULL,'74000','France','38.76.98.06','38.76.98.58',''),
+ (29,'Forêts d''érables','Chantal Goulet','Accounting Manager','148 rue Chasseur','Ste-Hyacinthe','Québec','J2S 7S8','Canada','(514) 555-2955','(514) 555-2921','');
+/*!40000 ALTER TABLE `suppliers` ENABLE KEYS */;
+
+
+
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
diff --git a/examples/data/mysql-northwind.sql b/examples/data/mysql-northwind.sql
new file mode 100644 (file)
index 0000000..8ca5681
--- /dev/null
@@ -0,0 +1,3678 @@
+-- MySQL Administrator dump 1.4
+--
+-- ------------------------------------------------------
+-- Server version      4.1.21-community-nt
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+
+
+--
+-- Create schema northwind
+--
+
+CREATE DATABASE IF NOT EXISTS northwind;
+USE northwind;
+
+--
+-- Definition of table `northwind`.`categories`
+--
+
+DROP TABLE IF EXISTS `northwind`.`categories`;
+CREATE TABLE  `northwind`.`categories` (
+  `CategoryID` int(11) NOT NULL auto_increment,
+  `CategoryName` varchar(15) default NULL,
+  `Description` text,
+  `Picture` varchar(40) default NULL,
+  PRIMARY KEY  (`CategoryID`)
+) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`categories`
+--
+
+/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
+INSERT INTO `northwind`.`categories` (`CategoryID`,`CategoryName`,`Description`,`Picture`) VALUES 
+ (1,'Beverages','Soft drinks, coffees, teas, beers, and ales',NULL),
+ (2,'Condiments','Sweet and savory sauces, relishes, spreads, and seasonings',''),
+ (3,'Confections','Desserts, candies, and sweet breads',''),
+ (4,'Dairy Products','Cheeses',''),
+ (5,'Grains/Cereals','Breads, crackers, pasta, and cereal',''),
+ (6,'Meat/Poultry','Prepared meats',''),
+ (7,'Produce','Dried fruit and bean curd',''),
+ (8,'Seafood','Seaweed and fish','');
+/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`customers`
+--
+
+DROP TABLE IF EXISTS `northwind`.`customers`;
+CREATE TABLE  `northwind`.`customers` (
+  `CustomerID` varchar(5) NOT NULL default '',
+  `CompanyName` varchar(40) NOT NULL default '',
+  `ContactName` varchar(30) default NULL,
+  `ContactTitle` varchar(30) default NULL,
+  `Address` varchar(60) default NULL,
+  `City` varchar(15) default NULL,
+  `Region` varchar(15) default NULL,
+  `PostalCode` varchar(10) default NULL,
+  `Country` varchar(15) default NULL,
+  `Phone` varchar(24) default NULL,
+  `Fax` varchar(24) default NULL,
+  PRIMARY KEY  (`CustomerID`),
+  UNIQUE KEY `CustomerID` (`CustomerID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`customers`
+--
+
+/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('ALFKI','Alfreds Futterkiste','Maria Anders','Sales Representative','Obere Str. 57','Berlin',NULL,'12209','Germany','030-0074321','030-0076545'),
+ ('ANATR','Ana Trujillo Emparedados y helados','Ana Trujillo','Owner','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico','(5) 555-4729','(5) 555-3745'),
+ ('ANTON','Antonio Moreno Taquería','Antonio Moreno','Owner','Mataderos  2312','México D.F.',NULL,'05023','Mexico','(5) 555-3932',NULL),
+ ('AROUT','Around the Horn','Thomas Hardy','Sales Representative','120 Hanover Sq.','London',NULL,'WA1 1DP','UK','(171) 555-7788','(171) 555-6750'),
+ ('BERGS','Berglunds snabbköp','Christina Berglund','Order Administrator','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden','0921-12 34 65','0921-12 34 67'),
+ ('BLAUS','Blauer See Delikatessen','Hanna Moos','Sales Representative','Forsterstr. 57','Mannheim',NULL,'68306','Germany','0621-08460','0621-08924'),
+ ('BLONP','Blondesddsl père et fils','Frédérique Citeaux','Marketing Manager','24, place Kléber','Strasbourg',NULL,'67000','France','88.60.15.31','88.60.15.32');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('BOLID','Bólido Comidas preparadas','Martín Sommer','Owner','C/ Araquil, 67','Madrid',NULL,'28023','Spain','(91) 555 22 82','(91) 555 91 99'),
+ ('BONAP','Bon app\'','Laurence Lebihan','Owner','12, rue des Bouchers','Marseille',NULL,'13008','France','91.24.45.40','91.24.45.41'),
+ ('BOTTM','Bottom-Dollar Markets','Elizabeth Lincoln','Accounting Manager','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada','(604) 555-4729','(604) 555-3745'),
+ ('BSBEV','B\'s Beverages','Victoria Ashworth','Sales Representative','Fauntleroy Circus','London',NULL,'EC2 5NT','UK','(171) 555-1212',NULL),
+ ('CACTU','Cactus Comidas para llevar','Patricio Simpson','Sales Agent','Cerrito 333','Buenos Aires',NULL,'1010','Argentina','(1) 135-5555','(1) 135-4892'),
+ ('CENTC','Centro comercial Moctezuma','Francisco Chang','Marketing Manager','Sierras de Granada 9993','México D.F.',NULL,'05022','Mexico','(5) 555-3392','(5) 555-7293'),
+ ('CHOPS','Chop-suey Chinese','Yang Wang','Owner','Hauptstr. 29','Bern',NULL,'3012','Switzerland','0452-076545',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('COMMI','Comércio Mineiro','Pedro Afonso','Sales Associate','Av. dos Lusíadas, 23','Sao Paulo','SP','05432-043','Brazil','(11) 555-7647',NULL),
+ ('CONSH','Consolidated Holdings','Elizabeth Brown','Sales Representative','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK','(171) 555-2282','(171) 555-9199'),
+ ('DRACD','Drachenblut Delikatessen','Sven Ottlieb','Order Administrator','Walserweg 21','Aachen',NULL,'52066','Germany','0241-039123','0241-059428'),
+ ('DUMON','Du monde entier','Janine Labrune','Owner','67, rue des Cinquante Otages','Nantes',NULL,'44000','France','40.67.88.88','40.67.89.89'),
+ ('EASTC','Eastern Connection','Ann Devon','Sales Agent','35 King George','London',NULL,'WX3 6FW','UK','(171) 555-0297','(171) 555-3373'),
+ ('ERNSH','Ernst Handel','Roland Mendel','Sales Manager','Kirchgasse 6','Graz',NULL,'8010','Austria','7675-3425','7675-3426'),
+ ('FAMIA','Familia Arquibaldo','Aria Cruz','Marketing Assistant','Rua Orós, 92','Sao Paulo','SP','05442-030','Brazil','(11) 555-9857',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('FISSA','FISSA Fabrica Inter. Salchichas S.A.','Diego Roel','Accounting Manager','C/ Moralzarzal, 86','Madrid',NULL,'28034','Spain','(91) 555 94 44','(91) 555 55 93'),
+ ('FOLIG','Folies gourmandes','Martine Rancé','Assistant Sales Agent','184, chaussée de Tournai','Lille',NULL,'59000','France','20.16.10.16','20.16.10.17'),
+ ('FOLKO','Folk och fä HB','Maria Larsson','Owner','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden','0695-34 67 21',NULL),
+ ('FRANK','Frankenversand','Peter Franken','Marketing Manager','Berliner Platz 43','München',NULL,'80805','Germany','089-0877310','089-0877451'),
+ ('FRANR','France restauration','Carine Schmitt','Marketing Manager','54, rue Royale','Nantes',NULL,'44000','France','40.32.21.21','40.32.21.20'),
+ ('FRANS','Franchi S.p.A.','Paolo Accorti','Sales Representative','Via Monte Bianco 34','Torino',NULL,'10100','Italy','011-4988260','011-4988261'),
+ ('FURIB','Furia Bacalhau e Frutos do Mar','Lino Rodriguez','Sales Manager','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal','(1) 354-2534','(1) 354-2535');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('GALED','Galería del gastrónomo','Eduardo Saavedra','Marketing Manager','Rambla de Cataluña, 23','Barcelona',NULL,'08022','Spain','(93) 203 4560','(93) 203 4561'),
+ ('GODOS','Godos Cocina Típica','José Pedro Freyre','Sales Manager','C/ Romero, 33','Sevilla',NULL,'41101','Spain','(95) 555 82 82',NULL),
+ ('GOURL','Gourmet Lanchonetes','André Fonseca','Sales Associate','Av. Brasil, 442','Campinas','SP','04876-786','Brazil','(11) 555-9482',NULL),
+ ('GREAL','Great Lakes Food Market','Howard Snyder','Marketing Manager','2732 Baker Blvd.','Eugene','OR','97403','USA','(503) 555-7555',NULL),
+ ('GROSR','GROSELLA-Restaurante','Manuel Pereira','Owner','5ª Ave. Los Palos Grandes','Caracas','DF','1081','Venezuela','(2) 283-2951','(2) 283-3397'),
+ ('HANAR','Hanari Carnes','Mario Pontes','Accounting Manager','Rua do Paço, 67','Rio de Janeiro','RJ','05454-876','Brazil','(21) 555-0091','(21) 555-8765'),
+ ('HILAA','HILARION-Abastos','Carlos Hernández','Sales Representative','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela','(5) 555-1340','(5) 555-1948');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('HUNGC','Hungry Coyote Import Store','Yoshi Latimer','Sales Representative','City Center Plaza 516 Main St.','Elgin','OR','97827','USA','(503) 555-6874','(503) 555-2376'),
+ ('HUNGO','Hungry Owl All-Night Grocers','Patricia McKenna','Sales Associate','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland','2967 542','2967 3333'),
+ ('ISLAT','Island Trading','Helen Bennett','Marketing Manager','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK','(198) 555-8888',NULL),
+ ('KOENE','Königlich Essen','Philip Cramer','Sales Associate','Maubelstr. 90','Brandenburg',NULL,'14776','Germany','0555-09876',NULL),
+ ('LACOR','La corne d\'abondance','Daniel Tonini','Sales Representative','67, avenue de l\'Europe','Versailles',NULL,'78000','France','30.59.84.10','30.59.85.11'),
+ ('LAMAI','La maison d\'Asie','Annette Roulet','Sales Manager','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France','61.77.61.10','61.77.61.11'),
+ ('LAUGB','Laughing Bacchus Wine Cellars','Yoshi Tannamuri','Marketing Assistant','1900 Oak St.','Vancouver','BC','V3F 2K1','Canada','(604) 555-3392','(604) 555-7293');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('LAZYK','Lazy K Kountry Store','John Steel','Marketing Manager','12 Orchestra Terrace','Walla Walla','WA','99362','USA','(509) 555-7969','(509) 555-6221'),
+ ('LEHMS','Lehmanns Marktstand','Renate Messner','Sales Representative','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany','069-0245984','069-0245874'),
+ ('LETSS','Let\'s Stop N Shop','Jaime Yorres','Owner','87 Polk St. Suite 5','San Francisco','CA','94117','USA','(415) 555-5938',NULL),
+ ('LILAS','LILA-Supermercado','Carlos González','Accounting Manager','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela','(9) 331-6954','(9) 331-7256'),
+ ('LINOD','LINO-Delicateses','Felipe Izquierdo','Owner','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela','(8) 34-56-12','(8) 34-93-93'),
+ ('LONEP','Lonesome Pine Restaurant','Fran Wilson','Sales Manager','89 Chiaroscuro Rd.','Portland','OR','97219','USA','(503) 555-9573','(503) 555-9646'),
+ ('MAGAA','Magazzini Alimentari Riuniti','Giovanni Rovelli','Marketing Manager','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy','035-640230','035-640231');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('MAISD','Maison Dewey','Catherine Dewey','Sales Agent','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium','(02) 201 24 67','(02) 201 24 68'),
+ ('MEREP','Mère Paillarde','Jean Fresnière','Marketing Assistant','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada','(514) 555-8054','(514) 555-8055'),
+ ('MORGK','Morgenstern Gesundkost','Alexander Feuer','Marketing Assistant','Heerstr. 22','Leipzig',NULL,'04179','Germany','0342-023176',NULL),
+ ('NORTS','North/South','Simon Crowther','Sales Associate','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK','(171) 555-7733','(171) 555-2530'),
+ ('OCEAN','Océano Atlántico Ltda.','Yvonne Moncada','Sales Agent','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina','(1) 135-5333','(1) 135-5535'),
+ ('OLDWO','Old World Delicatessen','Rene Phillips','Sales Representative','2743 Bering St.','Anchorage','AK','99508','USA','(907) 555-7584','(907) 555-2880'),
+ ('OTTIK','Ottilies Käseladen','Henriette Pfalzheim','Owner','Mehrheimerstr. 369','Köln',NULL,'50739','Germany','0221-0644327','0221-0765721');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('PARIS','Paris spécialités','Marie Bertrand','Owner','265, boulevard Charonne','Paris',NULL,'75012','France','(1) 42.34.22.66','(1) 42.34.22.77'),
+ ('PERIC','Pericles Comidas clásicas','Guillermo Fernández','Sales Representative','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico','(5) 552-3745','(5) 545-3745'),
+ ('PICCO','Piccolo und mehr','Georg Pipps','Sales Manager','Geislweg 14','Salzburg',NULL,'5020','Austria','6562-9722','6562-9723'),
+ ('PRINI','Princesa Isabel Vinhos','Isabel de Castro','Sales Representative','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal','(1) 356-5634',NULL),
+ ('QUEDE','Que Delícia','Bernardo Batista','Accounting Manager','Rua da Panificadora, 12','Rio de Janeiro','RJ','02389-673','Brazil','(21) 555-4252','(21) 555-4545'),
+ ('QUEEN','Queen Cozinha','Lúcia Carvalho','Marketing Assistant','Alameda dos Canàrios, 891','Sao Paulo','SP','05487-020','Brazil','(11) 555-1189',NULL),
+ ('QUICK','QUICK-Stop','Horst Kloss','Accounting Manager','Taucherstraße 10','Cunewalde',NULL,'01307','Germany','0372-035188',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('RANCH','Rancho grande','Sergio Gutiérrez','Sales Representative','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina','(1) 123-5555','(1) 123-5556'),
+ ('RATTC','Rattlesnake Canyon Grocery','Paula Wilson','Assistant Sales Representative','2817 Milton Dr.','Albuquerque','NM','87110','USA','(505) 555-5939','(505) 555-3620'),
+ ('REGGC','Reggiani Caseifici','Maurizio Moroni','Sales Associate','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy','0522-556721','0522-556722'),
+ ('RICAR','Ricardo Adocicados','Janete Limeira','Assistant Sales Agent','Av. Copacabana, 267','Rio de Janeiro','RJ','02389-890','Brazil','(21) 555-3412',NULL),
+ ('RICSU','Richter Supermarkt','Michael Holz','Sales Manager','Grenzacherweg 237','Genève',NULL,'1203','Switzerland','0897-034214',NULL),
+ ('ROMEY','Romero y tomillo','Alejandra Camino','Accounting Manager','Gran Vía, 1','Madrid',NULL,'28001','Spain','(91) 745 6200','(91) 745 6210'),
+ ('SANTG','Santé Gourmet','Jonas Bergulfsen','Owner','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway','07-98 92 35','07-98 92 47');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('SAVEA','Save-a-lot Markets','Jose Pavarotti','Sales Representative','187 Suffolk Ln.','Boise','ID','83720','USA','(208) 555-8097',NULL),
+ ('SEVES','Seven Seas Imports','Hari Kumar','Sales Manager','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK','(171) 555-1717','(171) 555-5646'),
+ ('SIMOB','Simons bistro','Jytte Petersen','Owner','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark','31 12 34 56','31 13 35 57'),
+ ('SPECD','Spécialités du monde','Dominique Perrier','Marketing Manager','25, rue Lauriston','Paris',NULL,'75016','France','(1) 47.55.60.10','(1) 47.55.60.20'),
+ ('SPLIR','Split Rail Beer & Ale','Art Braunschweiger','Sales Manager','P.O. Box 555','Lander','WY','82520','USA','(307) 555-4680','(307) 555-6525'),
+ ('SUPRD','Suprêmes délices','Pascale Cartrain','Accounting Manager','Boulevard Tirou, 255','Charleroi',NULL,'B-6000','Belgium','(071) 23 67 22 20','(071) 23 67 22 21'),
+ ('THEBI','The Big Cheese','Liz Nixon','Marketing Manager','89 Jefferson Way Suite 2','Portland','OR','97201','USA','(503) 555-3612',NULL);
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('THECR','The Cracker Box','Liu Wong','Marketing Assistant','55 Grizzly Peak Rd.','Butte','MT','59801','USA','(406) 555-5834','(406) 555-8083'),
+ ('TOMSP','Toms Spezialitäten','Karin Josephs','Marketing Manager','Luisenstr. 48','Münster',NULL,'44087','Germany','0251-031259','0251-035695'),
+ ('TORTU','Tortuga Restaurante','Miguel Angel Paolino','Owner','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico','(5) 555-2933',NULL),
+ ('TRADH','Tradição Hipermercados','Anabela Domingues','Sales Representative','Av. Inês de Castro, 414','Sao Paulo','SP','05634-030','Brazil','(11) 555-2167','(11) 555-2168'),
+ ('TRAIH','Trail\'s Head Gourmet Provisioners','Helvetius Nagy','Sales Associate','722 DaVinci Blvd.','Kirkland','WA','98034','USA','(206) 555-8257','(206) 555-2174'),
+ ('VAFFE','Vaffeljernet','Palle Ibsen','Sales Manager','Smagsloget 45','Århus',NULL,'8200','Denmark','86 21 32 43','86 22 33 44'),
+ ('VICTE','Victuailles en stock','Mary Saveley','Sales Agent','2, rue du Commerce','Lyon',NULL,'69004','France','78.32.54.86','78.32.54.87');
+INSERT INTO `northwind`.`customers` (`CustomerID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`) VALUES 
+ ('VINET','Vins et alcools Chevalier','Paul Henriot','Accounting Manager','59 rue de l\'Abbaye','Reims',NULL,'51100','France','26.47.15.10','26.47.15.11'),
+ ('WANDK','Die Wandernde Kuh','Rita Müller','Sales Representative','Adenauerallee 900','Stuttgart',NULL,'70563','Germany','0711-020361','0711-035428'),
+ ('WARTH','Wartian Herkku','Pirkko Koskitalo','Accounting Manager','Torikatu 38','Oulu',NULL,'90110','Finland','981-443655','981-443655'),
+ ('WELLI','Wellington Importadora','Paula Parente','Sales Manager','Rua do Mercado, 12','Resende','SP','08737-363','Brazil','(14) 555-8122',NULL),
+ ('WHITC','White Clover Markets','Karl Jablonski','Owner','305 - 14th Ave. S. Suite 3B','Seattle','WA','98128','USA','(206) 555-4112','(206) 555-4115'),
+ ('WILMK','Wilman Kala','Matti Karttunen','Owner/Marketing Assistant','Keskuskatu 45','Helsinki',NULL,'21240','Finland','90-224 8858','90-224 8858'),
+ ('WOLZA','Wolski  Zajazd','Zbyszek Piestrzeniewicz','Owner','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland','(26) 642-7012','(26) 642-7012');
+/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`employees`
+--
+
+DROP TABLE IF EXISTS `northwind`.`employees`;
+CREATE TABLE  `northwind`.`employees` (
+  `EmployeeID` int(11) NOT NULL default '0',
+  `LastName` varchar(20) NOT NULL default '',
+  `FirstName` varchar(10) NOT NULL default '',
+  `Title` varchar(30) default NULL,
+  `TitleOfCourtesy` varchar(25) default NULL,
+  `BirthDate` date default NULL,
+  `HireDate` date default NULL,
+  `Address` varchar(60) default NULL,
+  `City` varchar(15) default NULL,
+  `Region` varchar(15) default NULL,
+  `PostalCode` varchar(10) default NULL,
+  `Country` varchar(15) default NULL,
+  `HomePhone` varchar(24) default NULL,
+  `Extension` varchar(4) default NULL,
+  `Notes` text,
+  `ReportsTo` int(11) default NULL,
+  `PhotoFileName` varchar(255) default NULL,
+  PRIMARY KEY  (`EmployeeID`),
+  UNIQUE KEY `EmployeeID` (`EmployeeID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`employees`
+--
+
+/*!40000 ALTER TABLE `employees` DISABLE KEYS */;
+INSERT INTO `northwind`.`employees` (`EmployeeID`,`LastName`,`FirstName`,`Title`,`TitleOfCourtesy`,`BirthDate`,`HireDate`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`HomePhone`,`Extension`,`Notes`,`ReportsTo`,`PhotoFileName`) VALUES 
+ (1,'Davolio','Nancy','Sales Representative','Ms.','1948-12-08','1992-05-01','507 - 20th Ave. E.  Apt. 2A','Seattle','WA','98122','USA','(206) 555-9857','5467','Education includes a BA in psychology from Colorado State University in 1970.  She also completed \"The Art of the Cold Call.\"  Nancy is a member of Toastmasters International.',2,'http://accweb/emmployees/davolio.bmp'),
+ (2,'Fuller','Andrew','Vice President of Sales','Dr.','1952-02-19','1992-08-14','908 W. Capital Way','Tacoma','WA','98401','USA','(206) 555-9482','3457','Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981.  He is fluent in French and Italian and reads German.  He joined the company as a sales representative; was promoted to sales manager i',0,'http://accweb/emmployees/fuller.bmp'),
+ (3,'Leverling','Janet','Sales Representative','Ms.','1963-08-30','1992-04-01','722 Moss Bay Blvd.','Kirkland','WA','98033','USA','(206) 555-3412','3355','Janet has a BS degree in chemistry from Boston College (1984).  She has also completed a certificate program in food retailing management.  Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992.',2,'http://accweb/emmployees/leverling.bmp');
+INSERT INTO `northwind`.`employees` (`EmployeeID`,`LastName`,`FirstName`,`Title`,`TitleOfCourtesy`,`BirthDate`,`HireDate`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`HomePhone`,`Extension`,`Notes`,`ReportsTo`,`PhotoFileName`) VALUES 
+ (4,'Peacock','Margaret','Sales Representative','Mrs.','1937-09-19','1993-05-03','4110 Old Redmond Rd.','Redmond','WA','98052','USA','(206) 555-8122','5176','Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966).  She was assigned to the London office temporarily from July through November 1992.',2,'http://accweb/emmployees/peacock.bmp'),
+ (5,'Buchanan','Steven','Sales Manager','Mr.','1955-03-04','1993-10-17','14 Garrett Hill','London',NULL,'SW1 8JR','UK','(71) 555-4848','3453','Steven Buchanan graduated from St. Andrews University (Scotland) with a BSC degree in 1976.  Upon joining the company as a sales representative in 1992. He spent 6 months in an orientation program at the Seattle office and then returned to his permanent po',2,'http://accweb/emmployees/buchanan.bmp'),
+ (6,'Suyama','Michael','Sales Representative','Mr.','1963-07-02','1993-10-17','Coventry House  Miner Rd.','London',NULL,'EC2 7JR','UK','(71) 555-7773','428','Michael is a graduate of Sussex University (MA economics 1983) and the University of California at Los Angeles (MBA marketing 1986).  He has also taken the courses \"Multi-Cultural Selling\" and \"Time Management for the Sales Professional.\"  He is fluent',5,'http://accweb/emmployees/davolio.bmp');
+INSERT INTO `northwind`.`employees` (`EmployeeID`,`LastName`,`FirstName`,`Title`,`TitleOfCourtesy`,`BirthDate`,`HireDate`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`HomePhone`,`Extension`,`Notes`,`ReportsTo`,`PhotoFileName`) VALUES 
+ (7,'King','Robert','Sales Representative','Mr.','1960-05-29','1994-01-02','Edgeham Hollow  Winchester Way','London',NULL,'RG1 9SP','UK','(71) 555-5598','465','Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992; the year he joined the company.  After completing a course entitled \"Selling in Europe\" he was transferred to the',5,'http://accweb/emmployees/davolio.bmp'),
+ (8,'Callahan','Laura','Inside Sales Coordinator','Ms.','1958-01-09','1994-03-05','4726 - 11th Ave. N.E.','Seattle','WA','98105','USA','(206) 555-1189','2344','Laura received a BA in psychology from the University of Washington.  She has also completed a course in business French.  She reads and writes French.',2,'http://accweb/emmployees/davolio.bmp'),
+ (9,'Dodsworth','Anne','Sales Representative','Ms.','1966-01-27','1994-11-15','7 Houndstooth Rd.','London',NULL,'WG2 7LT','UK','(71) 555-4444','452','Anne has a BA degree in English from St. Lawrence College.  She is fluent in French and German.',5,'http://accweb/emmployees/davolio.bmp');
+/*!40000 ALTER TABLE `employees` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`order_details`
+--
+
+DROP TABLE IF EXISTS `northwind`.`order_details`;
+CREATE TABLE  `northwind`.`order_details` (
+  `OrderID` int(11) NOT NULL default '0',
+  `ProductID` int(11) NOT NULL default '0',
+  `UnitPrice` decimal(9,2) unsigned NOT NULL default '0.00',
+  `Quantity` smallint(5) unsigned NOT NULL default '1',
+  `Discount` double NOT NULL default '0',
+  PRIMARY KEY  (`OrderID`,`ProductID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`order_details`
+--
+
+/*!40000 ALTER TABLE `order_details` DISABLE KEYS */;
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10248,11,'14.00',12,0),
+ (10248,42,'9.80',10,0),
+ (10248,72,'34.80',5,0),
+ (10249,14,'18.60',9,0),
+ (10249,51,'42.40',40,0),
+ (10250,41,'7.70',10,0),
+ (10250,51,'42.40',35,0.15),
+ (10250,65,'16.80',15,0.15),
+ (10251,22,'16.80',6,0.05),
+ (10251,57,'15.60',15,0.05),
+ (10251,65,'16.80',20,0),
+ (10252,20,'64.80',40,0.05),
+ (10252,33,'2.00',25,0.05),
+ (10252,60,'27.20',40,0),
+ (10253,31,'10.00',20,0),
+ (10253,39,'14.40',42,0),
+ (10253,49,'16.00',40,0),
+ (10254,24,'3.60',15,0.15),
+ (10254,55,'19.20',21,0.15),
+ (10254,74,'8.00',21,0),
+ (10255,2,'15.20',20,0),
+ (10255,16,'13.90',35,0),
+ (10255,36,'15.20',25,0),
+ (10255,59,'44.00',30,0),
+ (10256,53,'26.20',15,0),
+ (10256,77,'10.40',12,0),
+ (10257,27,'35.10',25,0),
+ (10257,39,'14.40',6,0),
+ (10257,77,'10.40',15,0),
+ (10258,2,'15.20',50,0.2),
+ (10258,5,'17.00',65,0.2),
+ (10258,32,'25.60',6,0.2),
+ (10259,21,'8.00',10,0),
+ (10259,37,'20.80',1,0),
+ (10260,41,'7.70',16,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10260,57,'15.60',50,0),
+ (10260,62,'39.40',15,0.25),
+ (10260,70,'12.00',21,0.25),
+ (10261,21,'8.00',20,0),
+ (10261,35,'14.40',20,0),
+ (10262,5,'17.00',12,0.2),
+ (10262,7,'24.00',15,0),
+ (10262,56,'30.40',2,0),
+ (10263,16,'13.90',60,0.25),
+ (10263,24,'3.60',28,0),
+ (10263,30,'20.70',60,0.25),
+ (10263,74,'8.00',36,0.25),
+ (10264,2,'15.20',35,0),
+ (10264,41,'7.70',25,0.15),
+ (10265,17,'31.20',30,0),
+ (10265,70,'12.00',20,0),
+ (10266,12,'30.40',12,0.05),
+ (10267,40,'14.70',50,0),
+ (10267,59,'44.00',70,0.15),
+ (10267,76,'14.40',15,0.15),
+ (10268,29,'99.00',10,0),
+ (10268,72,'27.80',4,0),
+ (10269,33,'2.00',60,0.05),
+ (10269,72,'27.80',20,0.05),
+ (10270,36,'15.20',30,0),
+ (10270,43,'36.80',25,0),
+ (10271,33,'2.00',24,0),
+ (10272,20,'64.80',6,0),
+ (10272,31,'10.00',40,0),
+ (10272,72,'27.80',24,0),
+ (10273,10,'24.80',24,0.05),
+ (10273,31,'10.00',15,0.05),
+ (10273,33,'2.00',20,0),
+ (10273,40,'14.70',60,0.05),
+ (10273,76,'14.40',33,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10274,71,'17.20',20,0),
+ (10274,72,'27.80',7,0),
+ (10275,24,'3.60',12,0.05),
+ (10275,59,'44.00',6,0.05),
+ (10276,10,'24.80',15,0),
+ (10276,13,'4.80',10,0),
+ (10277,28,'36.40',20,0),
+ (10277,62,'39.40',12,0),
+ (10278,44,'15.50',16,0),
+ (10278,59,'44.00',15,0),
+ (10278,63,'35.10',8,0),
+ (10278,73,'12.00',25,0),
+ (10279,17,'31.20',15,0.25),
+ (10280,24,'3.60',12,0),
+ (10280,55,'19.20',20,0),
+ (10280,75,'6.20',30,0),
+ (10281,19,'7.30',1,0),
+ (10281,24,'3.60',6,0),
+ (10281,35,'14.40',4,0),
+ (10282,30,'20.70',6,0),
+ (10282,57,'15.60',2,0),
+ (10283,15,'12.40',20,0),
+ (10283,19,'7.30',18,0),
+ (10283,60,'27.20',35,0),
+ (10283,72,'27.80',3,0),
+ (10284,27,'35.10',15,0.25),
+ (10284,44,'15.50',21,0),
+ (10284,60,'27.20',20,0.25),
+ (10284,67,'11.20',5,0.25),
+ (10285,1,'14.40',45,0.2),
+ (10285,40,'14.70',40,0.2),
+ (10285,53,'26.20',36,0.2),
+ (10286,35,'14.40',100,0),
+ (10286,62,'39.40',40,0),
+ (10287,16,'13.90',40,0.15),
+ (10287,34,'11.20',20,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10287,46,'9.60',15,0.15),
+ (10288,54,'5.90',10,0.1),
+ (10288,68,'10.00',3,0.1),
+ (10289,3,'8.00',30,0),
+ (10289,64,'26.60',9,0),
+ (10290,5,'17.00',20,0),
+ (10290,29,'99.00',15,0),
+ (10290,49,'16.00',15,0),
+ (10290,77,'10.40',10,0),
+ (10291,13,'4.80',20,0.1),
+ (10291,44,'15.50',24,0.1),
+ (10291,51,'42.40',2,0.1),
+ (10292,20,'64.80',20,0),
+ (10293,18,'50.00',12,0),
+ (10293,24,'3.60',10,0),
+ (10293,63,'35.10',5,0),
+ (10293,75,'6.20',6,0),
+ (10294,1,'14.40',18,0),
+ (10294,17,'31.20',15,0),
+ (10294,43,'36.80',15,0),
+ (10294,60,'27.20',21,0),
+ (10294,75,'6.20',6,0),
+ (10295,56,'30.40',4,0),
+ (10296,11,'16.80',12,0),
+ (10296,16,'13.90',30,0),
+ (10296,69,'28.80',15,0),
+ (10297,39,'14.40',60,0),
+ (10297,72,'27.80',20,0),
+ (10298,2,'15.20',40,0),
+ (10298,36,'15.20',40,0.25),
+ (10298,59,'44.00',30,0.25),
+ (10298,62,'39.40',15,0),
+ (10299,19,'7.30',15,0),
+ (10299,70,'12.00',20,0),
+ (10300,66,'13.60',30,0),
+ (10300,68,'10.00',20,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10301,40,'14.70',10,0),
+ (10301,56,'30.40',20,0),
+ (10302,17,'31.20',40,0),
+ (10302,28,'36.40',28,0),
+ (10302,43,'36.80',12,0),
+ (10303,40,'14.70',40,0.1),
+ (10303,65,'16.80',30,0.1),
+ (10303,68,'10.00',15,0.1),
+ (10304,49,'16.00',30,0),
+ (10304,59,'44.00',10,0),
+ (10304,71,'17.20',2,0),
+ (10305,18,'50.00',25,0.1),
+ (10305,29,'99.00',25,0.1),
+ (10305,39,'14.40',30,0.1),
+ (10306,30,'20.70',10,0),
+ (10306,53,'26.20',10,0),
+ (10306,54,'5.90',5,0),
+ (10307,62,'39.40',10,0),
+ (10307,68,'10.00',3,0),
+ (10308,69,'28.80',1,0),
+ (10308,70,'12.00',5,0),
+ (10309,4,'17.60',20,0),
+ (10309,6,'20.00',30,0),
+ (10309,42,'11.20',2,0),
+ (10309,43,'36.80',20,0),
+ (10309,71,'17.20',3,0),
+ (10310,16,'13.90',10,0),
+ (10310,62,'39.40',5,0),
+ (10311,42,'11.20',6,0),
+ (10311,69,'28.80',7,0),
+ (10312,28,'36.40',4,0),
+ (10312,43,'36.80',24,0),
+ (10312,53,'26.20',20,0),
+ (10312,75,'6.20',10,0),
+ (10313,36,'15.20',12,0),
+ (10314,32,'25.60',40,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10314,58,'10.60',30,0.1),
+ (10314,62,'39.40',25,0.1),
+ (10315,34,'11.20',14,0),
+ (10315,70,'12.00',30,0),
+ (10316,41,'7.70',10,0),
+ (10316,62,'39.40',70,0),
+ (10317,1,'14.40',20,0),
+ (10318,41,'7.70',20,0),
+ (10318,76,'14.40',6,0),
+ (10319,17,'31.20',8,0),
+ (10319,28,'36.40',14,0),
+ (10319,76,'14.40',30,0),
+ (10320,71,'17.20',30,0),
+ (10321,35,'14.40',10,0),
+ (10322,52,'5.60',20,0),
+ (10323,15,'12.40',5,0),
+ (10323,25,'11.20',4,0),
+ (10323,39,'14.40',4,0),
+ (10324,16,'13.90',21,0.15),
+ (10324,35,'14.40',70,0.15),
+ (10324,46,'9.60',30,0),
+ (10324,59,'44.00',40,0.15),
+ (10324,63,'35.10',80,0.15),
+ (10325,6,'20.00',6,0),
+ (10325,13,'4.80',12,0),
+ (10325,14,'18.60',9,0),
+ (10325,31,'10.00',4,0),
+ (10325,72,'27.80',40,0),
+ (10326,4,'17.60',24,0),
+ (10326,57,'15.60',16,0),
+ (10326,75,'6.20',50,0),
+ (10327,2,'15.20',25,0.2),
+ (10327,11,'16.80',50,0.2),
+ (10327,30,'20.70',35,0.2),
+ (10327,58,'10.60',30,0.2),
+ (10328,59,'44.00',9,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10328,65,'16.80',40,0),
+ (10328,68,'10.00',10,0),
+ (10329,19,'7.30',10,0.05),
+ (10329,30,'20.70',8,0.05),
+ (10329,38,'210.80',20,0.05),
+ (10329,56,'30.40',12,0.05),
+ (10330,26,'24.90',50,0.15),
+ (10330,72,'27.80',25,0.15),
+ (10331,54,'5.90',15,0),
+ (10332,18,'50.00',40,0.2),
+ (10332,42,'11.20',10,0.2),
+ (10332,47,'7.60',16,0.2),
+ (10333,14,'18.60',10,0),
+ (10333,21,'8.00',10,0.1),
+ (10333,71,'17.20',40,0.1),
+ (10334,52,'5.60',8,0),
+ (10334,68,'10.00',10,0),
+ (10335,2,'15.20',7,0.2),
+ (10335,31,'10.00',25,0.2),
+ (10335,32,'25.60',6,0.2),
+ (10335,51,'42.40',48,0.2),
+ (10336,4,'17.60',18,0.1),
+ (10337,23,'7.20',40,0),
+ (10337,26,'24.90',24,0),
+ (10337,36,'15.20',20,0),
+ (10337,37,'20.80',28,0),
+ (10337,72,'27.80',25,0),
+ (10338,17,'31.20',20,0),
+ (10338,30,'20.70',15,0),
+ (10339,4,'17.60',10,0),
+ (10339,17,'31.20',70,0.05),
+ (10339,62,'39.40',28,0),
+ (10340,18,'50.00',20,0.05),
+ (10340,41,'7.70',12,0.05),
+ (10340,43,'36.80',40,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10341,33,'2.00',8,0),
+ (10341,59,'44.00',9,0.15),
+ (10342,2,'15.20',24,0.2),
+ (10342,31,'10.00',56,0.2),
+ (10342,36,'15.20',40,0.2),
+ (10342,55,'19.20',40,0.2),
+ (10343,64,'26.60',50,0),
+ (10343,68,'10.00',4,0.05),
+ (10343,76,'14.40',15,0),
+ (10344,4,'17.60',35,0),
+ (10344,8,'32.00',70,0.25),
+ (10345,8,'32.00',70,0),
+ (10345,19,'7.30',80,0),
+ (10345,42,'11.20',9,0),
+ (10346,17,'31.20',36,0.1),
+ (10346,56,'30.40',20,0),
+ (10347,25,'11.20',10,0),
+ (10347,39,'14.40',50,0.15),
+ (10347,40,'14.70',4,0),
+ (10347,75,'6.20',6,0.15),
+ (10348,1,'14.40',15,0.15),
+ (10348,23,'7.20',25,0),
+ (10349,54,'5.90',24,0),
+ (10350,50,'13.00',15,0.1),
+ (10350,69,'28.80',18,0.1),
+ (10351,38,'210.80',20,0.05),
+ (10351,41,'7.70',13,0),
+ (10351,44,'15.50',77,0.05),
+ (10351,65,'16.80',10,0.05),
+ (10352,24,'3.60',10,0),
+ (10352,54,'5.90',20,0.15),
+ (10353,11,'16.80',12,0.2),
+ (10353,38,'210.80',50,0.2),
+ (10354,1,'14.40',12,0),
+ (10354,29,'99.00',4,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10355,24,'3.60',25,0),
+ (10355,57,'15.60',25,0),
+ (10356,31,'10.00',30,0),
+ (10356,55,'19.20',12,0),
+ (10356,69,'28.80',20,0),
+ (10357,10,'24.80',30,0.2),
+ (10357,26,'24.90',16,0),
+ (10357,60,'27.20',8,0.2),
+ (10358,24,'3.60',10,0.05),
+ (10358,34,'11.20',10,0.05),
+ (10358,36,'15.20',20,0.05),
+ (10359,16,'13.90',56,0.05),
+ (10359,31,'10.00',70,0.05),
+ (10359,60,'27.20',80,0.05),
+ (10360,28,'36.40',30,0),
+ (10360,29,'99.00',35,0),
+ (10360,38,'210.80',10,0),
+ (10360,49,'16.00',35,0),
+ (10360,54,'5.90',28,0),
+ (10361,39,'14.40',54,0.1),
+ (10361,60,'27.20',55,0.1),
+ (10362,25,'11.20',50,0),
+ (10362,51,'42.40',20,0),
+ (10362,54,'5.90',24,0),
+ (10363,31,'10.00',20,0),
+ (10363,75,'6.20',12,0),
+ (10363,76,'14.40',12,0),
+ (10364,69,'28.80',30,0),
+ (10364,71,'17.20',5,0),
+ (10365,11,'16.80',24,0),
+ (10366,65,'16.80',5,0),
+ (10366,77,'10.40',5,0),
+ (10367,34,'11.20',36,0),
+ (10367,54,'5.90',18,0),
+ (10367,65,'16.80',15,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10367,77,'10.40',7,0),
+ (10368,21,'8.00',5,0.1),
+ (10368,28,'36.40',13,0.1),
+ (10368,57,'15.60',25,0),
+ (10368,64,'26.60',35,0.1),
+ (10369,29,'99.00',20,0),
+ (10369,56,'30.40',18,0.25),
+ (10370,1,'14.40',15,0.15),
+ (10370,64,'26.60',30,0),
+ (10370,74,'8.00',20,0.15),
+ (10371,36,'15.20',6,0.2),
+ (10372,20,'64.80',12,0.25),
+ (10372,38,'210.80',40,0.25),
+ (10372,60,'27.20',70,0.25),
+ (10372,72,'27.80',42,0.25),
+ (10373,58,'10.60',80,0.2),
+ (10373,71,'17.20',50,0.2),
+ (10374,31,'10.00',30,0),
+ (10374,58,'10.60',15,0),
+ (10375,14,'18.60',15,0),
+ (10375,54,'5.90',10,0),
+ (10376,31,'10.00',42,0.05),
+ (10377,28,'36.40',20,0.15),
+ (10377,39,'14.40',20,0.15),
+ (10378,71,'17.20',6,0),
+ (10379,41,'7.70',8,0.1),
+ (10379,63,'35.10',16,0.1),
+ (10379,65,'16.80',20,0.1),
+ (10380,30,'20.70',18,0.1),
+ (10380,53,'26.20',20,0.1),
+ (10380,60,'27.20',6,0.1),
+ (10380,70,'12.00',30,0),
+ (10381,74,'8.00',14,0),
+ (10382,5,'17.00',32,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10382,18,'50.00',9,0),
+ (10382,29,'99.00',14,0),
+ (10382,33,'2.00',60,0),
+ (10382,74,'8.00',50,0),
+ (10383,13,'4.80',20,0),
+ (10383,50,'13.00',15,0),
+ (10383,56,'30.40',20,0),
+ (10384,20,'64.80',28,0),
+ (10384,60,'27.20',15,0),
+ (10385,7,'24.00',10,0.2),
+ (10385,60,'27.20',20,0.2),
+ (10385,68,'10.00',8,0.2),
+ (10386,24,'3.60',15,0),
+ (10386,34,'11.20',10,0),
+ (10387,24,'3.60',15,0),
+ (10387,28,'36.40',6,0),
+ (10387,59,'44.00',12,0),
+ (10387,71,'17.20',15,0),
+ (10388,45,'7.60',15,0.2),
+ (10388,52,'5.60',20,0.2),
+ (10388,53,'26.20',40,0),
+ (10389,10,'24.80',16,0),
+ (10389,55,'19.20',15,0),
+ (10389,62,'39.40',20,0),
+ (10389,70,'12.00',30,0),
+ (10390,31,'10.00',60,0.1),
+ (10390,35,'14.40',40,0.1),
+ (10390,46,'9.60',45,0),
+ (10390,72,'27.80',24,0.1),
+ (10391,13,'4.80',18,0),
+ (10392,69,'28.80',50,0),
+ (10393,2,'15.20',25,0.25),
+ (10393,14,'18.60',42,0.25),
+ (10393,25,'11.20',7,0.25),
+ (10393,26,'24.90',70,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10393,31,'10.00',32,0),
+ (10394,13,'4.80',10,0),
+ (10394,62,'39.40',10,0),
+ (10395,46,'9.60',28,0.1),
+ (10395,53,'26.20',70,0.1),
+ (10395,69,'28.80',8,0),
+ (10396,23,'7.20',40,0),
+ (10396,71,'17.20',60,0),
+ (10396,72,'27.80',21,0),
+ (10397,21,'8.00',10,0.15),
+ (10397,51,'42.40',18,0.15),
+ (10398,35,'14.40',30,0),
+ (10398,55,'19.20',120,0.1),
+ (10399,68,'10.00',60,0),
+ (10399,71,'17.20',30,0),
+ (10399,76,'14.40',35,0),
+ (10399,77,'10.40',14,0),
+ (10400,29,'99.00',21,0),
+ (10400,35,'14.40',35,0),
+ (10400,49,'16.00',30,0),
+ (10401,30,'20.70',18,0),
+ (10401,56,'30.40',70,0),
+ (10401,65,'16.80',20,0),
+ (10401,71,'17.20',60,0),
+ (10402,23,'7.20',60,0),
+ (10402,63,'35.10',65,0),
+ (10403,16,'13.90',21,0.15),
+ (10403,48,'10.20',70,0.15),
+ (10404,26,'24.90',30,0.05),
+ (10404,42,'11.20',40,0.05),
+ (10404,49,'16.00',30,0.05),
+ (10405,3,'8.00',50,0),
+ (10406,1,'14.40',10,0),
+ (10406,21,'8.00',30,0.1),
+ (10406,28,'36.40',42,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10406,36,'15.20',5,0.1),
+ (10406,40,'14.70',2,0.1),
+ (10407,11,'16.80',30,0),
+ (10407,69,'28.80',15,0),
+ (10407,71,'17.20',15,0),
+ (10408,37,'20.80',10,0),
+ (10408,54,'5.90',6,0),
+ (10408,62,'39.40',35,0),
+ (10409,14,'18.60',12,0),
+ (10409,21,'8.00',12,0),
+ (10410,33,'2.00',49,0),
+ (10410,59,'44.00',16,0),
+ (10411,41,'7.70',25,0.2),
+ (10411,44,'15.50',40,0.2),
+ (10411,59,'44.00',9,0.2),
+ (10412,14,'18.60',20,0.1),
+ (10413,1,'14.40',24,0),
+ (10413,62,'39.40',40,0),
+ (10413,76,'14.40',14,0),
+ (10414,19,'7.30',18,0.05),
+ (10414,33,'2.00',50,0),
+ (10415,17,'31.20',2,0),
+ (10415,33,'2.00',20,0),
+ (10416,19,'7.30',20,0),
+ (10416,53,'26.20',10,0),
+ (10416,57,'15.60',20,0),
+ (10417,38,'210.80',50,0),
+ (10417,46,'9.60',2,0.25),
+ (10417,68,'10.00',36,0.25),
+ (10417,77,'10.40',35,0),
+ (10418,2,'15.20',60,0),
+ (10418,47,'7.60',55,0),
+ (10418,61,'22.80',16,0),
+ (10418,74,'8.00',15,0),
+ (10419,60,'27.20',60,0.05),
+ (10419,69,'28.80',20,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10420,9,'77.60',20,0.1),
+ (10420,13,'4.80',2,0.1),
+ (10420,70,'12.00',8,0.1),
+ (10420,73,'12.00',20,0.1),
+ (10421,19,'7.30',4,0.15),
+ (10421,26,'24.90',30,0),
+ (10421,53,'26.20',15,0.15),
+ (10421,77,'10.40',10,0.15),
+ (10422,26,'24.90',2,0),
+ (10423,31,'10.00',14,0),
+ (10423,59,'44.00',20,0),
+ (10424,35,'14.40',60,0.2),
+ (10424,38,'210.80',49,0.2),
+ (10424,68,'10.00',30,0.2),
+ (10425,55,'19.20',10,0.25),
+ (10425,76,'14.40',20,0.25),
+ (10426,56,'30.40',5,0),
+ (10426,64,'26.60',7,0),
+ (10427,14,'18.60',35,0),
+ (10428,46,'9.60',20,0),
+ (10429,50,'13.00',40,0),
+ (10429,63,'35.10',35,0.25),
+ (10430,17,'31.20',45,0.2),
+ (10430,21,'8.00',50,0),
+ (10430,56,'30.40',30,0),
+ (10430,59,'44.00',70,0.2),
+ (10431,17,'31.20',50,0.25),
+ (10431,40,'14.70',50,0.25),
+ (10431,47,'7.60',30,0.25),
+ (10432,26,'24.90',10,0),
+ (10432,54,'5.90',40,0),
+ (10433,56,'30.40',28,0),
+ (10434,11,'16.80',6,0),
+ (10434,76,'14.40',18,0.15),
+ (10435,2,'15.20',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10435,22,'16.80',12,0),
+ (10435,72,'27.80',10,0),
+ (10436,46,'9.60',5,0),
+ (10436,56,'30.40',40,0.1),
+ (10436,64,'26.60',30,0.1),
+ (10436,75,'6.20',24,0.1),
+ (10437,53,'26.20',15,0),
+ (10438,19,'7.30',15,0.2),
+ (10438,34,'11.20',20,0.2),
+ (10438,57,'15.60',15,0.2),
+ (10439,12,'30.40',15,0),
+ (10439,16,'13.90',16,0),
+ (10439,64,'26.60',6,0),
+ (10439,74,'8.00',30,0),
+ (10440,2,'15.20',45,0.15),
+ (10440,16,'13.90',49,0.15),
+ (10440,29,'99.00',24,0.15),
+ (10440,61,'22.80',90,0.15),
+ (10441,27,'35.10',50,0),
+ (10442,11,'16.80',30,0),
+ (10442,54,'5.90',80,0),
+ (10442,66,'13.60',60,0),
+ (10443,11,'16.80',6,0.2),
+ (10443,28,'36.40',12,0),
+ (10444,17,'31.20',10,0),
+ (10444,26,'24.90',15,0),
+ (10444,35,'14.40',8,0),
+ (10444,41,'7.70',30,0),
+ (10445,39,'14.40',6,0),
+ (10445,54,'5.90',15,0),
+ (10446,19,'7.30',12,0.1),
+ (10446,24,'3.60',20,0.1),
+ (10446,31,'10.00',3,0.1),
+ (10446,52,'5.60',15,0.1),
+ (10447,19,'7.30',40,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10447,65,'16.80',35,0),
+ (10447,71,'17.20',2,0),
+ (10448,26,'24.90',6,0),
+ (10448,40,'14.70',20,0),
+ (10449,10,'24.80',14,0),
+ (10449,52,'5.60',20,0),
+ (10449,62,'39.40',35,0),
+ (10450,10,'24.80',20,0.2),
+ (10450,54,'5.90',6,0.2),
+ (10451,55,'19.20',120,0.1),
+ (10451,64,'26.60',35,0.1),
+ (10451,65,'16.80',28,0.1),
+ (10451,77,'10.40',55,0.1),
+ (10452,28,'36.40',15,0),
+ (10452,44,'15.50',100,0.05),
+ (10453,48,'10.20',15,0.1),
+ (10453,70,'12.00',25,0.1),
+ (10454,16,'13.90',20,0.2),
+ (10454,33,'2.00',20,0.2),
+ (10454,46,'9.60',10,0.2),
+ (10455,39,'14.40',20,0),
+ (10455,53,'26.20',50,0),
+ (10455,61,'22.80',25,0),
+ (10455,71,'17.20',30,0),
+ (10456,21,'8.00',40,0.15),
+ (10456,49,'16.00',21,0.15),
+ (10457,59,'44.00',36,0),
+ (10458,26,'24.90',30,0),
+ (10458,28,'36.40',30,0),
+ (10458,43,'36.80',20,0),
+ (10458,56,'30.40',15,0),
+ (10458,71,'17.20',50,0),
+ (10459,7,'24.00',16,0.05),
+ (10459,46,'9.60',20,0.05),
+ (10459,72,'27.80',40,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10460,68,'10.00',21,0.25),
+ (10460,75,'6.20',4,0.25),
+ (10461,21,'8.00',40,0.25),
+ (10461,30,'20.70',28,0.25),
+ (10461,55,'19.20',60,0.25),
+ (10462,13,'4.80',1,0),
+ (10462,23,'7.20',21,0),
+ (10463,19,'7.30',21,0),
+ (10463,42,'11.20',50,0),
+ (10464,4,'17.60',16,0.2),
+ (10464,43,'36.80',3,0),
+ (10464,56,'30.40',30,0.2),
+ (10464,60,'27.20',20,0),
+ (10465,24,'3.60',25,0),
+ (10465,29,'99.00',18,0.1),
+ (10465,40,'14.70',20,0),
+ (10465,45,'7.60',30,0.1),
+ (10465,50,'13.00',25,0),
+ (10466,11,'16.80',10,0),
+ (10466,46,'9.60',5,0),
+ (10467,24,'3.60',28,0),
+ (10467,25,'11.20',12,0),
+ (10468,30,'20.70',8,0),
+ (10468,43,'36.80',15,0),
+ (10469,2,'15.20',40,0.15),
+ (10469,16,'13.90',35,0.15),
+ (10469,44,'15.50',2,0.15),
+ (10470,18,'50.00',30,0),
+ (10470,23,'7.20',15,0),
+ (10470,64,'26.60',8,0),
+ (10471,7,'24.00',30,0),
+ (10471,56,'30.40',20,0),
+ (10472,24,'3.60',80,0.05),
+ (10472,51,'42.40',18,0),
+ (10473,33,'2.00',12,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10473,71,'17.20',12,0),
+ (10474,14,'18.60',12,0),
+ (10474,28,'36.40',18,0),
+ (10474,40,'14.70',21,0),
+ (10474,75,'6.20',10,0),
+ (10475,31,'10.00',35,0.15),
+ (10475,66,'13.60',60,0.15),
+ (10475,76,'14.40',42,0.15),
+ (10476,55,'19.20',2,0.05),
+ (10476,70,'12.00',12,0),
+ (10477,1,'14.40',15,0),
+ (10477,21,'8.00',21,0.25),
+ (10477,39,'14.40',20,0.25),
+ (10478,10,'24.80',20,0.05),
+ (10479,38,'210.80',30,0),
+ (10479,53,'26.20',28,0),
+ (10479,59,'44.00',60,0),
+ (10479,64,'26.60',30,0),
+ (10480,47,'7.60',30,0),
+ (10480,59,'44.00',12,0),
+ (10481,49,'16.00',24,0),
+ (10481,60,'27.20',40,0),
+ (10482,40,'14.70',10,0),
+ (10483,34,'11.20',35,0.05),
+ (10483,77,'10.40',30,0.05),
+ (10484,21,'8.00',14,0),
+ (10484,40,'14.70',10,0),
+ (10484,51,'42.40',3,0),
+ (10485,2,'15.20',20,0.1),
+ (10485,3,'8.00',20,0.1),
+ (10485,55,'19.20',30,0.1),
+ (10485,70,'12.00',60,0.1),
+ (10486,11,'16.80',5,0),
+ (10486,51,'42.40',25,0),
+ (10486,74,'8.00',16,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10487,19,'7.30',5,0),
+ (10487,26,'24.90',30,0),
+ (10487,54,'5.90',24,0.25),
+ (10488,59,'44.00',30,0),
+ (10488,73,'12.00',20,0.2),
+ (10489,11,'16.80',15,0.25),
+ (10489,16,'13.90',18,0),
+ (10490,59,'44.00',60,0),
+ (10490,68,'10.00',30,0),
+ (10490,75,'6.20',36,0),
+ (10491,44,'15.50',15,0.15),
+ (10491,77,'10.40',7,0.15),
+ (10492,25,'11.20',60,0.05),
+ (10492,42,'11.20',20,0.05),
+ (10493,65,'16.80',15,0.1),
+ (10493,66,'13.60',10,0.1),
+ (10493,69,'28.80',10,0.1),
+ (10494,56,'30.40',30,0),
+ (10495,23,'7.20',10,0),
+ (10495,41,'7.70',20,0),
+ (10495,77,'10.40',5,0),
+ (10496,31,'10.00',20,0.05),
+ (10497,56,'30.40',14,0),
+ (10497,72,'27.80',25,0),
+ (10497,77,'10.40',25,0),
+ (10498,24,'4.50',14,0),
+ (10498,40,'18.40',5,0),
+ (10498,42,'14.00',30,0),
+ (10499,28,'45.60',20,0),
+ (10499,49,'20.00',25,0),
+ (10500,15,'15.50',12,0.05),
+ (10500,28,'45.60',8,0.05),
+ (10501,54,'7.45',20,0),
+ (10502,45,'9.50',21,0),
+ (10502,53,'32.80',6,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10502,67,'14.00',30,0),
+ (10503,14,'23.25',70,0),
+ (10503,65,'21.05',20,0),
+ (10504,2,'19.00',12,0),
+ (10504,21,'10.00',12,0),
+ (10504,53,'32.80',10,0),
+ (10504,61,'28.50',25,0),
+ (10505,62,'49.30',3,0),
+ (10506,25,'14.00',18,0.1),
+ (10506,70,'15.00',14,0.1),
+ (10507,43,'46.00',15,0.15),
+ (10507,48,'12.75',15,0.15),
+ (10508,13,'6.00',10,0),
+ (10508,39,'18.00',10,0),
+ (10509,28,'45.60',3,0),
+ (10510,29,'123.79',36,0),
+ (10510,75,'7.75',36,0.1),
+ (10511,4,'22.00',50,0.15),
+ (10511,7,'30.00',50,0.15),
+ (10511,8,'40.00',10,0.15),
+ (10512,24,'4.50',10,0.15),
+ (10512,46,'12.00',9,0.15),
+ (10512,47,'9.50',6,0.15),
+ (10512,60,'34.00',12,0.15),
+ (10513,21,'10.00',40,0.2),
+ (10513,32,'32.00',50,0.2),
+ (10513,61,'28.50',15,0.2),
+ (10514,20,'81.00',39,0),
+ (10514,28,'45.60',35,0),
+ (10514,56,'38.00',70,0),
+ (10514,65,'21.05',39,0),
+ (10514,75,'7.75',50,0),
+ (10515,9,'97.00',16,0.15),
+ (10515,16,'17.45',50,0),
+ (10515,27,'43.90',120,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10515,33,'2.50',16,0.15),
+ (10515,60,'34.00',84,0.15),
+ (10516,18,'62.50',25,0.1),
+ (10516,41,'9.65',80,0.1),
+ (10516,42,'14.00',20,0),
+ (10517,52,'7.00',6,0),
+ (10517,59,'55.00',4,0),
+ (10517,70,'15.00',6,0),
+ (10518,24,'4.50',5,0),
+ (10518,38,'263.50',15,0),
+ (10518,44,'19.45',9,0),
+ (10519,10,'31.00',16,0.05),
+ (10519,56,'38.00',40,0),
+ (10519,60,'34.00',10,0.05),
+ (10520,24,'4.50',8,0),
+ (10520,53,'32.80',5,0),
+ (10521,35,'18.00',3,0),
+ (10521,41,'9.65',10,0),
+ (10521,68,'12.50',6,0),
+ (10522,1,'18.00',40,0.2),
+ (10522,8,'40.00',24,0),
+ (10522,30,'25.89',20,0.2),
+ (10522,40,'18.40',25,0.2),
+ (10523,17,'39.00',25,0.1),
+ (10523,20,'81.00',15,0.1),
+ (10523,37,'26.00',18,0.1),
+ (10523,41,'9.65',6,0.1),
+ (10524,10,'31.00',2,0),
+ (10524,30,'25.89',10,0),
+ (10524,43,'46.00',60,0),
+ (10524,54,'7.45',15,0),
+ (10525,36,'19.00',30,0),
+ (10525,40,'18.40',15,0.1),
+ (10526,1,'18.00',8,0.15),
+ (10526,13,'6.00',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10526,56,'38.00',30,0.15),
+ (10527,4,'22.00',50,0.1),
+ (10527,36,'19.00',30,0.1),
+ (10528,11,'21.00',3,0),
+ (10528,33,'2.50',8,0.2),
+ (10528,72,'34.80',9,0),
+ (10529,55,'24.00',14,0),
+ (10529,68,'12.50',20,0),
+ (10529,69,'36.00',10,0),
+ (10530,17,'39.00',40,0),
+ (10530,43,'46.00',25,0),
+ (10530,61,'28.50',20,0),
+ (10530,76,'18.00',50,0),
+ (10531,59,'55.00',2,0),
+ (10532,30,'25.89',15,0),
+ (10532,66,'17.00',24,0),
+ (10533,4,'22.00',50,0.05),
+ (10533,72,'34.80',24,0),
+ (10533,73,'15.00',24,0.05),
+ (10534,30,'25.89',10,0),
+ (10534,40,'18.40',10,0.2),
+ (10534,54,'7.45',10,0.2),
+ (10535,11,'21.00',50,0.1),
+ (10535,40,'18.40',10,0.1),
+ (10535,57,'19.50',5,0.1),
+ (10535,59,'55.00',15,0.1),
+ (10536,12,'38.00',15,0.25),
+ (10536,31,'12.50',20,0),
+ (10536,33,'2.50',30,0),
+ (10536,60,'34.00',35,0.25),
+ (10537,31,'12.50',30,0),
+ (10537,51,'53.00',6,0),
+ (10537,58,'13.25',20,0),
+ (10537,72,'34.80',21,0),
+ (10537,73,'15.00',9,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10538,70,'15.00',7,0),
+ (10538,72,'34.80',1,0),
+ (10539,13,'6.00',8,0),
+ (10539,21,'10.00',15,0),
+ (10539,33,'2.50',15,0),
+ (10539,49,'20.00',6,0),
+ (10540,3,'10.00',60,0),
+ (10540,26,'31.23',40,0),
+ (10540,38,'263.50',30,0),
+ (10540,68,'12.50',35,0),
+ (10541,24,'4.50',35,0.1),
+ (10541,38,'263.50',4,0.1),
+ (10541,65,'21.05',36,0.1),
+ (10541,71,'21.50',9,0.1),
+ (10542,11,'21.00',15,0.05),
+ (10542,54,'7.45',24,0.05),
+ (10543,12,'38.00',30,0.15),
+ (10543,23,'9.00',70,0.15),
+ (10544,28,'45.60',7,0),
+ (10544,67,'14.00',7,0),
+ (10545,11,'21.00',10,0),
+ (10546,7,'30.00',10,0),
+ (10546,35,'18.00',30,0),
+ (10546,62,'49.30',40,0),
+ (10547,32,'32.00',24,0.15),
+ (10547,36,'19.00',60,0),
+ (10548,34,'14.00',10,0.25),
+ (10548,41,'9.65',14,0),
+ (10549,31,'12.50',55,0.15),
+ (10549,45,'9.50',100,0.15),
+ (10549,51,'53.00',48,0.15),
+ (10550,17,'39.00',8,0.1),
+ (10550,19,'9.20',10,0),
+ (10550,21,'10.00',6,0.1),
+ (10550,61,'28.50',10,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10551,16,'17.45',40,0.15),
+ (10551,35,'18.00',20,0.15),
+ (10551,44,'19.45',40,0),
+ (10552,69,'36.00',18,0),
+ (10552,75,'7.75',30,0),
+ (10553,11,'21.00',15,0),
+ (10553,16,'17.45',14,0),
+ (10553,22,'21.00',24,0),
+ (10553,31,'12.50',30,0),
+ (10553,35,'18.00',6,0),
+ (10554,16,'17.45',30,0.05),
+ (10554,23,'9.00',20,0.05),
+ (10554,62,'49.30',20,0.05),
+ (10554,77,'13.00',10,0.05),
+ (10555,14,'23.25',30,0.2),
+ (10555,19,'9.20',35,0.2),
+ (10555,24,'4.50',18,0.2),
+ (10555,51,'53.00',20,0.2),
+ (10555,56,'38.00',40,0.2),
+ (10556,72,'34.80',24,0),
+ (10557,64,'33.25',30,0),
+ (10557,75,'7.75',20,0),
+ (10558,47,'9.50',25,0),
+ (10558,51,'53.00',20,0),
+ (10558,52,'7.00',30,0),
+ (10558,53,'32.80',18,0),
+ (10558,73,'15.00',3,0),
+ (10559,41,'9.65',12,0.05),
+ (10559,55,'24.00',18,0.05),
+ (10560,30,'25.89',20,0),
+ (10560,62,'49.30',15,0.25),
+ (10561,44,'19.45',10,0),
+ (10561,51,'53.00',50,0),
+ (10562,33,'2.50',20,0.1),
+ (10562,62,'49.30',10,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10563,36,'19.00',25,0),
+ (10563,52,'7.00',70,0),
+ (10564,17,'39.00',16,0.05),
+ (10564,31,'12.50',6,0.05),
+ (10564,55,'24.00',25,0.05),
+ (10565,24,'4.50',25,0.1),
+ (10565,64,'33.25',18,0.1),
+ (10566,11,'21.00',35,0.15),
+ (10566,18,'62.50',18,0.15),
+ (10566,76,'18.00',10,0),
+ (10567,31,'12.50',60,0.2),
+ (10567,51,'53.00',3,0),
+ (10567,59,'55.00',40,0.2),
+ (10568,10,'31.00',5,0),
+ (10569,31,'12.50',35,0.2),
+ (10569,76,'18.00',30,0),
+ (10570,11,'21.00',15,0.05),
+ (10570,56,'38.00',60,0.05),
+ (10571,14,'23.25',11,0.15),
+ (10571,42,'14.00',28,0.15),
+ (10572,16,'17.45',12,0.1),
+ (10572,32,'32.00',10,0.1),
+ (10572,40,'18.40',50,0),
+ (10572,75,'7.75',15,0.1),
+ (10573,17,'39.00',18,0),
+ (10573,34,'14.00',40,0),
+ (10573,53,'32.80',25,0),
+ (10574,33,'2.50',14,0),
+ (10574,40,'18.40',2,0),
+ (10574,62,'49.30',10,0),
+ (10574,64,'33.25',6,0),
+ (10575,59,'55.00',12,0),
+ (10575,63,'43.90',6,0),
+ (10575,72,'34.80',30,0),
+ (10575,76,'18.00',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10576,1,'18.00',10,0),
+ (10576,31,'12.50',20,0),
+ (10576,44,'19.45',21,0),
+ (10577,39,'18.00',10,0),
+ (10577,75,'7.75',20,0),
+ (10577,77,'13.00',18,0),
+ (10578,35,'18.00',20,0),
+ (10578,57,'19.50',6,0),
+ (10579,15,'15.50',10,0),
+ (10579,75,'7.75',21,0),
+ (10580,14,'23.25',15,0.05),
+ (10580,41,'9.65',9,0.05),
+ (10580,65,'21.05',30,0.05),
+ (10581,75,'7.75',50,0.2),
+ (10582,57,'19.50',4,0),
+ (10582,76,'18.00',14,0),
+ (10583,29,'123.79',10,0),
+ (10583,60,'34.00',24,0.15),
+ (10583,69,'36.00',10,0.15),
+ (10584,31,'12.50',50,0.05),
+ (10585,47,'9.50',15,0),
+ (10586,52,'7.00',4,0.15),
+ (10587,26,'31.23',6,0),
+ (10587,35,'18.00',20,0),
+ (10587,77,'13.00',20,0),
+ (10588,18,'62.50',40,0.2),
+ (10588,42,'14.00',100,0.2),
+ (10589,35,'18.00',4,0),
+ (10590,1,'18.00',20,0),
+ (10590,77,'13.00',60,0.05),
+ (10591,3,'10.00',14,0),
+ (10591,7,'30.00',10,0),
+ (10591,54,'7.45',50,0),
+ (10592,15,'15.50',25,0.05),
+ (10592,26,'31.23',5,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10593,20,'81.00',21,0.2),
+ (10593,69,'36.00',20,0.2),
+ (10593,76,'18.00',4,0.2),
+ (10594,52,'7.00',24,0),
+ (10594,58,'13.25',30,0),
+ (10595,35,'18.00',30,0.25),
+ (10595,61,'28.50',120,0.25),
+ (10595,69,'36.00',65,0.25),
+ (10596,56,'38.00',5,0.2),
+ (10596,63,'43.90',24,0.2),
+ (10596,75,'7.75',30,0.2),
+ (10597,24,'4.50',35,0.2),
+ (10597,57,'19.50',20,0),
+ (10597,65,'21.05',12,0.2),
+ (10598,27,'43.90',50,0),
+ (10598,71,'21.50',9,0),
+ (10599,62,'49.30',10,0),
+ (10600,54,'7.45',4,0),
+ (10600,73,'15.00',30,0),
+ (10601,13,'6.00',60,0),
+ (10601,59,'55.00',35,0),
+ (10602,77,'13.00',5,0.25),
+ (10603,22,'21.00',48,0),
+ (10603,49,'20.00',25,0.05),
+ (10604,48,'12.75',6,0.1),
+ (10604,76,'18.00',10,0.1),
+ (10605,16,'17.45',30,0.05),
+ (10605,59,'55.00',20,0.05),
+ (10605,60,'34.00',70,0.05),
+ (10605,71,'21.50',15,0.05),
+ (10606,4,'22.00',20,0.2),
+ (10606,55,'24.00',20,0.2),
+ (10606,62,'49.30',10,0.2),
+ (10607,7,'30.00',45,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10607,17,'39.00',100,0),
+ (10607,33,'2.50',14,0),
+ (10607,40,'18.40',42,0),
+ (10607,72,'34.80',12,0),
+ (10608,56,'38.00',28,0),
+ (10609,1,'18.00',3,0),
+ (10609,10,'31.00',10,0),
+ (10609,21,'10.00',6,0),
+ (10610,36,'19.00',21,0.25),
+ (10611,1,'18.00',6,0),
+ (10611,2,'19.00',10,0),
+ (10611,60,'34.00',15,0),
+ (10612,10,'31.00',70,0),
+ (10612,36,'19.00',55,0),
+ (10612,49,'20.00',18,0),
+ (10612,60,'34.00',40,0),
+ (10612,76,'18.00',80,0),
+ (10613,13,'6.00',8,0.1),
+ (10613,75,'7.75',40,0),
+ (10614,11,'21.00',14,0),
+ (10614,21,'10.00',8,0),
+ (10614,39,'18.00',5,0),
+ (10615,55,'24.00',5,0),
+ (10616,38,'263.50',15,0.05),
+ (10616,56,'38.00',14,0),
+ (10616,70,'15.00',15,0.05),
+ (10616,71,'21.50',15,0.05),
+ (10617,59,'55.00',30,0.15),
+ (10618,6,'25.00',70,0),
+ (10618,56,'38.00',20,0),
+ (10618,68,'12.50',15,0),
+ (10619,21,'10.00',42,0),
+ (10619,22,'21.00',40,0),
+ (10620,24,'4.50',5,0),
+ (10620,52,'7.00',5,0),
+ (10621,19,'9.20',5,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10621,23,'9.00',10,0),
+ (10621,70,'15.00',20,0),
+ (10621,71,'21.50',15,0),
+ (10622,2,'19.00',20,0),
+ (10622,68,'12.50',18,0.2),
+ (10623,14,'23.25',21,0),
+ (10623,19,'9.20',15,0.1),
+ (10623,21,'10.00',25,0.1),
+ (10623,24,'4.50',3,0),
+ (10623,35,'18.00',30,0.1),
+ (10624,28,'45.60',10,0),
+ (10624,29,'123.79',6,0),
+ (10624,44,'19.45',10,0),
+ (10625,14,'23.25',3,0),
+ (10625,42,'14.00',5,0),
+ (10625,60,'34.00',10,0),
+ (10626,53,'32.80',12,0),
+ (10626,60,'34.00',20,0),
+ (10626,71,'21.50',20,0),
+ (10627,62,'49.30',15,0),
+ (10627,73,'15.00',35,0.15),
+ (10628,1,'18.00',25,0),
+ (10629,29,'123.79',20,0),
+ (10629,64,'33.25',9,0),
+ (10630,55,'24.00',12,0.05),
+ (10630,76,'18.00',35,0),
+ (10631,75,'7.75',8,0.1),
+ (10632,2,'19.00',30,0.05),
+ (10632,33,'2.50',20,0.05),
+ (10633,12,'38.00',36,0.15),
+ (10633,13,'6.00',13,0.15),
+ (10633,26,'31.23',35,0.15),
+ (10633,62,'49.30',80,0.15),
+ (10634,7,'30.00',35,0),
+ (10634,18,'62.50',50,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10634,51,'53.00',15,0),
+ (10634,75,'7.75',2,0),
+ (10635,4,'22.00',10,0.1),
+ (10635,5,'21.35',15,0.1),
+ (10635,22,'21.00',40,0),
+ (10636,4,'22.00',25,0),
+ (10636,58,'13.25',6,0),
+ (10637,11,'21.00',10,0),
+ (10637,50,'16.25',25,0.05),
+ (10637,56,'38.00',60,0.05),
+ (10638,45,'9.50',20,0),
+ (10638,65,'21.05',21,0),
+ (10638,72,'34.80',60,0),
+ (10639,18,'62.50',8,0),
+ (10640,69,'36.00',20,0.25),
+ (10640,70,'15.00',15,0.25),
+ (10641,2,'19.00',50,0),
+ (10641,40,'18.40',60,0),
+ (10642,21,'10.00',30,0.2),
+ (10642,61,'28.50',20,0.2),
+ (10643,28,'45.60',15,0.25),
+ (10643,39,'18.00',21,0.25),
+ (10643,46,'12.00',2,0.25),
+ (10644,18,'62.50',4,0.1),
+ (10644,43,'46.00',20,0),
+ (10644,46,'12.00',21,0.1),
+ (10645,18,'62.50',20,0),
+ (10645,36,'19.00',15,0),
+ (10646,1,'18.00',15,0.25),
+ (10646,10,'31.00',18,0.25),
+ (10646,71,'21.50',30,0.25),
+ (10646,77,'13.00',35,0.25),
+ (10647,19,'9.20',30,0),
+ (10647,39,'18.00',20,0),
+ (10648,22,'21.00',15,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10648,24,'4.50',15,0.15),
+ (10649,28,'45.60',20,0),
+ (10649,72,'34.80',15,0),
+ (10650,30,'25.89',30,0),
+ (10650,53,'32.80',25,0.05),
+ (10650,54,'7.45',30,0),
+ (10651,19,'9.20',12,0.25),
+ (10651,22,'21.00',20,0.25),
+ (10652,30,'25.89',2,0.25),
+ (10652,42,'14.00',20,0),
+ (10653,16,'17.45',30,0.1),
+ (10653,60,'34.00',20,0.1),
+ (10654,4,'22.00',12,0.1),
+ (10654,39,'18.00',20,0.1),
+ (10654,54,'7.45',6,0.1),
+ (10655,41,'9.65',20,0.2),
+ (10656,14,'23.25',3,0.1),
+ (10656,44,'19.45',28,0.1),
+ (10656,47,'9.50',6,0.1),
+ (10657,15,'15.50',50,0),
+ (10657,41,'9.65',24,0),
+ (10657,46,'12.00',45,0),
+ (10657,47,'9.50',10,0),
+ (10657,56,'38.00',45,0),
+ (10657,60,'34.00',30,0),
+ (10658,21,'10.00',60,0),
+ (10658,40,'18.40',70,0.05),
+ (10658,60,'34.00',55,0.05),
+ (10658,77,'13.00',70,0.05),
+ (10659,31,'12.50',20,0.05),
+ (10659,40,'18.40',24,0.05),
+ (10659,70,'15.00',40,0.05),
+ (10660,20,'81.00',21,0),
+ (10661,39,'18.00',3,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10661,58,'13.25',49,0.2),
+ (10662,68,'12.50',10,0),
+ (10663,40,'18.40',30,0.05),
+ (10663,42,'14.00',30,0.05),
+ (10663,51,'53.00',20,0.05),
+ (10664,10,'31.00',24,0.15),
+ (10664,56,'38.00',12,0.15),
+ (10664,65,'21.05',15,0.15),
+ (10665,51,'53.00',20,0),
+ (10665,59,'55.00',1,0),
+ (10665,76,'18.00',10,0),
+ (10666,29,'123.79',36,0),
+ (10666,65,'21.05',10,0),
+ (10667,69,'36.00',45,0.2),
+ (10667,71,'21.50',14,0.2),
+ (10668,31,'12.50',8,0.1),
+ (10668,55,'24.00',4,0.1),
+ (10668,64,'33.25',15,0.1),
+ (10669,36,'19.00',30,0),
+ (10670,23,'9.00',32,0),
+ (10670,46,'12.00',60,0),
+ (10670,67,'14.00',25,0),
+ (10670,73,'15.00',50,0),
+ (10670,75,'7.75',25,0),
+ (10671,16,'17.45',10,0),
+ (10671,62,'49.30',10,0),
+ (10671,65,'21.05',12,0),
+ (10672,38,'263.50',15,0.1),
+ (10672,71,'21.50',12,0),
+ (10673,16,'17.45',3,0),
+ (10673,42,'14.00',6,0),
+ (10673,43,'46.00',6,0),
+ (10674,23,'9.00',5,0),
+ (10675,14,'23.25',30,0),
+ (10675,53,'32.80',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10675,58,'13.25',30,0),
+ (10676,10,'31.00',2,0),
+ (10676,19,'9.20',7,0),
+ (10676,44,'19.45',21,0),
+ (10677,26,'31.23',30,0.15),
+ (10677,33,'2.50',8,0.15),
+ (10678,12,'38.00',100,0),
+ (10678,33,'2.50',30,0),
+ (10678,41,'9.65',120,0),
+ (10678,54,'7.45',30,0),
+ (10679,59,'55.00',12,0),
+ (10680,16,'17.45',50,0.25),
+ (10680,31,'12.50',20,0.25),
+ (10680,42,'14.00',40,0.25),
+ (10681,19,'9.20',30,0.1),
+ (10681,21,'10.00',12,0.1),
+ (10681,64,'33.25',28,0),
+ (10682,33,'2.50',30,0),
+ (10682,66,'17.00',4,0),
+ (10682,75,'7.75',30,0),
+ (10683,52,'7.00',9,0),
+ (10684,40,'18.40',20,0),
+ (10684,47,'9.50',40,0),
+ (10684,60,'34.00',30,0),
+ (10685,10,'31.00',20,0),
+ (10685,41,'9.65',4,0),
+ (10685,47,'9.50',15,0),
+ (10686,17,'39.00',30,0.2),
+ (10686,26,'31.23',15,0),
+ (10687,9,'97.00',50,0.25),
+ (10687,29,'123.79',10,0),
+ (10687,36,'19.00',6,0.25),
+ (10688,10,'31.00',18,0.1),
+ (10688,28,'45.60',60,0.1),
+ (10688,34,'14.00',14,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10689,1,'18.00',35,0.25),
+ (10690,56,'38.00',20,0.25),
+ (10690,77,'13.00',30,0.25),
+ (10691,1,'18.00',30,0),
+ (10691,29,'123.79',40,0),
+ (10691,43,'46.00',40,0),
+ (10691,44,'19.45',24,0),
+ (10691,62,'49.30',48,0),
+ (10692,63,'43.90',20,0),
+ (10693,9,'97.00',6,0),
+ (10693,54,'7.45',60,0.15),
+ (10693,69,'36.00',30,0.15),
+ (10693,73,'15.00',15,0.15),
+ (10694,7,'30.00',90,0),
+ (10694,59,'55.00',25,0),
+ (10694,70,'15.00',50,0),
+ (10695,8,'40.00',10,0),
+ (10695,12,'38.00',4,0),
+ (10695,24,'4.50',20,0),
+ (10696,17,'39.00',20,0),
+ (10696,46,'12.00',18,0),
+ (10697,19,'9.20',7,0.25),
+ (10697,35,'18.00',9,0.25),
+ (10697,58,'13.25',30,0.25),
+ (10697,70,'15.00',30,0.25),
+ (10698,11,'21.00',15,0),
+ (10698,17,'39.00',8,0.05),
+ (10698,29,'123.79',12,0.05),
+ (10698,65,'21.05',65,0.05),
+ (10698,70,'15.00',8,0.05),
+ (10699,47,'9.50',12,0),
+ (10700,1,'18.00',5,0.2),
+ (10700,34,'14.00',12,0.2),
+ (10700,68,'12.50',40,0.2),
+ (10700,71,'21.50',60,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10701,59,'55.00',42,0.15),
+ (10701,71,'21.50',20,0.15),
+ (10701,76,'18.00',35,0.15),
+ (10702,3,'10.00',6,0),
+ (10702,76,'18.00',15,0),
+ (10703,2,'19.00',5,0),
+ (10703,59,'55.00',35,0),
+ (10703,73,'15.00',35,0),
+ (10704,4,'22.00',6,0),
+ (10704,24,'4.50',35,0),
+ (10704,48,'12.75',24,0),
+ (10705,31,'12.50',20,0),
+ (10705,32,'32.00',4,0),
+ (10706,16,'17.45',20,0),
+ (10706,43,'46.00',24,0),
+ (10706,59,'55.00',8,0),
+ (10707,55,'24.00',21,0),
+ (10707,57,'19.50',40,0),
+ (10707,70,'15.00',28,0.15),
+ (10708,5,'21.35',4,0),
+ (10708,36,'19.00',5,0),
+ (10709,8,'40.00',40,0),
+ (10709,51,'53.00',28,0),
+ (10709,60,'34.00',10,0),
+ (10710,19,'9.20',5,0),
+ (10710,47,'9.50',5,0),
+ (10711,19,'9.20',12,0),
+ (10711,41,'9.65',42,0),
+ (10711,53,'32.80',120,0),
+ (10712,53,'32.80',3,0.05),
+ (10712,56,'38.00',30,0),
+ (10713,10,'31.00',18,0),
+ (10713,26,'31.23',30,0),
+ (10713,45,'9.50',110,0),
+ (10713,46,'12.00',24,0),
+ (10714,2,'19.00',30,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10714,17,'39.00',27,0.25),
+ (10714,47,'9.50',50,0.25),
+ (10714,56,'38.00',18,0.25),
+ (10714,58,'13.25',12,0.25),
+ (10715,10,'31.00',21,0),
+ (10715,71,'21.50',30,0),
+ (10716,21,'10.00',5,0),
+ (10716,51,'53.00',7,0),
+ (10716,61,'28.50',10,0),
+ (10717,21,'10.00',32,0.05),
+ (10717,54,'7.45',15,0),
+ (10717,69,'36.00',25,0.05),
+ (10718,12,'38.00',36,0),
+ (10718,16,'17.45',20,0),
+ (10718,36,'19.00',40,0),
+ (10718,62,'49.30',20,0),
+ (10719,18,'62.50',12,0.25),
+ (10719,30,'25.89',3,0.25),
+ (10719,54,'7.45',40,0.25),
+ (10720,35,'18.00',21,0),
+ (10720,71,'21.50',8,0),
+ (10721,44,'19.45',50,0.05),
+ (10722,2,'19.00',3,0),
+ (10722,31,'12.50',50,0),
+ (10722,68,'12.50',45,0),
+ (10722,75,'7.75',42,0),
+ (10723,26,'31.23',15,0),
+ (10724,10,'31.00',16,0),
+ (10724,61,'28.50',5,0),
+ (10725,41,'9.65',12,0),
+ (10725,52,'7.00',4,0),
+ (10725,55,'24.00',6,0),
+ (10726,4,'22.00',25,0),
+ (10726,11,'21.00',5,0),
+ (10727,17,'39.00',20,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10727,56,'38.00',10,0.05),
+ (10727,59,'55.00',10,0.05),
+ (10728,30,'25.89',15,0),
+ (10728,40,'18.40',6,0),
+ (10728,55,'24.00',12,0),
+ (10728,60,'34.00',15,0),
+ (10729,1,'18.00',50,0),
+ (10729,21,'10.00',30,0),
+ (10729,50,'16.25',40,0),
+ (10730,16,'17.45',15,0.05),
+ (10730,31,'12.50',3,0.05),
+ (10730,65,'21.05',10,0.05),
+ (10731,21,'10.00',40,0.05),
+ (10731,51,'53.00',30,0.05),
+ (10732,76,'18.00',20,0),
+ (10733,14,'23.25',16,0),
+ (10733,28,'45.60',20,0),
+ (10733,52,'7.00',25,0),
+ (10734,6,'25.00',30,0),
+ (10734,30,'25.89',15,0),
+ (10734,76,'18.00',20,0),
+ (10735,61,'28.50',20,0.1),
+ (10735,77,'13.00',2,0.1),
+ (10736,65,'21.05',40,0),
+ (10736,75,'7.75',20,0),
+ (10737,13,'6.00',4,0),
+ (10737,41,'9.65',12,0),
+ (10738,16,'17.45',3,0),
+ (10739,36,'19.00',6,0),
+ (10739,52,'7.00',18,0),
+ (10740,28,'45.60',5,0.2),
+ (10740,35,'18.00',35,0.2),
+ (10740,45,'9.50',40,0.2),
+ (10740,56,'38.00',14,0.2),
+ (10741,2,'19.00',15,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10742,3,'10.00',20,0),
+ (10742,60,'34.00',50,0),
+ (10742,72,'34.80',35,0),
+ (10743,46,'12.00',28,0.05),
+ (10744,40,'18.40',50,0.2),
+ (10745,18,'62.50',24,0),
+ (10745,44,'19.45',16,0),
+ (10745,59,'55.00',45,0),
+ (10745,72,'34.80',7,0),
+ (10746,13,'6.00',6,0),
+ (10746,42,'14.00',28,0),
+ (10746,62,'49.30',9,0),
+ (10746,69,'36.00',40,0),
+ (10747,31,'12.50',8,0),
+ (10747,41,'9.65',35,0),
+ (10747,63,'43.90',9,0),
+ (10747,69,'36.00',30,0),
+ (10748,23,'9.00',44,0),
+ (10748,40,'18.40',40,0),
+ (10748,56,'38.00',28,0),
+ (10749,56,'38.00',15,0),
+ (10749,59,'55.00',6,0),
+ (10749,76,'18.00',10,0),
+ (10750,14,'23.25',5,0.15),
+ (10750,45,'9.50',40,0.15),
+ (10750,59,'55.00',25,0.15),
+ (10751,26,'31.23',12,0.1),
+ (10751,30,'25.89',30,0),
+ (10751,50,'16.25',20,0.1),
+ (10751,73,'15.00',15,0),
+ (10752,1,'18.00',8,0),
+ (10752,69,'36.00',3,0),
+ (10753,45,'9.50',4,0),
+ (10753,74,'10.00',5,0),
+ (10754,40,'18.40',3,0),
+ (10755,47,'9.50',30,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10755,56,'38.00',30,0.25),
+ (10755,57,'19.50',14,0.25),
+ (10755,69,'36.00',25,0.25),
+ (10756,18,'62.50',21,0.2),
+ (10756,36,'19.00',20,0.2),
+ (10756,68,'12.50',6,0.2),
+ (10756,69,'36.00',20,0.2),
+ (10757,34,'14.00',30,0),
+ (10757,59,'55.00',7,0),
+ (10757,62,'49.30',30,0),
+ (10757,64,'33.25',24,0),
+ (10758,26,'31.23',20,0),
+ (10758,52,'7.00',60,0),
+ (10758,70,'15.00',40,0),
+ (10759,32,'32.00',10,0),
+ (10760,25,'14.00',12,0.25),
+ (10760,27,'43.90',40,0),
+ (10760,43,'46.00',30,0.25),
+ (10761,25,'14.00',35,0.25),
+ (10761,75,'7.75',18,0),
+ (10762,39,'18.00',16,0),
+ (10762,47,'9.50',30,0),
+ (10762,51,'53.00',28,0),
+ (10762,56,'38.00',60,0),
+ (10763,21,'10.00',40,0),
+ (10763,22,'21.00',6,0),
+ (10763,24,'4.50',20,0),
+ (10764,3,'10.00',20,0.1),
+ (10764,39,'18.00',130,0.1),
+ (10765,65,'21.05',80,0.1),
+ (10766,2,'19.00',40,0),
+ (10766,7,'30.00',35,0),
+ (10766,68,'12.50',40,0),
+ (10767,42,'14.00',2,0),
+ (10768,22,'21.00',4,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10768,31,'12.50',50,0),
+ (10768,60,'34.00',15,0),
+ (10768,71,'21.50',12,0),
+ (10769,41,'9.65',30,0.05),
+ (10769,52,'7.00',15,0.05),
+ (10769,61,'28.50',20,0),
+ (10769,62,'49.30',15,0),
+ (10770,11,'21.00',15,0.25),
+ (10771,71,'21.50',16,0),
+ (10772,29,'123.79',18,0),
+ (10772,59,'55.00',25,0),
+ (10773,17,'39.00',33,0),
+ (10773,31,'12.50',70,0.2),
+ (10773,75,'7.75',7,0.2),
+ (10774,31,'12.50',2,0.25),
+ (10774,66,'17.00',50,0),
+ (10775,10,'31.00',6,0),
+ (10775,67,'14.00',3,0),
+ (10776,31,'12.50',16,0.05),
+ (10776,42,'14.00',12,0.05),
+ (10776,45,'9.50',27,0.05),
+ (10776,51,'53.00',120,0.05),
+ (10777,42,'14.00',20,0.2),
+ (10778,41,'9.65',10,0),
+ (10779,16,'17.45',20,0),
+ (10779,62,'49.30',20,0),
+ (10780,70,'15.00',35,0),
+ (10780,77,'13.00',15,0),
+ (10781,54,'7.45',3,0.2),
+ (10781,56,'38.00',20,0.2),
+ (10781,74,'10.00',35,0),
+ (10782,31,'12.50',1,0),
+ (10783,31,'12.50',10,0),
+ (10783,38,'263.50',5,0),
+ (10784,36,'19.00',30,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10784,39,'18.00',2,0.15),
+ (10784,72,'34.80',30,0.15),
+ (10785,10,'31.00',10,0),
+ (10785,75,'7.75',10,0),
+ (10786,8,'40.00',30,0.2),
+ (10786,30,'25.89',15,0.2),
+ (10786,75,'7.75',42,0.2),
+ (10787,2,'19.00',15,0.05),
+ (10787,29,'123.79',20,0.05),
+ (10788,19,'9.20',50,0.05),
+ (10788,75,'7.75',40,0.05),
+ (10789,18,'62.50',30,0),
+ (10789,35,'18.00',15,0),
+ (10789,63,'43.90',30,0),
+ (10789,68,'12.50',18,0),
+ (10790,7,'30.00',3,0.15),
+ (10790,56,'38.00',20,0.15),
+ (10791,29,'123.79',14,0.05),
+ (10791,41,'9.65',20,0.05),
+ (10792,2,'19.00',10,0),
+ (10792,54,'7.45',3,0),
+ (10792,68,'12.50',15,0),
+ (10793,41,'9.65',14,0),
+ (10793,52,'7.00',8,0),
+ (10794,14,'23.25',15,0.2),
+ (10794,54,'7.45',6,0.2),
+ (10795,16,'17.45',65,0),
+ (10795,17,'39.00',35,0.25),
+ (10796,26,'31.23',21,0.2),
+ (10796,44,'19.45',10,0),
+ (10796,64,'33.25',35,0.2),
+ (10796,69,'36.00',24,0.2),
+ (10797,11,'21.00',20,0),
+ (10798,62,'49.30',2,0),
+ (10798,72,'34.80',10,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10799,13,'6.00',20,0.15),
+ (10799,24,'4.50',20,0.15),
+ (10799,59,'55.00',25,0),
+ (10800,11,'21.00',50,0.1),
+ (10800,51,'53.00',10,0.1),
+ (10800,54,'7.45',7,0.1),
+ (10801,17,'39.00',40,0.25),
+ (10801,29,'123.79',20,0.25),
+ (10802,30,'25.89',25,0.25),
+ (10802,51,'53.00',30,0.25),
+ (10802,55,'24.00',60,0.25),
+ (10802,62,'49.30',5,0.25),
+ (10803,19,'9.20',24,0.05),
+ (10803,25,'14.00',15,0.05),
+ (10803,59,'55.00',15,0.05),
+ (10804,10,'31.00',36,0),
+ (10804,28,'45.60',24,0),
+ (10804,49,'20.00',4,0.15),
+ (10805,34,'14.00',10,0),
+ (10805,38,'263.50',10,0),
+ (10806,2,'19.00',20,0.25),
+ (10806,65,'21.05',2,0),
+ (10806,74,'10.00',15,0.25),
+ (10807,40,'18.40',1,0),
+ (10808,56,'38.00',20,0.15),
+ (10808,76,'18.00',50,0.15),
+ (10809,52,'7.00',20,0),
+ (10810,13,'6.00',7,0),
+ (10810,25,'14.00',5,0),
+ (10810,70,'15.00',5,0),
+ (10811,19,'9.20',15,0),
+ (10811,23,'9.00',18,0),
+ (10811,40,'18.40',30,0),
+ (10812,31,'12.50',16,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10812,72,'34.80',40,0.1),
+ (10812,77,'13.00',20,0),
+ (10813,2,'19.00',12,0.2),
+ (10813,46,'12.00',35,0),
+ (10814,41,'9.65',20,0),
+ (10814,43,'46.00',20,0.15),
+ (10814,48,'12.75',8,0.15),
+ (10814,61,'28.50',30,0.15),
+ (10815,33,'2.50',16,0),
+ (10816,38,'263.50',30,0.05),
+ (10816,62,'49.30',20,0.05),
+ (10817,26,'31.23',40,0.15),
+ (10817,38,'263.50',30,0),
+ (10817,40,'18.40',60,0.15),
+ (10817,62,'49.30',25,0.15),
+ (10818,32,'32.00',20,0),
+ (10818,41,'9.65',20,0),
+ (10819,43,'46.00',7,0),
+ (10819,75,'7.75',20,0),
+ (10820,56,'38.00',30,0),
+ (10821,35,'18.00',20,0),
+ (10821,51,'53.00',6,0),
+ (10822,62,'49.30',3,0),
+ (10822,70,'15.00',6,0),
+ (10823,11,'21.00',20,0.1),
+ (10823,57,'19.50',15,0),
+ (10823,59,'55.00',40,0.1),
+ (10823,77,'13.00',15,0.1),
+ (10824,41,'9.65',12,0),
+ (10824,70,'15.00',9,0),
+ (10825,26,'31.23',12,0),
+ (10825,53,'32.80',20,0),
+ (10826,31,'12.50',35,0),
+ (10826,57,'19.50',15,0),
+ (10827,10,'31.00',15,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10827,39,'18.00',21,0),
+ (10828,20,'81.00',5,0),
+ (10828,38,'263.50',2,0),
+ (10829,2,'19.00',10,0),
+ (10829,8,'40.00',20,0),
+ (10829,13,'6.00',10,0),
+ (10829,60,'34.00',21,0),
+ (10830,6,'25.00',6,0),
+ (10830,39,'18.00',28,0),
+ (10830,60,'34.00',30,0),
+ (10830,68,'12.50',24,0),
+ (10831,19,'9.20',2,0),
+ (10831,35,'18.00',8,0),
+ (10831,38,'263.50',8,0),
+ (10831,43,'46.00',9,0),
+ (10832,13,'6.00',3,0.2),
+ (10832,25,'14.00',10,0.2),
+ (10832,44,'19.45',16,0.2),
+ (10832,64,'33.25',3,0),
+ (10833,7,'30.00',20,0.1),
+ (10833,31,'12.50',9,0.1),
+ (10833,53,'32.80',9,0.1),
+ (10834,29,'123.79',8,0.05),
+ (10834,30,'25.89',20,0.05),
+ (10835,59,'55.00',15,0),
+ (10835,77,'13.00',2,0.2),
+ (10836,22,'21.00',52,0),
+ (10836,35,'18.00',6,0),
+ (10836,57,'19.50',24,0),
+ (10836,60,'34.00',60,0),
+ (10836,64,'33.25',30,0),
+ (10837,13,'6.00',6,0),
+ (10837,40,'18.40',25,0),
+ (10837,47,'9.50',40,0.25),
+ (10837,76,'18.00',21,0.25),
+ (10838,1,'18.00',4,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10838,18,'62.50',25,0.25),
+ (10838,36,'19.00',50,0.25),
+ (10839,58,'13.25',30,0.1),
+ (10839,72,'34.80',15,0.1),
+ (10840,25,'14.00',6,0.2),
+ (10840,39,'18.00',10,0.2),
+ (10841,10,'31.00',16,0),
+ (10841,56,'38.00',30,0),
+ (10841,59,'55.00',50,0),
+ (10841,77,'13.00',15,0),
+ (10842,11,'21.00',15,0),
+ (10842,43,'46.00',5,0),
+ (10842,68,'12.50',20,0),
+ (10842,70,'15.00',12,0),
+ (10843,51,'53.00',4,0.25),
+ (10844,22,'21.00',35,0),
+ (10845,23,'9.00',70,0.1),
+ (10845,35,'18.00',25,0.1),
+ (10845,42,'14.00',42,0.1),
+ (10845,58,'13.25',60,0.1),
+ (10845,64,'33.25',48,0),
+ (10846,4,'22.00',21,0),
+ (10846,70,'15.00',30,0),
+ (10846,74,'10.00',20,0),
+ (10847,1,'18.00',80,0.2),
+ (10847,19,'9.20',12,0.2),
+ (10847,37,'26.00',60,0.2),
+ (10847,45,'9.50',36,0.2),
+ (10847,60,'34.00',45,0.2),
+ (10847,71,'21.50',55,0.2),
+ (10848,5,'21.35',30,0),
+ (10848,9,'97.00',3,0),
+ (10849,3,'10.00',49,0),
+ (10849,26,'31.23',18,0.15),
+ (10850,25,'14.00',20,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10850,33,'2.50',4,0.15),
+ (10850,70,'15.00',30,0.15),
+ (10851,2,'19.00',5,0.05),
+ (10851,25,'14.00',10,0.05),
+ (10851,57,'19.50',10,0.05),
+ (10851,59,'55.00',42,0.05),
+ (10852,2,'19.00',15,0),
+ (10852,17,'39.00',6,0),
+ (10852,62,'49.30',50,0),
+ (10853,18,'62.50',10,0),
+ (10854,10,'31.00',100,0.15),
+ (10854,13,'6.00',65,0.15),
+ (10855,16,'17.45',50,0),
+ (10855,31,'12.50',14,0),
+ (10855,56,'38.00',24,0),
+ (10855,65,'21.05',15,0.15),
+ (10856,2,'19.00',20,0),
+ (10856,42,'14.00',20,0),
+ (10857,3,'10.00',30,0),
+ (10857,26,'31.23',35,0.25),
+ (10857,29,'123.79',10,0.25),
+ (10858,7,'30.00',5,0),
+ (10858,27,'43.90',10,0),
+ (10858,70,'15.00',4,0),
+ (10859,24,'4.50',40,0.25),
+ (10859,54,'7.45',35,0.25),
+ (10859,64,'33.25',30,0.25),
+ (10860,51,'53.00',3,0),
+ (10860,76,'18.00',20,0),
+ (10861,17,'39.00',42,0),
+ (10861,18,'62.50',20,0),
+ (10861,21,'10.00',40,0),
+ (10861,33,'2.50',35,0),
+ (10861,62,'49.30',3,0),
+ (10862,11,'21.00',25,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10862,52,'7.00',8,0),
+ (10863,1,'18.00',20,0.15),
+ (10863,58,'13.25',12,0.15),
+ (10864,35,'18.00',4,0),
+ (10864,67,'14.00',15,0),
+ (10865,38,'263.50',60,0.05),
+ (10865,39,'18.00',80,0.05),
+ (10866,2,'19.00',21,0.25),
+ (10866,24,'4.50',6,0.25),
+ (10866,30,'25.89',40,0.25),
+ (10867,53,'32.80',3,0),
+ (10868,26,'31.23',20,0),
+ (10868,35,'18.00',30,0),
+ (10868,49,'20.00',42,0.1),
+ (10869,1,'18.00',40,0),
+ (10869,11,'21.00',10,0),
+ (10869,23,'9.00',50,0),
+ (10869,68,'12.50',20,0),
+ (10870,35,'18.00',3,0),
+ (10870,51,'53.00',2,0),
+ (10871,6,'25.00',50,0.05),
+ (10871,16,'17.45',12,0.05),
+ (10871,17,'39.00',16,0.05),
+ (10872,55,'24.00',10,0.05),
+ (10872,62,'49.30',20,0.05),
+ (10872,64,'33.25',15,0.05),
+ (10872,65,'21.05',21,0.05),
+ (10873,21,'10.00',20,0),
+ (10873,28,'45.60',3,0),
+ (10874,10,'31.00',10,0),
+ (10875,19,'9.20',25,0),
+ (10875,47,'9.50',21,0.1),
+ (10875,49,'20.00',15,0),
+ (10876,46,'12.00',21,0),
+ (10876,64,'33.25',20,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10877,16,'17.45',30,0.25),
+ (10877,18,'62.50',25,0),
+ (10878,20,'81.00',20,0.05),
+ (10879,40,'18.40',12,0),
+ (10879,65,'21.05',10,0),
+ (10879,76,'18.00',10,0),
+ (10880,23,'9.00',30,0.2),
+ (10880,61,'28.50',30,0.2),
+ (10880,70,'15.00',50,0.2),
+ (10881,73,'15.00',10,0),
+ (10882,42,'14.00',25,0),
+ (10882,49,'20.00',20,0.15),
+ (10882,54,'7.45',32,0.15),
+ (10883,24,'4.50',8,0),
+ (10884,21,'10.00',40,0.05),
+ (10884,56,'38.00',21,0.05),
+ (10884,65,'21.05',12,0.05),
+ (10885,2,'19.00',20,0),
+ (10885,24,'4.50',12,0),
+ (10885,70,'15.00',30,0),
+ (10885,77,'13.00',25,0),
+ (10886,10,'31.00',70,0),
+ (10886,31,'12.50',35,0),
+ (10886,77,'13.00',40,0),
+ (10887,25,'14.00',5,0),
+ (10888,2,'19.00',20,0),
+ (10888,68,'12.50',18,0),
+ (10889,11,'21.00',40,0),
+ (10889,38,'263.50',40,0),
+ (10890,17,'39.00',15,0),
+ (10890,34,'14.00',10,0),
+ (10890,41,'9.65',14,0),
+ (10891,30,'25.89',15,0.05),
+ (10892,59,'55.00',40,0.05),
+ (10893,8,'40.00',30,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10893,24,'4.50',10,0),
+ (10893,29,'123.79',24,0),
+ (10893,30,'25.89',35,0),
+ (10893,36,'19.00',20,0),
+ (10894,13,'6.00',28,0.05),
+ (10894,69,'36.00',50,0.05),
+ (10894,75,'7.75',120,0.05),
+ (10895,24,'4.50',110,0),
+ (10895,39,'18.00',45,0),
+ (10895,40,'18.40',91,0),
+ (10895,60,'34.00',100,0),
+ (10896,45,'9.50',15,0),
+ (10896,56,'38.00',16,0),
+ (10897,29,'123.79',80,0),
+ (10897,30,'25.89',36,0),
+ (10898,13,'6.00',5,0),
+ (10899,39,'18.00',8,0.15),
+ (10900,70,'15.00',3,0.25),
+ (10901,41,'9.65',30,0),
+ (10901,71,'21.50',30,0),
+ (10902,55,'24.00',30,0.15),
+ (10902,62,'49.30',6,0.15),
+ (10903,13,'6.00',40,0),
+ (10903,65,'21.05',21,0),
+ (10903,68,'12.50',20,0),
+ (10904,58,'13.25',15,0),
+ (10904,62,'49.30',35,0),
+ (10905,1,'18.00',20,0.05),
+ (10906,61,'28.50',15,0),
+ (10907,75,'7.75',14,0),
+ (10908,7,'30.00',20,0.05),
+ (10908,52,'7.00',14,0.05),
+ (10909,7,'30.00',12,0),
+ (10909,16,'17.45',15,0),
+ (10909,41,'9.65',5,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10910,19,'9.20',12,0),
+ (10910,49,'20.00',10,0),
+ (10910,61,'28.50',5,0),
+ (10911,1,'18.00',10,0),
+ (10911,17,'39.00',12,0),
+ (10911,67,'14.00',15,0),
+ (10912,11,'21.00',40,0.25),
+ (10912,29,'123.79',60,0.25),
+ (10913,4,'22.00',30,0.25),
+ (10913,33,'2.50',40,0.25),
+ (10913,58,'13.25',15,0),
+ (10914,71,'21.50',25,0),
+ (10915,17,'39.00',10,0),
+ (10915,33,'2.50',30,0),
+ (10915,54,'7.45',10,0),
+ (10916,16,'17.45',6,0),
+ (10916,32,'32.00',6,0),
+ (10916,57,'19.50',20,0),
+ (10917,30,'25.89',1,0),
+ (10917,60,'34.00',10,0),
+ (10918,1,'18.00',60,0.25),
+ (10918,60,'34.00',25,0.25),
+ (10919,16,'17.45',24,0),
+ (10919,25,'14.00',24,0),
+ (10919,40,'18.40',20,0),
+ (10920,50,'16.25',24,0),
+ (10921,35,'18.00',10,0),
+ (10921,63,'43.90',40,0),
+ (10922,17,'39.00',15,0),
+ (10922,24,'4.50',35,0),
+ (10923,42,'14.00',10,0.2),
+ (10923,43,'46.00',10,0.2),
+ (10923,67,'14.00',24,0.2),
+ (10924,10,'31.00',20,0.1),
+ (10924,28,'45.60',30,0.1);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10924,75,'7.75',6,0),
+ (10925,36,'19.00',25,0.15),
+ (10925,52,'7.00',12,0.15),
+ (10926,11,'21.00',2,0),
+ (10926,13,'6.00',10,0),
+ (10926,19,'9.20',7,0),
+ (10926,72,'34.80',10,0),
+ (10927,20,'81.00',5,0),
+ (10927,52,'7.00',5,0),
+ (10927,76,'18.00',20,0),
+ (10928,47,'9.50',5,0),
+ (10928,76,'18.00',5,0),
+ (10929,21,'10.00',60,0),
+ (10929,75,'7.75',49,0),
+ (10929,77,'13.00',15,0),
+ (10930,21,'10.00',36,0),
+ (10930,27,'43.90',25,0),
+ (10930,55,'24.00',25,0.2),
+ (10930,58,'13.25',30,0.2),
+ (10931,13,'6.00',42,0.15),
+ (10931,57,'19.50',30,0),
+ (10932,16,'17.45',30,0.1),
+ (10932,62,'49.30',14,0.1),
+ (10932,72,'34.80',16,0),
+ (10932,75,'7.75',20,0.1),
+ (10933,53,'32.80',2,0),
+ (10933,61,'28.50',30,0),
+ (10934,6,'25.00',20,0),
+ (10935,1,'18.00',21,0),
+ (10935,18,'62.50',4,0.25),
+ (10935,23,'9.00',8,0.25),
+ (10936,36,'19.00',30,0.2),
+ (10937,28,'45.60',8,0),
+ (10937,34,'14.00',20,0),
+ (10938,13,'6.00',20,0.25),
+ (10938,43,'46.00',24,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10938,60,'34.00',49,0.25),
+ (10938,71,'21.50',35,0.25),
+ (10939,2,'19.00',10,0.15),
+ (10939,67,'14.00',40,0.15),
+ (10940,7,'30.00',8,0),
+ (10940,13,'6.00',20,0),
+ (10941,31,'12.50',44,0.25),
+ (10941,62,'49.30',30,0.25),
+ (10941,68,'12.50',80,0.25),
+ (10941,72,'34.80',50,0),
+ (10942,49,'20.00',28,0),
+ (10943,13,'6.00',15,0),
+ (10943,22,'21.00',21,0),
+ (10943,46,'12.00',15,0),
+ (10944,11,'21.00',5,0.25),
+ (10944,44,'19.45',18,0.25),
+ (10944,56,'38.00',18,0),
+ (10945,13,'6.00',20,0),
+ (10945,31,'12.50',10,0),
+ (10946,10,'31.00',25,0),
+ (10946,24,'4.50',25,0),
+ (10946,77,'13.00',40,0),
+ (10947,59,'55.00',4,0),
+ (10948,50,'16.25',9,0),
+ (10948,51,'53.00',40,0),
+ (10948,55,'24.00',4,0),
+ (10949,6,'25.00',12,0),
+ (10949,10,'31.00',30,0),
+ (10949,17,'39.00',6,0),
+ (10949,62,'49.30',60,0),
+ (10950,4,'22.00',5,0),
+ (10951,33,'2.50',15,0.05),
+ (10951,41,'9.65',6,0.05),
+ (10951,75,'7.75',50,0.05),
+ (10952,6,'25.00',16,0.05);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10952,28,'45.60',2,0),
+ (10953,20,'81.00',50,0.05),
+ (10953,31,'12.50',50,0.05),
+ (10954,16,'17.45',28,0.15),
+ (10954,31,'12.50',25,0.15),
+ (10954,45,'9.50',30,0),
+ (10954,60,'34.00',24,0.15),
+ (10955,75,'7.75',12,0.2),
+ (10956,21,'10.00',12,0),
+ (10956,47,'9.50',14,0),
+ (10956,51,'53.00',8,0),
+ (10957,30,'25.89',30,0),
+ (10957,35,'18.00',40,0),
+ (10957,64,'33.25',8,0),
+ (10958,5,'21.35',20,0),
+ (10958,7,'30.00',6,0),
+ (10958,72,'34.80',5,0),
+ (10959,75,'7.75',20,0.15),
+ (10960,24,'4.50',10,0.25),
+ (10960,41,'9.65',24,0),
+ (10961,52,'7.00',6,0.05),
+ (10961,76,'18.00',60,0),
+ (10962,7,'30.00',45,0),
+ (10962,13,'6.00',77,0),
+ (10962,53,'32.80',20,0),
+ (10962,69,'36.00',9,0),
+ (10962,76,'18.00',44,0),
+ (10963,60,'34.00',2,0.15),
+ (10964,18,'62.50',6,0),
+ (10964,38,'263.50',5,0),
+ (10964,69,'36.00',10,0),
+ (10965,51,'53.00',16,0),
+ (10966,37,'26.00',8,0),
+ (10966,56,'38.00',12,0.15),
+ (10966,62,'49.30',12,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10967,19,'9.20',12,0),
+ (10967,49,'20.00',40,0),
+ (10968,12,'38.00',30,0),
+ (10968,24,'4.50',30,0),
+ (10968,64,'33.25',4,0),
+ (10969,46,'12.00',9,0),
+ (10970,52,'7.00',40,0.2),
+ (10971,29,'123.79',14,0),
+ (10972,17,'39.00',6,0),
+ (10972,33,'2.50',7,0),
+ (10973,26,'31.23',5,0),
+ (10973,41,'9.65',6,0),
+ (10973,75,'7.75',10,0),
+ (10974,63,'43.90',10,0),
+ (10975,8,'40.00',16,0),
+ (10975,75,'7.75',10,0),
+ (10976,28,'45.60',20,0),
+ (10977,39,'18.00',30,0),
+ (10977,47,'9.50',30,0),
+ (10977,51,'53.00',10,0),
+ (10977,63,'43.90',20,0),
+ (10978,8,'40.00',20,0.15),
+ (10978,21,'10.00',40,0.15),
+ (10978,40,'18.40',10,0),
+ (10978,44,'19.45',6,0.15),
+ (10979,7,'30.00',18,0),
+ (10979,12,'38.00',20,0),
+ (10979,24,'4.50',80,0),
+ (10979,27,'43.90',30,0),
+ (10979,31,'12.50',24,0),
+ (10979,63,'43.90',35,0),
+ (10980,75,'7.75',40,0.2),
+ (10981,38,'263.50',60,0),
+ (10982,7,'30.00',20,0),
+ (10982,43,'46.00',9,0),
+ (10983,13,'6.00',84,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10983,57,'19.50',15,0),
+ (10984,16,'17.45',55,0),
+ (10984,24,'4.50',20,0),
+ (10984,36,'19.00',40,0),
+ (10985,16,'17.45',36,0.1),
+ (10985,18,'62.50',8,0.1),
+ (10985,32,'32.00',35,0.1),
+ (10986,11,'21.00',30,0),
+ (10986,20,'81.00',15,0),
+ (10986,76,'18.00',10,0),
+ (10986,77,'13.00',15,0),
+ (10987,7,'30.00',60,0),
+ (10987,43,'46.00',6,0),
+ (10987,72,'34.80',20,0),
+ (10988,7,'30.00',60,0),
+ (10988,62,'49.30',40,0.1),
+ (10989,6,'25.00',40,0),
+ (10989,11,'21.00',15,0),
+ (10989,41,'9.65',4,0),
+ (10990,21,'10.00',65,0),
+ (10990,34,'14.00',60,0.15),
+ (10990,55,'24.00',65,0.15),
+ (10990,61,'28.50',66,0.15),
+ (10991,2,'19.00',50,0.2),
+ (10991,70,'15.00',20,0.2),
+ (10991,76,'18.00',90,0.2),
+ (10992,72,'34.80',2,0),
+ (10993,29,'123.79',50,0.25),
+ (10993,41,'9.65',35,0.25),
+ (10994,59,'55.00',18,0.05),
+ (10995,51,'53.00',20,0),
+ (10995,60,'34.00',4,0),
+ (10996,42,'14.00',40,0),
+ (10997,32,'32.00',50,0),
+ (10997,46,'12.00',20,0.25);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (10997,52,'7.00',20,0.25),
+ (10998,24,'4.50',12,0),
+ (10998,61,'28.50',7,0),
+ (10998,74,'10.00',20,0),
+ (10998,75,'7.75',30,0),
+ (10999,41,'9.65',20,0.05),
+ (10999,51,'53.00',15,0.05),
+ (10999,77,'13.00',21,0.05),
+ (11000,4,'22.00',25,0.25),
+ (11000,24,'4.50',30,0.25),
+ (11000,77,'13.00',30,0),
+ (11001,7,'30.00',60,0),
+ (11001,22,'21.00',25,0),
+ (11001,46,'12.00',25,0),
+ (11001,55,'24.00',6,0),
+ (11002,13,'6.00',56,0),
+ (11002,35,'18.00',15,0.15),
+ (11002,42,'14.00',24,0.15),
+ (11002,55,'24.00',40,0),
+ (11003,1,'18.00',4,0),
+ (11003,40,'18.40',10,0),
+ (11003,52,'7.00',10,0),
+ (11004,26,'31.23',6,0),
+ (11004,76,'18.00',6,0),
+ (11005,1,'18.00',2,0),
+ (11005,59,'55.00',10,0),
+ (11006,1,'18.00',8,0),
+ (11006,29,'123.79',2,0.25),
+ (11007,8,'40.00',30,0),
+ (11007,29,'123.79',10,0),
+ (11007,42,'14.00',14,0),
+ (11008,28,'45.60',70,0.05),
+ (11008,34,'14.00',90,0.05),
+ (11008,71,'21.50',21,0),
+ (11009,24,'4.50',12,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11009,36,'19.00',18,0.25),
+ (11009,60,'34.00',9,0),
+ (11010,7,'30.00',20,0),
+ (11010,24,'4.50',10,0),
+ (11011,58,'13.25',40,0.05),
+ (11011,71,'21.50',20,0),
+ (11012,19,'9.20',50,0.05),
+ (11012,60,'34.00',36,0.05),
+ (11012,71,'21.50',60,0.05),
+ (11013,23,'9.00',10,0),
+ (11013,42,'14.00',4,0),
+ (11013,45,'9.50',20,0),
+ (11013,68,'12.50',2,0),
+ (11014,41,'9.65',28,0.1),
+ (11015,30,'25.89',15,0),
+ (11015,77,'13.00',18,0),
+ (11016,31,'12.50',15,0),
+ (11016,36,'19.00',16,0),
+ (11017,3,'10.00',25,0),
+ (11017,59,'55.00',110,0),
+ (11017,70,'15.00',30,0),
+ (11018,12,'38.00',20,0),
+ (11018,18,'62.50',10,0),
+ (11018,56,'38.00',5,0),
+ (11019,46,'12.00',3,0),
+ (11019,49,'20.00',2,0),
+ (11020,10,'31.00',24,0.15),
+ (11021,2,'19.00',11,0.25),
+ (11021,20,'81.00',15,0),
+ (11021,26,'31.23',63,0),
+ (11021,51,'53.00',44,0.25),
+ (11021,72,'34.80',35,0),
+ (11022,19,'9.20',35,0),
+ (11022,69,'36.00',30,0),
+ (11023,7,'30.00',4,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11023,43,'46.00',30,0),
+ (11024,26,'31.23',12,0),
+ (11024,33,'2.50',30,0),
+ (11024,65,'21.05',21,0),
+ (11024,71,'21.50',50,0),
+ (11025,1,'18.00',10,0.1),
+ (11025,13,'6.00',20,0.1),
+ (11026,18,'62.50',8,0),
+ (11026,51,'53.00',10,0),
+ (11027,24,'4.50',30,0.25),
+ (11027,62,'49.30',21,0.25),
+ (11028,55,'24.00',35,0),
+ (11028,59,'55.00',24,0),
+ (11029,56,'38.00',20,0),
+ (11029,63,'43.90',12,0),
+ (11030,2,'19.00',100,0.25),
+ (11030,5,'21.35',70,0),
+ (11030,29,'123.79',60,0.25),
+ (11030,59,'55.00',100,0.25),
+ (11031,1,'18.00',45,0),
+ (11031,13,'6.00',80,0),
+ (11031,24,'4.50',21,0),
+ (11031,64,'33.25',20,0),
+ (11031,71,'21.50',16,0),
+ (11032,36,'19.00',35,0),
+ (11032,38,'263.50',25,0),
+ (11032,59,'55.00',30,0),
+ (11033,53,'32.80',70,0.1),
+ (11033,69,'36.00',36,0.1),
+ (11034,21,'10.00',15,0.1),
+ (11034,44,'19.45',12,0),
+ (11034,61,'28.50',6,0),
+ (11035,1,'18.00',10,0),
+ (11035,35,'18.00',60,0),
+ (11035,42,'14.00',30,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11035,54,'7.45',10,0),
+ (11036,13,'6.00',7,0),
+ (11036,59,'55.00',30,0),
+ (11037,70,'15.00',4,0),
+ (11038,40,'18.40',5,0.2),
+ (11038,52,'7.00',2,0),
+ (11038,71,'21.50',30,0),
+ (11039,28,'45.60',20,0),
+ (11039,35,'18.00',24,0),
+ (11039,49,'20.00',60,0),
+ (11039,57,'19.50',28,0),
+ (11040,21,'10.00',20,0),
+ (11041,2,'19.00',30,0.2),
+ (11041,63,'43.90',30,0),
+ (11042,44,'19.45',15,0),
+ (11042,61,'28.50',4,0),
+ (11043,11,'21.00',10,0),
+ (11044,62,'49.30',12,0),
+ (11045,33,'2.50',15,0),
+ (11045,51,'53.00',24,0),
+ (11046,12,'38.00',20,0.05),
+ (11046,32,'32.00',15,0.05),
+ (11046,35,'18.00',18,0.05),
+ (11047,1,'18.00',25,0.25),
+ (11047,5,'21.35',30,0.25),
+ (11048,68,'12.50',42,0),
+ (11049,2,'19.00',10,0.2),
+ (11049,12,'38.00',4,0.2),
+ (11050,76,'18.00',50,0.1),
+ (11051,24,'4.50',10,0.2),
+ (11052,43,'46.00',30,0.2),
+ (11052,61,'28.50',10,0.2),
+ (11053,18,'62.50',35,0.2),
+ (11053,32,'32.00',20,0),
+ (11053,64,'33.25',25,0.2);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11054,33,'2.50',10,0),
+ (11054,67,'14.00',20,0),
+ (11055,24,'4.50',15,0),
+ (11055,25,'14.00',15,0),
+ (11055,51,'53.00',20,0),
+ (11055,57,'19.50',20,0),
+ (11056,7,'30.00',40,0),
+ (11056,55,'24.00',35,0),
+ (11056,60,'34.00',50,0),
+ (11057,70,'15.00',3,0),
+ (11058,21,'10.00',3,0),
+ (11058,60,'34.00',21,0),
+ (11058,61,'28.50',4,0),
+ (11059,13,'6.00',30,0),
+ (11059,17,'39.00',12,0),
+ (11059,60,'34.00',35,0),
+ (11060,60,'34.00',4,0),
+ (11060,77,'13.00',10,0),
+ (11061,60,'34.00',15,0),
+ (11062,53,'32.80',10,0.2),
+ (11062,70,'15.00',12,0.2),
+ (11063,34,'14.00',30,0),
+ (11063,40,'18.40',40,0.1),
+ (11063,41,'9.65',30,0.1),
+ (11064,17,'39.00',77,0.1),
+ (11064,41,'9.65',12,0),
+ (11064,53,'32.80',25,0.1),
+ (11064,55,'24.00',4,0.1),
+ (11064,68,'12.50',55,0),
+ (11065,30,'25.89',4,0.25),
+ (11065,54,'7.45',20,0.25),
+ (11066,16,'17.45',3,0),
+ (11066,19,'9.20',42,0),
+ (11066,34,'14.00',35,0),
+ (11067,41,'9.65',9,0),
+ (11068,28,'45.60',8,0.15);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11068,43,'46.00',36,0.15),
+ (11068,77,'13.00',28,0.15),
+ (11069,39,'18.00',20,0),
+ (11070,1,'18.00',40,0.15),
+ (11070,2,'19.00',20,0.15),
+ (11070,16,'17.45',30,0.15),
+ (11070,31,'12.50',20,0),
+ (11071,7,'30.00',15,0.05),
+ (11071,13,'6.00',10,0.05),
+ (11072,2,'19.00',8,0),
+ (11072,41,'9.65',40,0),
+ (11072,50,'16.25',22,0),
+ (11072,64,'33.25',130,0),
+ (11073,11,'21.00',10,0),
+ (11073,24,'4.50',20,0),
+ (11074,16,'17.45',14,0.05),
+ (11075,2,'19.00',10,0.15),
+ (11075,46,'12.00',30,0.15),
+ (11075,76,'18.00',2,0.15),
+ (11076,6,'25.00',20,0.25),
+ (11076,14,'23.25',20,0.25),
+ (11076,19,'9.20',10,0.25),
+ (11077,2,'19.00',24,0.2),
+ (11077,3,'10.00',4,0),
+ (11077,4,'22.00',1,0),
+ (11077,6,'25.00',1,0.02),
+ (11077,7,'30.00',1,0.05),
+ (11077,8,'40.00',2,0.1),
+ (11077,10,'31.00',1,0),
+ (11077,12,'38.00',2,0.05),
+ (11077,13,'6.00',4,0),
+ (11077,14,'23.25',1,0.03),
+ (11077,16,'17.45',2,0.03),
+ (11077,20,'81.00',1,0.04),
+ (11077,23,'9.00',2,0);
+INSERT INTO `northwind`.`order_details` (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) VALUES 
+ (11077,32,'32.00',1,0),
+ (11077,39,'18.00',2,0.05),
+ (11077,41,'9.65',3,0),
+ (11077,46,'12.00',3,0.02),
+ (11077,52,'7.00',2,0),
+ (11077,55,'24.00',2,0),
+ (11077,60,'34.00',2,0.06),
+ (11077,64,'33.25',2,0.03),
+ (11077,66,'17.00',1,0),
+ (11077,73,'15.00',2,0.01),
+ (11077,75,'7.75',4,0),
+ (11077,77,'13.00',2,0);
+/*!40000 ALTER TABLE `order_details` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`orders`
+--
+
+DROP TABLE IF EXISTS `northwind`.`orders`;
+CREATE TABLE  `northwind`.`orders` (
+  `OrderID` int(11) NOT NULL auto_increment,
+  `CustomerID` varchar(5) default NULL,
+  `EmployeeID` int(11) default NULL,
+  `OrderDate` datetime default NULL,
+  `RequiredDate` datetime default NULL,
+  `ShippedDate` datetime default NULL,
+  `ShipVia` int(11) default NULL,
+  `Freight` decimal(9,2) default '0.00',
+  `ShipName` varchar(40) default NULL,
+  `ShipAddress` varchar(60) default NULL,
+  `ShipCity` varchar(15) default NULL,
+  `ShipRegion` varchar(15) default NULL,
+  `ShipPostalCode` varchar(10) default NULL,
+  `ShipCountry` varchar(15) default NULL,
+  PRIMARY KEY  (`OrderID`)
+) ENGINE=MyISAM AUTO_INCREMENT=11078 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`orders`
+--
+
+/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10248,'VINET',5,'1996-07-04 00:00:00','1996-08-01 00:00:00','1996-07-16 00:00:00',3,'32.38','Vins et alcools Chevalier','59 rue de l\'Abbaye','Reims',NULL,'51100','France'),
+ (10249,'TOMSP',6,'1996-07-05 00:00:00','1996-08-16 00:00:00','1996-07-10 00:00:00',1,'11.61','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10250,'HANAR',4,'1996-07-08 00:00:00','1996-08-05 00:00:00','1996-07-12 00:00:00',2,'65.83','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10251,'VICTE',3,'1996-07-08 00:00:00','1996-08-05 00:00:00','1996-07-15 00:00:00',1,'41.34','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10252,'SUPRD',4,'1996-07-09 00:00:00','1996-08-06 00:00:00','1996-07-11 00:00:00',2,'51.30','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10253,'HANAR',3,'1996-07-10 00:00:00','1996-07-24 00:00:00','1996-07-16 00:00:00',2,'58.17','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10254,'CHOPS',5,'1996-07-11 00:00:00','1996-08-08 00:00:00','1996-07-23 00:00:00',2,'22.98','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10255,'RICSU',9,'1996-07-12 00:00:00','1996-08-09 00:00:00','1996-07-15 00:00:00',3,'148.33','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10256,'WELLI',3,'1996-07-15 00:00:00','1996-08-12 00:00:00','1996-07-17 00:00:00',2,'13.97','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10257,'HILAA',4,'1996-07-16 00:00:00','1996-08-13 00:00:00','1996-07-22 00:00:00',3,'81.91','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10258,'ERNSH',1,'1996-07-17 00:00:00','1996-08-14 00:00:00','1996-07-23 00:00:00',1,'140.51','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10259,'CENTC',4,'1996-07-18 00:00:00','1996-08-15 00:00:00','1996-07-25 00:00:00',3,'3.25','Centro comercial Moctezuma','Sierras de Granada 9993','México D.F.',NULL,'05022','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10260,'OTTIK',4,'1996-07-19 00:00:00','1996-08-16 00:00:00','1996-07-29 00:00:00',1,'55.09','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10261,'QUEDE',4,'1996-07-19 00:00:00','1996-08-16 00:00:00','1996-07-30 00:00:00',2,'3.05','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10262,'RATTC',8,'1996-07-22 00:00:00','1996-08-19 00:00:00','1996-07-25 00:00:00',3,'48.29','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10263,'ERNSH',9,'1996-07-23 00:00:00','1996-08-20 00:00:00','1996-07-31 00:00:00',3,'146.06','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10264,'FOLKO',6,'1996-07-24 00:00:00','1996-08-21 00:00:00','1996-08-23 00:00:00',3,'3.67','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10265,'BLONP',2,'1996-07-25 00:00:00','1996-08-22 00:00:00','1996-08-12 00:00:00',1,'55.28','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10266,'WARTH',3,'1996-07-26 00:00:00','1996-09-06 00:00:00','1996-07-31 00:00:00',3,'25.73','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10267,'FRANK',4,'1996-07-29 00:00:00','1996-08-26 00:00:00','1996-08-06 00:00:00',1,'208.58','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10268,'GROSR',8,'1996-07-30 00:00:00','1996-08-27 00:00:00','1996-08-02 00:00:00',3,'66.29','GROSELLA-Restaurante','5ª Ave. Los Palos Grandes','Caracas','DF','1081','Venezuela'),
+ (10269,'WHITC',5,'1996-07-31 00:00:00','1996-08-14 00:00:00','1996-08-09 00:00:00',1,'4.56','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10270,'WARTH',1,'1996-08-01 00:00:00','1996-08-29 00:00:00','1996-08-02 00:00:00',1,'136.54','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10271,'SPLIR',6,'1996-08-01 00:00:00','1996-08-29 00:00:00','1996-08-30 00:00:00',2,'4.54','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10272,'RATTC',6,'1996-08-02 00:00:00','1996-08-30 00:00:00','1996-08-06 00:00:00',2,'98.03','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10273,'QUICK',3,'1996-08-05 00:00:00','1996-09-02 00:00:00','1996-08-12 00:00:00',3,'76.07','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10274,'VINET',6,'1996-08-06 00:00:00','1996-09-03 00:00:00','1996-08-16 00:00:00',1,'6.01','Vins et alcools Chevalier','59 rue de l\'Abbaye','Reims',NULL,'51100','France'),
+ (10275,'MAGAA',1,'1996-08-07 00:00:00','1996-09-04 00:00:00','1996-08-09 00:00:00',1,'26.93','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10276,'TORTU',8,'1996-08-08 00:00:00','1996-08-22 00:00:00','1996-08-14 00:00:00',3,'13.84','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10277,'MORGK',2,'1996-08-09 00:00:00','1996-09-06 00:00:00','1996-08-13 00:00:00',3,'125.77','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10278,'BERGS',8,'1996-08-12 00:00:00','1996-09-09 00:00:00','1996-08-16 00:00:00',2,'92.69','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10279,'LEHMS',8,'1996-08-13 00:00:00','1996-09-10 00:00:00','1996-08-16 00:00:00',2,'25.83','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10280,'BERGS',2,'1996-08-14 00:00:00','1996-09-11 00:00:00','1996-09-12 00:00:00',1,'8.98','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10281,'ROMEY',4,'1996-08-14 00:00:00','1996-08-28 00:00:00','1996-08-21 00:00:00',1,'2.94','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10282,'ROMEY',4,'1996-08-15 00:00:00','1996-09-12 00:00:00','1996-08-21 00:00:00',1,'12.69','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10283,'LILAS',3,'1996-08-16 00:00:00','1996-09-13 00:00:00','1996-08-23 00:00:00',3,'84.81','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10284,'LEHMS',4,'1996-08-19 00:00:00','1996-09-16 00:00:00','1996-08-27 00:00:00',1,'76.56','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10285,'QUICK',1,'1996-08-20 00:00:00','1996-09-17 00:00:00','1996-08-26 00:00:00',2,'76.83','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10286,'QUICK',8,'1996-08-21 00:00:00','1996-09-18 00:00:00','1996-08-30 00:00:00',3,'229.24','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10287,'RICAR',8,'1996-08-22 00:00:00','1996-09-19 00:00:00','1996-08-28 00:00:00',3,'12.76','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10288,'REGGC',4,'1996-08-23 00:00:00','1996-09-20 00:00:00','1996-09-03 00:00:00',1,'7.45','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10289,'BSBEV',7,'1996-08-26 00:00:00','1996-09-23 00:00:00','1996-08-28 00:00:00',3,'22.77','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10290,'COMMI',8,'1996-08-27 00:00:00','1996-09-24 00:00:00','1996-09-03 00:00:00',1,'79.70','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10291,'QUEDE',6,'1996-08-27 00:00:00','1996-09-24 00:00:00','1996-09-04 00:00:00',2,'6.40','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10292,'TRADH',1,'1996-08-28 00:00:00','1996-09-25 00:00:00','1996-09-02 00:00:00',2,'1.35','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10293,'TORTU',1,'1996-08-29 00:00:00','1996-09-26 00:00:00','1996-09-11 00:00:00',3,'21.18','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10294,'RATTC',4,'1996-08-30 00:00:00','1996-09-27 00:00:00','1996-09-05 00:00:00',2,'147.26','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10295,'VINET',2,'1996-09-02 00:00:00','1996-09-30 00:00:00','1996-09-10 00:00:00',2,'1.15','Vins et alcools Chevalier','59 rue de l\'Abbaye','Reims',NULL,'51100','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10296,'LILAS',6,'1996-09-03 00:00:00','1996-10-01 00:00:00','1996-09-11 00:00:00',1,'0.12','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10297,'BLONP',5,'1996-09-04 00:00:00','1996-10-16 00:00:00','1996-09-10 00:00:00',2,'5.74','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10298,'HUNGO',6,'1996-09-05 00:00:00','1996-10-03 00:00:00','1996-09-11 00:00:00',2,'168.22','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10299,'RICAR',4,'1996-09-06 00:00:00','1996-10-04 00:00:00','1996-09-13 00:00:00',2,'29.76','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10300,'MAGAA',2,'1996-09-09 00:00:00','1996-10-07 00:00:00','1996-09-18 00:00:00',2,'17.68','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10301,'WANDK',8,'1996-09-09 00:00:00','1996-10-07 00:00:00','1996-09-17 00:00:00',2,'45.08','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10302,'SUPRD',4,'1996-09-10 00:00:00','1996-10-08 00:00:00','1996-10-09 00:00:00',2,'6.27','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10303,'GODOS',7,'1996-09-11 00:00:00','1996-10-09 00:00:00','1996-09-18 00:00:00',2,'107.83','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10304,'TORTU',1,'1996-09-12 00:00:00','1996-10-10 00:00:00','1996-09-17 00:00:00',2,'63.79','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10305,'OLDWO',8,'1996-09-13 00:00:00','1996-10-11 00:00:00','1996-10-09 00:00:00',3,'257.62','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10306,'ROMEY',1,'1996-09-16 00:00:00','1996-10-14 00:00:00','1996-09-23 00:00:00',3,'7.56','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10307,'LONEP',2,'1996-09-17 00:00:00','1996-10-15 00:00:00','1996-09-25 00:00:00',2,'0.56','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10308,'ANATR',7,'1996-09-18 00:00:00','1996-10-16 00:00:00','1996-09-24 00:00:00',3,'1.61','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico'),
+ (10309,'HUNGO',3,'1996-09-19 00:00:00','1996-10-17 00:00:00','1996-10-23 00:00:00',1,'47.30','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10310,'THEBI',8,'1996-09-20 00:00:00','1996-10-18 00:00:00','1996-09-27 00:00:00',2,'17.52','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA'),
+ (10311,'DUMON',1,'1996-09-20 00:00:00','1996-10-04 00:00:00','1996-09-26 00:00:00',3,'24.69','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10312,'WANDK',2,'1996-09-23 00:00:00','1996-10-21 00:00:00','1996-10-03 00:00:00',2,'40.26','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10313,'QUICK',2,'1996-09-24 00:00:00','1996-10-22 00:00:00','1996-10-04 00:00:00',2,'1.96','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10314,'RATTC',1,'1996-09-25 00:00:00','1996-10-23 00:00:00','1996-10-04 00:00:00',2,'74.16','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10315,'ISLAT',4,'1996-09-26 00:00:00','1996-10-24 00:00:00','1996-10-03 00:00:00',2,'41.76','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10316,'RATTC',1,'1996-09-27 00:00:00','1996-10-25 00:00:00','1996-10-08 00:00:00',3,'150.15','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10317,'LONEP',6,'1996-09-30 00:00:00','1996-10-28 00:00:00','1996-10-10 00:00:00',1,'12.69','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10318,'ISLAT',8,'1996-10-01 00:00:00','1996-10-29 00:00:00','1996-10-04 00:00:00',2,'4.73','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10319,'TORTU',7,'1996-10-02 00:00:00','1996-10-30 00:00:00','1996-10-11 00:00:00',3,'64.50','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10320,'WARTH',5,'1996-10-03 00:00:00','1996-10-17 00:00:00','1996-10-18 00:00:00',3,'34.57','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10321,'ISLAT',3,'1996-10-03 00:00:00','1996-10-31 00:00:00','1996-10-11 00:00:00',2,'3.43','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10322,'PERIC',7,'1996-10-04 00:00:00','1996-11-01 00:00:00','1996-10-23 00:00:00',3,'0.40','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10323,'KOENE',4,'1996-10-07 00:00:00','1996-11-04 00:00:00','1996-10-14 00:00:00',1,'4.88','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10324,'SAVEA',9,'1996-10-08 00:00:00','1996-11-05 00:00:00','1996-10-10 00:00:00',1,'214.27','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10325,'KOENE',1,'1996-10-09 00:00:00','1996-10-23 00:00:00','1996-10-14 00:00:00',3,'64.86','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10326,'BOLID',4,'1996-10-10 00:00:00','1996-11-07 00:00:00','1996-10-14 00:00:00',2,'77.92','Bólido Comidas preparadas','C/ Araquil 67','Madrid',NULL,'28023','Spain'),
+ (10327,'FOLKO',2,'1996-10-11 00:00:00','1996-11-08 00:00:00','1996-10-14 00:00:00',1,'63.36','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10328,'FURIB',4,'1996-10-14 00:00:00','1996-11-11 00:00:00','1996-10-17 00:00:00',3,'87.03','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10329,'SPLIR',4,'1996-10-15 00:00:00','1996-11-26 00:00:00','1996-10-23 00:00:00',2,'191.67','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10330,'LILAS',3,'1996-10-16 00:00:00','1996-11-13 00:00:00','1996-10-28 00:00:00',1,'12.75','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10331,'BONAP',9,'1996-10-16 00:00:00','1996-11-27 00:00:00','1996-10-21 00:00:00',1,'10.19','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10332,'MEREP',3,'1996-10-17 00:00:00','1996-11-28 00:00:00','1996-10-21 00:00:00',2,'52.84','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10333,'WARTH',5,'1996-10-18 00:00:00','1996-11-15 00:00:00','1996-10-25 00:00:00',3,'0.59','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10334,'VICTE',8,'1996-10-21 00:00:00','1996-11-18 00:00:00','1996-10-28 00:00:00',2,'8.56','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10335,'HUNGO',7,'1996-10-22 00:00:00','1996-11-19 00:00:00','1996-10-24 00:00:00',2,'42.11','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10336,'PRINI',7,'1996-10-23 00:00:00','1996-11-20 00:00:00','1996-10-25 00:00:00',2,'15.51','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal'),
+ (10337,'FRANK',4,'1996-10-24 00:00:00','1996-11-21 00:00:00','1996-10-29 00:00:00',3,'108.26','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10338,'OLDWO',4,'1996-10-25 00:00:00','1996-11-22 00:00:00','1996-10-29 00:00:00',3,'84.21','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10339,'MEREP',2,'1996-10-28 00:00:00','1996-11-25 00:00:00','1996-11-04 00:00:00',2,'15.66','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10340,'BONAP',1,'1996-10-29 00:00:00','1996-11-26 00:00:00','1996-11-08 00:00:00',3,'166.31','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10341,'SIMOB',7,'1996-10-29 00:00:00','1996-11-26 00:00:00','1996-11-05 00:00:00',3,'26.78','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10342,'FRANK',4,'1996-10-30 00:00:00','1996-11-13 00:00:00','1996-11-04 00:00:00',2,'54.83','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10343,'LEHMS',4,'1996-10-31 00:00:00','1996-11-28 00:00:00','1996-11-06 00:00:00',1,'110.37','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10344,'WHITC',4,'1996-11-01 00:00:00','1996-11-29 00:00:00','1996-11-05 00:00:00',2,'23.29','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10345,'QUICK',2,'1996-11-04 00:00:00','1996-12-02 00:00:00','1996-11-11 00:00:00',2,'249.06','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10346,'RATTC',3,'1996-11-05 00:00:00','1996-12-17 00:00:00','1996-11-08 00:00:00',3,'142.08','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10347,'FAMIA',4,'1996-11-06 00:00:00','1996-12-04 00:00:00','1996-11-08 00:00:00',3,'3.10','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10348,'WANDK',4,'1996-11-07 00:00:00','1996-12-05 00:00:00','1996-11-15 00:00:00',2,'0.78','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10349,'SPLIR',7,'1996-11-08 00:00:00','1996-12-06 00:00:00','1996-11-15 00:00:00',1,'8.63','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10350,'LAMAI',6,'1996-11-11 00:00:00','1996-12-09 00:00:00','1996-12-03 00:00:00',2,'64.19','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10351,'ERNSH',1,'1996-11-11 00:00:00','1996-12-09 00:00:00','1996-11-20 00:00:00',1,'162.33','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10352,'FURIB',3,'1996-11-12 00:00:00','1996-11-26 00:00:00','1996-11-18 00:00:00',3,'1.30','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10353,'PICCO',7,'1996-11-13 00:00:00','1996-12-11 00:00:00','1996-11-25 00:00:00',3,'360.63','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10354,'PERIC',8,'1996-11-14 00:00:00','1996-12-12 00:00:00','1996-11-20 00:00:00',3,'53.80','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10355,'AROUT',6,'1996-11-15 00:00:00','1996-12-13 00:00:00','1996-11-20 00:00:00',1,'41.95','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10356,'WANDK',6,'1996-11-18 00:00:00','1996-12-16 00:00:00','1996-11-27 00:00:00',2,'36.71','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10357,'LILAS',1,'1996-11-19 00:00:00','1996-12-17 00:00:00','1996-12-02 00:00:00',3,'34.88','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10358,'LAMAI',5,'1996-11-20 00:00:00','1996-12-18 00:00:00','1996-11-27 00:00:00',1,'19.64','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10359,'SEVES',5,'1996-11-21 00:00:00','1996-12-19 00:00:00','1996-11-26 00:00:00',3,'288.43','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10360,'BLONP',4,'1996-11-22 00:00:00','1996-12-20 00:00:00','1996-12-02 00:00:00',3,'131.70','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10361,'QUICK',1,'1996-11-22 00:00:00','1996-12-20 00:00:00','1996-12-03 00:00:00',2,'183.17','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10362,'BONAP',3,'1996-11-25 00:00:00','1996-12-23 00:00:00','1996-11-28 00:00:00',1,'96.04','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10363,'DRACD',4,'1996-11-26 00:00:00','1996-12-24 00:00:00','1996-12-04 00:00:00',3,'30.54','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (10364,'EASTC',1,'1996-11-26 00:00:00','1997-01-07 00:00:00','1996-12-04 00:00:00',1,'71.97','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10365,'ANTON',3,'1996-11-27 00:00:00','1996-12-25 00:00:00','1996-12-02 00:00:00',2,'22.00','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10366,'GALED',8,'1996-11-28 00:00:00','1997-01-09 00:00:00','1996-12-30 00:00:00',2,'10.14','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10367,'VAFFE',7,'1996-11-28 00:00:00','1996-12-26 00:00:00','1996-12-02 00:00:00',3,'13.55','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10368,'ERNSH',2,'1996-11-29 00:00:00','1996-12-27 00:00:00','1996-12-02 00:00:00',2,'101.95','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10369,'SPLIR',8,'1996-12-02 00:00:00','1996-12-30 00:00:00','1996-12-09 00:00:00',2,'195.68','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10370,'CHOPS',6,'1996-12-03 00:00:00','1996-12-31 00:00:00','1996-12-27 00:00:00',2,'1.17','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10371,'LAMAI',1,'1996-12-03 00:00:00','1996-12-31 00:00:00','1996-12-24 00:00:00',1,'0.45','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10372,'QUEEN',5,'1996-12-04 00:00:00','1997-01-01 00:00:00','1996-12-09 00:00:00',2,'890.78','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10373,'HUNGO',4,'1996-12-05 00:00:00','1997-01-02 00:00:00','1996-12-11 00:00:00',3,'124.12','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10374,'WOLZA',1,'1996-12-05 00:00:00','1997-01-02 00:00:00','1996-12-09 00:00:00',3,'3.94','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10375,'HUNGC',3,'1996-12-06 00:00:00','1997-01-03 00:00:00','1996-12-09 00:00:00',2,'20.12','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10376,'MEREP',1,'1996-12-09 00:00:00','1997-01-06 00:00:00','1996-12-13 00:00:00',2,'20.39','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10377,'SEVES',1,'1996-12-09 00:00:00','1997-01-06 00:00:00','1996-12-13 00:00:00',3,'22.21','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10378,'FOLKO',5,'1996-12-10 00:00:00','1997-01-07 00:00:00','1996-12-19 00:00:00',3,'5.44','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10379,'QUEDE',2,'1996-12-11 00:00:00','1997-01-08 00:00:00','1996-12-13 00:00:00',1,'45.03','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10380,'HUNGO',8,'1996-12-12 00:00:00','1997-01-09 00:00:00','1997-01-16 00:00:00',3,'35.03','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10381,'LILAS',3,'1996-12-12 00:00:00','1997-01-09 00:00:00','1996-12-13 00:00:00',3,'7.99','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10382,'ERNSH',4,'1996-12-13 00:00:00','1997-01-10 00:00:00','1996-12-16 00:00:00',1,'94.77','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10383,'AROUT',8,'1996-12-16 00:00:00','1997-01-13 00:00:00','1996-12-18 00:00:00',3,'34.24','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10384,'BERGS',3,'1996-12-16 00:00:00','1997-01-13 00:00:00','1996-12-20 00:00:00',3,'168.64','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10385,'SPLIR',1,'1996-12-17 00:00:00','1997-01-14 00:00:00','1996-12-23 00:00:00',2,'30.96','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10386,'FAMIA',9,'1996-12-18 00:00:00','1997-01-01 00:00:00','1996-12-25 00:00:00',3,'13.99','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10387,'SANTG',1,'1996-12-18 00:00:00','1997-01-15 00:00:00','1996-12-20 00:00:00',2,'93.63','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10388,'SEVES',2,'1996-12-19 00:00:00','1997-01-16 00:00:00','1996-12-20 00:00:00',1,'34.86','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10389,'BOTTM',4,'1996-12-20 00:00:00','1997-01-17 00:00:00','1996-12-24 00:00:00',2,'47.42','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10390,'ERNSH',6,'1996-12-23 00:00:00','1997-01-20 00:00:00','1996-12-26 00:00:00',1,'126.38','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10391,'DRACD',3,'1996-12-23 00:00:00','1997-01-20 00:00:00','1996-12-31 00:00:00',3,'5.45','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10392,'PICCO',2,'1996-12-24 00:00:00','1997-01-21 00:00:00','1997-01-01 00:00:00',3,'122.46','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10393,'SAVEA',1,'1996-12-25 00:00:00','1997-01-22 00:00:00','1997-01-03 00:00:00',3,'126.56','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10394,'HUNGC',1,'1996-12-25 00:00:00','1997-01-22 00:00:00','1997-01-03 00:00:00',3,'30.34','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10395,'HILAA',6,'1996-12-26 00:00:00','1997-01-23 00:00:00','1997-01-03 00:00:00',1,'184.41','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10396,'FRANK',1,'1996-12-27 00:00:00','1997-01-10 00:00:00','1997-01-06 00:00:00',3,'135.35','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10397,'PRINI',5,'1996-12-27 00:00:00','1997-01-24 00:00:00','1997-01-02 00:00:00',1,'60.26','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10398,'SAVEA',2,'1996-12-30 00:00:00','1997-01-27 00:00:00','1997-01-09 00:00:00',3,'89.16','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10399,'VAFFE',8,'1996-12-31 00:00:00','1997-01-14 00:00:00','1997-01-08 00:00:00',3,'27.36','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10400,'EASTC',1,'1997-01-01 00:00:00','1997-01-29 00:00:00','1997-01-16 00:00:00',3,'83.93','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10401,'RATTC',1,'1997-01-01 00:00:00','1997-01-29 00:00:00','1997-01-10 00:00:00',1,'12.51','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10402,'ERNSH',8,'1997-01-02 00:00:00','1997-02-13 00:00:00','1997-01-10 00:00:00',2,'67.88','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10403,'ERNSH',4,'1997-01-03 00:00:00','1997-01-31 00:00:00','1997-01-09 00:00:00',3,'73.79','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10404,'MAGAA',2,'1997-01-03 00:00:00','1997-01-31 00:00:00','1997-01-08 00:00:00',1,'155.97','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10405,'LINOD',1,'1997-01-06 00:00:00','1997-02-03 00:00:00','1997-01-22 00:00:00',1,'34.82','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10406,'QUEEN',7,'1997-01-07 00:00:00','1997-02-18 00:00:00','1997-01-13 00:00:00',1,'108.04','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10407,'OTTIK',2,'1997-01-07 00:00:00','1997-02-04 00:00:00','1997-01-30 00:00:00',2,'91.48','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10408,'FOLIG',8,'1997-01-08 00:00:00','1997-02-05 00:00:00','1997-01-14 00:00:00',1,'11.26','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10409,'OCEAN',3,'1997-01-09 00:00:00','1997-02-06 00:00:00','1997-01-14 00:00:00',1,'29.83','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10410,'BOTTM',3,'1997-01-10 00:00:00','1997-02-07 00:00:00','1997-01-15 00:00:00',3,'2.40','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10411,'BOTTM',9,'1997-01-10 00:00:00','1997-02-07 00:00:00','1997-01-21 00:00:00',3,'23.65','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10412,'WARTH',8,'1997-01-13 00:00:00','1997-02-10 00:00:00','1997-01-15 00:00:00',2,'3.77','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10413,'LAMAI',3,'1997-01-14 00:00:00','1997-02-11 00:00:00','1997-01-16 00:00:00',2,'95.66','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10414,'FAMIA',2,'1997-01-14 00:00:00','1997-02-11 00:00:00','1997-01-17 00:00:00',3,'21.48','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10415,'HUNGC',3,'1997-01-15 00:00:00','1997-02-12 00:00:00','1997-01-24 00:00:00',1,'0.20','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10416,'WARTH',8,'1997-01-16 00:00:00','1997-02-13 00:00:00','1997-01-27 00:00:00',3,'22.72','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10417,'SIMOB',4,'1997-01-16 00:00:00','1997-02-13 00:00:00','1997-01-28 00:00:00',3,'70.29','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10418,'QUICK',4,'1997-01-17 00:00:00','1997-02-14 00:00:00','1997-01-24 00:00:00',1,'17.55','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10419,'RICSU',4,'1997-01-20 00:00:00','1997-02-17 00:00:00','1997-01-30 00:00:00',2,'137.35','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10420,'WELLI',3,'1997-01-21 00:00:00','1997-02-18 00:00:00','1997-01-27 00:00:00',1,'44.12','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10421,'QUEDE',8,'1997-01-21 00:00:00','1997-03-04 00:00:00','1997-01-27 00:00:00',1,'99.23','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10422,'FRANS',2,'1997-01-22 00:00:00','1997-02-19 00:00:00','1997-01-31 00:00:00',1,'3.02','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10423,'GOURL',6,'1997-01-23 00:00:00','1997-02-06 00:00:00','1997-02-24 00:00:00',3,'24.50','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10424,'MEREP',7,'1997-01-23 00:00:00','1997-02-20 00:00:00','1997-01-27 00:00:00',2,'370.61','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10425,'LAMAI',6,'1997-01-24 00:00:00','1997-02-21 00:00:00','1997-02-14 00:00:00',2,'7.93','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10426,'GALED',4,'1997-01-27 00:00:00','1997-02-24 00:00:00','1997-02-06 00:00:00',1,'18.69','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10427,'PICCO',4,'1997-01-27 00:00:00','1997-02-24 00:00:00','1997-03-03 00:00:00',2,'31.29','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10428,'REGGC',7,'1997-01-28 00:00:00','1997-02-25 00:00:00','1997-02-04 00:00:00',1,'11.09','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10429,'HUNGO',3,'1997-01-29 00:00:00','1997-03-12 00:00:00','1997-02-07 00:00:00',2,'56.63','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10430,'ERNSH',4,'1997-01-30 00:00:00','1997-02-13 00:00:00','1997-02-03 00:00:00',1,'458.78','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10431,'BOTTM',4,'1997-01-30 00:00:00','1997-02-13 00:00:00','1997-02-07 00:00:00',2,'44.17','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10432,'SPLIR',3,'1997-01-31 00:00:00','1997-02-14 00:00:00','1997-02-07 00:00:00',2,'4.34','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10433,'PRINI',3,'1997-02-03 00:00:00','1997-03-03 00:00:00','1997-03-04 00:00:00',3,'73.83','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10434,'FOLKO',3,'1997-02-03 00:00:00','1997-03-03 00:00:00','1997-02-13 00:00:00',2,'17.92','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10435,'CONSH',8,'1997-02-04 00:00:00','1997-03-18 00:00:00','1997-02-07 00:00:00',2,'9.21','Consolidated Holdings','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK'),
+ (10436,'BLONP',3,'1997-02-05 00:00:00','1997-03-05 00:00:00','1997-02-11 00:00:00',2,'156.66','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10437,'WARTH',8,'1997-02-05 00:00:00','1997-03-05 00:00:00','1997-02-12 00:00:00',1,'19.97','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10438,'TOMSP',3,'1997-02-06 00:00:00','1997-03-06 00:00:00','1997-02-14 00:00:00',2,'8.24','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10439,'MEREP',6,'1997-02-07 00:00:00','1997-03-07 00:00:00','1997-02-10 00:00:00',3,'4.07','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10440,'SAVEA',4,'1997-02-10 00:00:00','1997-03-10 00:00:00','1997-02-28 00:00:00',2,'86.53','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10441,'OLDWO',3,'1997-02-10 00:00:00','1997-03-24 00:00:00','1997-03-14 00:00:00',2,'73.02','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10442,'ERNSH',3,'1997-02-11 00:00:00','1997-03-11 00:00:00','1997-02-18 00:00:00',2,'47.94','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10443,'REGGC',8,'1997-02-12 00:00:00','1997-03-12 00:00:00','1997-02-14 00:00:00',1,'13.95','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10444,'BERGS',3,'1997-02-12 00:00:00','1997-03-12 00:00:00','1997-02-21 00:00:00',3,'3.50','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10445,'BERGS',3,'1997-02-13 00:00:00','1997-03-13 00:00:00','1997-02-20 00:00:00',1,'9.30','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10446,'TOMSP',6,'1997-02-14 00:00:00','1997-03-14 00:00:00','1997-02-19 00:00:00',1,'14.68','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10447,'RICAR',4,'1997-02-14 00:00:00','1997-03-14 00:00:00','1997-03-07 00:00:00',2,'68.66','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10448,'RANCH',4,'1997-02-17 00:00:00','1997-03-17 00:00:00','1997-02-24 00:00:00',2,'38.82','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10449,'BLONP',3,'1997-02-18 00:00:00','1997-03-18 00:00:00','1997-02-27 00:00:00',2,'53.30','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10450,'VICTE',8,'1997-02-19 00:00:00','1997-03-19 00:00:00','1997-03-11 00:00:00',2,'7.23','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10451,'QUICK',4,'1997-02-19 00:00:00','1997-03-05 00:00:00','1997-03-12 00:00:00',3,'189.09','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10452,'SAVEA',8,'1997-02-20 00:00:00','1997-03-20 00:00:00','1997-02-26 00:00:00',1,'140.26','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10453,'AROUT',1,'1997-02-21 00:00:00','1997-03-21 00:00:00','1997-02-26 00:00:00',2,'25.36','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10454,'LAMAI',4,'1997-02-21 00:00:00','1997-03-21 00:00:00','1997-02-25 00:00:00',3,'2.74','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10455,'WARTH',8,'1997-02-24 00:00:00','1997-04-07 00:00:00','1997-03-03 00:00:00',2,'180.45','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10456,'KOENE',8,'1997-02-25 00:00:00','1997-04-08 00:00:00','1997-02-28 00:00:00',2,'8.12','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10457,'KOENE',2,'1997-02-25 00:00:00','1997-03-25 00:00:00','1997-03-03 00:00:00',1,'11.57','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10458,'SUPRD',7,'1997-02-26 00:00:00','1997-03-26 00:00:00','1997-03-04 00:00:00',3,'147.06','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10459,'VICTE',4,'1997-02-27 00:00:00','1997-03-27 00:00:00','1997-02-28 00:00:00',2,'25.09','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10460,'FOLKO',8,'1997-02-28 00:00:00','1997-03-28 00:00:00','1997-03-03 00:00:00',1,'16.27','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10461,'LILAS',1,'1997-02-28 00:00:00','1997-03-28 00:00:00','1997-03-05 00:00:00',3,'148.61','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10462,'CONSH',2,'1997-03-03 00:00:00','1997-03-31 00:00:00','1997-03-18 00:00:00',1,'6.17','Consolidated Holdings','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK'),
+ (10463,'SUPRD',5,'1997-03-04 00:00:00','1997-04-01 00:00:00','1997-03-06 00:00:00',3,'14.78','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10464,'FURIB',4,'1997-03-04 00:00:00','1997-04-01 00:00:00','1997-03-14 00:00:00',2,'89.00','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10465,'VAFFE',1,'1997-03-05 00:00:00','1997-04-02 00:00:00','1997-03-14 00:00:00',3,'145.04','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10466,'COMMI',4,'1997-03-06 00:00:00','1997-04-03 00:00:00','1997-03-13 00:00:00',1,'11.93','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10467,'MAGAA',8,'1997-03-06 00:00:00','1997-04-03 00:00:00','1997-03-11 00:00:00',2,'4.93','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10468,'KOENE',3,'1997-03-07 00:00:00','1997-04-04 00:00:00','1997-03-12 00:00:00',3,'44.12','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10469,'WHITC',1,'1997-03-10 00:00:00','1997-04-07 00:00:00','1997-03-14 00:00:00',1,'60.18','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10470,'BONAP',4,'1997-03-11 00:00:00','1997-04-08 00:00:00','1997-03-14 00:00:00',2,'64.56','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10471,'BSBEV',2,'1997-03-11 00:00:00','1997-04-08 00:00:00','1997-03-18 00:00:00',3,'45.59','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10472,'SEVES',8,'1997-03-12 00:00:00','1997-04-09 00:00:00','1997-03-19 00:00:00',1,'4.20','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10473,'ISLAT',1,'1997-03-13 00:00:00','1997-03-27 00:00:00','1997-03-21 00:00:00',3,'16.37','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10474,'PERIC',5,'1997-03-13 00:00:00','1997-04-10 00:00:00','1997-03-21 00:00:00',2,'83.49','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10475,'SUPRD',9,'1997-03-14 00:00:00','1997-04-11 00:00:00','1997-04-04 00:00:00',1,'68.52','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10476,'HILAA',8,'1997-03-17 00:00:00','1997-04-14 00:00:00','1997-03-24 00:00:00',3,'4.41','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10477,'PRINI',5,'1997-03-17 00:00:00','1997-04-14 00:00:00','1997-03-25 00:00:00',2,'13.02','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal'),
+ (10478,'VICTE',2,'1997-03-18 00:00:00','1997-04-01 00:00:00','1997-03-26 00:00:00',3,'4.81','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10479,'RATTC',3,'1997-03-19 00:00:00','1997-04-16 00:00:00','1997-03-21 00:00:00',3,'708.95','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10480,'FOLIG',6,'1997-03-20 00:00:00','1997-04-17 00:00:00','1997-03-24 00:00:00',2,'1.35','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10481,'RICAR',8,'1997-03-20 00:00:00','1997-04-17 00:00:00','1997-03-25 00:00:00',2,'64.33','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10482,'LAZYK',1,'1997-03-21 00:00:00','1997-04-18 00:00:00','1997-04-10 00:00:00',3,'7.48','Lazy K Kountry Store','12 Orchestra Terrace','Walla Walla','WA','99362','USA'),
+ (10483,'WHITC',7,'1997-03-24 00:00:00','1997-04-21 00:00:00','1997-04-25 00:00:00',2,'15.28','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10484,'BSBEV',3,'1997-03-24 00:00:00','1997-04-21 00:00:00','1997-04-01 00:00:00',3,'6.88','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10485,'LINOD',4,'1997-03-25 00:00:00','1997-04-08 00:00:00','1997-03-31 00:00:00',2,'64.45','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10486,'HILAA',1,'1997-03-26 00:00:00','1997-04-23 00:00:00','1997-04-02 00:00:00',2,'30.53','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10487,'QUEEN',2,'1997-03-26 00:00:00','1997-04-23 00:00:00','1997-03-28 00:00:00',2,'71.07','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10488,'FRANK',8,'1997-03-27 00:00:00','1997-04-24 00:00:00','1997-04-02 00:00:00',2,'4.93','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10489,'PICCO',6,'1997-03-28 00:00:00','1997-04-25 00:00:00','1997-04-09 00:00:00',2,'5.29','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10490,'HILAA',7,'1997-03-31 00:00:00','1997-04-28 00:00:00','1997-04-03 00:00:00',2,'210.19','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10491,'FURIB',8,'1997-03-31 00:00:00','1997-04-28 00:00:00','1997-04-08 00:00:00',3,'16.96','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10492,'BOTTM',3,'1997-04-01 00:00:00','1997-04-29 00:00:00','1997-04-11 00:00:00',1,'62.89','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10493,'LAMAI',4,'1997-04-02 00:00:00','1997-04-30 00:00:00','1997-04-10 00:00:00',3,'10.64','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10494,'COMMI',4,'1997-04-02 00:00:00','1997-04-30 00:00:00','1997-04-09 00:00:00',2,'65.99','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10495,'LAUGB',3,'1997-04-03 00:00:00','1997-05-01 00:00:00','1997-04-11 00:00:00',3,'4.65','Laughing Bacchus Wine Cellars','2319 Elm St.','Vancouver','BC','V3F 2K1','Canada'),
+ (10496,'TRADH',7,'1997-04-04 00:00:00','1997-05-02 00:00:00','1997-04-07 00:00:00',2,'46.77','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10497,'LEHMS',7,'1997-04-04 00:00:00','1997-05-02 00:00:00','1997-04-07 00:00:00',1,'36.21','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10498,'HILAA',8,'1997-04-07 00:00:00','1997-05-05 00:00:00','1997-04-11 00:00:00',2,'29.75','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10499,'LILAS',4,'1997-04-08 00:00:00','1997-05-06 00:00:00','1997-04-16 00:00:00',2,'102.02','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10500,'LAMAI',6,'1997-04-09 00:00:00','1997-05-07 00:00:00','1997-04-17 00:00:00',1,'42.68','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10501,'BLAUS',9,'1997-04-09 00:00:00','1997-05-07 00:00:00','1997-04-16 00:00:00',3,'8.85','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10502,'PERIC',2,'1997-04-10 00:00:00','1997-05-08 00:00:00','1997-04-29 00:00:00',1,'69.32','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10503,'HUNGO',6,'1997-04-11 00:00:00','1997-05-09 00:00:00','1997-04-16 00:00:00',2,'16.74','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10504,'WHITC',4,'1997-04-11 00:00:00','1997-05-09 00:00:00','1997-04-18 00:00:00',3,'59.13','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10505,'MEREP',3,'1997-04-14 00:00:00','1997-05-12 00:00:00','1997-04-21 00:00:00',3,'7.13','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10506,'KOENE',9,'1997-04-15 00:00:00','1997-05-13 00:00:00','1997-05-02 00:00:00',2,'21.19','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10507,'ANTON',7,'1997-04-15 00:00:00','1997-05-13 00:00:00','1997-04-22 00:00:00',1,'47.45','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10508,'OTTIK',1,'1997-04-16 00:00:00','1997-05-14 00:00:00','1997-05-13 00:00:00',2,'4.99','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10509,'BLAUS',4,'1997-04-17 00:00:00','1997-05-15 00:00:00','1997-04-29 00:00:00',1,'0.15','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10510,'SAVEA',6,'1997-04-18 00:00:00','1997-05-16 00:00:00','1997-04-28 00:00:00',3,'367.63','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10511,'BONAP',4,'1997-04-18 00:00:00','1997-05-16 00:00:00','1997-04-21 00:00:00',3,'350.64','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10512,'FAMIA',7,'1997-04-21 00:00:00','1997-05-19 00:00:00','1997-04-24 00:00:00',2,'3.53','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10513,'WANDK',7,'1997-04-22 00:00:00','1997-06-03 00:00:00','1997-04-28 00:00:00',1,'105.65','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10514,'ERNSH',3,'1997-04-22 00:00:00','1997-05-20 00:00:00','1997-05-16 00:00:00',2,'789.95','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10515,'QUICK',2,'1997-04-23 00:00:00','1997-05-07 00:00:00','1997-05-23 00:00:00',1,'204.47','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10516,'HUNGO',2,'1997-04-24 00:00:00','1997-05-22 00:00:00','1997-05-01 00:00:00',3,'62.78','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10517,'NORTS',3,'1997-04-24 00:00:00','1997-05-22 00:00:00','1997-04-29 00:00:00',3,'32.07','North/South','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10518,'TORTU',4,'1997-04-25 00:00:00','1997-05-09 00:00:00','1997-05-05 00:00:00',2,'218.15','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10519,'CHOPS',6,'1997-04-28 00:00:00','1997-05-26 00:00:00','1997-05-01 00:00:00',3,'91.76','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10520,'SANTG',7,'1997-04-29 00:00:00','1997-05-27 00:00:00','1997-05-01 00:00:00',1,'13.37','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10521,'CACTU',8,'1997-04-29 00:00:00','1997-05-27 00:00:00','1997-05-02 00:00:00',2,'17.22','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10522,'LEHMS',4,'1997-04-30 00:00:00','1997-05-28 00:00:00','1997-05-06 00:00:00',1,'45.33','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10523,'SEVES',7,'1997-05-01 00:00:00','1997-05-29 00:00:00','1997-05-30 00:00:00',2,'77.63','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10524,'BERGS',1,'1997-05-01 00:00:00','1997-05-29 00:00:00','1997-05-07 00:00:00',2,'244.79','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10525,'BONAP',1,'1997-05-02 00:00:00','1997-05-30 00:00:00','1997-05-23 00:00:00',2,'11.06','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10526,'WARTH',4,'1997-05-05 00:00:00','1997-06-02 00:00:00','1997-05-15 00:00:00',2,'58.59','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10527,'QUICK',7,'1997-05-05 00:00:00','1997-06-02 00:00:00','1997-05-07 00:00:00',1,'41.90','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10528,'GREAL',6,'1997-05-06 00:00:00','1997-05-20 00:00:00','1997-05-09 00:00:00',2,'3.35','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10529,'MAISD',5,'1997-05-07 00:00:00','1997-06-04 00:00:00','1997-05-09 00:00:00',2,'66.69','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10530,'PICCO',3,'1997-05-08 00:00:00','1997-06-05 00:00:00','1997-05-12 00:00:00',2,'339.22','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10531,'OCEAN',7,'1997-05-08 00:00:00','1997-06-05 00:00:00','1997-05-19 00:00:00',1,'8.12','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10532,'EASTC',7,'1997-05-09 00:00:00','1997-06-06 00:00:00','1997-05-12 00:00:00',3,'74.46','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10533,'FOLKO',8,'1997-05-12 00:00:00','1997-06-09 00:00:00','1997-05-22 00:00:00',1,'188.04','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10534,'LEHMS',8,'1997-05-12 00:00:00','1997-06-09 00:00:00','1997-05-14 00:00:00',2,'27.94','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10535,'ANTON',4,'1997-05-13 00:00:00','1997-06-10 00:00:00','1997-05-21 00:00:00',1,'15.64','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10536,'LEHMS',3,'1997-05-14 00:00:00','1997-06-11 00:00:00','1997-06-06 00:00:00',2,'58.88','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10537,'RICSU',1,'1997-05-14 00:00:00','1997-05-28 00:00:00','1997-05-19 00:00:00',1,'78.85','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10538,'BSBEV',9,'1997-05-15 00:00:00','1997-06-12 00:00:00','1997-05-16 00:00:00',3,'4.87','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10539,'BSBEV',6,'1997-05-16 00:00:00','1997-06-13 00:00:00','1997-05-23 00:00:00',3,'12.36','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10540,'QUICK',3,'1997-05-19 00:00:00','1997-06-16 00:00:00','1997-06-13 00:00:00',3,'1007.64','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10541,'HANAR',2,'1997-05-19 00:00:00','1997-06-16 00:00:00','1997-05-29 00:00:00',1,'68.65','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10542,'KOENE',1,'1997-05-20 00:00:00','1997-06-17 00:00:00','1997-05-26 00:00:00',3,'10.95','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10543,'LILAS',8,'1997-05-21 00:00:00','1997-06-18 00:00:00','1997-05-23 00:00:00',2,'48.17','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10544,'LONEP',4,'1997-05-21 00:00:00','1997-06-18 00:00:00','1997-05-30 00:00:00',1,'24.91','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10545,'LAZYK',8,'1997-05-22 00:00:00','1997-06-19 00:00:00','1997-06-26 00:00:00',2,'11.92','Lazy K Kountry Store','12 Orchestra Terrace','Walla Walla','WA','99362','USA'),
+ (10546,'VICTE',1,'1997-05-23 00:00:00','1997-06-20 00:00:00','1997-05-27 00:00:00',3,'194.72','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10547,'SEVES',3,'1997-05-23 00:00:00','1997-06-20 00:00:00','1997-06-02 00:00:00',2,'178.43','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10548,'TOMSP',3,'1997-05-26 00:00:00','1997-06-23 00:00:00','1997-06-02 00:00:00',2,'1.43','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10549,'QUICK',5,'1997-05-27 00:00:00','1997-06-10 00:00:00','1997-05-30 00:00:00',1,'171.24','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10550,'GODOS',7,'1997-05-28 00:00:00','1997-06-25 00:00:00','1997-06-06 00:00:00',3,'4.32','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10551,'FURIB',4,'1997-05-28 00:00:00','1997-07-09 00:00:00','1997-06-06 00:00:00',3,'72.95','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10552,'HILAA',2,'1997-05-29 00:00:00','1997-06-26 00:00:00','1997-06-05 00:00:00',1,'83.22','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10553,'WARTH',2,'1997-05-30 00:00:00','1997-06-27 00:00:00','1997-06-03 00:00:00',2,'149.49','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10554,'OTTIK',4,'1997-05-30 00:00:00','1997-06-27 00:00:00','1997-06-05 00:00:00',3,'120.97','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10555,'SAVEA',6,'1997-06-02 00:00:00','1997-06-30 00:00:00','1997-06-04 00:00:00',3,'252.49','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10556,'SIMOB',2,'1997-06-03 00:00:00','1997-07-15 00:00:00','1997-06-13 00:00:00',1,'9.80','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10557,'LEHMS',9,'1997-06-03 00:00:00','1997-06-17 00:00:00','1997-06-06 00:00:00',2,'96.72','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10558,'AROUT',1,'1997-06-04 00:00:00','1997-07-02 00:00:00','1997-06-10 00:00:00',2,'72.97','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10559,'BLONP',6,'1997-06-05 00:00:00','1997-07-03 00:00:00','1997-06-13 00:00:00',1,'8.05','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10560,'FRANK',8,'1997-06-06 00:00:00','1997-07-04 00:00:00','1997-06-09 00:00:00',1,'36.65','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10561,'FOLKO',2,'1997-06-06 00:00:00','1997-07-04 00:00:00','1997-06-09 00:00:00',2,'242.21','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10562,'REGGC',1,'1997-06-09 00:00:00','1997-07-07 00:00:00','1997-06-12 00:00:00',1,'22.95','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10563,'RICAR',2,'1997-06-10 00:00:00','1997-07-22 00:00:00','1997-06-24 00:00:00',2,'60.43','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10564,'RATTC',4,'1997-06-10 00:00:00','1997-07-08 00:00:00','1997-06-16 00:00:00',3,'13.75','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10565,'MEREP',8,'1997-06-11 00:00:00','1997-07-09 00:00:00','1997-06-18 00:00:00',2,'7.15','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10566,'BLONP',9,'1997-06-12 00:00:00','1997-07-10 00:00:00','1997-06-18 00:00:00',1,'88.40','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10567,'HUNGO',1,'1997-06-12 00:00:00','1997-07-10 00:00:00','1997-06-17 00:00:00',1,'33.97','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10568,'GALED',3,'1997-06-13 00:00:00','1997-07-11 00:00:00','1997-07-09 00:00:00',3,'6.54','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10569,'RATTC',5,'1997-06-16 00:00:00','1997-07-14 00:00:00','1997-07-11 00:00:00',1,'58.98','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10570,'MEREP',3,'1997-06-17 00:00:00','1997-07-15 00:00:00','1997-06-19 00:00:00',3,'188.99','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10571,'ERNSH',8,'1997-06-17 00:00:00','1997-07-29 00:00:00','1997-07-04 00:00:00',3,'26.06','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10572,'BERGS',3,'1997-06-18 00:00:00','1997-07-16 00:00:00','1997-06-25 00:00:00',2,'116.43','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10573,'ANTON',7,'1997-06-19 00:00:00','1997-07-17 00:00:00','1997-06-20 00:00:00',3,'84.84','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10574,'TRAIH',4,'1997-06-19 00:00:00','1997-07-17 00:00:00','1997-06-30 00:00:00',2,'37.60','Trail\'s Head Gourmet Provisioners','722 DaVinci Blvd.','Kirkland','WA','98034','USA'),
+ (10575,'MORGK',5,'1997-06-20 00:00:00','1997-07-04 00:00:00','1997-06-30 00:00:00',1,'127.34','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10576,'TORTU',3,'1997-06-23 00:00:00','1997-07-07 00:00:00','1997-06-30 00:00:00',3,'18.56','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10577,'TRAIH',9,'1997-06-23 00:00:00','1997-08-04 00:00:00','1997-06-30 00:00:00',2,'25.41','Trail\'s Head Gourmet Provisioners','722 DaVinci Blvd.','Kirkland','WA','98034','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10578,'BSBEV',4,'1997-06-24 00:00:00','1997-07-22 00:00:00','1997-07-25 00:00:00',3,'29.60','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10579,'LETSS',1,'1997-06-25 00:00:00','1997-07-23 00:00:00','1997-07-04 00:00:00',2,'13.73','Let\'s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10580,'OTTIK',4,'1997-06-26 00:00:00','1997-07-24 00:00:00','1997-07-01 00:00:00',3,'75.89','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10581,'FAMIA',3,'1997-06-26 00:00:00','1997-07-24 00:00:00','1997-07-02 00:00:00',1,'3.01','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10582,'BLAUS',3,'1997-06-27 00:00:00','1997-07-25 00:00:00','1997-07-14 00:00:00',2,'27.71','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10583,'WARTH',2,'1997-06-30 00:00:00','1997-07-28 00:00:00','1997-07-04 00:00:00',2,'7.28','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10584,'BLONP',4,'1997-06-30 00:00:00','1997-07-28 00:00:00','1997-07-04 00:00:00',1,'59.14','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10585,'WELLI',7,'1997-07-01 00:00:00','1997-07-29 00:00:00','1997-07-10 00:00:00',1,'13.41','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10586,'REGGC',9,'1997-07-02 00:00:00','1997-07-30 00:00:00','1997-07-09 00:00:00',1,'0.48','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10587,'QUEDE',1,'1997-07-02 00:00:00','1997-07-30 00:00:00','1997-07-09 00:00:00',1,'62.52','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10588,'QUICK',2,'1997-07-03 00:00:00','1997-07-31 00:00:00','1997-07-10 00:00:00',3,'194.67','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10589,'GREAL',8,'1997-07-04 00:00:00','1997-08-01 00:00:00','1997-07-14 00:00:00',2,'4.42','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10590,'MEREP',4,'1997-07-07 00:00:00','1997-08-04 00:00:00','1997-07-14 00:00:00',3,'44.77','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10591,'VAFFE',1,'1997-07-07 00:00:00','1997-07-21 00:00:00','1997-07-16 00:00:00',1,'55.92','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10592,'LEHMS',3,'1997-07-08 00:00:00','1997-08-05 00:00:00','1997-07-16 00:00:00',1,'32.10','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10593,'LEHMS',7,'1997-07-09 00:00:00','1997-08-06 00:00:00','1997-08-13 00:00:00',2,'174.20','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10594,'OLDWO',3,'1997-07-09 00:00:00','1997-08-06 00:00:00','1997-07-16 00:00:00',2,'5.24','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10595,'ERNSH',2,'1997-07-10 00:00:00','1997-08-07 00:00:00','1997-07-14 00:00:00',1,'96.78','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10596,'WHITC',8,'1997-07-11 00:00:00','1997-08-08 00:00:00','1997-08-12 00:00:00',1,'16.34','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10597,'PICCO',7,'1997-07-11 00:00:00','1997-08-08 00:00:00','1997-07-18 00:00:00',3,'35.12','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10598,'RATTC',1,'1997-07-14 00:00:00','1997-08-11 00:00:00','1997-07-18 00:00:00',3,'44.42','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10599,'BSBEV',6,'1997-07-15 00:00:00','1997-08-26 00:00:00','1997-07-21 00:00:00',3,'29.98','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10600,'HUNGC',4,'1997-07-16 00:00:00','1997-08-13 00:00:00','1997-07-21 00:00:00',1,'45.13','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10601,'HILAA',7,'1997-07-16 00:00:00','1997-08-27 00:00:00','1997-07-22 00:00:00',1,'58.30','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10602,'VAFFE',8,'1997-07-17 00:00:00','1997-08-14 00:00:00','1997-07-22 00:00:00',2,'2.92','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10603,'SAVEA',8,'1997-07-18 00:00:00','1997-08-15 00:00:00','1997-08-08 00:00:00',2,'48.77','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10604,'FURIB',1,'1997-07-18 00:00:00','1997-08-15 00:00:00','1997-07-29 00:00:00',1,'7.46','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10605,'MEREP',1,'1997-07-21 00:00:00','1997-08-18 00:00:00','1997-07-29 00:00:00',2,'379.13','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10606,'TRADH',4,'1997-07-22 00:00:00','1997-08-19 00:00:00','1997-07-31 00:00:00',3,'79.40','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10607,'SAVEA',5,'1997-07-22 00:00:00','1997-08-19 00:00:00','1997-07-25 00:00:00',1,'200.24','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10608,'TOMSP',4,'1997-07-23 00:00:00','1997-08-20 00:00:00','1997-08-01 00:00:00',2,'27.79','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany'),
+ (10609,'DUMON',7,'1997-07-24 00:00:00','1997-08-21 00:00:00','1997-07-30 00:00:00',2,'1.85','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10610,'LAMAI',8,'1997-07-25 00:00:00','1997-08-22 00:00:00','1997-08-06 00:00:00',1,'26.78','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10611,'WOLZA',6,'1997-07-25 00:00:00','1997-08-22 00:00:00','1997-08-01 00:00:00',2,'80.65','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10612,'SAVEA',1,'1997-07-28 00:00:00','1997-08-25 00:00:00','1997-08-01 00:00:00',2,'544.08','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10613,'HILAA',4,'1997-07-29 00:00:00','1997-08-26 00:00:00','1997-08-01 00:00:00',2,'8.11','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10614,'BLAUS',8,'1997-07-29 00:00:00','1997-08-26 00:00:00','1997-08-01 00:00:00',3,'1.93','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10615,'WILMK',2,'1997-07-30 00:00:00','1997-08-27 00:00:00','1997-08-06 00:00:00',3,'0.75','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10616,'GREAL',1,'1997-07-31 00:00:00','1997-08-28 00:00:00','1997-08-05 00:00:00',2,'116.53','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10617,'GREAL',4,'1997-07-31 00:00:00','1997-08-28 00:00:00','1997-08-04 00:00:00',2,'18.53','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10618,'MEREP',1,'1997-08-01 00:00:00','1997-09-12 00:00:00','1997-08-08 00:00:00',1,'154.68','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10619,'MEREP',3,'1997-08-04 00:00:00','1997-09-01 00:00:00','1997-08-07 00:00:00',3,'91.05','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10620,'LAUGB',2,'1997-08-05 00:00:00','1997-09-02 00:00:00','1997-08-14 00:00:00',3,'0.94','Laughing Bacchus Wine Cellars','2319 Elm St.','Vancouver','BC','V3F 2K1','Canada'),
+ (10621,'ISLAT',4,'1997-08-05 00:00:00','1997-09-02 00:00:00','1997-08-11 00:00:00',2,'23.73','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10622,'RICAR',4,'1997-08-06 00:00:00','1997-09-03 00:00:00','1997-08-11 00:00:00',3,'50.97','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10623,'FRANK',8,'1997-08-07 00:00:00','1997-09-04 00:00:00','1997-08-12 00:00:00',2,'97.18','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10624,'THECR',4,'1997-08-07 00:00:00','1997-09-04 00:00:00','1997-08-19 00:00:00',2,'94.80','The Cracker Box','55 Grizzly Peak Rd.','Butte','MT','59801','USA'),
+ (10625,'ANATR',3,'1997-08-08 00:00:00','1997-09-05 00:00:00','1997-08-14 00:00:00',1,'43.90','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10626,'BERGS',1,'1997-08-11 00:00:00','1997-09-08 00:00:00','1997-08-20 00:00:00',2,'138.69','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10627,'SAVEA',8,'1997-08-11 00:00:00','1997-09-22 00:00:00','1997-08-21 00:00:00',3,'107.46','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10628,'BLONP',4,'1997-08-12 00:00:00','1997-09-09 00:00:00','1997-08-20 00:00:00',3,'30.36','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10629,'GODOS',4,'1997-08-12 00:00:00','1997-09-09 00:00:00','1997-08-20 00:00:00',3,'85.46','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10630,'KOENE',1,'1997-08-13 00:00:00','1997-09-10 00:00:00','1997-08-19 00:00:00',2,'32.35','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10631,'LAMAI',8,'1997-08-14 00:00:00','1997-09-11 00:00:00','1997-08-15 00:00:00',1,'0.87','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10632,'WANDK',8,'1997-08-14 00:00:00','1997-09-11 00:00:00','1997-08-19 00:00:00',1,'41.38','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10633,'ERNSH',7,'1997-08-15 00:00:00','1997-09-12 00:00:00','1997-08-18 00:00:00',3,'477.90','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10634,'FOLIG',4,'1997-08-15 00:00:00','1997-09-12 00:00:00','1997-08-21 00:00:00',3,'487.38','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10635,'MAGAA',8,'1997-08-18 00:00:00','1997-09-15 00:00:00','1997-08-21 00:00:00',3,'47.46','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10636,'WARTH',4,'1997-08-19 00:00:00','1997-09-16 00:00:00','1997-08-26 00:00:00',1,'1.15','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10637,'QUEEN',6,'1997-08-19 00:00:00','1997-09-16 00:00:00','1997-08-26 00:00:00',1,'201.29','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10638,'LINOD',3,'1997-08-20 00:00:00','1997-09-17 00:00:00','1997-09-01 00:00:00',1,'158.44','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10639,'SANTG',7,'1997-08-20 00:00:00','1997-09-17 00:00:00','1997-08-27 00:00:00',3,'38.64','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10640,'WANDK',4,'1997-08-21 00:00:00','1997-09-18 00:00:00','1997-08-28 00:00:00',1,'23.55','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10641,'HILAA',4,'1997-08-22 00:00:00','1997-09-19 00:00:00','1997-08-26 00:00:00',2,'179.61','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10642,'SIMOB',7,'1997-08-22 00:00:00','1997-09-19 00:00:00','1997-09-05 00:00:00',3,'41.89','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10643,'ALFKI',6,'1997-08-25 00:00:00','1997-09-22 00:00:00','1997-09-02 00:00:00',1,'29.46','Alfreds Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10644,'WELLI',3,'1997-08-25 00:00:00','1997-09-22 00:00:00','1997-09-01 00:00:00',2,'0.14','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10645,'HANAR',4,'1997-08-26 00:00:00','1997-09-23 00:00:00','1997-09-02 00:00:00',1,'12.41','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10646,'HUNGO',9,'1997-08-27 00:00:00','1997-10-08 00:00:00','1997-09-03 00:00:00',3,'142.33','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10647,'QUEDE',4,'1997-08-27 00:00:00','1997-09-10 00:00:00','1997-09-03 00:00:00',2,'45.54','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10648,'RICAR',5,'1997-08-28 00:00:00','1997-10-09 00:00:00','1997-09-09 00:00:00',2,'14.25','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10649,'MAISD',5,'1997-08-28 00:00:00','1997-09-25 00:00:00','1997-08-29 00:00:00',3,'6.20','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10650,'FAMIA',5,'1997-08-29 00:00:00','1997-09-26 00:00:00','1997-09-03 00:00:00',3,'176.81','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10651,'WANDK',8,'1997-09-01 00:00:00','1997-09-29 00:00:00','1997-09-11 00:00:00',2,'20.60','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10652,'GOURL',4,'1997-09-01 00:00:00','1997-09-29 00:00:00','1997-09-08 00:00:00',2,'7.14','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10653,'FRANK',1,'1997-09-02 00:00:00','1997-09-30 00:00:00','1997-09-19 00:00:00',1,'93.25','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10654,'BERGS',5,'1997-09-02 00:00:00','1997-09-30 00:00:00','1997-09-11 00:00:00',1,'55.26','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10655,'REGGC',1,'1997-09-03 00:00:00','1997-10-01 00:00:00','1997-09-11 00:00:00',2,'4.41','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10656,'GREAL',6,'1997-09-04 00:00:00','1997-10-02 00:00:00','1997-09-10 00:00:00',1,'57.15','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10657,'SAVEA',2,'1997-09-04 00:00:00','1997-10-02 00:00:00','1997-09-15 00:00:00',2,'352.69','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10658,'QUICK',4,'1997-09-05 00:00:00','1997-10-03 00:00:00','1997-09-08 00:00:00',1,'364.15','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10659,'QUEEN',7,'1997-09-05 00:00:00','1997-10-03 00:00:00','1997-09-10 00:00:00',2,'105.81','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10660,'HUNGC',8,'1997-09-08 00:00:00','1997-10-06 00:00:00','1997-10-15 00:00:00',1,'111.29','Hungry Coyote Import Store','City Center Plaza 516 Main St.','Elgin','OR','97827','USA'),
+ (10661,'HUNGO',7,'1997-09-09 00:00:00','1997-10-07 00:00:00','1997-09-15 00:00:00',3,'17.55','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10662,'LONEP',3,'1997-09-09 00:00:00','1997-10-07 00:00:00','1997-09-18 00:00:00',2,'1.28','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10663,'BONAP',2,'1997-09-10 00:00:00','1997-09-24 00:00:00','1997-10-03 00:00:00',2,'113.15','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10664,'FURIB',1,'1997-09-10 00:00:00','1997-10-08 00:00:00','1997-09-19 00:00:00',3,'1.27','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10665,'LONEP',1,'1997-09-11 00:00:00','1997-10-09 00:00:00','1997-09-17 00:00:00',2,'26.31','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10666,'RICSU',7,'1997-09-12 00:00:00','1997-10-10 00:00:00','1997-09-22 00:00:00',2,'232.42','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10667,'ERNSH',7,'1997-09-12 00:00:00','1997-10-10 00:00:00','1997-09-19 00:00:00',1,'78.09','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10668,'WANDK',1,'1997-09-15 00:00:00','1997-10-13 00:00:00','1997-09-23 00:00:00',2,'47.22','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (10669,'SIMOB',2,'1997-09-15 00:00:00','1997-10-13 00:00:00','1997-09-22 00:00:00',1,'24.39','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10670,'FRANK',4,'1997-09-16 00:00:00','1997-10-14 00:00:00','1997-09-18 00:00:00',1,'203.48','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10671,'FRANR',1,'1997-09-17 00:00:00','1997-10-15 00:00:00','1997-09-24 00:00:00',1,'30.34','France restauration','54 rue Royale','Nantes',NULL,'44000','France'),
+ (10672,'BERGS',9,'1997-09-17 00:00:00','1997-10-01 00:00:00','1997-09-26 00:00:00',2,'95.75','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10673,'WILMK',2,'1997-09-18 00:00:00','1997-10-16 00:00:00','1997-09-19 00:00:00',1,'22.76','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10674,'ISLAT',4,'1997-09-18 00:00:00','1997-10-16 00:00:00','1997-09-30 00:00:00',2,'0.90','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10675,'FRANK',5,'1997-09-19 00:00:00','1997-10-17 00:00:00','1997-09-23 00:00:00',2,'31.85','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10676,'TORTU',2,'1997-09-22 00:00:00','1997-10-20 00:00:00','1997-09-29 00:00:00',2,'2.01','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10677,'ANTON',1,'1997-09-22 00:00:00','1997-10-20 00:00:00','1997-09-26 00:00:00',3,'4.03','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10678,'SAVEA',7,'1997-09-23 00:00:00','1997-10-21 00:00:00','1997-10-16 00:00:00',3,'388.98','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10679,'BLONP',8,'1997-09-23 00:00:00','1997-10-21 00:00:00','1997-09-30 00:00:00',3,'27.94','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10680,'OLDWO',1,'1997-09-24 00:00:00','1997-10-22 00:00:00','1997-09-26 00:00:00',1,'26.61','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10681,'GREAL',3,'1997-09-25 00:00:00','1997-10-23 00:00:00','1997-09-30 00:00:00',3,'76.13','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10682,'ANTON',3,'1997-09-25 00:00:00','1997-10-23 00:00:00','1997-10-01 00:00:00',2,'36.13','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10683,'DUMON',2,'1997-09-26 00:00:00','1997-10-24 00:00:00','1997-10-01 00:00:00',1,'4.40','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10684,'OTTIK',3,'1997-09-26 00:00:00','1997-10-24 00:00:00','1997-09-30 00:00:00',1,'145.63','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10685,'GOURL',4,'1997-09-29 00:00:00','1997-10-13 00:00:00','1997-10-03 00:00:00',2,'33.75','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10686,'PICCO',2,'1997-09-30 00:00:00','1997-10-28 00:00:00','1997-10-08 00:00:00',1,'96.50','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10687,'HUNGO',9,'1997-09-30 00:00:00','1997-10-28 00:00:00','1997-10-30 00:00:00',2,'296.43','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10688,'VAFFE',4,'1997-10-01 00:00:00','1997-10-15 00:00:00','1997-10-07 00:00:00',2,'299.09','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10689,'BERGS',1,'1997-10-01 00:00:00','1997-10-29 00:00:00','1997-10-07 00:00:00',2,'13.42','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10690,'HANAR',1,'1997-10-02 00:00:00','1997-10-30 00:00:00','1997-10-03 00:00:00',1,'15.80','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10691,'QUICK',2,'1997-10-03 00:00:00','1997-11-14 00:00:00','1997-10-22 00:00:00',2,'810.05','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10692,'ALFKI',4,'1997-10-03 00:00:00','1997-10-31 00:00:00','1997-10-13 00:00:00',2,'61.02','Alfred\'s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (10693,'WHITC',3,'1997-10-06 00:00:00','1997-10-20 00:00:00','1997-10-10 00:00:00',3,'139.34','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10694,'QUICK',8,'1997-10-06 00:00:00','1997-11-03 00:00:00','1997-10-09 00:00:00',3,'398.36','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10695,'WILMK',7,'1997-10-07 00:00:00','1997-11-18 00:00:00','1997-10-14 00:00:00',1,'16.72','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10696,'WHITC',8,'1997-10-08 00:00:00','1997-11-19 00:00:00','1997-10-14 00:00:00',3,'102.55','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10697,'LINOD',3,'1997-10-08 00:00:00','1997-11-05 00:00:00','1997-10-14 00:00:00',1,'45.52','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10698,'ERNSH',4,'1997-10-09 00:00:00','1997-11-06 00:00:00','1997-10-17 00:00:00',1,'272.47','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10699,'MORGK',3,'1997-10-09 00:00:00','1997-11-06 00:00:00','1997-10-13 00:00:00',3,'0.58','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10700,'SAVEA',3,'1997-10-10 00:00:00','1997-11-07 00:00:00','1997-10-16 00:00:00',1,'65.10','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10701,'HUNGO',6,'1997-10-13 00:00:00','1997-10-27 00:00:00','1997-10-15 00:00:00',3,'220.31','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10702,'ALFKI',4,'1997-10-13 00:00:00','1997-11-24 00:00:00','1997-10-21 00:00:00',1,'23.94','Alfred\'s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (10703,'FOLKO',6,'1997-10-14 00:00:00','1997-11-11 00:00:00','1997-10-20 00:00:00',2,'152.30','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10704,'QUEEN',6,'1997-10-14 00:00:00','1997-11-11 00:00:00','1997-11-07 00:00:00',1,'4.78','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10705,'HILAA',9,'1997-10-15 00:00:00','1997-11-12 00:00:00','1997-11-18 00:00:00',2,'3.52','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10706,'OLDWO',8,'1997-10-16 00:00:00','1997-11-13 00:00:00','1997-10-21 00:00:00',3,'135.63','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10707,'AROUT',4,'1997-10-16 00:00:00','1997-10-30 00:00:00','1997-10-23 00:00:00',3,'21.74','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10708,'THEBI',6,'1997-10-17 00:00:00','1997-11-28 00:00:00','1997-11-05 00:00:00',2,'2.96','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA'),
+ (10709,'GOURL',1,'1997-10-17 00:00:00','1997-11-14 00:00:00','1997-11-20 00:00:00',3,'210.80','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10710,'FRANS',1,'1997-10-20 00:00:00','1997-11-17 00:00:00','1997-10-23 00:00:00',1,'4.98','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10711,'SAVEA',5,'1997-10-21 00:00:00','1997-12-02 00:00:00','1997-10-29 00:00:00',2,'52.41','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10712,'HUNGO',3,'1997-10-21 00:00:00','1997-11-18 00:00:00','1997-10-31 00:00:00',1,'89.93','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10713,'SAVEA',1,'1997-10-22 00:00:00','1997-11-19 00:00:00','1997-10-24 00:00:00',1,'167.05','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10714,'SAVEA',5,'1997-10-22 00:00:00','1997-11-19 00:00:00','1997-10-27 00:00:00',3,'24.49','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10715,'BONAP',3,'1997-10-23 00:00:00','1997-11-06 00:00:00','1997-10-29 00:00:00',1,'63.20','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10716,'RANCH',4,'1997-10-24 00:00:00','1997-11-21 00:00:00','1997-10-27 00:00:00',2,'22.57','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10717,'FRANK',1,'1997-10-24 00:00:00','1997-11-21 00:00:00','1997-10-29 00:00:00',2,'59.25','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10718,'KOENE',1,'1997-10-27 00:00:00','1997-11-24 00:00:00','1997-10-29 00:00:00',3,'170.88','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10719,'LETSS',8,'1997-10-27 00:00:00','1997-11-24 00:00:00','1997-11-05 00:00:00',2,'51.44','Let\'s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10720,'QUEDE',8,'1997-10-28 00:00:00','1997-11-11 00:00:00','1997-11-05 00:00:00',2,'9.53','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10721,'QUICK',5,'1997-10-29 00:00:00','1997-11-26 00:00:00','1997-10-31 00:00:00',3,'48.92','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10722,'SAVEA',8,'1997-10-29 00:00:00','1997-12-10 00:00:00','1997-11-04 00:00:00',1,'74.58','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10723,'WHITC',3,'1997-10-30 00:00:00','1997-11-27 00:00:00','1997-11-25 00:00:00',1,'21.72','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10724,'MEREP',8,'1997-10-30 00:00:00','1997-12-11 00:00:00','1997-11-05 00:00:00',2,'57.75','Mère Paillarde','43 rue St. Laurent','Montréal','Québec','H1J 1C3','Canada'),
+ (10725,'FAMIA',4,'1997-10-31 00:00:00','1997-11-28 00:00:00','1997-11-05 00:00:00',3,'10.83','Familia Arquibaldo','Rua Orós 92','Sao Paulo','SP','05442-030','Brazil'),
+ (10726,'EASTC',4,'1997-11-03 00:00:00','1997-11-17 00:00:00','1997-12-05 00:00:00',1,'16.56','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10727,'REGGC',2,'1997-11-03 00:00:00','1997-12-01 00:00:00','1997-12-05 00:00:00',1,'89.90','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10728,'QUEEN',4,'1997-11-04 00:00:00','1997-12-02 00:00:00','1997-11-11 00:00:00',2,'58.33','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10729,'LINOD',8,'1997-11-04 00:00:00','1997-12-16 00:00:00','1997-11-14 00:00:00',3,'141.06','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10730,'BONAP',5,'1997-11-05 00:00:00','1997-12-03 00:00:00','1997-11-14 00:00:00',1,'20.12','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10731,'CHOPS',7,'1997-11-06 00:00:00','1997-12-04 00:00:00','1997-11-14 00:00:00',1,'96.65','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10732,'BONAP',3,'1997-11-06 00:00:00','1997-12-04 00:00:00','1997-11-07 00:00:00',1,'16.97','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10733,'BERGS',1,'1997-11-07 00:00:00','1997-12-05 00:00:00','1997-11-10 00:00:00',3,'110.11','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10734,'GOURL',2,'1997-11-07 00:00:00','1997-12-05 00:00:00','1997-11-12 00:00:00',3,'1.63','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10735,'LETSS',6,'1997-11-10 00:00:00','1997-12-08 00:00:00','1997-11-21 00:00:00',2,'45.97','Let\'s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10736,'HUNGO',9,'1997-11-11 00:00:00','1997-12-09 00:00:00','1997-11-21 00:00:00',2,'44.10','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10737,'VINET',2,'1997-11-11 00:00:00','1997-12-09 00:00:00','1997-11-18 00:00:00',2,'7.79','Vins et alcools Chevalier','59 rue de l\'Abbaye','Reims',NULL,'51100','France'),
+ (10738,'SPECD',2,'1997-11-12 00:00:00','1997-12-10 00:00:00','1997-11-18 00:00:00',1,'2.91','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France'),
+ (10739,'VINET',3,'1997-11-12 00:00:00','1997-12-10 00:00:00','1997-11-17 00:00:00',3,'11.08','Vins et alcools Chevalier','59 rue de l\'Abbaye','Reims',NULL,'51100','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10740,'WHITC',4,'1997-11-13 00:00:00','1997-12-11 00:00:00','1997-11-25 00:00:00',2,'81.88','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10741,'AROUT',4,'1997-11-14 00:00:00','1997-11-28 00:00:00','1997-11-18 00:00:00',3,'10.96','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10742,'BOTTM',3,'1997-11-14 00:00:00','1997-12-12 00:00:00','1997-11-18 00:00:00',3,'243.73','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10743,'AROUT',1,'1997-11-17 00:00:00','1997-12-15 00:00:00','1997-11-21 00:00:00',2,'23.72','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10744,'VAFFE',6,'1997-11-17 00:00:00','1997-12-15 00:00:00','1997-11-24 00:00:00',1,'69.19','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10745,'QUICK',9,'1997-11-18 00:00:00','1997-12-16 00:00:00','1997-11-27 00:00:00',1,'3.52','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10746,'CHOPS',1,'1997-11-19 00:00:00','1997-12-17 00:00:00','1997-11-21 00:00:00',3,'31.43','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10747,'PICCO',6,'1997-11-19 00:00:00','1997-12-17 00:00:00','1997-11-26 00:00:00',1,'117.33','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10748,'SAVEA',3,'1997-11-20 00:00:00','1997-12-18 00:00:00','1997-11-28 00:00:00',1,'232.55','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10749,'ISLAT',4,'1997-11-20 00:00:00','1997-12-18 00:00:00','1997-12-19 00:00:00',2,'61.53','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10750,'WARTH',9,'1997-11-21 00:00:00','1997-12-19 00:00:00','1997-11-24 00:00:00',1,'79.30','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (10751,'RICSU',3,'1997-11-24 00:00:00','1997-12-22 00:00:00','1997-12-03 00:00:00',3,'130.79','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10752,'NORTS',2,'1997-11-24 00:00:00','1997-12-22 00:00:00','1997-11-28 00:00:00',3,'1.39','North/South','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK'),
+ (10753,'FRANS',3,'1997-11-25 00:00:00','1997-12-23 00:00:00','1997-11-27 00:00:00',1,'7.70','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10754,'MAGAA',6,'1997-11-25 00:00:00','1997-12-23 00:00:00','1997-11-27 00:00:00',3,'2.38','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10755,'BONAP',4,'1997-11-26 00:00:00','1997-12-24 00:00:00','1997-11-28 00:00:00',2,'16.71','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10756,'SPLIR',8,'1997-11-27 00:00:00','1997-12-25 00:00:00','1997-12-02 00:00:00',2,'73.21','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10757,'SAVEA',6,'1997-11-27 00:00:00','1997-12-25 00:00:00','1997-12-15 00:00:00',1,'8.19','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10758,'RICSU',3,'1997-11-28 00:00:00','1997-12-26 00:00:00','1997-12-04 00:00:00',3,'138.17','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10759,'ANATR',3,'1997-11-28 00:00:00','1997-12-26 00:00:00','1997-12-12 00:00:00',3,'11.99','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico'),
+ (10760,'MAISD',4,'1997-12-01 00:00:00','1997-12-29 00:00:00','1997-12-10 00:00:00',1,'155.64','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10761,'RATTC',5,'1997-12-02 00:00:00','1997-12-30 00:00:00','1997-12-08 00:00:00',2,'18.66','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10762,'FOLKO',3,'1997-12-02 00:00:00','1997-12-30 00:00:00','1997-12-09 00:00:00',1,'328.74','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10763,'FOLIG',3,'1997-12-03 00:00:00','1997-12-31 00:00:00','1997-12-08 00:00:00',3,'37.35','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10764,'ERNSH',6,'1997-12-03 00:00:00','1997-12-31 00:00:00','1997-12-08 00:00:00',3,'145.45','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10765,'QUICK',3,'1997-12-04 00:00:00','1998-01-01 00:00:00','1997-12-09 00:00:00',3,'42.74','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10766,'OTTIK',4,'1997-12-05 00:00:00','1998-01-02 00:00:00','1997-12-09 00:00:00',1,'157.55','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10767,'SUPRD',4,'1997-12-05 00:00:00','1998-01-02 00:00:00','1997-12-15 00:00:00',3,'1.59','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10768,'AROUT',3,'1997-12-08 00:00:00','1998-01-05 00:00:00','1997-12-15 00:00:00',2,'146.32','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10769,'VAFFE',3,'1997-12-08 00:00:00','1998-01-05 00:00:00','1997-12-12 00:00:00',1,'65.06','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10770,'HANAR',8,'1997-12-09 00:00:00','1998-01-06 00:00:00','1997-12-17 00:00:00',3,'5.32','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10771,'ERNSH',9,'1997-12-10 00:00:00','1998-01-07 00:00:00','1998-01-02 00:00:00',2,'11.19','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10772,'LEHMS',3,'1997-12-10 00:00:00','1998-01-07 00:00:00','1997-12-19 00:00:00',2,'91.28','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10773,'ERNSH',1,'1997-12-11 00:00:00','1998-01-08 00:00:00','1997-12-16 00:00:00',3,'96.43','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10774,'FOLKO',4,'1997-12-11 00:00:00','1997-12-25 00:00:00','1997-12-12 00:00:00',1,'48.20','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10775,'THECR',7,'1997-12-12 00:00:00','1998-01-09 00:00:00','1997-12-26 00:00:00',1,'20.25','The Cracker Box','55 Grizzly Peak Rd.','Butte','MT','59801','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10776,'ERNSH',1,'1997-12-15 00:00:00','1998-01-12 00:00:00','1997-12-18 00:00:00',3,'351.53','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10777,'GOURL',7,'1997-12-15 00:00:00','1997-12-29 00:00:00','1998-01-21 00:00:00',2,'3.01','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10778,'BERGS',3,'1997-12-16 00:00:00','1998-01-13 00:00:00','1997-12-24 00:00:00',1,'6.79','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10779,'MORGK',3,'1997-12-16 00:00:00','1998-01-13 00:00:00','1998-01-14 00:00:00',2,'58.13','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10780,'LILAS',2,'1997-12-16 00:00:00','1997-12-30 00:00:00','1997-12-25 00:00:00',1,'42.13','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10781,'WARTH',2,'1997-12-17 00:00:00','1998-01-14 00:00:00','1997-12-19 00:00:00',3,'73.16','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10782,'CACTU',9,'1997-12-17 00:00:00','1998-01-14 00:00:00','1997-12-22 00:00:00',3,'1.10','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10783,'HANAR',4,'1997-12-18 00:00:00','1998-01-15 00:00:00','1997-12-19 00:00:00',2,'124.98','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10784,'MAGAA',4,'1997-12-18 00:00:00','1998-01-15 00:00:00','1997-12-22 00:00:00',3,'70.09','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10785,'GROSR',1,'1997-12-18 00:00:00','1998-01-15 00:00:00','1997-12-24 00:00:00',3,'1.51','GROSELLA-Restaurante','5ª Ave. Los Palos Grandes','Caracas','DF','1081','Venezuela'),
+ (10786,'QUEEN',8,'1997-12-19 00:00:00','1998-01-16 00:00:00','1997-12-23 00:00:00',1,'110.87','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10787,'LAMAI',2,'1997-12-19 00:00:00','1998-01-02 00:00:00','1997-12-26 00:00:00',1,'249.93','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10788,'QUICK',1,'1997-12-22 00:00:00','1998-01-19 00:00:00','1998-01-19 00:00:00',2,'42.70','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10789,'FOLIG',1,'1997-12-22 00:00:00','1998-01-19 00:00:00','1997-12-31 00:00:00',2,'100.60','Folies gourmandes','184 chaussée de Tournai','Lille',NULL,'59000','France'),
+ (10790,'GOURL',6,'1997-12-22 00:00:00','1998-01-19 00:00:00','1997-12-26 00:00:00',1,'28.23','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10791,'FRANK',6,'1997-12-23 00:00:00','1998-01-20 00:00:00','1998-01-01 00:00:00',2,'16.85','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10792,'WOLZA',1,'1997-12-23 00:00:00','1998-01-20 00:00:00','1997-12-31 00:00:00',3,'23.79','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10793,'AROUT',3,'1997-12-24 00:00:00','1998-01-21 00:00:00','1998-01-08 00:00:00',3,'4.52','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10794,'QUEDE',6,'1997-12-24 00:00:00','1998-01-21 00:00:00','1998-01-02 00:00:00',1,'21.49','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10795,'ERNSH',8,'1997-12-24 00:00:00','1998-01-21 00:00:00','1998-01-20 00:00:00',2,'126.66','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10796,'HILAA',3,'1997-12-25 00:00:00','1998-01-22 00:00:00','1998-01-14 00:00:00',1,'26.52','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10797,'DRACD',7,'1997-12-25 00:00:00','1998-01-22 00:00:00','1998-01-05 00:00:00',2,'33.35','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (10798,'ISLAT',2,'1997-12-26 00:00:00','1998-01-23 00:00:00','1998-01-05 00:00:00',1,'2.33','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10799,'KOENE',9,'1997-12-26 00:00:00','1998-02-06 00:00:00','1998-01-05 00:00:00',3,'30.76','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10800,'SEVES',1,'1997-12-26 00:00:00','1998-01-23 00:00:00','1998-01-05 00:00:00',3,'137.44','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10801,'BOLID',4,'1997-12-29 00:00:00','1998-01-26 00:00:00','1997-12-31 00:00:00',2,'97.09','Bólido Comidas preparadas','C/ Araquil 67','Madrid',NULL,'28023','Spain'),
+ (10802,'SIMOB',4,'1997-12-29 00:00:00','1998-01-26 00:00:00','1998-01-02 00:00:00',2,'257.26','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (10803,'WELLI',4,'1997-12-30 00:00:00','1998-01-27 00:00:00','1998-01-06 00:00:00',1,'55.23','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10804,'SEVES',6,'1997-12-30 00:00:00','1998-01-27 00:00:00','1998-01-07 00:00:00',2,'27.33','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10805,'THEBI',2,'1997-12-30 00:00:00','1998-01-27 00:00:00','1998-01-09 00:00:00',3,'237.34','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10806,'VICTE',3,'1997-12-31 00:00:00','1998-01-28 00:00:00','1998-01-05 00:00:00',2,'22.11','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10807,'FRANS',4,'1997-12-31 00:00:00','1998-01-28 00:00:00','1998-01-30 00:00:00',1,'1.36','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (10808,'OLDWO',2,'1998-01-01 00:00:00','1998-01-29 00:00:00','1998-01-09 00:00:00',3,'45.53','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10809,'WELLI',7,'1998-01-01 00:00:00','1998-01-29 00:00:00','1998-01-07 00:00:00',1,'4.87','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10810,'LAUGB',2,'1998-01-01 00:00:00','1998-01-29 00:00:00','1998-01-07 00:00:00',3,'4.33','Laughing Bacchus Wine Cellars','2319 Elm St.','Vancouver','BC','V3F 2K1','Canada'),
+ (10811,'LINOD',8,'1998-01-02 00:00:00','1998-01-30 00:00:00','1998-01-08 00:00:00',1,'31.22','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10812,'REGGC',5,'1998-01-02 00:00:00','1998-01-30 00:00:00','1998-01-12 00:00:00',1,'59.78','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10813,'RICAR',1,'1998-01-05 00:00:00','1998-02-02 00:00:00','1998-01-09 00:00:00',1,'47.38','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10814,'VICTE',3,'1998-01-05 00:00:00','1998-02-02 00:00:00','1998-01-14 00:00:00',3,'130.94','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10815,'SAVEA',2,'1998-01-05 00:00:00','1998-02-02 00:00:00','1998-01-14 00:00:00',3,'14.62','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10816,'GREAL',4,'1998-01-06 00:00:00','1998-02-03 00:00:00','1998-02-04 00:00:00',2,'719.78','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10817,'KOENE',3,'1998-01-06 00:00:00','1998-01-20 00:00:00','1998-01-13 00:00:00',2,'306.07','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10818,'MAGAA',7,'1998-01-07 00:00:00','1998-02-04 00:00:00','1998-01-12 00:00:00',3,'65.48','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10819,'CACTU',2,'1998-01-07 00:00:00','1998-02-04 00:00:00','1998-01-16 00:00:00',3,'19.76','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10820,'RATTC',3,'1998-01-07 00:00:00','1998-02-04 00:00:00','1998-01-13 00:00:00',2,'37.52','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10821,'SPLIR',1,'1998-01-08 00:00:00','1998-02-05 00:00:00','1998-01-15 00:00:00',1,'36.68','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10822,'TRAIH',6,'1998-01-08 00:00:00','1998-02-05 00:00:00','1998-01-16 00:00:00',3,'7.00','Trail\'s Head Gourmet Provisioners','722 DaVinci Blvd.','Kirkland','WA','98034','USA'),
+ (10823,'LILAS',5,'1998-01-09 00:00:00','1998-02-06 00:00:00','1998-01-13 00:00:00',2,'163.97','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10824,'FOLKO',8,'1998-01-09 00:00:00','1998-02-06 00:00:00','1998-01-30 00:00:00',1,'1.23','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10825,'DRACD',1,'1998-01-09 00:00:00','1998-02-06 00:00:00','1998-01-14 00:00:00',1,'79.25','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (10826,'BLONP',6,'1998-01-12 00:00:00','1998-02-09 00:00:00','1998-02-06 00:00:00',1,'7.09','Blondel père et fils','24 place Kléber','Strasbourg',NULL,'67000','France'),
+ (10827,'BONAP',1,'1998-01-12 00:00:00','1998-01-26 00:00:00','1998-02-06 00:00:00',2,'63.54','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10828,'RANCH',9,'1998-01-13 00:00:00','1998-01-27 00:00:00','1998-02-04 00:00:00',1,'90.85','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10829,'ISLAT',9,'1998-01-13 00:00:00','1998-02-10 00:00:00','1998-01-23 00:00:00',1,'154.72','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10830,'TRADH',4,'1998-01-13 00:00:00','1998-02-24 00:00:00','1998-01-21 00:00:00',2,'81.83','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10831,'SANTG',3,'1998-01-14 00:00:00','1998-02-11 00:00:00','1998-01-23 00:00:00',2,'72.19','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10832,'LAMAI',2,'1998-01-14 00:00:00','1998-02-11 00:00:00','1998-01-19 00:00:00',2,'43.26','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10833,'OTTIK',6,'1998-01-15 00:00:00','1998-02-12 00:00:00','1998-01-23 00:00:00',2,'71.49','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (10834,'TRADH',1,'1998-01-15 00:00:00','1998-02-12 00:00:00','1998-01-19 00:00:00',3,'29.78','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10835,'ALFKI',1,'1998-01-15 00:00:00','1998-02-12 00:00:00','1998-01-21 00:00:00',3,'69.53','Alfred\'s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10836,'ERNSH',7,'1998-01-16 00:00:00','1998-02-13 00:00:00','1998-01-21 00:00:00',1,'411.88','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10837,'BERGS',9,'1998-01-16 00:00:00','1998-02-13 00:00:00','1998-01-23 00:00:00',3,'13.32','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10838,'LINOD',3,'1998-01-19 00:00:00','1998-02-16 00:00:00','1998-01-23 00:00:00',3,'59.28','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10839,'TRADH',3,'1998-01-19 00:00:00','1998-02-16 00:00:00','1998-01-22 00:00:00',3,'35.43','Tradiçao Hipermercados','Av. Inês de Castro 414','Sao Paulo','SP','05634-030','Brazil'),
+ (10840,'LINOD',4,'1998-01-19 00:00:00','1998-03-02 00:00:00','1998-02-16 00:00:00',2,'2.71','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10841,'SUPRD',5,'1998-01-20 00:00:00','1998-02-17 00:00:00','1998-01-29 00:00:00',2,'424.30','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10842,'TORTU',1,'1998-01-20 00:00:00','1998-02-17 00:00:00','1998-01-29 00:00:00',3,'54.42','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10843,'VICTE',4,'1998-01-21 00:00:00','1998-02-18 00:00:00','1998-01-26 00:00:00',2,'9.26','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10844,'PICCO',8,'1998-01-21 00:00:00','1998-02-18 00:00:00','1998-01-26 00:00:00',2,'25.22','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (10845,'QUICK',8,'1998-01-21 00:00:00','1998-02-04 00:00:00','1998-01-30 00:00:00',1,'212.98','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10846,'SUPRD',2,'1998-01-22 00:00:00','1998-03-05 00:00:00','1998-01-23 00:00:00',3,'56.46','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10847,'SAVEA',4,'1998-01-22 00:00:00','1998-02-05 00:00:00','1998-02-10 00:00:00',3,'487.57','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10848,'CONSH',7,'1998-01-23 00:00:00','1998-02-20 00:00:00','1998-01-29 00:00:00',2,'38.24','Consolidated Holdings','Berkeley Gardens 12  Brewery','London',NULL,'WX1 6LT','UK'),
+ (10849,'KOENE',9,'1998-01-23 00:00:00','1998-02-20 00:00:00','1998-01-30 00:00:00',2,'0.56','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10850,'VICTE',1,'1998-01-23 00:00:00','1998-03-06 00:00:00','1998-01-30 00:00:00',1,'49.19','Victuailles en stock','2 rue du Commerce','Lyon',NULL,'69004','France'),
+ (10851,'RICAR',5,'1998-01-26 00:00:00','1998-02-23 00:00:00','1998-02-02 00:00:00',1,'160.55','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (10852,'RATTC',8,'1998-01-26 00:00:00','1998-02-09 00:00:00','1998-01-30 00:00:00',1,'174.05','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10853,'BLAUS',9,'1998-01-27 00:00:00','1998-02-24 00:00:00','1998-02-03 00:00:00',2,'53.83','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10854,'ERNSH',3,'1998-01-27 00:00:00','1998-02-24 00:00:00','1998-02-05 00:00:00',2,'100.22','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10855,'OLDWO',3,'1998-01-27 00:00:00','1998-02-24 00:00:00','1998-02-04 00:00:00',1,'170.97','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10856,'ANTON',3,'1998-01-28 00:00:00','1998-02-25 00:00:00','1998-02-10 00:00:00',2,'58.43','Antonio Moreno Taquería','Mataderos  2312','México D.F.',NULL,'05023','Mexico'),
+ (10857,'BERGS',8,'1998-01-28 00:00:00','1998-02-25 00:00:00','1998-02-06 00:00:00',2,'188.85','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10858,'LACOR',2,'1998-01-29 00:00:00','1998-02-26 00:00:00','1998-02-03 00:00:00',1,'52.51','La corne d\'abondance','67 avenue de l\'Europe','Versailles',NULL,'78000','France'),
+ (10859,'FRANK',1,'1998-01-29 00:00:00','1998-02-26 00:00:00','1998-02-02 00:00:00',2,'76.10','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10860,'FRANR',3,'1998-01-29 00:00:00','1998-02-26 00:00:00','1998-02-04 00:00:00',3,'19.26','France restauration','54 rue Royale','Nantes',NULL,'44000','France'),
+ (10861,'WHITC',4,'1998-01-30 00:00:00','1998-02-27 00:00:00','1998-02-17 00:00:00',2,'14.93','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10862,'LEHMS',8,'1998-01-30 00:00:00','1998-03-13 00:00:00','1998-02-02 00:00:00',2,'53.23','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10863,'HILAA',4,'1998-02-02 00:00:00','1998-03-02 00:00:00','1998-02-17 00:00:00',2,'30.26','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10864,'AROUT',4,'1998-02-02 00:00:00','1998-03-02 00:00:00','1998-02-09 00:00:00',2,'3.04','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10865,'QUICK',2,'1998-02-02 00:00:00','1998-02-16 00:00:00','1998-02-12 00:00:00',1,'348.14','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10866,'BERGS',5,'1998-02-03 00:00:00','1998-03-03 00:00:00','1998-02-12 00:00:00',1,'109.11','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10867,'LONEP',6,'1998-02-03 00:00:00','1998-03-17 00:00:00','1998-02-11 00:00:00',1,'1.93','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (10868,'QUEEN',7,'1998-02-04 00:00:00','1998-03-04 00:00:00','1998-02-23 00:00:00',2,'191.27','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10869,'SEVES',5,'1998-02-04 00:00:00','1998-03-04 00:00:00','1998-02-09 00:00:00',1,'143.28','Seven Seas Imports','90 Wadhurst Rd.','London',NULL,'OX15 4NB','UK'),
+ (10870,'WOLZA',5,'1998-02-04 00:00:00','1998-03-04 00:00:00','1998-02-13 00:00:00',3,'12.04','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10871,'BONAP',9,'1998-02-05 00:00:00','1998-03-05 00:00:00','1998-02-10 00:00:00',2,'112.27','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10872,'GODOS',5,'1998-02-05 00:00:00','1998-03-05 00:00:00','1998-02-09 00:00:00',2,'175.32','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10873,'WILMK',4,'1998-02-06 00:00:00','1998-03-06 00:00:00','1998-02-09 00:00:00',1,'0.82','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10874,'GODOS',5,'1998-02-06 00:00:00','1998-03-06 00:00:00','1998-02-11 00:00:00',2,'19.58','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10875,'BERGS',4,'1998-02-06 00:00:00','1998-03-06 00:00:00','1998-03-03 00:00:00',2,'32.37','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10876,'BONAP',7,'1998-02-09 00:00:00','1998-03-09 00:00:00','1998-02-12 00:00:00',3,'60.42','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10877,'RICAR',1,'1998-02-09 00:00:00','1998-03-09 00:00:00','1998-02-19 00:00:00',1,'38.06','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10878,'QUICK',4,'1998-02-10 00:00:00','1998-03-10 00:00:00','1998-02-12 00:00:00',1,'46.69','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10879,'WILMK',3,'1998-02-10 00:00:00','1998-03-10 00:00:00','1998-02-12 00:00:00',3,'8.50','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10880,'FOLKO',7,'1998-02-10 00:00:00','1998-03-24 00:00:00','1998-02-18 00:00:00',1,'88.01','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10881,'CACTU',4,'1998-02-11 00:00:00','1998-03-11 00:00:00','1998-02-18 00:00:00',1,'2.84','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (10882,'SAVEA',4,'1998-02-11 00:00:00','1998-03-11 00:00:00','1998-02-20 00:00:00',3,'23.10','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10883,'LONEP',8,'1998-02-12 00:00:00','1998-03-12 00:00:00','1998-02-20 00:00:00',3,'0.53','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10884,'LETSS',4,'1998-02-12 00:00:00','1998-03-12 00:00:00','1998-02-13 00:00:00',2,'90.97','Let\'s Stop N Shop','87 Polk St. Suite 5','San Francisco','CA','94117','USA'),
+ (10885,'SUPRD',6,'1998-02-12 00:00:00','1998-03-12 00:00:00','1998-02-18 00:00:00',3,'5.64','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10886,'HANAR',1,'1998-02-13 00:00:00','1998-03-13 00:00:00','1998-03-02 00:00:00',1,'4.99','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10887,'GALED',8,'1998-02-13 00:00:00','1998-03-13 00:00:00','1998-02-16 00:00:00',3,'1.25','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10888,'GODOS',1,'1998-02-16 00:00:00','1998-03-16 00:00:00','1998-02-23 00:00:00',2,'51.87','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10889,'RATTC',9,'1998-02-16 00:00:00','1998-03-16 00:00:00','1998-02-23 00:00:00',3,'280.61','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10890,'DUMON',7,'1998-02-16 00:00:00','1998-03-16 00:00:00','1998-02-18 00:00:00',1,'32.76','Du monde entier','67 rue des Cinquante Otages','Nantes',NULL,'44000','France'),
+ (10891,'LEHMS',7,'1998-02-17 00:00:00','1998-03-17 00:00:00','1998-02-19 00:00:00',2,'20.37','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10892,'MAISD',4,'1998-02-17 00:00:00','1998-03-17 00:00:00','1998-02-19 00:00:00',2,'120.27','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10893,'KOENE',9,'1998-02-18 00:00:00','1998-03-18 00:00:00','1998-02-20 00:00:00',2,'77.78','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (10894,'SAVEA',1,'1998-02-18 00:00:00','1998-03-18 00:00:00','1998-02-20 00:00:00',1,'116.13','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10895,'ERNSH',3,'1998-02-18 00:00:00','1998-03-18 00:00:00','1998-02-23 00:00:00',1,'162.75','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10896,'MAISD',7,'1998-02-19 00:00:00','1998-03-19 00:00:00','1998-02-27 00:00:00',3,'32.45','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10897,'HUNGO',3,'1998-02-19 00:00:00','1998-03-19 00:00:00','1998-02-25 00:00:00',2,'603.54','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10898,'OCEAN',4,'1998-02-20 00:00:00','1998-03-20 00:00:00','1998-03-06 00:00:00',2,'1.27','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10899,'LILAS',5,'1998-02-20 00:00:00','1998-03-20 00:00:00','1998-02-26 00:00:00',3,'1.21','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (10900,'WELLI',1,'1998-02-20 00:00:00','1998-03-20 00:00:00','1998-03-04 00:00:00',2,'1.66','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10901,'HILAA',4,'1998-02-23 00:00:00','1998-03-23 00:00:00','1998-02-26 00:00:00',1,'62.09','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10902,'FOLKO',1,'1998-02-23 00:00:00','1998-03-23 00:00:00','1998-03-03 00:00:00',1,'44.15','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10903,'HANAR',3,'1998-02-24 00:00:00','1998-03-24 00:00:00','1998-03-04 00:00:00',3,'36.71','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10904,'WHITC',3,'1998-02-24 00:00:00','1998-03-24 00:00:00','1998-02-27 00:00:00',3,'162.95','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (10905,'WELLI',9,'1998-02-24 00:00:00','1998-03-24 00:00:00','1998-03-06 00:00:00',2,'13.72','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10906,'WOLZA',4,'1998-02-25 00:00:00','1998-03-11 00:00:00','1998-03-03 00:00:00',3,'26.29','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10907,'SPECD',6,'1998-02-25 00:00:00','1998-03-25 00:00:00','1998-02-27 00:00:00',3,'9.19','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10908,'REGGC',4,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-06 00:00:00',2,'32.96','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10909,'SANTG',1,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-10 00:00:00',2,'53.05','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway'),
+ (10910,'WILMK',1,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-04 00:00:00',3,'38.11','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (10911,'GODOS',3,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-05 00:00:00',1,'38.19','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10912,'HUNGO',2,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-18 00:00:00',2,'580.91','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland'),
+ (10913,'QUEEN',4,'1998-02-26 00:00:00','1998-03-26 00:00:00','1998-03-04 00:00:00',1,'33.05','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10914,'QUEEN',6,'1998-02-27 00:00:00','1998-03-27 00:00:00','1998-03-02 00:00:00',1,'21.19','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (10915,'TORTU',2,'1998-02-27 00:00:00','1998-03-27 00:00:00','1998-03-02 00:00:00',2,'3.51','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico'),
+ (10916,'RANCH',1,'1998-02-27 00:00:00','1998-03-27 00:00:00','1998-03-09 00:00:00',2,'63.77','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (10917,'ROMEY',4,'1998-03-02 00:00:00','1998-03-30 00:00:00','1998-03-11 00:00:00',2,'8.29','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (10918,'BOTTM',3,'1998-03-02 00:00:00','1998-03-30 00:00:00','1998-03-11 00:00:00',3,'48.83','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10919,'LINOD',2,'1998-03-02 00:00:00','1998-03-30 00:00:00','1998-03-04 00:00:00',2,'19.80','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10920,'AROUT',4,'1998-03-03 00:00:00','1998-03-31 00:00:00','1998-03-09 00:00:00',2,'29.61','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10921,'VAFFE',1,'1998-03-03 00:00:00','1998-04-14 00:00:00','1998-03-09 00:00:00',1,'176.48','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10922,'HANAR',5,'1998-03-03 00:00:00','1998-03-31 00:00:00','1998-03-05 00:00:00',3,'62.74','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10923,'LAMAI',7,'1998-03-03 00:00:00','1998-04-14 00:00:00','1998-03-13 00:00:00',3,'68.26','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France'),
+ (10924,'BERGS',3,'1998-03-04 00:00:00','1998-04-01 00:00:00','1998-04-08 00:00:00',2,'151.52','Berglunds snabbköp','Berguvsvägen  8','Luleå',NULL,'S-958 22','Sweden'),
+ (10925,'HANAR',3,'1998-03-04 00:00:00','1998-04-01 00:00:00','1998-03-13 00:00:00',1,'2.27','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10926,'ANATR',4,'1998-03-04 00:00:00','1998-04-01 00:00:00','1998-03-11 00:00:00',3,'39.92','Ana Trujillo Emparedados y helados','Avda. de la Constitución 2222','México D.F.',NULL,'05021','Mexico'),
+ (10927,'LACOR',4,'1998-03-05 00:00:00','1998-04-02 00:00:00','1998-04-08 00:00:00',1,'19.79','La corne d\'abondance','67 avenue de l\'Europe','Versailles',NULL,'78000','France'),
+ (10928,'GALED',1,'1998-03-05 00:00:00','1998-04-02 00:00:00','1998-03-18 00:00:00',1,'1.36','Galería del gastronómo','Rambla de Cataluña 23','Barcelona',NULL,'8022','Spain'),
+ (10929,'FRANK',6,'1998-03-05 00:00:00','1998-04-02 00:00:00','1998-03-12 00:00:00',1,'33.93','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (10930,'SUPRD',4,'1998-03-06 00:00:00','1998-04-17 00:00:00','1998-03-18 00:00:00',3,'15.55','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (10931,'RICSU',4,'1998-03-06 00:00:00','1998-03-20 00:00:00','1998-03-19 00:00:00',2,'13.60','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10932,'BONAP',8,'1998-03-06 00:00:00','1998-04-03 00:00:00','1998-03-24 00:00:00',1,'134.64','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10933,'ISLAT',6,'1998-03-06 00:00:00','1998-04-03 00:00:00','1998-03-16 00:00:00',3,'54.15','Island Trading','Garden House Crowther Way','Cowes','Isle of Wight','PO31 7PJ','UK'),
+ (10934,'LEHMS',3,'1998-03-09 00:00:00','1998-04-06 00:00:00','1998-03-12 00:00:00',3,'32.01','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (10935,'WELLI',4,'1998-03-09 00:00:00','1998-04-06 00:00:00','1998-03-18 00:00:00',3,'47.59','Wellington Importadora','Rua do Mercado 12','Resende','SP','08737-363','Brazil'),
+ (10936,'GREAL',3,'1998-03-09 00:00:00','1998-04-06 00:00:00','1998-03-18 00:00:00',2,'33.68','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (10937,'CACTU',7,'1998-03-10 00:00:00','1998-03-24 00:00:00','1998-03-13 00:00:00',3,'31.51','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10938,'QUICK',3,'1998-03-10 00:00:00','1998-04-07 00:00:00','1998-03-16 00:00:00',2,'31.89','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10939,'MAGAA',2,'1998-03-10 00:00:00','1998-04-07 00:00:00','1998-03-13 00:00:00',2,'76.33','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10940,'BONAP',8,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-23 00:00:00',3,'19.77','Bon app\'','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (10941,'SAVEA',7,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-20 00:00:00',2,'400.81','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10942,'REGGC',9,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-18 00:00:00',3,'17.95','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (10943,'BSBEV',4,'1998-03-11 00:00:00','1998-04-08 00:00:00','1998-03-19 00:00:00',2,'2.17','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10944,'BOTTM',6,'1998-03-12 00:00:00','1998-03-26 00:00:00','1998-03-13 00:00:00',3,'52.92','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10945,'MORGK',4,'1998-03-12 00:00:00','1998-04-09 00:00:00','1998-03-18 00:00:00',1,'10.22','Morgenstern Gesundkost','Heerstr. 22','Leipzig',NULL,'04179','Germany'),
+ (10946,'VAFFE',1,'1998-03-12 00:00:00','1998-04-09 00:00:00','1998-03-19 00:00:00',2,'27.20','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10947,'BSBEV',3,'1998-03-13 00:00:00','1998-04-10 00:00:00','1998-03-16 00:00:00',2,'3.26','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (10948,'GODOS',3,'1998-03-13 00:00:00','1998-04-10 00:00:00','1998-03-19 00:00:00',3,'23.39','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (10949,'BOTTM',2,'1998-03-13 00:00:00','1998-04-10 00:00:00','1998-03-17 00:00:00',3,'74.44','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10950,'MAGAA',1,'1998-03-16 00:00:00','1998-04-13 00:00:00','1998-03-23 00:00:00',2,'2.50','Magazzini Alimentari Riuniti','Via Ludovico il Moro 22','Bergamo',NULL,'24100','Italy'),
+ (10951,'RICSU',9,'1998-03-16 00:00:00','1998-04-27 00:00:00','1998-04-07 00:00:00',2,'30.85','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland'),
+ (10952,'ALFKI',1,'1998-03-16 00:00:00','1998-04-27 00:00:00','1998-03-24 00:00:00',1,'40.42','Alfred\'s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (10953,'AROUT',9,'1998-03-16 00:00:00','1998-03-30 00:00:00','1998-03-25 00:00:00',2,'23.72','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (10954,'LINOD',5,'1998-03-17 00:00:00','1998-04-28 00:00:00','1998-03-20 00:00:00',1,'27.91','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (10955,'FOLKO',8,'1998-03-17 00:00:00','1998-04-14 00:00:00','1998-03-20 00:00:00',2,'3.26','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10956,'BLAUS',6,'1998-03-17 00:00:00','1998-04-28 00:00:00','1998-03-20 00:00:00',2,'44.65','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (10957,'HILAA',8,'1998-03-18 00:00:00','1998-04-15 00:00:00','1998-03-27 00:00:00',3,'105.36','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10958,'OCEAN',7,'1998-03-18 00:00:00','1998-04-15 00:00:00','1998-03-27 00:00:00',2,'49.56','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10959,'GOURL',6,'1998-03-18 00:00:00','1998-04-29 00:00:00','1998-03-23 00:00:00',2,'4.98','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (10960,'HILAA',3,'1998-03-19 00:00:00','1998-04-02 00:00:00','1998-04-08 00:00:00',1,'2.08','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10961,'QUEEN',8,'1998-03-19 00:00:00','1998-04-16 00:00:00','1998-03-30 00:00:00',1,'104.47','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10962,'QUICK',8,'1998-03-19 00:00:00','1998-04-16 00:00:00','1998-03-23 00:00:00',2,'275.79','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10963,'FURIB',9,'1998-03-19 00:00:00','1998-04-16 00:00:00','1998-03-26 00:00:00',3,'2.70','Furia Bacalhau e Frutos do Mar','Jardim das rosas n. 32','Lisboa',NULL,'1675','Portugal'),
+ (10964,'SPECD',3,'1998-03-20 00:00:00','1998-04-17 00:00:00','1998-03-24 00:00:00',2,'87.38','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France'),
+ (10965,'OLDWO',6,'1998-03-20 00:00:00','1998-04-17 00:00:00','1998-03-30 00:00:00',3,'144.38','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (10966,'CHOPS',4,'1998-03-20 00:00:00','1998-04-17 00:00:00','1998-04-08 00:00:00',1,'27.19','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (10967,'TOMSP',2,'1998-03-23 00:00:00','1998-04-20 00:00:00','1998-04-02 00:00:00',2,'62.22','Toms Spezialitäten','Luisenstr. 48','Münster',NULL,'44087','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10968,'ERNSH',1,'1998-03-23 00:00:00','1998-04-20 00:00:00','1998-04-01 00:00:00',3,'74.60','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10969,'COMMI',1,'1998-03-23 00:00:00','1998-04-20 00:00:00','1998-03-30 00:00:00',2,'0.21','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (10970,'BOLID',9,'1998-03-24 00:00:00','1998-04-07 00:00:00','1998-04-24 00:00:00',1,'16.16','Bólido Comidas preparadas','C/ Araquil 67','Madrid',NULL,'28023','Spain'),
+ (10971,'FRANR',2,'1998-03-24 00:00:00','1998-04-21 00:00:00','1998-04-02 00:00:00',2,'121.82','France restauration','54 rue Royale','Nantes',NULL,'44000','France'),
+ (10972,'LACOR',4,'1998-03-24 00:00:00','1998-04-21 00:00:00','1998-03-26 00:00:00',2,'0.02','La corne d\'abondance','67 avenue de l\'Europe','Versailles',NULL,'78000','France'),
+ (10973,'LACOR',6,'1998-03-24 00:00:00','1998-04-21 00:00:00','1998-03-27 00:00:00',2,'15.17','La corne d\'abondance','67 avenue de l\'Europe','Versailles',NULL,'78000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10974,'SPLIR',3,'1998-03-25 00:00:00','1998-04-08 00:00:00','1998-04-03 00:00:00',3,'12.96','Split Rail Beer & Ale','P.O. Box 555','Lander','WY','82520','USA'),
+ (10975,'BOTTM',1,'1998-03-25 00:00:00','1998-04-22 00:00:00','1998-03-27 00:00:00',3,'32.27','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10976,'HILAA',1,'1998-03-25 00:00:00','1998-05-06 00:00:00','1998-04-03 00:00:00',1,'37.97','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (10977,'FOLKO',8,'1998-03-26 00:00:00','1998-04-23 00:00:00','1998-04-10 00:00:00',3,'208.50','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10978,'MAISD',9,'1998-03-26 00:00:00','1998-04-23 00:00:00','1998-04-23 00:00:00',2,'32.82','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (10979,'ERNSH',8,'1998-03-26 00:00:00','1998-04-23 00:00:00','1998-03-31 00:00:00',2,'353.07','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10980,'FOLKO',4,'1998-03-27 00:00:00','1998-05-08 00:00:00','1998-04-17 00:00:00',1,'1.26','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10981,'HANAR',1,'1998-03-27 00:00:00','1998-04-24 00:00:00','1998-04-02 00:00:00',2,'193.37','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (10982,'BOTTM',2,'1998-03-27 00:00:00','1998-04-24 00:00:00','1998-04-08 00:00:00',1,'14.01','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (10983,'SAVEA',2,'1998-03-27 00:00:00','1998-04-24 00:00:00','1998-04-06 00:00:00',2,'657.54','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10984,'SAVEA',1,'1998-03-30 00:00:00','1998-04-27 00:00:00','1998-04-03 00:00:00',3,'211.22','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (10985,'HUNGO',2,'1998-03-30 00:00:00','1998-04-27 00:00:00','1998-04-02 00:00:00',1,'91.51','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10986,'OCEAN',8,'1998-03-30 00:00:00','1998-04-27 00:00:00','1998-04-21 00:00:00',2,'217.86','Océano Atlántico Ltda.','Ing. Gustavo Moncada 8585 Piso 20-A','Buenos Aires',NULL,'1010','Argentina'),
+ (10987,'EASTC',8,'1998-03-31 00:00:00','1998-04-28 00:00:00','1998-04-06 00:00:00',1,'185.48','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (10988,'RATTC',3,'1998-03-31 00:00:00','1998-04-28 00:00:00','1998-04-10 00:00:00',2,'61.14','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (10989,'QUEDE',2,'1998-03-31 00:00:00','1998-04-28 00:00:00','1998-04-02 00:00:00',1,'34.76','Que Delícia','Rua da Panificadora 12','Rio de Janeiro','RJ','02389-673','Brazil'),
+ (10990,'ERNSH',2,'1998-04-01 00:00:00','1998-05-13 00:00:00','1998-04-07 00:00:00',3,'117.61','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (10991,'QUICK',1,'1998-04-01 00:00:00','1998-04-29 00:00:00','1998-04-07 00:00:00',1,'38.51','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10992,'THEBI',1,'1998-04-01 00:00:00','1998-04-29 00:00:00','1998-04-03 00:00:00',3,'4.27','The Big Cheese','89 Jefferson Way Suite 2','Portland','OR','97201','USA'),
+ (10993,'FOLKO',7,'1998-04-01 00:00:00','1998-04-29 00:00:00','1998-04-10 00:00:00',3,'8.81','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (10994,'VAFFE',2,'1998-04-02 00:00:00','1998-04-16 00:00:00','1998-04-09 00:00:00',3,'65.53','Vaffeljernet','Smagsloget 45','Århus',NULL,'8200','Denmark'),
+ (10995,'PERIC',1,'1998-04-02 00:00:00','1998-04-30 00:00:00','1998-04-06 00:00:00',3,'46.00','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (10996,'QUICK',4,'1998-04-02 00:00:00','1998-04-30 00:00:00','1998-04-10 00:00:00',2,'1.12','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany'),
+ (10997,'LILAS',8,'1998-04-03 00:00:00','1998-05-15 00:00:00','1998-04-13 00:00:00',2,'73.91','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (10998,'WOLZA',8,'1998-04-03 00:00:00','1998-04-17 00:00:00','1998-04-17 00:00:00',2,'20.31','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (10999,'OTTIK',6,'1998-04-03 00:00:00','1998-05-01 00:00:00','1998-04-10 00:00:00',2,'96.35','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (11000,'RATTC',2,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-14 00:00:00',3,'55.12','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA'),
+ (11001,'FOLKO',2,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-14 00:00:00',2,'197.30','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (11002,'SAVEA',4,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-16 00:00:00',1,'141.16','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11003,'THECR',3,'1998-04-06 00:00:00','1998-05-04 00:00:00','1998-04-08 00:00:00',3,'14.91','The Cracker Box','55 Grizzly Peak Rd.','Butte','MT','59801','USA');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11004,'MAISD',3,'1998-04-07 00:00:00','1998-05-05 00:00:00','1998-04-20 00:00:00',1,'44.84','Maison Dewey','Rue Joseph-Bens 532','Bruxelles',NULL,'B-1180','Belgium'),
+ (11005,'WILMK',2,'1998-04-07 00:00:00','1998-05-05 00:00:00','1998-04-10 00:00:00',1,'0.75','Wilman Kala','Keskuskatu 45','Helsinki',NULL,'21240','Finland'),
+ (11006,'GREAL',3,'1998-04-07 00:00:00','1998-05-05 00:00:00','1998-04-15 00:00:00',2,'25.19','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (11007,'PRINI',8,'1998-04-08 00:00:00','1998-05-06 00:00:00','1998-04-13 00:00:00',2,'202.24','Princesa Isabel Vinhos','Estrada da saúde n. 58','Lisboa',NULL,'1756','Portugal'),
+ (11008,'ERNSH',7,'1998-04-08 00:00:00','1998-05-06 00:00:00','0000-00-00 00:00:00',3,'79.46','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (11009,'GODOS',2,'1998-04-08 00:00:00','1998-05-06 00:00:00','1998-04-10 00:00:00',1,'59.11','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11010,'REGGC',2,'1998-04-09 00:00:00','1998-05-07 00:00:00','1998-04-21 00:00:00',2,'28.71','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (11011,'ALFKI',3,'1998-04-09 00:00:00','1998-05-07 00:00:00','1998-04-13 00:00:00',1,'1.21','Alfred\'s Futterkiste','Obere Str. 57','Berlin',NULL,'12209','Germany'),
+ (11012,'FRANK',1,'1998-04-09 00:00:00','1998-04-23 00:00:00','1998-04-17 00:00:00',3,'242.95','Frankenversand','Berliner Platz 43','München',NULL,'80805','Germany'),
+ (11013,'ROMEY',2,'1998-04-09 00:00:00','1998-05-07 00:00:00','1998-04-10 00:00:00',1,'32.99','Romero y tomillo','Gran Vía 1','Madrid',NULL,'28001','Spain'),
+ (11014,'LINOD',2,'1998-04-10 00:00:00','1998-05-08 00:00:00','1998-04-15 00:00:00',3,'23.60','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela'),
+ (11015,'SANTG',2,'1998-04-10 00:00:00','1998-04-24 00:00:00','1998-04-20 00:00:00',2,'4.62','Santé Gourmet','Erling Skakkes gate 78','Stavern',NULL,'4110','Norway');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11016,'AROUT',9,'1998-04-10 00:00:00','1998-05-08 00:00:00','1998-04-13 00:00:00',2,'33.80','Around the Horn','Brook Farm Stratford St. Mary','Colchester','Essex','CO7 6JX','UK'),
+ (11017,'ERNSH',9,'1998-04-13 00:00:00','1998-05-11 00:00:00','1998-04-20 00:00:00',2,'754.26','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (11018,'LONEP',4,'1998-04-13 00:00:00','1998-05-11 00:00:00','1998-04-16 00:00:00',2,'11.65','Lonesome Pine Restaurant','89 Chiaroscuro Rd.','Portland','OR','97219','USA'),
+ (11019,'RANCH',6,'1998-04-13 00:00:00','1998-05-11 00:00:00','0000-00-00 00:00:00',3,'3.17','Rancho grande','Av. del Libertador 900','Buenos Aires',NULL,'1010','Argentina'),
+ (11020,'OTTIK',2,'1998-04-14 00:00:00','1998-05-12 00:00:00','1998-04-16 00:00:00',2,'43.30','Ottilies Käseladen','Mehrheimerstr. 369','Köln',NULL,'50739','Germany'),
+ (11021,'QUICK',3,'1998-04-14 00:00:00','1998-05-12 00:00:00','1998-04-21 00:00:00',1,'297.18','QUICK-Stop','Taucherstraße 10','Cunewalde',NULL,'01307','Germany');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11022,'HANAR',9,'1998-04-14 00:00:00','1998-05-12 00:00:00','1998-05-04 00:00:00',2,'6.27','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (11023,'BSBEV',1,'1998-04-14 00:00:00','1998-04-28 00:00:00','1998-04-24 00:00:00',2,'123.83','B\'s Beverages','Fauntleroy Circus','London',NULL,'EC2 5NT','UK'),
+ (11024,'EASTC',4,'1998-04-15 00:00:00','1998-05-13 00:00:00','1998-04-20 00:00:00',1,'74.36','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (11025,'WARTH',6,'1998-04-15 00:00:00','1998-05-13 00:00:00','1998-04-24 00:00:00',3,'29.17','Wartian Herkku','Torikatu 38','Oulu',NULL,'90110','Finland'),
+ (11026,'FRANS',4,'1998-04-15 00:00:00','1998-05-13 00:00:00','1998-04-28 00:00:00',1,'47.09','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (11027,'BOTTM',1,'1998-04-16 00:00:00','1998-05-14 00:00:00','1998-04-20 00:00:00',1,'52.52','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11028,'KOENE',2,'1998-04-16 00:00:00','1998-05-14 00:00:00','1998-04-22 00:00:00',1,'29.59','Königlich Essen','Maubelstr. 90','Brandenburg',NULL,'14776','Germany'),
+ (11029,'CHOPS',4,'1998-04-16 00:00:00','1998-05-14 00:00:00','1998-04-27 00:00:00',1,'47.84','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (11030,'SAVEA',7,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-27 00:00:00',2,'830.75','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11031,'SAVEA',6,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-24 00:00:00',2,'227.22','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11032,'WHITC',2,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-23 00:00:00',3,'606.19','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (11033,'RICSU',7,'1998-04-17 00:00:00','1998-05-15 00:00:00','1998-04-23 00:00:00',3,'84.74','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11034,'OLDWO',8,'1998-04-20 00:00:00','1998-06-01 00:00:00','1998-04-27 00:00:00',1,'40.32','Old World Delicatessen','2743 Bering St.','Anchorage','AK','99508','USA'),
+ (11035,'SUPRD',2,'1998-04-20 00:00:00','1998-05-18 00:00:00','1998-04-24 00:00:00',2,'0.17','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (11036,'DRACD',8,'1998-04-20 00:00:00','1998-05-18 00:00:00','1998-04-22 00:00:00',3,'149.47','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (11037,'GODOS',7,'1998-04-21 00:00:00','1998-05-19 00:00:00','1998-04-27 00:00:00',1,'3.20','Godos Cocina Típica','C/ Romero 33','Sevilla',NULL,'41101','Spain'),
+ (11038,'SUPRD',1,'1998-04-21 00:00:00','1998-05-19 00:00:00','1998-04-30 00:00:00',2,'29.59','Suprêmes délices','Boulevard Tirou 255','Charleroi',NULL,'B-6000','Belgium'),
+ (11039,'LINOD',1,'1998-04-21 00:00:00','1998-05-19 00:00:00','0000-00-00 00:00:00',2,'65.00','LINO-Delicateses','Ave. 5 de Mayo Porlamar','I. de Margarita','Nueva Esparta','4980','Venezuela');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11040,'GREAL',4,'1998-04-22 00:00:00','1998-05-20 00:00:00','0000-00-00 00:00:00',3,'18.84','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (11041,'CHOPS',3,'1998-04-22 00:00:00','1998-05-20 00:00:00','1998-04-28 00:00:00',2,'48.22','Chop-suey Chinese','Hauptstr. 31','Bern',NULL,'3012','Switzerland'),
+ (11042,'COMMI',2,'1998-04-22 00:00:00','1998-05-06 00:00:00','1998-05-01 00:00:00',1,'29.99','Comércio Mineiro','Av. dos Lusíadas 23','Sao Paulo','SP','05432-043','Brazil'),
+ (11043,'SPECD',5,'1998-04-22 00:00:00','1998-05-20 00:00:00','1998-04-29 00:00:00',2,'8.80','Spécialités du monde','25 rue Lauriston','Paris',NULL,'75016','France'),
+ (11044,'WOLZA',4,'1998-04-23 00:00:00','1998-05-21 00:00:00','1998-05-01 00:00:00',1,'8.72','Wolski Zajazd','ul. Filtrowa 68','Warszawa',NULL,'01-012','Poland'),
+ (11045,'BOTTM',6,'1998-04-23 00:00:00','1998-05-21 00:00:00','0000-00-00 00:00:00',2,'70.58','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11046,'WANDK',8,'1998-04-23 00:00:00','1998-05-21 00:00:00','1998-04-24 00:00:00',2,'71.64','Die Wandernde Kuh','Adenauerallee 900','Stuttgart',NULL,'70563','Germany'),
+ (11047,'EASTC',7,'1998-04-24 00:00:00','1998-05-22 00:00:00','1998-05-01 00:00:00',3,'46.62','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (11048,'BOTTM',7,'1998-04-24 00:00:00','1998-05-22 00:00:00','1998-04-30 00:00:00',3,'24.12','Bottom-Dollar Markets','23 Tsawassen Blvd.','Tsawassen','BC','T2F 8M4','Canada'),
+ (11049,'GOURL',3,'1998-04-24 00:00:00','1998-05-22 00:00:00','1998-05-04 00:00:00',1,'8.34','Gourmet Lanchonetes','Av. Brasil 442','Campinas','SP','04876-786','Brazil'),
+ (11050,'FOLKO',8,'1998-04-27 00:00:00','1998-05-25 00:00:00','1998-05-05 00:00:00',2,'59.41','Folk och fä HB','Åkergatan 24','Bräcke',NULL,'S-844 67','Sweden'),
+ (11051,'LAMAI',7,'1998-04-27 00:00:00','1998-05-25 00:00:00','0000-00-00 00:00:00',3,'2.79','La maison d\'Asie','1 rue Alsace-Lorraine','Toulouse',NULL,'31000','France');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11052,'HANAR',3,'1998-04-27 00:00:00','1998-05-25 00:00:00','1998-05-01 00:00:00',1,'67.26','Hanari Carnes','Rua do Paço 67','Rio de Janeiro','RJ','05454-876','Brazil'),
+ (11053,'PICCO',2,'1998-04-27 00:00:00','1998-05-25 00:00:00','1998-04-29 00:00:00',2,'53.05','Piccolo und mehr','Geislweg 14','Salzburg',NULL,'5020','Austria'),
+ (11054,'CACTU',8,'1998-04-28 00:00:00','1998-05-26 00:00:00','0000-00-00 00:00:00',1,'0.33','Cactus Comidas para llevar','Cerrito 333','Buenos Aires',NULL,'1010','Argentina'),
+ (11055,'HILAA',7,'1998-04-28 00:00:00','1998-05-26 00:00:00','1998-05-05 00:00:00',2,'120.92','HILARION-Abastos','Carrera 22 con Ave. Carlos Soublette #8-35','San Cristóbal','Táchira','5022','Venezuela'),
+ (11056,'EASTC',8,'1998-04-28 00:00:00','1998-05-12 00:00:00','1998-05-01 00:00:00',2,'278.96','Eastern Connection','35 King George','London',NULL,'WX3 6FW','UK'),
+ (11057,'NORTS',3,'1998-04-29 00:00:00','1998-05-27 00:00:00','1998-05-01 00:00:00',3,'4.13','North/South','South House 300 Queensbridge','London',NULL,'SW7 1RZ','UK');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11058,'BLAUS',9,'1998-04-29 00:00:00','1998-05-27 00:00:00','0000-00-00 00:00:00',3,'31.14','Blauer See Delikatessen','Forsterstr. 57','Mannheim',NULL,'68306','Germany'),
+ (11059,'RICAR',2,'1998-04-29 00:00:00','1998-06-10 00:00:00','0000-00-00 00:00:00',2,'85.80','Ricardo Adocicados','Av. Copacabana 267','Rio de Janeiro','RJ','02389-890','Brazil'),
+ (11060,'FRANS',2,'1998-04-30 00:00:00','1998-05-28 00:00:00','1998-05-04 00:00:00',2,'10.98','Franchi S.p.A.','Via Monte Bianco 34','Torino',NULL,'10100','Italy'),
+ (11061,'GREAL',4,'1998-04-30 00:00:00','1998-06-11 00:00:00','0000-00-00 00:00:00',3,'14.01','Great Lakes Food Market','2732 Baker Blvd.','Eugene','OR','97403','USA'),
+ (11062,'REGGC',4,'1998-04-30 00:00:00','1998-05-28 00:00:00','0000-00-00 00:00:00',2,'29.93','Reggiani Caseifici','Strada Provinciale 124','Reggio Emilia',NULL,'42100','Italy'),
+ (11063,'HUNGO',3,'1998-04-30 00:00:00','1998-05-28 00:00:00','1998-05-06 00:00:00',2,'81.73','Hungry Owl All-Night Grocers','8 Johnstown Road','Cork','Co. Cork',NULL,'Ireland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11064,'SAVEA',1,'1998-05-01 00:00:00','1998-05-29 00:00:00','1998-05-04 00:00:00',1,'30.09','Save-a-lot Markets','187 Suffolk Ln.','Boise','ID','83720','USA'),
+ (11065,'LILAS',8,'1998-05-01 00:00:00','1998-05-29 00:00:00','0000-00-00 00:00:00',1,'12.91','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (11066,'WHITC',7,'1998-05-01 00:00:00','1998-05-29 00:00:00','1998-05-04 00:00:00',2,'44.72','White Clover Markets','1029 - 12th Ave. S.','Seattle','WA','98124','USA'),
+ (11067,'DRACD',1,'1998-05-04 00:00:00','1998-05-18 00:00:00','1998-05-06 00:00:00',2,'7.98','Drachenblut Delikatessen','Walserweg 21','Aachen',NULL,'52066','Germany'),
+ (11068,'QUEEN',8,'1998-05-04 00:00:00','1998-06-01 00:00:00','0000-00-00 00:00:00',2,'81.75','Queen Cozinha','Alameda dos Canàrios 891','Sao Paulo','SP','05487-020','Brazil'),
+ (11069,'TORTU',1,'1998-05-04 00:00:00','1998-06-01 00:00:00','1998-05-06 00:00:00',2,'15.67','Tortuga Restaurante','Avda. Azteca 123','México D.F.',NULL,'05033','Mexico');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11070,'LEHMS',2,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',1,'136.00','Lehmanns Marktstand','Magazinweg 7','Frankfurt a.M.',NULL,'60528','Germany'),
+ (11071,'LILAS',1,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',1,'0.93','LILA-Supermercado','Carrera 52 con Ave. Bolívar #65-98 Llano Largo','Barquisimeto','Lara','3508','Venezuela'),
+ (11072,'ERNSH',4,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',2,'258.64','Ernst Handel','Kirchgasse 6','Graz',NULL,'8010','Austria'),
+ (11073,'PERIC',2,'1998-05-05 00:00:00','1998-06-02 00:00:00','0000-00-00 00:00:00',2,'24.95','Pericles Comidas clásicas','Calle Dr. Jorge Cash 321','México D.F.',NULL,'05033','Mexico'),
+ (11074,'SIMOB',7,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'18.44','Simons bistro','Vinbæltet 34','Kobenhavn',NULL,'1734','Denmark'),
+ (11075,'RICSU',8,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'6.19','Richter Supermarkt','Starenweg 5','Genève',NULL,'1204','Switzerland');
+INSERT INTO `northwind`.`orders` (`OrderID`,`CustomerID`,`EmployeeID`,`OrderDate`,`RequiredDate`,`ShippedDate`,`ShipVia`,`Freight`,`ShipName`,`ShipAddress`,`ShipCity`,`ShipRegion`,`ShipPostalCode`,`ShipCountry`) VALUES 
+ (11076,'BONAP',4,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'38.28','Bon app`','12 rue des Bouchers','Marseille',NULL,'13008','France'),
+ (11077,'RATTC',1,'1998-05-06 00:00:00','1998-06-03 00:00:00','0000-00-00 00:00:00',2,'8.53','Rattlesnake Canyon Grocery','2817 Milton Dr.','Albuquerque','NM','87110','USA');
+/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`products`
+--
+
+DROP TABLE IF EXISTS `northwind`.`products`;
+CREATE TABLE  `northwind`.`products` (
+  `ProductID` int(11) NOT NULL auto_increment,
+  `ProductName` varchar(40) NOT NULL default '',
+  `SupplierID` int(11) default NULL,
+  `CategoryID` int(11) default NULL,
+  `QuantityPerUnit` varchar(20) default NULL,
+  `UnitPrice` decimal(9,2) default '0.00',
+  `UnitsInStock` smallint(6) default '0',
+  `UnitsOnOrder` smallint(6) default '0',
+  `ReorderLevel` smallint(6) default '0',
+  `Discontinued` char(1) default '0',
+  PRIMARY KEY  (`ProductID`)
+) ENGINE=MyISAM AUTO_INCREMENT=78 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`products`
+--
+
+/*!40000 ALTER TABLE `products` DISABLE KEYS */;
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (1,'Chai',1,1,'10 boxes x 20 bags','18.00',39,0,10,'0'),
+ (2,'Chang',1,1,'24 - 12 oz bottles','19.00',17,40,25,'0'),
+ (3,'Aniseed Syrup',1,2,'12 - 550 ml bottles','10.00',13,70,25,'0'),
+ (4,'Chef Anton\'s Cajun Seasoning',2,2,'48 - 6 oz jars','22.00',53,0,0,'0'),
+ (5,'Chef Anton\'s Gumbo Mix',2,2,'36 boxes','21.35',0,0,0,'1'),
+ (6,'Grandma\'s Boysenberry Spread',3,2,'12 - 8 oz jars','25.00',120,0,25,'0'),
+ (7,'Uncle Bob\'s Organic Dried Pears',3,7,'12 - 1 lb pkgs.','30.00',15,0,10,'0'),
+ (8,'Northwoods Cranberry Sauce',3,2,'12 - 12 oz jars','40.00',6,0,0,'0'),
+ (9,'Mishi Kobe Niku',4,6,'18 - 500 g pkgs.','97.00',29,0,0,'1'),
+ (10,'Ikura',4,8,'12 - 200 ml jars','31.00',31,0,0,'0'),
+ (11,'Queso Cabrales',5,4,'1 kg pkg.','21.00',22,30,30,'0'),
+ (12,'Queso Manchego La Pastora',5,4,'10 - 500 g pkgs.','38.00',86,0,0,'0'),
+ (13,'Konbu',6,8,'2 kg box','6.00',24,0,5,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (14,'Tofu',6,7,'40 - 100 g pkgs.','23.25',35,0,0,'0'),
+ (15,'Genen Shouyu',6,2,'24 - 250 ml bottles','15.50',39,0,5,'0'),
+ (16,'Pavlova',7,3,'32 - 500 g boxes','17.45',29,0,10,'0'),
+ (17,'Alice Mutton',7,6,'20 - 1 kg tins','39.00',0,0,0,'1'),
+ (18,'Carnarvon Tigers',7,8,'16 kg pkg.','62.50',42,0,0,'0'),
+ (19,'Teatime Chocolate Biscuits',8,3,'10 boxes x 12 pieces','9.20',25,0,5,'0'),
+ (20,'Sir Rodney\'s Marmalade',8,3,'30 gift boxes','81.00',40,0,0,'0'),
+ (21,'Sir Rodney\'s Scones',8,3,'24 pkgs. x 4 pieces','10.00',3,40,5,'0'),
+ (22,'Gustaf\'s Knäckebröd',9,5,'24 - 500 g pkgs.','21.00',104,0,25,'0'),
+ (23,'Tunnbröd',9,5,'12 - 250 g pkgs.','9.00',61,0,25,'0'),
+ (24,'Guaraná Fantástica',10,1,'12 - 355 ml cans','4.50',20,0,0,'1'),
+ (25,'NuNuCa Nuß-Nougat-Creme',11,3,'20 - 450 g glasses','14.00',76,0,30,'0'),
+ (26,'Gumbär Gummibärchen',11,3,'100 - 250 g bags','31.23',15,0,0,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (27,'Schoggi Schokolade',11,3,'100 - 100 g pieces','43.90',49,0,30,'0'),
+ (28,'Rössle Sauerkraut',12,7,'25 - 825 g cans','45.60',26,0,0,'1'),
+ (29,'Thüringer Rostbratwurst',12,6,'50 bags x 30 sausgs.','123.79',0,0,0,'1'),
+ (30,'Nord-Ost Matjeshering',13,8,'10 - 200 g glasses','25.89',10,0,15,'0'),
+ (31,'Gorgonzola Telino',14,4,'12 - 100 g pkgs','12.50',0,70,20,'0'),
+ (32,'Mascarpone Fabioli',14,4,'24 - 200 g pkgs.','32.00',9,40,25,'0'),
+ (33,'Geitost',15,4,'500 g','2.50',112,0,20,'0'),
+ (34,'Sasquatch Ale',16,1,'24 - 12 oz bottles','14.00',111,0,15,'0'),
+ (35,'Steeleye Stout',16,1,'24 - 12 oz bottles','18.00',20,0,15,'0'),
+ (36,'Inlagd Sill',17,8,'24 - 250 g  jars','19.00',112,0,20,'0'),
+ (37,'Gravad lax',17,8,'12 - 500 g pkgs.','26.00',11,50,25,'0'),
+ (38,'Côte de Blaye',18,1,'12 - 75 cl bottles','263.50',17,0,15,'0'),
+ (39,'Chartreuse verte',18,1,'750 cc per bottle','18.00',69,0,5,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (40,'Boston Crab Meat',19,8,'24 - 4 oz tins','18.40',123,0,30,'0'),
+ (41,'Jack\'s New England Clam Chowder',19,8,'12 - 12 oz cans','9.65',85,0,10,'0'),
+ (42,'Singaporean Hokkien Fried Mee',20,5,'32 - 1 kg pkgs.','14.00',26,0,0,'1'),
+ (43,'Ipoh Coffee',20,1,'16 - 500 g tins','46.00',17,10,25,'0'),
+ (44,'Gula Malacca',20,2,'20 - 2 kg bags','19.45',27,0,15,'0'),
+ (45,'Rogede sild',21,8,'1k pkg.','9.50',5,70,15,'0'),
+ (46,'Spegesild',21,8,'4 - 450 g glasses','12.00',95,0,0,'0'),
+ (47,'Zaanse koeken',22,3,'10 - 4 oz boxes','9.50',36,0,0,'0'),
+ (48,'Chocolade',22,3,'10 pkgs.','12.75',15,70,25,'0'),
+ (49,'Maxilaku',23,3,'24 - 50 g pkgs.','20.00',10,60,15,'0'),
+ (50,'Valkoinen suklaa',23,3,'12 - 100 g bars','16.25',65,0,30,'0'),
+ (51,'Manjimup Dried Apples',24,7,'50 - 300 g pkgs.','53.00',20,0,10,'0'),
+ (52,'Filo Mix',24,5,'16 - 2 kg boxes','7.00',38,0,25,'0'),
+ (53,'Perth Pasties',24,6,'48 pieces','32.80',0,0,0,'1');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (54,'Tourtière',25,6,'16 pies','7.45',21,0,10,'0'),
+ (55,'Pâté chinois',25,6,'24 boxes x 2 pies','24.00',115,0,20,'0'),
+ (56,'Gnocchi di nonna Alice',26,5,'24 - 250 g pkgs.','38.00',21,10,30,'0'),
+ (57,'Ravioli Angelo',26,5,'24 - 250 g pkgs.','19.50',36,0,20,'0'),
+ (58,'Escargots de Bourgogne',27,8,'24 pieces','13.25',62,0,20,'0'),
+ (59,'Raclette Courdavault',28,4,'5 kg pkg.','55.00',79,0,0,'0'),
+ (60,'Camembert Pierrot',28,4,'15 - 300 g rounds','34.00',19,0,0,'0'),
+ (61,'Sirop d\'érable',29,2,'24 - 500 ml bottles','28.50',113,0,25,'0'),
+ (62,'Tarte au sucre',29,3,'48 pies','49.30',17,0,0,'0'),
+ (63,'Vegie-spread',7,2,'15 - 625 g jars','43.90',24,0,5,'0'),
+ (64,'Wimmers gute Semmelknödel',12,5,'20 bags x 4 pieces','33.25',22,80,30,'0'),
+ (65,'Louisiana Fiery Hot Pepper Sauce',2,2,'32 - 8 oz bottles','21.05',76,0,0,'0'),
+ (66,'Louisiana Hot Spiced Okra',2,2,'24 - 8 oz jars','17.00',4,100,20,'0');
+INSERT INTO `northwind`.`products` (`ProductID`,`ProductName`,`SupplierID`,`CategoryID`,`QuantityPerUnit`,`UnitPrice`,`UnitsInStock`,`UnitsOnOrder`,`ReorderLevel`,`Discontinued`) VALUES 
+ (67,'Laughing Lumberjack Lager',16,1,'24 - 12 oz bottles','14.00',52,0,10,'0'),
+ (68,'Scottish Longbreads',8,3,'10 boxes x 8 pieces','12.50',6,10,15,'0'),
+ (69,'Gudbrandsdalsost',15,4,'10 kg pkg.','36.00',26,0,15,'0'),
+ (70,'Outback Lager',7,1,'24 - 355 ml bottles','15.00',15,10,30,'0'),
+ (71,'Flotemysost',15,4,'10 - 500 g pkgs.','21.50',26,0,0,'0'),
+ (72,'Mozzarella di Giovanni',14,4,'24 - 200 g pkgs.','34.80',14,0,0,'0'),
+ (73,'Röd Kaviar',17,8,'24 - 150 g jars','15.00',101,0,5,'0'),
+ (74,'Longlife Tofu',4,7,'5 kg pkg.','10.00',4,20,5,'0'),
+ (75,'Rhönbräu Klosterbier',12,1,'24 - 0.5 l bottles','7.75',125,0,25,'0'),
+ (76,'Lakkalikööri',23,1,'500 ml','18.00',57,0,20,'0'),
+ (77,'Original Frankfurter grüne Soße',12,2,'12 boxes','13.00',32,0,15,'0');
+/*!40000 ALTER TABLE `products` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`shippers`
+--
+
+DROP TABLE IF EXISTS `northwind`.`shippers`;
+CREATE TABLE  `northwind`.`shippers` (
+  `ShipperID` int(11) NOT NULL auto_increment,
+  `CompanyName` varchar(40) NOT NULL default '',
+  `Phone` varchar(24) default NULL,
+  PRIMARY KEY  (`ShipperID`)
+) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`shippers`
+--
+
+/*!40000 ALTER TABLE `shippers` DISABLE KEYS */;
+INSERT INTO `northwind`.`shippers` (`ShipperID`,`CompanyName`,`Phone`) VALUES 
+ (1,'Speedy Express','(503) 555-9831'),
+ (2,'United Package','(503) 555-3199'),
+ (3,'Federal Shipping','(503) 555-9931');
+/*!40000 ALTER TABLE `shippers` ENABLE KEYS */;
+
+
+--
+-- Definition of table `northwind`.`suppliers`
+--
+
+DROP TABLE IF EXISTS `northwind`.`suppliers`;
+CREATE TABLE  `northwind`.`suppliers` (
+  `SupplierID` int(11) NOT NULL auto_increment,
+  `CompanyName` varchar(40) NOT NULL default '',
+  `ContactName` varchar(30) default NULL,
+  `ContactTitle` varchar(30) default NULL,
+  `Address` varchar(60) default NULL,
+  `City` varchar(15) default NULL,
+  `Region` varchar(15) default NULL,
+  `PostalCode` varchar(10) default NULL,
+  `Country` varchar(15) default NULL,
+  `Phone` varchar(24) default NULL,
+  `Fax` varchar(24) default NULL,
+  `HomePage` text,
+  PRIMARY KEY  (`SupplierID`)
+) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `northwind`.`suppliers`
+--
+
+/*!40000 ALTER TABLE `suppliers` DISABLE KEYS */;
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (1,'Exotic Liquids','Charlotte Cooper','Purchasing Manager','49 Gilbert St.','London',NULL,'EC1 4SD','UK','(171) 555-2222',NULL,NULL),
+ (2,'New Orleans Cajun Delights','Shelley Burke','Order Administrator','P.O. Box 78934','New Orleans','LA','70117','USA','(100) 555-4822',NULL,NULL),
+ (3,'Grandma Kelly\'s Homestead','Regina Murphy','Sales Representative','707 Oxford Rd.','Ann Arbor','MI','48104','USA','(313) 555-5735','(313) 555-3349',NULL),
+ (4,'Tokyo Traders','Yoshi Nagase','Marketing Manager','9-8 Sekimai Musashino-shi','Tokyo',NULL,'100','Japan','(03) 3555-5011',NULL,NULL),
+ (5,'Cooperativa de Quesos \'Las Cabras\'','Antonio del Valle Saavedra','Export Administrator','Calle del Rosal 4','Oviedo','Asturias','33007','Spain','(98) 598 76 54',NULL,NULL),
+ (6,'Mayumi\'s','Mayumi Ohno','Marketing Representative','92 Setsuko Chuo-ku','Osaka',NULL,'545','Japan','(06) 431-7877',NULL,NULL),
+ (7,'Pavlova Ltd.','Ian Devling','Marketing Manager','74 Rose St. Moonie Ponds','Melbourne','Victoria','3058','Australia','(03) 444-2343','(03) 444-6588',NULL);
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (8,'Specialty Biscuits Ltd.','Peter Wilson','Sales Representative','29 King\'s Way','Manchester',NULL,'M14 GSD','UK','(161) 555-4448',NULL,NULL),
+ (9,'PB Knäckebröd AB','Lars Peterson','Sales Agent','Kaloadagatan 13','Göteborg',NULL,'S-345 67','Sweden','031-987 65 43','031-987 65 91',NULL),
+ (10,'Refrescos Americanas LTDA','Carlos Diaz','Marketing Manager','Av. das Americanas 12.890','Sao Paulo',NULL,'5442','Brazil','(11) 555 4640',NULL,NULL),
+ (11,'Heli Süßwaren GmbH & Co. KG','Petra Winkler','Sales Manager','Tiergartenstraße 5','Berlin',NULL,'10785','Germany','(010) 9984510',NULL,NULL),
+ (12,'Plutzer Lebensmittelgroßmärkte AG','Martin Bein','International Marketing Mgr.','Bogenallee 51','Frankfurt',NULL,'60439','Germany','(069) 992755',NULL,NULL),
+ (13,'Nord-Ost-Fisch Handelsgesellschaft mbH','Sven Petersen','Coordinator Foreign Markets','Frahmredder 112a','Cuxhaven',NULL,'27478','Germany','(04721) 8713','(04721) 8714',NULL),
+ (14,'Formaggi Fortini s.r.l.','Elio Rossi','Sales Representative','Viale Dante 75','Ravenna',NULL,'48100','Italy','(0544) 60323','(0544) 60603',NULL);
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (15,'Norske Meierier','Beate Vileid','Marketing Manager','Hatlevegen 5','Sandvika',NULL,'1320','Norway','(0)2-953010',NULL,''),
+ (16,'Bigfoot Breweries','Cheryl Saylor','Regional Account Rep.','3400 - 8th Avenue Suite 210','Bend','OR','97101','USA','(503) 555-9931',NULL,''),
+ (17,'Svensk Sjöföda AB','Michael Björn','Sales Representative','Brovallavägen 231','Stockholm',NULL,'S-123 45','Sweden','08-123 45 67',NULL,''),
+ (18,'Aux joyeux ecclésiastiques','Guylène Nodier','Sales Manager','203 Rue des Francs-Bourgeois','Paris',NULL,'75004','France','(1) 03.83.00.68','(1) 03.83.00.62',''),
+ (19,'New England Seafood Cannery','Robb Merchant','Wholesale Account Agent','Order Processing Dept. 2100 Paul Revere Blvd.','Boston','MA','02134','USA','(617) 555-3267','(617) 555-3389',''),
+ (20,'Leka Trading','Chandra Leka','Owner','471 Serangoon Loop Suite #402','Singapore',NULL,'0512','Singapore','555-8787',NULL,''),
+ (21,'Lyngbysild','Niels Petersen','Sales Manager','Lyngbysild Fiskebakken 10','Lyngby',NULL,'2800','Denmark','43844108','43844115','');
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (22,'Zaanse Snoepfabriek','Dirk Luchte','Accounting Manager','Verkoop Rijnweg 22','Zaandam',NULL,'9999 ZZ','Netherlands','(12345) 1212','(12345) 1210',''),
+ (23,'Karkki Oy','Anne Heikkonen','Product Manager','Valtakatu 12','Lappeenranta',NULL,'53120','Finland','(953) 10956',NULL,''),
+ (24,'G\'day Mate','Wendy Mackenzie','Sales Representative','170 Prince Edward Parade Hunter\'s Hill','Sydney','NSW','2042','Australia','(02) 555-5914','(02) 555-4873','G\'day Mate (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/gdaymate.htm#'),
+ (25,'Ma Maison','Jean-Guy Lauzon','Marketing Manager','2960 Rue St. Laurent','Montréal','Québec','H1J 1C3','Canada','(514) 555-9022',NULL,''),
+ (26,'Pasta Buttini s.r.l.','Giovanni Giudici','Order Administrator','Via dei Gelsomini 153','Salerno',NULL,'84100','Italy','(089) 6547665','(089) 6547667',''),
+ (27,'Escargots Nouveaux','Marie Delamare','Sales Manager','22 rue H. Voiron','Montceau',NULL,'71300','France','85.57.00.07',NULL,'');
+INSERT INTO `northwind`.`suppliers` (`SupplierID`,`CompanyName`,`ContactName`,`ContactTitle`,`Address`,`City`,`Region`,`PostalCode`,`Country`,`Phone`,`Fax`,`HomePage`) VALUES 
+ (28,'Gai pâturage','Eliane Noz','Sales Representative','Bat. B 3 rue des Alpes','Annecy',NULL,'74000','France','38.76.98.06','38.76.98.58',''),
+ (29,'Forêts d\'érables','Chantal Goulet','Accounting Manager','148 rue Chasseur','Ste-Hyacinthe','Québec','J2S 7S8','Canada','(514) 555-2955','(514) 555-2921','');
+/*!40000 ALTER TABLE `suppliers` ENABLE KEYS */;
+
+
+
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
diff --git a/examples/data/northwind.mdb b/examples/data/northwind.mdb
new file mode 100644 (file)
index 0000000..586006b
Binary files /dev/null and b/examples/data/northwind.mdb differ
diff --git a/examples/demo.css b/examples/demo.css
new file mode 100644 (file)
index 0000000..6ccf9dc
--- /dev/null
@@ -0,0 +1,62 @@
+/* this file is only for running the Rico 3.0 examples */\r
+\r
+body {\r
+font-family: Verdana, Arial, Helvetica, sans-serif;\r
+}\r
+\r
+h1 {\r
+       font-family : Trebuchet MS, Arial, Helvetica, sans-serif;\r
+       font-size: 16pt;\r
+}\r
+\r
+#explanation {\r
+  background-color:#EEEEFF;\r
+  font-size:small;\r
+  margin-bottom:0.5em;\r
+  padding: 2px;\r
+}\r
+\r
+#libinfo {\r
+  background-color:#EEEEFF;\r
+  font-size:9pt;\r
+  margin-bottom:0.5em;\r
+  padding: 2px;\r
+}\r
+\r
+#libname {\r
+  font-size:small;\r
+}\r
+\r
+\r
+p.ricoBookmark { clear:both; }\r
+\r
+form#settings {\r
+  font-size:smaller;\r
+  margin: 0px 10px 0px 0px;\r
+  padding: 3px;\r
+  border: 1px solid black;\r
+}\r
+\r
+.appHeader {\r
+       margin:0px;\r
+}\r
+\r
+#DrillDownDesc {\r
+  font-weight: bold;\r
+}\r
+\r
+table.demoSettings td {\r
+  font-size:small;\r
+  white-space: nowrap;\r
+}\r
+\r
+#addplaceholder {\r
+  height: 125px;\r
+  width: 125px;\r
+  background-color:white;\r
+  border: 1px solid blue;\r
+}\r
+\r
+.ui-tabs *, .ui-accordion * {\r
+  font-size: 12px;\r
+}
\ No newline at end of file
diff --git a/examples/dotnet/CustTree.aspx b/examples/dotnet/CustTree.aspx
new file mode 100644 (file)
index 0000000..81a1326
--- /dev/null
@@ -0,0 +1,38 @@
+<%@ Page Language="vb" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="XmlWriter" Src="../../plugins/dotnet/ricoResponse.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+\r
+dim RequestId as string\r
+dim parent as string\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Response.CacheControl = "no-cache"\r
+  Response.AddHeader("Pragma", "no-cache")\r
+  Response.Expires = -1\r
+  Response.ContentType="text/xml"\r
+  \r
+  RequestId=trim(Request.QueryString("id"))\r
+  parent=trim(Request.QueryString("Parent"))\r
+\r
+  if RequestId="" then\r
+    XmlObj.ErrorMsg="No ID provided!"\r
+  elseif not app.OpenDB() then\r
+    XmlObj.ErrorMsg=app.LastErrorMsg\r
+  else\r
+    XmlObj.dbConnection=app.dbConnection\r
+    XmlObj.dbDialect=app.dbDialect\r
+    if parent <> "" then\r
+      XmlObj.sqlText="SELECT '" & parent & "',CustomerID,CompanyName,'L',1 FROM customers where CompanyName like '" & parent & "%'"\r
+    else\r
+      XmlObj.WriteTreeRow("","root","Customer names starting with...","C",0)\r
+      XmlObj.sqlText="SELECT distinct 'root',left(CompanyName,1),left(CompanyName,1),'C',0 FROM customers"\r
+    end if\r
+  end if\r
+End Sub\r
+\r
+</script>\r
+\r
+<Rico:XmlWriter id="XmlObj" runat="server"/>\r
diff --git a/examples/dotnet/LoadRicoClient.ascx b/examples/dotnet/LoadRicoClient.ascx
new file mode 100644 (file)
index 0000000..73221f4
--- /dev/null
@@ -0,0 +1,178 @@
+<%@ Control Language="vb" debug="true"%>\r
+\r
+<script runat="server">\r
+\r
+Public jsDir as String ="../../ricoClient/js/"       ' directory containing Rico's javascript files\r
+Public cssDir as String ="../../ricoClient/css/"     ' directory containing Rico's css files\r
+Public imgDir as String ="../../ricoClient/images/"  ' directory containing Rico's image files\r
+Public transDir as String =jsDir & "translations/"\r
+Public baselibsDir as String =jsDir & "baselibs/"\r
+\r
+Public jslib as String = "proto"           ' base library (proto, jquery, moo, dojo, ext, or glow)\r
+Public modules as String                   ' comma separated list of Rico modules to load\r
+Public ricoLogging as Boolean = false      ' enable javascript console logging?\r
+Public language as String                  ' if left unset, language will be set automatically based on request's HTTP_ACCEPT_LANGUAGE\r
+Public checkQueryString as Boolean = true  ' load settings from QueryString?  true for demo, false for production\r
+Public LoadBaseLib as Boolean = true       ' load base Javascript library (prototype, jQuery, etc) from Rico directory?\r
+Public grid_striping as Boolean = true     ' apply row striping to LiveGrids?\r
+Public jQuery_theme_path as String = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/"\r
+\r
+Protected theme as String = "j-ui-lightness"  ' jquery themes start with j-, rico themes start with r-\r
+\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  if checkQueryString then ricoLogging=CBool(trim(Request.QueryString("log")) <> "")\r
+  SetConfig(writer)\r
+\r
+  dim qs as String\r
+  if checkQueryString then\r
+    qs=trim(Request.QueryString("lib"))\r
+    if qs<>"" then jslib=qs\r
+  end if\r
+  LoadLib(writer, LCase(jslib))\r
+\r
+  if IsNothing(language) then language=Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")\r
+  setLang(writer, language)\r
+\r
+  if checkQueryString then\r
+    qs=trim(Request.QueryString("theme"))\r
+    if qs<>"" then theme=qs\r
+  end if\r
+  if theme<>"" then\r
+    LoadTheme(writer, theme)\r
+  end if\r
+  if modules<>"" then\r
+    dim ricoModule as String\r
+    dim arModules=split(modules,",")\r
+    for each ricoModule in arModules\r
+      requireRicoModule(writer, ricoModule)\r
+    next\r
+  end if\r
+end sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' do client-side initialization\r
+' -------------------------------------------------------------\r
+Protected sub SetConfig(writer as HTMLTextWriter)\r
+  writer.Write(vbLf & "<script type='text/javascript'>")\r
+  writer.Write(vbLf & "Rico_CONFIG = {")\r
+  if ricoLogging then writer.Write(vbLf & "enableLogging: true,")\r
+  writer.Write(vbLf & "jsDir: '" & jsDir & "',")\r
+  writer.Write(vbLf & "cssDir: '" & cssDir & "',")\r
+  writer.Write(vbLf & "imgDir: '" & imgDir & "'")\r
+  writer.Write(vbLf & "};")\r
+  writer.Write(vbLf & "</" & "script>")\r
+end sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' set theme to one of the jQuery Themeroller themes\r
+' -------------------------------------------------------------\r
+Public WriteOnly Property jTheme() As String\r
+  Set(ByVal ThemeName As String)\r
+    theme="j_" & ThemeName\r
+  End Set\r
+End Property\r
+\r
+\r
+' -------------------------------------------------------------\r
+' set theme to one of the Rico themes\r
+' -------------------------------------------------------------\r
+Public WriteOnly Property ricoTheme() As String\r
+  Set(ByVal ThemeName As String)\r
+    theme="r_" & ThemeName\r
+  End Set\r
+End Property\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Check specifed languages and see if there is a ricoLocale file to match\r
+' -------------------------------------------------------------\r
+Protected sub setLang(writer as HTMLTextWriter, lang as String)\r
+  dim lang2,fname,i\r
+  \r
+  dim arLang=split(LCase(lang),",")\r
+  for i=0 to ubound(arLang)\r
+    lang2=lcase(left(trim(arLang(i)),2))\r
+    if lang2="en" then exit for\r
+    fname=transDir & "ricoLocale_" & lang2 & ".js"\r
+    if System.IO.File.Exists(Server.MapPath(fname)) then\r
+      writer.Write("<script src='" & fname & "' type='text/javascript'></" & "script>")\r
+      exit for\r
+    end if\r
+  next\r
+end sub\r
+\r
+\r
+Protected sub LoadLib(writer as HTMLTextWriter, baseLib as String)\r
+  dim baseFile,adapter\r
+  select case baseLib\r
+    case "proto":\r
+      baseFile="prototype"\r
+      adapter="2Proto"\r
+    case "jquery":\r
+      baseFile="jquery"\r
+      adapter="2jQuery"\r
+    case "moo":\r
+      baseFile="mootools"\r
+      adapter="2Moo"\r
+    case "dojo":\r
+      baseFile="dojo"\r
+      adapter="2Dojo"\r
+    case "ext":\r
+      baseFile="ext-core"\r
+      adapter="2Ext"\r
+    case "glow":\r
+      baseFile="glow.core"\r
+      adapter="2Glow"\r
+    case else:\r
+      Response.End\r
+  end select\r
+\r
+  if LoadBaseLib then writer.Write(vbLf & "<script src='" & baselibsDir & baseFile & ".js' type='text/javascript'></" & "script>")\r
+  requireRicoJS(writer, "")\r
+  requireRicoJS(writer, adapter)\r
+  writer.Write(vbLf & "<script src='" & transDir & "ricoLocale_en.js' type='text/javascript'></" & "script>")\r
+  requireRicoCSS(writer, "rico")\r
+  requireRicoJS(writer, "UI")\r
+end sub\r
+\r
+\r
+\r
+' -------------------------------------------------------------\r
+' set theme\r
+' "j-ui-lightness" for a Themeroller theme\r
+' "r-greenHdg" for a native Rico theme\r
+' -------------------------------------------------------------\r
+Protected sub LoadTheme(writer as HTMLTextWriter, theme as String)\r
+  dim prefix,themeFile\r
+  prefix=left(theme,1)\r
+  themeFile=mid(theme,3)\r
+  select case prefix\r
+    case "j":\r
+      requireRicoJS(writer, "Themeroller")\r
+      writer.Write(vbLf & "<link type='text/css' rel='stylesheet' href='" & cssDir & "jquery-base/ui.base.css' />")\r
+      writer.Write(vbLf & "<link type='text/css' rel='Stylesheet' href='" & jQuery_theme_path & themeFile & "/jquery-ui.css' />")\r
+    case "r":\r
+      requireRicoCSS(writer, themeFile)\r
+  end select\r
+  if grid_striping then writer.Write(vbLf & "<link type='text/css' rel='stylesheet' href='" & cssDir & "striping/" & themeFile & ".css' />")\r
+end sub\r
+\r
+\r
+Protected sub requireRicoModule(writer as HTMLTextWriter, modulename as String)\r
+  writer.Write(vbLf & "<script type='text/javascript'>Rico.loadModule('" & trim(modulename) & "');</" & "script>")\r
+end sub\r
+\r
+\r
+Protected sub requireRicoJS(writer as HTMLTextWriter, filename as String)\r
+  writer.Write(vbLf & "<script src='" & jsDir & "rico" & filename & ".js' type='text/javascript'></" & "script>")\r
+end sub\r
+\r
+\r
+Protected sub requireRicoCSS(writer as HTMLTextWriter, filename as String)\r
+  writer.Write(vbLf & "<link href='" & cssDir & filename & ".css' type='text/css' rel='stylesheet' />")\r
+end sub\r
+\r
+</script>\r
diff --git a/examples/dotnet/RicoDbViewer.aspx b/examples/dotnet/RicoDbViewer.aspx
new file mode 100644 (file)
index 0000000..91371be
--- /dev/null
@@ -0,0 +1,91 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Import Namespace="System.Data" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Dim restrictions() As String = New String(3) {}\r
+  if app.OpenDB() then\r
+    restrictions(3)="BASE TABLE"\r
+    'restrictions(3)="TABLE"\r
+    TableList.DataSource = app.dbConnection.GetSchema ("Tables", restrictions)\r
+    TableList.DataBind()\r
+    restrictions(3)="VIEW"\r
+    ViewList.DataSource = app.dbConnection.GetSchema ("Tables", restrictions)\r
+    ViewList.DataBind()\r
+  end if\r
+End Sub\r
+\r
+</script>\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico-Table List</title>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<style type="text/css">\r
+html, body {\r
+  height:97%;\r
+  margin: 0px;\r
+  padding: 0px;\r
+  border: none;\r
+}\r
+\r
+#tablist {\r
+  height:100%;\r
+  width:25%;\r
+  overflow:auto;\r
+  float:left;\r
+  border: 1px solid #EEE;\r
+  font-size:smaller;\r
+}\r
+\r
+#detail {\r
+  height:100%;\r
+  width:70%;\r
+  float:left;\r
+  border: 1px solid #EEE;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<div id='tablist'>\r
+\r
+<p><strong>Rico Raw Data Viewer</strong>\r
+\r
+<p><strong>TABLES</strong>\r
+\r
+<ul>\r
+<asp:Repeater ID="TableList" Runat="server">\r
+<ItemTemplate>\r
+<li>\r
+<asp:HyperLink runat="server" NavigateUrl='<%# "RicoDbViewerDetail.aspx?id=" & DataBinder.Eval(Container.DataItem, "TABLE_NAME") & "&" & request.servervariables("QUERY_STRING") %>' Text='<%#DataBinder.Eval(Container.DataItem, "TABLE_NAME")%>' Target="detail" />\r
+</li>\r
+</ItemTemplate>\r
+</asp:Repeater>\r
+</ul>\r
+\r
+<p><strong>VIEWS</strong>\r
+\r
+<ul>\r
+<asp:Repeater ID="ViewList" Runat="server">\r
+<ItemTemplate>\r
+<li>\r
+<asp:HyperLink runat="server" NavigateUrl='<%# "RicoDbViewerDetail.aspx?id=" & DataBinder.Eval(Container.DataItem, "TABLE_NAME") & "&" & request.servervariables("QUERY_STRING") %>' Text='<%#DataBinder.Eval(Container.DataItem, "TABLE_NAME")%>' Target="detail" />\r
+</li>\r
+</ItemTemplate>\r
+</asp:Repeater>\r
+</ul>\r
+\r
+</div>\r
+\r
+<iframe id='detail' name='detail'>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/RicoDbViewerDetail.aspx b/examples/dotnet/RicoDbViewerDetail.aspx
new file mode 100644 (file)
index 0000000..3b6e604
--- /dev/null
@@ -0,0 +1,87 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Import Namespace="System.Data" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+Dim TableName as String\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Dim restrictions() As String = New String(2) {}\r
+  Dim ColumnInfo As DataTable\r
+  Dim columnlist as String\r
+\r
+  TableName = trim(request.querystring("id"))\r
+  if app.OpenDB() then\r
+\r
+    restrictions(2)=TableName\r
+    ColumnInfo = app.dbConnection.GetSchema ("Columns", restrictions)\r
+\r
+    Dim colname as String, colname0 as String, datatype as String\r
+    For Each colinfo As DataRow In ColumnInfo.Rows\r
+      colname=colinfo("COLUMN_NAME").ToString\r
+      datatype=colinfo("DATA_TYPE").ToString\r
+      if IsNothing(colname0) then colname0=colname\r
+      if IsNumeric(datatype) then datatype=ADOColType(datatype)\r
+      if not IsNothing(columnlist) then\r
+        columnlist=columnlist & ","\r
+      end if\r
+      if InStr(1,datatype,"binary",1) > 0 or left(datatype,3)="???" or datatype="image" then\r
+        columnlist=columnlist & "'?'"\r
+      else\r
+        columnlist=columnlist & colname\r
+      end if\r
+      Dim ColumnObj as New GridColumn()\r
+      ColumnObj.Heading=colname\r
+      ColumnObj.width=100\r
+      if InStr(1,datatype,"DATETIME",1) > 0 then ColumnObj.DataType="datetime"\r
+      dbViewer.AddColumn(ColumnObj)\r
+    Next\r
+    dbViewer.sqlQuery="select " & columnlist & " from [" & TableName & "] order by " & colname0\r
+\r
+  end if\r
+End Sub\r
+\r
+Function ADOColType(typenum)\r
+  select case typenum\r
+    case 2,3,16,17,18,19,20,21,139: ADOColType="INT"\r
+    case 7,133,134,135: ADOColType="DATETIME"\r
+    case 129,130:   ADOColType="CHAR"\r
+    case 8,200,202: ADOColType="VARCHAR"\r
+    case 201,203:   ADOColType="TEXT"\r
+    case 4,5,6,14:  ADOColType="FLOAT"\r
+    case 11:        ADOColType="BOOLEAN"\r
+    case else:      ADOColType="???" & typenum\r
+  end select\r
+End Function\r
+\r
+</script>\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-DB Viewer</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+html { border: none; }\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<p><strong><%=TableName%></strong>\r
+<Rico:LiveGrid runat='server' id='dbViewer' highlightElem='cursorRow' menuEvent='click' >\r
+<GridColumns>\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/ShipperEdit.aspx b/examples/dotnet/ShipperEdit.aspx
new file mode 100644 (file)
index 0000000..131b92a
--- /dev/null
@@ -0,0 +1,76 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Panel" Src="../../plugins/dotnet/GridPanel.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlCompatibilty" Src="../../plugins/dotnet/sqlCompatibilty.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Session.Timeout=60\r
+  app.OpenGridForm(ex8)\r
+End Sub\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  select case ex8.action\r
+    case "table": MyBase.Render(writer)\r
+    case "ins":   ex8.InsertRecord(writer)\r
+    case "upd":   ex8.UpdateRecord(writer)\r
+    case "del":   ex8.DeleteRecord(writer)\r
+  end select\r
+End Sub\r
+\r
+</script>\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Shippers (editable)</title>
+\r
+<My:LoadRicoClient id='initlibs' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<style type="text/css">
+div.ricoLG_cell {
+  white-space:nowrap;
+}
+</style>
+</head>\r
+\r
+\r
+<body>\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>\r
+<hr>\r
+The data on this grid can be edited using pop-up forms. \r
+Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. \r
+The Add and Edit forms are automatically generated by LiveGrid. \r
+Updates are disabled on the database, so you will get an error message if you try to save.\r
+</td><td>\r
+<script type='text/javascript'><!--\r
+google_ad_client = 'pub-7218597156507462';\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = '9298106441';\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>\r
+</td></tr></table>\r
+\r
+<p><strong>Shippers Table</strong></p>
+\r
+<Rico:LiveGrid runat='server' id='ex8' formView='true' TableName='shippers' DefaultSort='ShipperID' frozenColumns='1'>\r
+<GridColumns>\r
+  <Rico:Column runat='server' heading='ID'           width='50'  ColName='ShipperID'   EntryType='B' ColData='<auto>' />\r
+  <Rico:Column runat='server' heading='Company Name' width='150' ColName='CompanyName' EntryType='B' ConfirmDeleteColumn='true' />\r
+  <Rico:Column runat='server' heading='Phone Number' width='150' ColName='Phone'       EntryType='B' />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/dbConnect.ascx b/examples/dotnet/dbConnect.ascx
new file mode 100644 (file)
index 0000000..e3f0fa4
--- /dev/null
@@ -0,0 +1,86 @@
+<%@ Control Language="vb" debug="true"%>\r
+<%@ Import Namespace="System.Data" %>\r
+<%@ Import Namespace="System.Data.OleDb" %>\r
+<%@ Import Namespace="System.Data.SqlClient" %>\r
+<%@ Import Namespace="System.Data.Odbc" %>\r
+\r
+<script runat="server">\r
+\r
+Public dbConnection as object, accessRights as string\r
+Public LastErrorMsg as String\r
+Public defaultDB as String = "Northwind"\r
+Public const dbDialect     = "TSQL"   ' What kind of database are we connecting to?\r
+\r
+\r
+Public Function OpenDB()\r
+  try\r
+    select case dbDialect\r
+      case "Access": dbConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../data/" & defaultDB & ".mdb") & ";User ID=;Password=;")\r
+      case "TSQL":   dbConnection = new SqlConnection("Data Source=mbrown27;User ID=userid;Password=password;Initial Catalog=" & defaultDB & ";")\r
+      case "Oracle": dbConnection = new OleDbConnection("Provider=OraOLEDB.Oracle;Data Source=XE;User ID=" & defaultDB & ";Password=Password;")\r
+      case "MySQL":  dbConnection = new OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=" & defaultDB & ";USER=userid;PASSWORD=password;")\r
+      case "DB2":    dbConnection = new OleDbConnection("Provider=IBMDADB2;Data Source=NORTHWND;Protocol=local;CurrentSchema=SCHEMA;User ID=userid;Password=password;")\r
+    end select\r
+    dbConnection.Open()\r
+    OpenDB=true\r
+  Catch ex As Exception\r
+    OpenDB=false\r
+    LastErrorMsg=ex.Message\r
+  end try\r
+end function\r
+\r
+\r
+Public function OpenApp()\r
+  OpenApp=false\r
+  if not OpenDB then exit function\r
+  accessRights="rw"  ' CHECK APPLICATION SECURITY HERE  (in this example, "r" gives read-only access and "rw" gives read/write access)\r
+  if IsNothing(accessRights) OrElse left(accessRights,1)<>"r" then\r
+    LastErrorMsg="You do not have permission to access this application"\r
+  else\r
+    OpenApp=true\r
+  end if\r
+end function\r
+\r
+\r
+Public function OpenGridForm(oLiveGrid as object)\r
+  OpenGridForm=false\r
+  if not OpenApp() then\r
+    response.write("ERROR: " & LastErrorMsg)\r
+    response.end\r
+    exit function\r
+  end if\r
+  oLiveGrid.dbConnection=Me.dbConnection\r
+  oLiveGrid.dbDialect=Me.dbDialect\r
+\r
+  '-------------------------------\r
+  ' set application-wide defaults\r
+  '-------------------------------\r
+  'oLiveGrid.dataProvider="ricoXMLquery.aspx"\r
+  oLiveGrid.highlightElem="menuRow"\r
+  oLiveGrid.menuEvent="click"\r
+  'Session.Timeout=60\r
+\r
+  '-------------------------------\r
+  ' set security rights\r
+  '-------------------------------\r
+  dim CanModify as Boolean=CBool(accessRights="rw")\r
+  oLiveGrid.canAdd=CanModify\r
+  oLiveGrid.canEdit=CanModify\r
+  oLiveGrid.canDelete=CanModify\r
+\r
+  OpenGridForm=true\r
+end function\r
+\r
+\r
+Public sub CloseApp()\r
+  if IsNothing(dbConnection) then exit sub\r
+  dbConnection.Close()\r
+  dbConnection = Nothing\r
+end sub\r
+\r
+\r
+Sub Page_Unload(Sender As object, e As EventArgs)\r
+  Me.CloseApp()\r
+End Sub\r
+\r
+</script>\r
diff --git a/examples/dotnet/employees.aspx b/examples/dotnet/employees.aspx
new file mode 100644 (file)
index 0000000..2c19734
--- /dev/null
@@ -0,0 +1,106 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlCompatibilty" Src="../../plugins/dotnet/sqlCompatibilty.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Session.Timeout=60\r
+  dim arEmpSql as string() = {"%alias%LastName","', '","%alias%FirstName"}\r
+  dim oSqlCompat=new sqlCompatibilty(app.dbDialect)\r
+  emp.getColumnByName("ReportsTo").SelectSql="select EmployeeID," & oSqlCompat.Concat(arEmpSql,false) & " from employees order by LastName,FirstName" \r
+  app.OpenGridForm(emp)\r
+End Sub\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  select case emp.action\r
+    case "table": MyBase.Render(writer)\r
+    case "ins":   emp.InsertRecord(writer)\r
+    case "upd":   emp.UpdateRecord(writer)\r
+    case "del":   emp.DeleteRecord(writer)\r
+  end select\r
+End Sub\r
+\r
+</script>\r
+\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Northwind Employees</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' modules='Calendar' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+\r
+// ricoLiveGridForms will call emp_FormInit right before form initialization.\r
+\r
+function emp_FormInit() {\r
+  var cal=new Rico.CalendarControl("Cal");\r
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>The data on this grid can be edited using pop-up forms. \r
+Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. \r
+The Add and Edit forms are automatically generated by LiveGrid. \r
+Notice on the Edit form how the Rico Calendar is used to change dates. \r
+Updates are disabled on the database, so you will get an error message if you try to save.\r
+<a href='ricoQuery.aspx?id=ex2x&offset=0&page_size=10&get_total=true'>View the AJAX response (XML)</a>.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+<p><strong>Employees Table</strong></p>\r
+\r
+<Rico:LiveGrid runat='server' id='emp' TableName='employees' formView='true' DefaultSort='t.LastName,t.FirstName' menuEvent='click' frozenColumns='2' highlightElem='cursorRow'>\r
+<GridColumns>\r
+  <Rico:Column runat='server' ColName='EmployeeID' heading='Emp#'        width='60'  EntryType='B' ColData='<auto>' />\r
+  <Rico:Column runat='server' ColName='LastName'   heading='Last Name'   width='100' EntryType='B' />\r
+  <Rico:Column runat='server' ColName='FirstName'  heading='First Name'  width='100' EntryType='B' />\r
+  <Rico:Column runat='server' ColName='Title'      heading='Title'       width='120' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='TitleOfCourtesy' heading='Title (Courtesy)' width='90' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='BirthDate'  heading='Birth Date'  width='100' datatype='date' EntryType='D' SelectCtl='Cal' />\r
+  <Rico:Column runat='server' ColName='HireDate'   heading='Hire Date'   width='100' datatype='date' EntryType='D' ColData='Today' SelectCtl='Cal' />\r
+  <Rico:Column runat='server' ColName='Address'    heading='Address'     width='100' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='City'       heading='City'        width='100' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='Region'     heading='Region'      width='100' EntryType='N' />\r
+  <Rico:Column runat='server' ColName='PostalCode' heading='Postal Code' width='100' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='Country'    heading='Country'     width='100' EntryType='N' />\r
+  <Rico:Column runat='server' ColName='HomePhone'  heading='Home Phone'  width='100' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='Extension'  heading='Extension'   width='100' EntryType='T' />\r
+  <Rico:Column runat='server' ColName='ReportsTo'  heading='ReportsTo'   width='100' EntryType='SL' />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/ex1.aspx b/examples/dotnet/ex1.aspx
new file mode 100644 (file)
index 0000000..375a377
--- /dev/null
@@ -0,0 +1,1924 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\r
+<title>Rico LiveGrid sourced from HTML table</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' modules='LiveGridBasic,LiveGridMenu' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.onLoad( function() {\r
+  //alert('We are stopping here, at the start of the onLoad event, to show you that the grid is populated with data from a regular HTML table. This is what browsers with javascript disabled would display.');\r
+  var opts = {\r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    defaultWidth : 90,\r
+    useUnformattedColWidth: false,\r
+    columnSpecs  : [{width:200},'specQty','specQty','specQty','specQty','specQty']\r
+  };\r
+  var ex1=new Rico.LiveGrid ('population', new Rico.Buffer.Base(document.getElementById('population').tBodies[0]), opts);\r
+  ex1.menu=new Rico.GridMenu({});\r
+});\r
+</script>\r
+\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how Rico can convert an existing HTML table into\r
+a much more usable LiveGrid. \r
+LiveGrid provides scrolling, column resizing, filtering, and sorting capabilities.\r
+Click on a cell to see available actions.\r
+<p style='font-size:smaller;'>Data source: <a href="http://www.un.org/esa/population/unpop.htm">Population Division of the \r
+Department of Economic and Social Affairs of the United Nations Secretariat</a> (2009). \r
+<em>World Population Prospects: The 2008 Revision. Highlights.</em> New York: United Nations.  </p>                            \r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id="population_bookmark">&nbsp;</span></p>\r
+<table class="ricoLiveGrid" id="population">\r
+<thead>\r
+ <tr>\r
+  <td class='ricoFrozen'></td>\r
+  <td colspan=5>Population (thousands)</td>\r
+ </tr>\r
+ <tr>\r
+  <td class='ricoFrozen'>Country or area</td>\r
+  <td>1950</td>\r
+  <td>2009</td>\r
+  <td>2015</td>\r
+  <td>2025</td>\r
+  <td>2050</td>\r
+ </tr>\r
+</thead>\r
+<tbody>\r
+ <tr>\r
+  <td>Afghanistan</td>\r
+  <td>8151</td>\r
+  <td>28150</td>\r
+  <td>34246</td>\r
+  <td>44970</td>\r
+  <td>73938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Albania</td>\r
+  <td>1215</td>\r
+  <td>3155</td>\r
+  <td>3256</td>\r
+  <td>3395</td>\r
+  <td>3303</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Algeria</td>\r
+  <td>8753</td>\r
+  <td>34895</td>\r
+  <td>38088</td>\r
+  <td>42882</td>\r
+  <td>49610</td>\r
+ </tr>\r
+ <tr>\r
+  <td>American Samoa</td>\r
+  <td>19</td>\r
+  <td>67</td>\r
+  <td>74</td>\r
+  <td>86</td>\r
+  <td>107</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Andorra</td>\r
+  <td>6</td>\r
+  <td>86</td>\r
+  <td>93</td>\r
+  <td>107</td>\r
+  <td>137</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Angola</td>\r
+  <td>4148</td>\r
+  <td>18498</td>\r
+  <td>21690</td>\r
+  <td>27441</td>\r
+  <td>42267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Anguilla</td>\r
+  <td>5</td>\r
+  <td>15</td>\r
+  <td>17</td>\r
+  <td>18</td>\r
+  <td>20</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Antigua and Barbuda</td>\r
+  <td>46</td>\r
+  <td>88</td>\r
+  <td>93</td>\r
+  <td>101</td>\r
+  <td>112</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Argentina</td>\r
+  <td>17150</td>\r
+  <td>40276</td>\r
+  <td>42548</td>\r
+  <td>45883</td>\r
+  <td>50943</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Armenia</td>\r
+  <td>1354</td>\r
+  <td>3083</td>\r
+  <td>3139</td>\r
+  <td>3181</td>\r
+  <td>3018</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Aruba</td>\r
+  <td>38</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>112</td>\r
+  <td>106</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Australia</td>\r
+  <td>8219</td>\r
+  <td>21293</td>\r
+  <td>22607</td>\r
+  <td>24703</td>\r
+  <td>28724</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Austria</td>\r
+  <td>6936</td>\r
+  <td>8364</td>\r
+  <td>8467</td>\r
+  <td>8600</td>\r
+  <td>8515</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Azerbaijan</td>\r
+  <td>2896</td>\r
+  <td>8832</td>\r
+  <td>9426</td>\r
+  <td>10128</td>\r
+  <td>10579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahamas</td>\r
+  <td>79</td>\r
+  <td>342</td>\r
+  <td>366</td>\r
+  <td>402</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahrain</td>\r
+  <td>116</td>\r
+  <td>791</td>\r
+  <td>882</td>\r
+  <td>1021</td>\r
+  <td>1277</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bangladesh</td>\r
+  <td>43595</td>\r
+  <td>162221</td>\r
+  <td>175217</td>\r
+  <td>195012</td>\r
+  <td>222495</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Barbados</td>\r
+  <td>211</td>\r
+  <td>256</td>\r
+  <td>260</td>\r
+  <td>262</td>\r
+  <td>237</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belarus</td>\r
+  <td>7745</td>\r
+  <td>9634</td>\r
+  <td>9355</td>\r
+  <td>8851</td>\r
+  <td>7275</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belgium</td>\r
+  <td>8628</td>\r
+  <td>10647</td>\r
+  <td>10878</td>\r
+  <td>11191</td>\r
+  <td>11493</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belize</td>\r
+  <td>69</td>\r
+  <td>307</td>\r
+  <td>344</td>\r
+  <td>404</td>\r
+  <td>506</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Benin</td>\r
+  <td>2050</td>\r
+  <td>8935</td>\r
+  <td>10647</td>\r
+  <td>13767</td>\r
+  <td>21982</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bermuda</td>\r
+  <td>37</td>\r
+  <td>65</td>\r
+  <td>65</td>\r
+  <td>66</td>\r
+  <td>63</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bhutan</td>\r
+  <td>168</td>\r
+  <td>697</td>\r
+  <td>770</td>\r
+  <td>865</td>\r
+  <td>1013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bolivia</td>\r
+  <td>2714</td>\r
+  <td>9863</td>\r
+  <td>10854</td>\r
+  <td>12368</td>\r
+  <td>14908</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bosnia and Herzegovina</td>\r
+  <td>2661</td>\r
+  <td>3767</td>\r
+  <td>3727</td>\r
+  <td>3608</td>\r
+  <td>3008</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Botswana</td>\r
+  <td>413</td>\r
+  <td>1950</td>\r
+  <td>2106</td>\r
+  <td>2337</td>\r
+  <td>2758</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brazil</td>\r
+  <td>53975</td>\r
+  <td>193734</td>\r
+  <td>202866</td>\r
+  <td>213802</td>\r
+  <td>218512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>British Virgin Islands</td>\r
+  <td>7</td>\r
+  <td>23</td>\r
+  <td>24</td>\r
+  <td>26</td>\r
+  <td>28</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brunei Darussalam</td>\r
+  <td>48</td>\r
+  <td>400</td>\r
+  <td>443</td>\r
+  <td>513</td>\r
+  <td>658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bulgaria</td>\r
+  <td>7251</td>\r
+  <td>7545</td>\r
+  <td>7263</td>\r
+  <td>6752</td>\r
+  <td>5392</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burkina Faso</td>\r
+  <td>4080</td>\r
+  <td>15757</td>\r
+  <td>19013</td>\r
+  <td>24837</td>\r
+  <td>40830</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burundi</td>\r
+  <td>2456</td>\r
+  <td>8303</td>\r
+  <td>9413</td>\r
+  <td>11161</td>\r
+  <td>14846</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cambodia</td>\r
+  <td>4346</td>\r
+  <td>14805</td>\r
+  <td>16357</td>\r
+  <td>18973</td>\r
+  <td>23795</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cameroon</td>\r
+  <td>4466</td>\r
+  <td>19522</td>\r
+  <td>22169</td>\r
+  <td>26478</td>\r
+  <td>36736</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Canada</td>\r
+  <td>13737</td>\r
+  <td>33573</td>\r
+  <td>35493</td>\r
+  <td>38659</td>\r
+  <td>44414</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cape Verde</td>\r
+  <td>146</td>\r
+  <td>506</td>\r
+  <td>548</td>\r
+  <td>616</td>\r
+  <td>703</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cayman Islands</td>\r
+  <td>7</td>\r
+  <td>56</td>\r
+  <td>59</td>\r
+  <td>63</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Central African Republic</td>\r
+  <td>1327</td>\r
+  <td>4422</td>\r
+  <td>4927</td>\r
+  <td>5747</td>\r
+  <td>7603</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chad</td>\r
+  <td>2429</td>\r
+  <td>11206</td>\r
+  <td>13120</td>\r
+  <td>16906</td>\r
+  <td>27776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Channel Islands</td>\r
+  <td>102</td>\r
+  <td>150</td>\r
+  <td>151</td>\r
+  <td>152</td>\r
+  <td>144</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chile</td>\r
+  <td>6082</td>\r
+  <td>16970</td>\r
+  <td>17926</td>\r
+  <td>19266</td>\r
+  <td>20657</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China</td>\r
+  <td>544951</td>\r
+  <td>1345751</td>\r
+  <td>1395998</td>\r
+  <td>1453140</td>\r
+  <td>1417045</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Hong Kong SAR</td>\r
+  <td>1974</td>\r
+  <td>7022</td>\r
+  <td>7398</td>\r
+  <td>7969</td>\r
+  <td>8623</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Macao SAR</td>\r
+  <td>190</td>\r
+  <td>538</td>\r
+  <td>568</td>\r
+  <td>603</td>\r
+  <td>593</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Colombia</td>\r
+  <td>12000</td>\r
+  <td>45660</td>\r
+  <td>49385</td>\r
+  <td>54920</td>\r
+  <td>62877</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Comoros</td>\r
+  <td>156</td>\r
+  <td>676</td>\r
+  <td>767</td>\r
+  <td>907</td>\r
+  <td>1226</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Congo</td>\r
+  <td>808</td>\r
+  <td>3683</td>\r
+  <td>4225</td>\r
+  <td>5094</td>\r
+  <td>6863</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cook Islands</td>\r
+  <td>15</td>\r
+  <td>20</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>24</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Costa Rica</td>\r
+  <td>966</td>\r
+  <td>4579</td>\r
+  <td>4957</td>\r
+  <td>5521</td>\r
+  <td>6373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Côte d'Ivoire</td>\r
+  <td>2505</td>\r
+  <td>21075</td>\r
+  <td>24210</td>\r
+  <td>29738</td>\r
+  <td>43373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Croatia</td>\r
+  <td>3850</td>\r
+  <td>4416</td>\r
+  <td>4370</td>\r
+  <td>4254</td>\r
+  <td>3825</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cuba</td>\r
+  <td>5920</td>\r
+  <td>11204</td>\r
+  <td>11213</td>\r
+  <td>11148</td>\r
+  <td>9725</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cyprus</td>\r
+  <td>494</td>\r
+  <td>871</td>\r
+  <td>925</td>\r
+  <td>1014</td>\r
+  <td>1175</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Czech Republic</td>\r
+  <td>8925</td>\r
+  <td>10369</td>\r
+  <td>10510</td>\r
+  <td>10573</td>\r
+  <td>10294</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. People's Rep. of Korea</td>\r
+  <td>9737</td>\r
+  <td>23906</td>\r
+  <td>24399</td>\r
+  <td>25128</td>\r
+  <td>24562</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. Republic of the Congo</td>\r
+  <td>12184</td>\r
+  <td>66020</td>\r
+  <td>77419</td>\r
+  <td>98123</td>\r
+  <td>147512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Denmark</td>\r
+  <td>4271</td>\r
+  <td>5470</td>\r
+  <td>5523</td>\r
+  <td>5590</td>\r
+  <td>5551</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Djibouti</td>\r
+  <td>62</td>\r
+  <td>864</td>\r
+  <td>953</td>\r
+  <td>1111</td>\r
+  <td>1469</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominica</td>\r
+  <td>51</td>\r
+  <td>67</td>\r
+  <td>67</td>\r
+  <td>68</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominican Republic</td>\r
+  <td>2427</td>\r
+  <td>10090</td>\r
+  <td>10867</td>\r
+  <td>11973</td>\r
+  <td>13441</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ecuador</td>\r
+  <td>3387</td>\r
+  <td>13625</td>\r
+  <td>14596</td>\r
+  <td>16074</td>\r
+  <td>17989</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Egypt</td>\r
+  <td>21514</td>\r
+  <td>82999</td>\r
+  <td>91778</td>\r
+  <td>104970</td>\r
+  <td>129533</td>\r
+ </tr>\r
+ <tr>\r
+  <td>El Salvador</td>\r
+  <td>2200</td>\r
+  <td>6163</td>\r
+  <td>6383</td>\r
+  <td>6895</td>\r
+  <td>7882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Equatorial Guinea</td>\r
+  <td>226</td>\r
+  <td>676</td>\r
+  <td>781</td>\r
+  <td>971</td>\r
+  <td>1445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Eritrea</td>\r
+  <td>1141</td>\r
+  <td>5073</td>\r
+  <td>6009</td>\r
+  <td>7404</td>\r
+  <td>10787</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Estonia</td>\r
+  <td>1101</td>\r
+  <td>1340</td>\r
+  <td>1337</td>\r
+  <td>1321</td>\r
+  <td>1233</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ethiopia</td>\r
+  <td>18434</td>\r
+  <td>82825</td>\r
+  <td>96237</td>\r
+  <td>119822</td>\r
+  <td>173811</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Faeroe Islands</td>\r
+  <td>32</td>\r
+  <td>50</td>\r
+  <td>52</td>\r
+  <td>55</td>\r
+  <td>58</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Falkland Islands (Malvinas)</td>\r
+  <td>2</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Fiji</td>\r
+  <td>289</td>\r
+  <td>849</td>\r
+  <td>874</td>\r
+  <td>905</td>\r
+  <td>910</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Finland</td>\r
+  <td>4009</td>\r
+  <td>5326</td>\r
+  <td>5432</td>\r
+  <td>5533</td>\r
+  <td>5445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>France</td>\r
+  <td>41832</td>\r
+  <td>62343</td>\r
+  <td>63900</td>\r
+  <td>65769</td>\r
+  <td>67668</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Guiana</td>\r
+  <td>25</td>\r
+  <td>226</td>\r
+  <td>261</td>\r
+  <td>323</td>\r
+  <td>462</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Polynesia</td>\r
+  <td>61</td>\r
+  <td>269</td>\r
+  <td>289</td>\r
+  <td>318</td>\r
+  <td>354</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gabon</td>\r
+  <td>469</td>\r
+  <td>1475</td>\r
+  <td>1639</td>\r
+  <td>1915</td>\r
+  <td>2471</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gambia</td>\r
+  <td>258</td>\r
+  <td>1705</td>\r
+  <td>1985</td>\r
+  <td>2478</td>\r
+  <td>3763</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Georgia</td>\r
+  <td>3527</td>\r
+  <td>4260</td>\r
+  <td>4084</td>\r
+  <td>3888</td>\r
+  <td>3267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Germany</td>\r
+  <td>68376</td>\r
+  <td>82167</td>\r
+  <td>81346</td>\r
+  <td>79258</td>\r
+  <td>70504</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ghana</td>\r
+  <td>4981</td>\r
+  <td>23837</td>\r
+  <td>26925</td>\r
+  <td>32233</td>\r
+  <td>45213</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gibraltar</td>\r
+  <td>20</td>\r
+  <td>31</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>30</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greece</td>\r
+  <td>7566</td>\r
+  <td>11161</td>\r
+  <td>11261</td>\r
+  <td>11274</td>\r
+  <td>10939</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greenland</td>\r
+  <td>23</td>\r
+  <td>57</td>\r
+  <td>57</td>\r
+  <td>56</td>\r
+  <td>50</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Grenada</td>\r
+  <td>77</td>\r
+  <td>104</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guadeloupe</td>\r
+  <td>210</td>\r
+  <td>465</td>\r
+  <td>476</td>\r
+  <td>489</td>\r
+  <td>477</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guam</td>\r
+  <td>60</td>\r
+  <td>178</td>\r
+  <td>191</td>\r
+  <td>211</td>\r
+  <td>242</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guatemala</td>\r
+  <td>3146</td>\r
+  <td>14027</td>\r
+  <td>16227</td>\r
+  <td>19927</td>\r
+  <td>27480</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea</td>\r
+  <td>2619</td>\r
+  <td>10069</td>\r
+  <td>11844</td>\r
+  <td>15158</td>\r
+  <td>23975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea-Bissau</td>\r
+  <td>518</td>\r
+  <td>1611</td>\r
+  <td>1848</td>\r
+  <td>2296</td>\r
+  <td>3555</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guyana</td>\r
+  <td>423</td>\r
+  <td>762</td>\r
+  <td>754</td>\r
+  <td>732</td>\r
+  <td>558</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Haiti</td>\r
+  <td>3221</td>\r
+  <td>10033</td>\r
+  <td>10957</td>\r
+  <td>12476</td>\r
+  <td>15485</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Holy See</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Honduras</td>\r
+  <td>1487</td>\r
+  <td>7466</td>\r
+  <td>8386</td>\r
+  <td>9844</td>\r
+  <td>12402</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Hungary</td>\r
+  <td>9338</td>\r
+  <td>9993</td>\r
+  <td>9874</td>\r
+  <td>9647</td>\r
+  <td>8934</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iceland</td>\r
+  <td>143</td>\r
+  <td>323</td>\r
+  <td>353</td>\r
+  <td>384</td>\r
+  <td>407</td>\r
+ </tr>\r
+ <tr>\r
+  <td>India</td>\r
+  <td>371857</td>\r
+  <td>1198003</td>\r
+  <td>1294192</td>\r
+  <td>1431272</td>\r
+  <td>1613800</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Indonesia</td>\r
+  <td>77152</td>\r
+  <td>229965</td>\r
+  <td>244191</td>\r
+  <td>263287</td>\r
+  <td>288110</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iran (Islamic Republic of)</td>\r
+  <td>16913</td>\r
+  <td>74196</td>\r
+  <td>79454</td>\r
+  <td>87134</td>\r
+  <td>96975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iraq</td>\r
+  <td>5719</td>\r
+  <td>30747</td>\r
+  <td>35884</td>\r
+  <td>44692</td>\r
+  <td>63995</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ireland</td>\r
+  <td>2969</td>\r
+  <td>4515</td>\r
+  <td>4886</td>\r
+  <td>5370</td>\r
+  <td>6295</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Isle of Man</td>\r
+  <td>55</td>\r
+  <td>80</td>\r
+  <td>81</td>\r
+  <td>80</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Israel</td>\r
+  <td>1258</td>\r
+  <td>7170</td>\r
+  <td>7823</td>\r
+  <td>8769</td>\r
+  <td>10649</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Italy</td>\r
+  <td>46367</td>\r
+  <td>59870</td>\r
+  <td>60604</td>\r
+  <td>60018</td>\r
+  <td>57066</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jamaica</td>\r
+  <td>1403</td>\r
+  <td>2719</td>\r
+  <td>2786</td>\r
+  <td>2866</td>\r
+  <td>2683</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Japan</td>\r
+  <td>82824</td>\r
+  <td>127156</td>\r
+  <td>125791</td>\r
+  <td>120793</td>\r
+  <td>101659</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jordan</td>\r
+  <td>472</td>\r
+  <td>6316</td>\r
+  <td>6957</td>\r
+  <td>8088</td>\r
+  <td>10241</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kazakhstan</td>\r
+  <td>6703</td>\r
+  <td>15637</td>\r
+  <td>16289</td>\r
+  <td>17025</td>\r
+  <td>17848</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kenya</td>\r
+  <td>6077</td>\r
+  <td>39802</td>\r
+  <td>46433</td>\r
+  <td>57573</td>\r
+  <td>85410</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kiribati</td>\r
+  <td>26</td>\r
+  <td>98</td>\r
+  <td>107</td>\r
+  <td>123</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kuwait</td>\r
+  <td>152</td>\r
+  <td>2985</td>\r
+  <td>3378</td>\r
+  <td>3988</td>\r
+  <td>5240</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kyrgyzstan</td>\r
+  <td>1740</td>\r
+  <td>5482</td>\r
+  <td>5877</td>\r
+  <td>6378</td>\r
+  <td>6882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lao People's Dem. Republic</td>\r
+  <td>1666</td>\r
+  <td>6320</td>\r
+  <td>7028</td>\r
+  <td>8273</td>\r
+  <td>10744</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Latvia</td>\r
+  <td>1949</td>\r
+  <td>2249</td>\r
+  <td>2197</td>\r
+  <td>2101</td>\r
+  <td>1854</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lebanon</td>\r
+  <td>1443</td>\r
+  <td>4224</td>\r
+  <td>4426</td>\r
+  <td>4736</td>\r
+  <td>5033</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lesotho</td>\r
+  <td>734</td>\r
+  <td>2067</td>\r
+  <td>2168</td>\r
+  <td>2306</td>\r
+  <td>2491</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liberia</td>\r
+  <td>824</td>\r
+  <td>3955</td>\r
+  <td>4665</td>\r
+  <td>5858</td>\r
+  <td>8841</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Libyan Arab Jamahiriya</td>\r
+  <td>1029</td>\r
+  <td>6420</td>\r
+  <td>7158</td>\r
+  <td>8144</td>\r
+  <td>9819</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liechtenstein</td>\r
+  <td>14</td>\r
+  <td>36</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+  <td>45</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lithuania</td>\r
+  <td>2567</td>\r
+  <td>3287</td>\r
+  <td>3143</td>\r
+  <td>2985</td>\r
+  <td>2579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Luxembourg</td>\r
+  <td>296</td>\r
+  <td>486</td>\r
+  <td>520</td>\r
+  <td>582</td>\r
+  <td>733</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Madagascar</td>\r
+  <td>4084</td>\r
+  <td>19625</td>\r
+  <td>22853</td>\r
+  <td>28595</td>\r
+  <td>42693</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malawi</td>\r
+  <td>2881</td>\r
+  <td>15263</td>\r
+  <td>17998</td>\r
+  <td>23194</td>\r
+  <td>36575</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malaysia</td>\r
+  <td>6110</td>\r
+  <td>27468</td>\r
+  <td>30041</td>\r
+  <td>33770</td>\r
+  <td>39664</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Maldives</td>\r
+  <td>82</td>\r
+  <td>309</td>\r
+  <td>338</td>\r
+  <td>384</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mali</td>\r
+  <td>4268</td>\r
+  <td>13010</td>\r
+  <td>14993</td>\r
+  <td>18603</td>\r
+  <td>28260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malta</td>\r
+  <td>312</td>\r
+  <td>409</td>\r
+  <td>417</td>\r
+  <td>426</td>\r
+  <td>413</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Marshall Islands</td>\r
+  <td>13</td>\r
+  <td>62</td>\r
+  <td>70</td>\r
+  <td>79</td>\r
+  <td>92</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Martinique</td>\r
+  <td>222</td>\r
+  <td>405</td>\r
+  <td>411</td>\r
+  <td>418</td>\r
+  <td>393</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritania</td>\r
+  <td>651</td>\r
+  <td>3291</td>\r
+  <td>3732</td>\r
+  <td>4443</td>\r
+  <td>6061</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritius</td>\r
+  <td>493</td>\r
+  <td>1288</td>\r
+  <td>1337</td>\r
+  <td>1400</td>\r
+  <td>1426</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mayotte</td>\r
+  <td>15</td>\r
+  <td>194</td>\r
+  <td>224</td>\r
+  <td>277</td>\r
+  <td>386</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mexico</td>\r
+  <td>27741</td>\r
+  <td>109610</td>\r
+  <td>115528</td>\r
+  <td>123366</td>\r
+  <td>128964</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Micronesia (Fed. States of)</td>\r
+  <td>32</td>\r
+  <td>111</td>\r
+  <td>114</td>\r
+  <td>122</td>\r
+  <td>128</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Moldova (Republic of)</td>\r
+  <td>2341</td>\r
+  <td>3604</td>\r
+  <td>3462</td>\r
+  <td>3291</td>\r
+  <td>2734</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Monaco</td>\r
+  <td>20</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mongolia</td>\r
+  <td>761</td>\r
+  <td>2671</td>\r
+  <td>2855</td>\r
+  <td>3134</td>\r
+  <td>3446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montenegro</td>\r
+  <td>399</td>\r
+  <td>624</td>\r
+  <td>627</td>\r
+  <td>633</td>\r
+  <td>618</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montserrat</td>\r
+  <td>14</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>7</td>\r
+  <td>7</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Morocco</td>\r
+  <td>8953</td>\r
+  <td>31993</td>\r
+  <td>34330</td>\r
+  <td>37865</td>\r
+  <td>42583</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mozambique</td>\r
+  <td>6442</td>\r
+  <td>22894</td>\r
+  <td>25957</td>\r
+  <td>31190</td>\r
+  <td>44148</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Myanmar</td>\r
+  <td>17158</td>\r
+  <td>50020</td>\r
+  <td>53087</td>\r
+  <td>57585</td>\r
+  <td>63373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Namibia</td>\r
+  <td>485</td>\r
+  <td>2171</td>\r
+  <td>2412</td>\r
+  <td>2810</td>\r
+  <td>3588</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nauru</td>\r
+  <td>3</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nepal</td>\r
+  <td>8126</td>\r
+  <td>29331</td>\r
+  <td>32503</td>\r
+  <td>38031</td>\r
+  <td>49028</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands</td>\r
+  <td>10114</td>\r
+  <td>16592</td>\r
+  <td>16915</td>\r
+  <td>17348</td>\r
+  <td>17399</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands Antilles</td>\r
+  <td>112</td>\r
+  <td>198</td>\r
+  <td>207</td>\r
+  <td>210</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Caledonia</td>\r
+  <td>65</td>\r
+  <td>250</td>\r
+  <td>271</td>\r
+  <td>304</td>\r
+  <td>362</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Zealand</td>\r
+  <td>1908</td>\r
+  <td>4266</td>\r
+  <td>4492</td>\r
+  <td>4831</td>\r
+  <td>5349</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nicaragua</td>\r
+  <td>1295</td>\r
+  <td>5743</td>\r
+  <td>6265</td>\r
+  <td>7058</td>\r
+  <td>8143</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niger</td>\r
+  <td>2462</td>\r
+  <td>15290</td>\r
+  <td>19150</td>\r
+  <td>27388</td>\r
+  <td>58216</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nigeria</td>\r
+  <td>36680</td>\r
+  <td>154729</td>\r
+  <td>175928</td>\r
+  <td>210057</td>\r
+  <td>289083</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niue</td>\r
+  <td>5</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Northern Mariana Islands</td>\r
+  <td>7</td>\r
+  <td>87</td>\r
+  <td>96</td>\r
+  <td>111</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Norway</td>\r
+  <td>3265</td>\r
+  <td>4812</td>\r
+  <td>5036</td>\r
+  <td>5365</td>\r
+  <td>5947</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Occupied Palestinian Territory</td>\r
+  <td>1005</td>\r
+  <td>4277</td>\r
+  <td>5090</td>\r
+  <td>6553</td>\r
+  <td>10265</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Oman</td>\r
+  <td>456</td>\r
+  <td>2845</td>\r
+  <td>3198</td>\r
+  <td>3782</td>\r
+  <td>4878</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pakistan</td>\r
+  <td>41177</td>\r
+  <td>180808</td>\r
+  <td>205504</td>\r
+  <td>246286</td>\r
+  <td>335195</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Palau</td>\r
+  <td>7</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>23</td>\r
+  <td>26</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Panama</td>\r
+  <td>860</td>\r
+  <td>3454</td>\r
+  <td>3773</td>\r
+  <td>4267</td>\r
+  <td>5092</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Papua New Guinea</td>\r
+  <td>1798</td>\r
+  <td>6732</td>\r
+  <td>7678</td>\r
+  <td>9265</td>\r
+  <td>12871</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Paraguay</td>\r
+  <td>1473</td>\r
+  <td>6349</td>\r
+  <td>7007</td>\r
+  <td>8026</td>\r
+  <td>9867</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Peru</td>\r
+  <td>7632</td>\r
+  <td>29165</td>\r
+  <td>31197</td>\r
+  <td>34528</td>\r
+  <td>39776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Philippines</td>\r
+  <td>19996</td>\r
+  <td>91983</td>\r
+  <td>101734</td>\r
+  <td>117270</td>\r
+  <td>146156</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pitcairn</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Poland</td>\r
+  <td>24824</td>\r
+  <td>38074</td>\r
+  <td>37788</td>\r
+  <td>36964</td>\r
+  <td>32013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Portugal</td>\r
+  <td>8405</td>\r
+  <td>10707</td>\r
+  <td>10787</td>\r
+  <td>10706</td>\r
+  <td>10015</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Puerto Rico</td>\r
+  <td>2218</td>\r
+  <td>3982</td>\r
+  <td>4074</td>\r
+  <td>4176</td>\r
+  <td>4103</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Qatar</td>\r
+  <td>25</td>\r
+  <td>1409</td>\r
+  <td>1630</td>\r
+  <td>1848</td>\r
+  <td>2316</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Republic of Korea</td>\r
+  <td>19211</td>\r
+  <td>48333</td>\r
+  <td>49153</td>\r
+  <td>49484</td>\r
+  <td>44077</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Réunion</td>\r
+  <td>248</td>\r
+  <td>827</td>\r
+  <td>886</td>\r
+  <td>973</td>\r
+  <td>1096</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Romania</td>\r
+  <td>16311</td>\r
+  <td>21275</td>\r
+  <td>20787</td>\r
+  <td>19961</td>\r
+  <td>17279</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Russian Federation</td>\r
+  <td>102702</td>\r
+  <td>140874</td>\r
+  <td>137983</td>\r
+  <td>132345</td>\r
+  <td>116097</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Rwanda</td>\r
+  <td>2162</td>\r
+  <td>9998</td>\r
+  <td>11743</td>\r
+  <td>14676</td>\r
+  <td>22082</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Helena</td>\r
+  <td>5</td>\r
+  <td>4</td>\r
+  <td>4</td>\r
+  <td>5</td>\r
+  <td>5</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Kitts and Nevis</td>\r
+  <td>46</td>\r
+  <td>52</td>\r
+  <td>56</td>\r
+  <td>61</td>\r
+  <td>69</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Lucia</td>\r
+  <td>83</td>\r
+  <td>172</td>\r
+  <td>182</td>\r
+  <td>198</td>\r
+  <td>217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Pierre and Miquelon</td>\r
+  <td>5</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+ </tr>\r
+ <tr>\r
+  <td>St. Vincent and the Grenadines</td>\r
+  <td>67</td>\r
+  <td>109</td>\r
+  <td>110</td>\r
+  <td>111</td>\r
+  <td>119</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Samoa</td>\r
+  <td>82</td>\r
+  <td>179</td>\r
+  <td>181</td>\r
+  <td>188</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>San Marino</td>\r
+  <td>13</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sao Tome and Principe</td>\r
+  <td>60</td>\r
+  <td>163</td>\r
+  <td>180</td>\r
+  <td>216</td>\r
+  <td>296</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saudi Arabia</td>\r
+  <td>3201</td>\r
+  <td>25721</td>\r
+  <td>28933</td>\r
+  <td>34176</td>\r
+  <td>43658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Senegal</td>\r
+  <td>2416</td>\r
+  <td>12534</td>\r
+  <td>14526</td>\r
+  <td>17861</td>\r
+  <td>26102</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Serbia</td>\r
+  <td>6732</td>\r
+  <td>9850</td>\r
+  <td>9828</td>\r
+  <td>9720</td>\r
+  <td>9193</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Seychelles</td>\r
+  <td>36</td>\r
+  <td>84</td>\r
+  <td>86</td>\r
+  <td>91</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sierra Leone</td>\r
+  <td>1944</td>\r
+  <td>5696</td>\r
+  <td>6557</td>\r
+  <td>8112</td>\r
+  <td>12446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Singapore</td>\r
+  <td>1022</td>\r
+  <td>4737</td>\r
+  <td>5059</td>\r
+  <td>5362</td>\r
+  <td>5221</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovakia</td>\r
+  <td>3463</td>\r
+  <td>5406</td>\r
+  <td>5437</td>\r
+  <td>5413</td>\r
+  <td>4917</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovenia</td>\r
+  <td>1473</td>\r
+  <td>2020</td>\r
+  <td>2044</td>\r
+  <td>2050</td>\r
+  <td>1954</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Solomon Islands</td>\r
+  <td>90</td>\r
+  <td>523</td>\r
+  <td>599</td>\r
+  <td>725</td>\r
+  <td>1007</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Somalia</td>\r
+  <td>2264</td>\r
+  <td>9133</td>\r
+  <td>10731</td>\r
+  <td>13922</td>\r
+  <td>23522</td>\r
+ </tr>\r
+ <tr>\r
+  <td>South Africa</td>\r
+  <td>13683</td>\r
+  <td>50110</td>\r
+  <td>51684</td>\r
+  <td>53766</td>\r
+  <td>56802</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Spain</td>\r
+  <td>28009</td>\r
+  <td>44904</td>\r
+  <td>47203</td>\r
+  <td>49265</td>\r
+  <td>51260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sri Lanka</td>\r
+  <td>8241</td>\r
+  <td>20238</td>\r
+  <td>21167</td>\r
+  <td>22033</td>\r
+  <td>21705</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sudan</td>\r
+  <td>9190</td>\r
+  <td>42272</td>\r
+  <td>47730</td>\r
+  <td>56688</td>\r
+  <td>75884</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Suriname</td>\r
+  <td>215</td>\r
+  <td>520</td>\r
+  <td>547</td>\r
+  <td>586</td>\r
+  <td>619</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Swaziland</td>\r
+  <td>273</td>\r
+  <td>1185</td>\r
+  <td>1287</td>\r
+  <td>1455</td>\r
+  <td>1749</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sweden</td>\r
+  <td>7014</td>\r
+  <td>9249</td>\r
+  <td>9498</td>\r
+  <td>9915</td>\r
+  <td>10571</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Switzerland</td>\r
+  <td>4693</td>\r
+  <td>7568</td>\r
+  <td>7736</td>\r
+  <td>8020</td>\r
+  <td>8514</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Syrian Arab Republic</td>\r
+  <td>3536</td>\r
+  <td>21906</td>\r
+  <td>24494</td>\r
+  <td>28592</td>\r
+  <td>36911</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tajikistan</td>\r
+  <td>1532</td>\r
+  <td>6952</td>\r
+  <td>7761</td>\r
+  <td>9075</td>\r
+  <td>11111</td>\r
+ </tr>\r
+ <tr>\r
+  <td>TFYR Macedonia</td>\r
+  <td>1230</td>\r
+  <td>2042</td>\r
+  <td>2045</td>\r
+  <td>2037</td>\r
+  <td>1857</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Thailand</td>\r
+  <td>20607</td>\r
+  <td>67764</td>\r
+  <td>69939</td>\r
+  <td>72628</td>\r
+  <td>73361</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Timor-Leste</td>\r
+  <td>433</td>\r
+  <td>1134</td>\r
+  <td>1385</td>\r
+  <td>1869</td>\r
+  <td>3217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Togo</td>\r
+  <td>1329</td>\r
+  <td>6619</td>\r
+  <td>7607</td>\r
+  <td>9282</td>\r
+  <td>13196</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tokelau</td>\r
+  <td>2</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tonga</td>\r
+  <td>47</td>\r
+  <td>104</td>\r
+  <td>105</td>\r
+  <td>112</td>\r
+  <td>123</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Trinidad and Tobago</td>\r
+  <td>636</td>\r
+  <td>1339</td>\r
+  <td>1368</td>\r
+  <td>1388</td>\r
+  <td>1278</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tunisia</td>\r
+  <td>3530</td>\r
+  <td>10272</td>\r
+  <td>10884</td>\r
+  <td>11797</td>\r
+  <td>12711</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkey</td>\r
+  <td>21484</td>\r
+  <td>74816</td>\r
+  <td>79966</td>\r
+  <td>87364</td>\r
+  <td>97389</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkmenistan</td>\r
+  <td>1211</td>\r
+  <td>5110</td>\r
+  <td>5509</td>\r
+  <td>6072</td>\r
+  <td>6796</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turks and Caicos Islands</td>\r
+  <td>5</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tuvalu</td>\r
+  <td>5</td>\r
+  <td>10</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uganda</td>\r
+  <td>5158</td>\r
+  <td>32710</td>\r
+  <td>39710</td>\r
+  <td>53406</td>\r
+  <td>91271</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ukraine</td>\r
+  <td>37298</td>\r
+  <td>45708</td>\r
+  <td>44165</td>\r
+  <td>41617</td>\r
+  <td>35026</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Arab Emirates</td>\r
+  <td>70</td>\r
+  <td>4599</td>\r
+  <td>5193</td>\r
+  <td>6109</td>\r
+  <td>8253</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Kingdom</td>\r
+  <td>50616</td>\r
+  <td>61565</td>\r
+  <td>63528</td>\r
+  <td>66601</td>\r
+  <td>72365</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Republic of Tanzania</td>\r
+  <td>7650</td>\r
+  <td>43739</td>\r
+  <td>52109</td>\r
+  <td>67394</td>\r
+  <td>109450</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States of America</td>\r
+  <td>157813</td>\r
+  <td>314659</td>\r
+  <td>332334</td>\r
+  <td>358735</td>\r
+  <td>403932</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States Virgin Islands</td>\r
+  <td>27</td>\r
+  <td>110</td>\r
+  <td>108</td>\r
+  <td>103</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uruguay</td>\r
+  <td>2239</td>\r
+  <td>3361</td>\r
+  <td>3430</td>\r
+  <td>3546</td>\r
+  <td>3637</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uzbekistan</td>\r
+  <td>6314</td>\r
+  <td>27488</td>\r
+  <td>29456</td>\r
+  <td>32715</td>\r
+  <td>36439</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Vanuatu</td>\r
+  <td>48</td>\r
+  <td>240</td>\r
+  <td>276</td>\r
+  <td>338</td>\r
+  <td>482</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Venezuela (Bolivarian Republic of)</td>\r
+  <td>5094</td>\r
+  <td>28583</td>\r
+  <td>31292</td>\r
+  <td>35370</td>\r
+  <td>42042</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Viet Nam</td>\r
+  <td>27367</td>\r
+  <td>88069</td>\r
+  <td>93647</td>\r
+  <td>102054</td>\r
+  <td>111666</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Wallis and Futuna Islands</td>\r
+  <td>7</td>\r
+  <td>15</td>\r
+  <td>16</td>\r
+  <td>17</td>\r
+  <td>17</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Western Sahara</td>\r
+  <td>14</td>\r
+  <td>513</td>\r
+  <td>625</td>\r
+  <td>775</td>\r
+  <td>938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Yemen</td>\r
+  <td>4316</td>\r
+  <td>23580</td>\r
+  <td>27819</td>\r
+  <td>35509</td>\r
+  <td>53689</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zambia</td>\r
+  <td>2340</td>\r
+  <td>12935</td>\r
+  <td>14980</td>\r
+  <td>18890</td>\r
+  <td>28957</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zimbabwe</td>\r
+  <td>2747</td>\r
+  <td>12523</td>\r
+  <td>14029</td>\r
+  <td>16780</td>\r
+  <td>22178</td>\r
+ </tr>\r
+</tbody>\r
+</table>\r
+\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/dotnet/ex2editfilter.aspx b/examples/dotnet/ex2editfilter.aspx
new file mode 100644 (file)
index 0000000..855b10f
--- /dev/null
@@ -0,0 +1,109 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Panel" Src="../../plugins/dotnet/GridPanel.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlCompatibilty" Src="../../plugins/dotnet/sqlCompatibilty.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Session.Timeout=60\r
+  dim arEmpSql as string() = {"LastName","', '","FirstName"}\r
+  dim oSqlCompat=new sqlCompatibilty(app.dbDialect)\r
+  ex8.columns(ex8.ColIndex("EmployeeID")).SelectSql="select EmployeeID," & oSqlCompat.Concat(arEmpSql,false) & " from employees order by LastName,FirstName" \r
+  app.OpenGridForm(ex8)\r
+End Sub\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  select case ex8.action\r
+    case "table": MyBase.Render(writer)\r
+    case "ins":   ex8.InsertRecord(writer)\r
+    case "upd":   ex8.UpdateRecord(writer)\r
+    case "del":   ex8.DeleteRecord(writer)\r
+  end select\r
+End Sub\r
+\r
+</script>\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2 (editable)</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' modules='Calendar,Tree' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+\r
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.\r
+\r
+function ex8_FormInit() {\r
+  var cal=new Rico.CalendarControl("Cal");\r
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');\r
+  \r
+  var CustTree=new Rico.TreeControl("CustomerTree","CustTree.aspx");\r
+  Rico.EditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {\r
+       height:1.5em;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>\r
+<hr>The data on this grid can be edited using pop-up forms. \r
+Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. \r
+The Add and Edit forms are automatically generated by LiveGrid. \r
+Notice on the Add form how you use the Rico Tree control to select the customer. \r
+Notice on the Edit form how the Rico Calendar is used to change dates. \r
+Updates are disabled on the database, so you will get an error message if you try to save.\r
+</td><td>\r
+<script type='text/javascript'><!--\r
+google_ad_client = 'pub-7218597156507462';\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = '9298106441';\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>\r
+</td></tr></table>\r
+<p><strong>Orders Table</strong></p>\r
+\r
+\r
+<Rico:LiveGrid runat='server' id='ex8' formView='true' TableName='orders' DefaultSort='OrderID' FilterLocation='-1'>\r
+<GridColumns>\r
+  <Rico:Panel runat='server' heading='Basic Info' />\r
+  <Rico:Column runat='server' heading='Order#'        width='60'  ColName='OrderID'      EntryType='B' ColData='<auto>' ConfirmDeleteColumn='true' />\r
+  <Rico:Column runat='server' heading='Customer'      width='160' ColName='CustomerID'   EntryType='CL' InsertOnly='true' SelectCtl='CustomerTree' SelectSql="select CustomerID,CompanyName from customers order by CompanyName" filterUI='t' />\r
+  <Rico:Column runat='server' heading='Sales Person'  width='140' ColName='EmployeeID'   EntryType='SL' filterUI='m' />\r
+  <Rico:Column runat='server' heading='Order Date'    width='100' ColName='OrderDate'    EntryType='D' ColData='Today' SelectCtl='Cal' />\r
+  <Rico:Column runat='server' heading='Required Date' width='100' ColName='RequiredDate' EntryType='D' ColData='Today' SelectCtl='Cal' />\r
+  <Rico:Column runat='server' heading='Net Sale'      width='80'  format='DOLLAR'        Formula='select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID' />\r
+\r
+  <Rico:Panel runat='server' heading='Ship To' />\r
+  <Rico:Column runat='server' heading='Name'        width='150' ColName='ShipName'       EntryType='B' />\r
+  <Rico:Column runat='server' heading='Address'     width='150' ColName='ShipAddress'    EntryType='B' />\r
+  <Rico:Column runat='server' heading='City'        width='120' ColName='ShipCity'       EntryType='B' filterUI='m' />\r
+  <Rico:Column runat='server' heading='Region'      width='80'  ColName='ShipRegion'     EntryType='T' />\r
+  <Rico:Column runat='server' heading='Postal Code' width='80'  ColName='ShipPostalCode' EntryType='T' />\r
+  <Rico:Column runat='server' heading='Country'     width='90'  ColName='ShipCountry'    EntryType='N' filterUI='s' control="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{11}','_blank')" />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/ex2json.aspx b/examples/dotnet/ex2json.aspx
new file mode 100644 (file)
index 0000000..9bd4f83
--- /dev/null
@@ -0,0 +1,67 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example uses AJAX to fetch order data, as required, from the server. \r
+Notice how the number of visible rows is set automatically based\r
+on the size of the window. Try the different grid styles that\r
+are available. \r
+Click on a cell to see available actions.\r
+<a href='ricoQuery.aspx?id=ex2j&offset=0&page_size=10&_fmt=json'>View the AJAX response (JSON)</a>\r
+(requires JSONview or similar extension in FF).\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<Rico:LiveGrid runat='server' id='ex2j' fmt="json" TableName='orders' DefaultSort='OrderID' menuEvent='click' frozenColumns='1' highlightElem='cursorRow'>\r
+<GridColumns>\r
+  <Rico:Column runat='server' ColName='OrderID' heading='Order#' width='60' />\r
+  <Rico:Column runat='server' ColName='CustomerID' heading='Cust#' width='60' />\r
+  <Rico:Column runat='server' ColName='ShipName' heading='Ship Name' width='150' />\r
+  <Rico:Column runat='server' ColName='ShipCity' heading='Ship City' width='120' />\r
+  <Rico:Column runat='server' ColName='ShipCountry' heading='Ship Country' width='90' />\r
+  <Rico:Column runat='server' ColName='OrderDate' heading='Order Date' datatype='date' width='100' />\r
+  <Rico:Column runat='server' ColName='ShippedDate' heading='Ship Date' datatype='date' width='100' />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/ex2nosession.aspx b/examples/dotnet/ex2nosession.aspx
new file mode 100644 (file)
index 0000000..1a3ae1f
--- /dev/null
@@ -0,0 +1,121 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Panel" Src="../../plugins/dotnet/GridPanel.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlCompatibilty" Src="../../plugins/dotnet/sqlCompatibilty.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="ricoResponse" Src="../../plugins/dotnet/ricoResponse.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Session.Timeout=60\r
+  dim arEmpSql as string() = {"LastName","', '","FirstName"}\r
+  dim oSqlCompat=new sqlCompatibilty(app.dbDialect)\r
+  ex8n.columns(ex8n.ColIndex("EmployeeID")).SelectSql="select EmployeeID," & oSqlCompat.Concat(arEmpSql,false) & " from employees order by LastName,FirstName" \r
+  ex8n.dataProvider=Request.ServerVariables("SCRIPT_NAME")\r
+  app.OpenGridForm(ex8n)\r
+End Sub\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  select case ex8n.action\r
+    case "table": \r
+      RespObj.RenderFlag=false\r
+      MyBase.Render(writer)\r
+    case "ins":   ex8n.InsertRecord(writer)\r
+    case "upd":   ex8n.UpdateRecord(writer)\r
+    case "del":   ex8n.DeleteRecord(writer)\r
+    case "query":\r
+      RespObj.dbConnection=app.dbConnection\r
+      RespObj.dbDialect=app.dbDialect\r
+      RespObj.sendDebugMsgs=true   ' true for development, false for production\r
+      RespObj.LogSqlOnError=true   ' true for development, false for production\r
+      RespObj.oParse=ex8n.ParseClone()\r
+      RespObj.RunQuery(writer)\r
+  end select\r
+End Sub\r
+\r
+</script>\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2 (editable)</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' modules='Calendar,Tree' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+\r
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.\r
+\r
+function ex8_FormInit() {\r
+  var cal=new Rico.CalendarControl("Cal");\r
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');\r
+  \r
+  var CustTree=new Rico.TreeControl("CustomerTree","CustTree.aspx");\r
+  Rico.EditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {\r
+       height:1.5em;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>\r
+<hr>The data on this grid can be edited using pop-up forms. \r
+Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. \r
+Updates are disabled on the database, so you will get an error message if you try to save.\r
+<p>Rather than requesting data from RicoQuery, this page is able to process the AJAX\r
+data requests itself. No session variables are used.\r
+</td><td>\r
+<script type='text/javascript'><!--\r
+google_ad_client = 'pub-7218597156507462';\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = '9298106441';\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>\r
+</td></tr></table>\r
+<p><strong>Orders Table (without sessions)</strong></p>\r
+\r
+\r
+<Rico:LiveGrid runat='server' id='ex8n' formView='true' TableName='orders' DefaultSort='OrderID' FilterLocation='-1' sessions='false'>\r
+<GridColumns>\r
+  <Rico:Panel runat='server' heading='Basic Info' />\r
+  <Rico:Column runat='server' heading='Order#'        width='60'  ColName='OrderID'      EntryType='B' ColData='<auto>' ConfirmDeleteColumn='true' />\r
+  <Rico:Column runat='server' heading='Customer'      width='160' ColName='CustomerID'   EntryType='CL' InsertOnly='true' SelectCtl='CustomerTree' SelectSql="select CustomerID,CompanyName from customers order by CompanyName" filterUI='t' />\r
+  <Rico:Column runat='server' heading='Sales Person'  width='140' ColName='EmployeeID'   EntryType='SL' filterUI='s' />\r
+  <Rico:Column runat='server' heading='Order Date'    width='100' ColName='OrderDate'    EntryType='D' ColData='Today' SelectCtl='Cal' />\r
+  <Rico:Column runat='server' heading='Required Date' width='100' ColName='RequiredDate' EntryType='D' ColData='Today' SelectCtl='Cal' />\r
+  <Rico:Column runat='server' heading='Net Sale'      width='80'  format='DOLLAR'        Formula='select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID' />\r
+\r
+  <Rico:Panel runat='server' heading='Ship To' />\r
+  <Rico:Column runat='server' heading='Name'        width='150' ColName='ShipName'       EntryType='B' />\r
+  <Rico:Column runat='server' heading='Address'     width='150' ColName='ShipAddress'    EntryType='B' />\r
+  <Rico:Column runat='server' heading='City'        width='80'  ColName='ShipCity'       EntryType='B' filterUI='s' />\r
+  <Rico:Column runat='server' heading='Region'      width='80'  ColName='ShipRegion'     EntryType='T' />\r
+  <Rico:Column runat='server' heading='Postal Code' width='80'  ColName='ShipPostalCode' EntryType='T' />\r
+  <Rico:Column runat='server' heading='Country'     width='90'  ColName='ShipCountry'    EntryType='N' filterUI='s' control="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{11}','_blank')" />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+<Rico:ricoResponse id="RespObj" runat="server" />\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/ex2xml.aspx b/examples/dotnet/ex2xml.aspx
new file mode 100644 (file)
index 0000000..645abdf
--- /dev/null
@@ -0,0 +1,65 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example uses AJAX to fetch order data, as required, from the server. \r
+Notice how the number of visible rows is set automatically based\r
+on the size of the window. Try the different grid styles that\r
+are available. \r
+Click on a cell to see available actions.\r
+<a href='ricoQuery.aspx?id=ex2x&offset=0&page_size=10&get_total=true'>View the AJAX response (XML)</a>.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<Rico:LiveGrid runat='server' id='ex2x' TableName='orders' DefaultSort='OrderID' menuEvent='click' frozenColumns='1' highlightElem='cursorRow'>\r
+<GridColumns>\r
+  <Rico:Column runat='server' ColName='OrderID' heading='Order#' width='60' />\r
+  <Rico:Column runat='server' ColName='CustomerID' heading='Cust#' width='60' />\r
+  <Rico:Column runat='server' ColName='ShipName' heading='Ship Name' width='150' />\r
+  <Rico:Column runat='server' ColName='ShipCity' heading='Ship City' width='120' />\r
+  <Rico:Column runat='server' ColName='ShipCountry' heading='Ship Country' width='90' />\r
+  <Rico:Column runat='server' ColName='OrderDate' heading='Order Date' datatype='date' width='100' />\r
+  <Rico:Column runat='server' ColName='ShippedDate' heading='Ship Date' datatype='date' width='100' />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/flickrPhotos.ascx b/examples/dotnet/flickrPhotos.ascx
new file mode 100644 (file)
index 0000000..ec3ef61
--- /dev/null
@@ -0,0 +1,50 @@
+<%@ Control Language="vb" debug="true"%>\r
+<%@ Import Namespace="System.Xml" %>\r
+<script runat="server">\r
+\r
+public tags as string\r
+public flickrKey as String\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  writer.WriteLine("<rows update_ui='true' offset='0'>")\r
+
+  dim url as string = "http://api.flickr.com/services/rest/?method=flickr.photos.search"
+  dim cnt as integer = 0
+  if (tags <> "") then
+    url &= "&safe_search=1"
+    url &= "&tag_mode=all"
+    url &= "&sort=interestingness-desc"
+    url &= "&extras=date_taken,owner_name,geo,tags"
+    url &= "&tags=" & tags
+    url &= "&api_key=" & flickrKey\r
+    
+    Dim doc As XmlDocument = New XmlDocument()\r
+    doc.Load(url)                     \r
+    Dim root As XmlElement = doc.DocumentElement\r
+    'writer.WriteLine(root.OuterXml)\r
+    Dim photoNodes = root.GetElementsByTagName("photo")\r
+    Dim node as object, photourl as string\r
+    For Each node In photoNodes\r
+      writer.WriteLine("<tr>")\r
+      ' "_s" suffix specifies a 75x75 pixel format
+      photourl = "http://farm" & node.Attributes("farm").value & ".static.flickr.com/" & node.Attributes("server").value & "/" & node.Attributes("id").value & "_" & node.Attributes("secret").value & "_s.jpg"
+      writer.WriteLine(XmlStringCell(photourl))\r
+      writer.WriteLine(XmlStringCell(node.Attributes("title").value))\r
+      writer.WriteLine(XmlStringCell(node.Attributes("ownername").value))\r
+      writer.WriteLine(XmlStringCell(node.Attributes("datetaken").value))\r
+      writer.WriteLine(XmlStringCell(node.Attributes("tags").value))\r
+      writer.WriteLine("</tr>")\r
+      cnt += 1\r
+    Next\r
+\r
+  end if
+
+  writer.WriteLine("</rows>")\r
+  writer.WriteLine("<rowcount>" & cnt & "</rowcount>")
+End Sub\r
+\r
+Public function XmlStringCell(value as object) as String\r
+  XmlStringCell="<td>" & server.HTMLEncode(value) & "</td>"\r
+end function\r
+\r
+</script>\r
diff --git a/examples/dotnet/flickrPhotos.aspx b/examples/dotnet/flickrPhotos.aspx
new file mode 100644 (file)
index 0000000..72a2aaa
--- /dev/null
@@ -0,0 +1,33 @@
+<%@ Page Language="vb" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="Rico" TagName="XmlWriter" Src="flickrPhotos.ascx" %>\r
+
+<script runat="server">\r
+\r
+'' -----------------------------------------------------------------------------
+'' This script takes a "tags" parameter from the query string
+'' and returns a list of flickr photos with that tag in the Rico LiveGrid format
+''
+'' PLEASE USE YOUR OWN FLICKR API KEY
+'' Get one at: http://flickr.com/services/
+''
+'' Created by Matt Brown, Dec 2007
+'' -----------------------------------------------------------------------------
+
+dim RequestId as string\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  Response.CacheControl = "no-cache"\r
+  Response.AddHeader("Pragma", "no-cache")\r
+  Response.Expires = -1\r
+  Response.ContentType="text/xml"\r
+  \r
+  RequestId=trim(Request.QueryString("id"))\r
+  XmlObj.tags=trim(Request.QueryString("tags"))
+  XmlObj.flickrKey= "3773d42a5766f0bd27caa1d584ae0bc9"\r
+End Sub\r
+
+</script>\r
+\r
+<ajax-response><response type='object' id='<%=RequestId%>_updater'>\r
+<Rico:XmlWriter id="XmlObj" runat="server"/>\r
+</response></ajax-response>\r
diff --git a/examples/dotnet/index.html b/examples/dotnet/index.html
new file mode 100644 (file)
index 0000000..4be0eea
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\r
+<html>\r
+<HEAD>\r
+<title>Rico 3.0 .net Examples</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+</HEAD>\r
+<frameset cols="300, *">\r
+  <frame name="menu" src="menu.html">\r
+  <frame name="content" src="../welcome.html" scrolling="yes">\r
+</frameset>\r
+</html>\r
diff --git a/examples/dotnet/menu.html b/examples/dotnet/menu.html
new file mode 100644 (file)
index 0000000..f242df4
--- /dev/null
@@ -0,0 +1,186 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
+<html>\r
+<head>\r
+<title>Rico 3.0</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<base target="content">\r
+\r
+<script src="../../ricoClient/js/baselibs/prototype.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico2Proto.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<link href="../../ricoClient/css/rico.css" type="text/css" rel="stylesheet">\r
+\r
+<script src="../menu.js" type="text/javascript"></script>\r
+<link href="../menu.css" type="text/css" rel="stylesheet">\r
+\r
+<style type="text/css">\r
+</style>\r
+<!--[if lt IE 7]>\r
+  <style type="text/css">\r
+ul li {
+   height: 1%;\r
+}
+ </style>\r
+<![endif]-->\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<div id="menuheader">
+<p>Rico <span id='RicoVersion'></span> <span id='RicoDir'></span> Demo</p>\r
+</div>
+\r
+<div class='top'>\r
+<form action='' method='get' id='form1'>\r
+<ul>\r
+<li id='demolist'>Example: <span id='demospan'></span>\r
+<li>Theme: <span id='themespan'></span><input type='hidden' name='theme' id='theme' value=''>\r
+<li>Base Lib: <span id='libspan'></span><input type='hidden' name='lib' id='lib' value=''>\r
+<li><input type='checkbox' name='log'>&nbsp; Enable logging\r
+</ul>\r
+</form>\r
+</div>\r
+\r
+\r
+<div id="accordion1">\r
+\r
+<div>\r
+  <div>Choose the Example</div>\r
+  <div>\r
+<ul>\r
+<li><a id="demo_widgets.aspx">Rico Widget Overview</a>\r
+<li><a id="demo_ex1.aspx">LiveGrid sourced from HTML table</a>\r
+<li><a id="demo_ex2xml.aspx">LiveGrid sourced from SQL database (xml)</a>\r
+<li><a id="demo_ex2json.aspx">LiveGrid sourced from SQL database (json)</a>\r
+<li><a id="demo_ShipperEdit.aspx">Editable LiveGrid (Shippers)</a>\r
+<li><a id="demo_employees.aspx">Editable LiveGrid (Employees)</a>\r
+<li><a id="demo_ex2editfilter.aspx">Editable LiveGrid (Orders)</a>\r
+<li><a id="demo_ex2nosession.aspx">Editable LiveGrid without session vars</a>\r
+<li><a id="demo_photos.aspx">LiveGrid sourced from flickr</a>\r
+<li><a id="demo_simplegrid.aspx">SimpleGrid</a>\r
+<li><a id="demo_tree1.aspx">Tree control</a>\r
+<li><a id="demo_RicoDbViewer.aspx">Northwind data browser</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Theme</div>\r
+  <div>\r
+  <table border='0'>\r
+  <tr>\r
+  <td>Themeroller<br>Themes</td><td>Rico<br>Themes</td>\r
+  </tr>\r
+  <tr valign='top'>\r
+  <td>\r
+\r
+    <ul>\r
+<li><a id="theme_j-ui-lightness"><img src="../images/themeroller/theme_30_ui_light.png" alt="UI Lightness" title="UI Lightness" />\r
+<br><span class="themeName">UI lightness</span></a></li>\r
+\r
+<li><a id="theme_j-ui-darkness"><img src="../images/themeroller/theme_30_ui_dark.png" alt="UI Darkness" title="UI Darkness" />\r
+<br><span class="themeName">UI darkness</span></a></li>\r
+\r
+<li><a id="theme_j-smoothness"><img src="../images/themeroller/theme_30_smoothness.png" alt="Smoothness" title="Smoothness" />\r
+<br><span class="themeName">Smoothness</span></a></li>\r
+\r
+<li><a id="theme_j-start"><img src="../images/themeroller/theme_30_start_menu.png" alt="Start" title="Start" />\r
+<br><span class="themeName">Start</span></a></li>\r
+\r
+<li><a id="theme_j-redmond"><img src="../images/themeroller/theme_30_windoze.png" alt="Redmond" title="Redmond" />\r
+<br><span class="themeName">Redmond</span></a></li>\r
+\r
+<li><a id="theme_j-sunny"><img src="../images/themeroller/theme_30_sunny.png" alt="Sunny" title="Sunny" />\r
+<br><span class="themeName">Sunny</span></a></li>\r
+\r
+<li><a  id="theme_j-overcast"><img src="../images/themeroller/theme_30_overcast.png" alt="Overcast" title="Overcast" />\r
+<br><span class="themeName">Overcast</span></a></li>\r
+\r
+<li><a  id="theme_j-le-frog"><img src="../images/themeroller/theme_30_le_frog.png" alt="Le Frog" title="Le Frog" />\r
+<br><span class="themeName">Le Frog</span></a></li>\r
+\r
+<li><a  id="theme_j-flick"><img src="../images/themeroller/theme_30_flick.png" alt="Flick" title="Flick" />\r
+<br><span class="themeName">Flick</span></a></li>\r
+\r
+<li><a  id="theme_j-pepper-grinder"><img src="../images/themeroller/theme_30_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" />\r
+<br><span class="themeName">Pepper Grinder</span></a></li>\r
+\r
+<li><a  id="theme_j-eggplant"><img src="../images/themeroller/theme_30_eggplant.png" alt="Eggplant" title="Eggplant" />\r
+<br><span class="themeName">Eggplant</span></a></li>\r
+\r
+<li><a  id="theme_j-dark-hive"><img src="../images/themeroller/theme_30_dark_hive.png" alt="Dark Hive" title="Dark Hive" />\r
+<br><span class="themeName">Dark Hive</span></a></li>\r
+\r
+<li><a  id="theme_j-cupertino"><img src="../images/themeroller/theme_30_cupertino.png" alt="Cupertino" title="Cupertino" />\r
+<br><span class="themeName">Cupertino</span></a></li>\r
+\r
+<li><a  id="theme_j-south-street"><img src="../images/themeroller/theme_30_south_street.png" alt="South St" title="South St" />\r
+<br><span class="themeName">South Street</span></a></li>\r
+\r
+<li><a  id="theme_j-blitzer"><img src="../images/themeroller/theme_30_blitzer.png" alt="Blitzer" title="Blitzer" />\r
+<br><span class="themeName">Blitzer</span></a></li>    \r
+\r
+<li><a  id="theme_j-humanity"><img src="../images/themeroller/theme_30_humanity.png" alt="Humanity" title="Humanity" />\r
+<br><span class="themeName">Humanity</span></a></li>\r
+\r
+<li><a  id="theme_j-hot-sneaks"><img src="../images/themeroller/theme_30_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" />\r
+<br><span class="themeName">Hot sneaks</span></a></li>\r
+\r
+<li><a  id="theme_j-excite-bike"><img src="../images/themeroller/theme_30_excite_bike.png" alt="Excite Bike" title="Excite Bike" />\r
+<br><span class="themeName">Excite Bike</span></a></li>\r
+\r
+<li><a  id="theme_j-vader"><img src="../images/themeroller/theme_30_black_matte.png" alt="Vader" title="Vader" />\r
+<br><span class="themeName">Vader</span></a></li>\r
+\r
+<li><a  id="theme_j-dot-luv"><img src="../images/themeroller/theme_30_dot_luv.png" alt="Dot Luv" title="Dot Luv" />\r
+<br><span class="themeName">Dot Luv</span></a></li>\r
+\r
+<li><a  id="theme_j-mint-choc"><img src="../images/themeroller/theme_30_mint_choco.png" alt="Mint Choc" title="Mint Choc" />\r
+<br><span class="themeName">Mint Choc</span></a></li>\r
+\r
+<li><a  id="theme_j-black-tie"><img src="../images/themeroller/theme_30_black_tie.png" alt="Black Tie" title="Black Tie" />\r
+<br><span class="themeName">Black Tie</span></a></li>\r
+\r
+<li><a  id="theme_j-trontastic"><img src="../images/themeroller/theme_30_trontastic.png" alt="Trontastic" title="Trontastic" />\r
+<br><span class="themeName">Trontastic</span></a></li>\r
+\r
+<li><a  id="theme_j-swanky-purse"><img src="../images/themeroller/theme_30_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" />\r
+<br><span class="themeName">Swanky Purse</span></a></li>\r
+    </ul>\r
+\r
+    </td><td>\r
+\r
+    <ul>\r
+  <li><a id='theme_r-greenHdg'>Green Heading</a></li>\r
+  <li><a id='theme_r-warmfall'>Warm Fall</a></li>\r
+  <li><a id='theme_r-seaglass'>Sea Glass</a></li>\r
+  <li><a id='theme_r-coffee-with-milk'>Coffee with milk</a></li>\r
+  <li><a id='theme_r-grayedout'>Grayed out</a></li>\r
+    </ul>\r
+\r
+  </td>\r
+  </tr>\r
+  </table>\r
+\r
+\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Base Library</div>\r
+  <div>\r
+<ul>\r
+<li><a id='lib_proto'>Prototype</a>\r
+<li><a id='lib_jquery'>jQuery</a>\r
+<li><a id='lib_moo'>MooTools</a>\r
+<li><a id='lib_dojo'>dojo</a>\r
+<li><a id='lib_ext'>Ext</a>\r
+<li><a id='lib_glow'>Glow</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+</div>\r
+</body></html>\r
diff --git a/examples/dotnet/photos.aspx b/examples/dotnet/photos.aspx
new file mode 100644 (file)
index 0000000..f319b14
--- /dev/null
@@ -0,0 +1,92 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="LiveGrid" Src="../../plugins/dotnet/LiveGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Photo Example</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+var img_popup;\r
+\r
+function photogrid_InitComplete() {\r
+  // do something special when the mouse hovers over an image\r
+  var c0=photogrid['grid'].columns[0];\r
+  for (var i=0; i<c0._img.length; i++) {\r
+    Rico.eventBind(c0._img[i],'mouseover',Rico.eventHandle(window,'img_mouseover'));\r
+    Rico.eventBind(c0._img[i],'mouseout',Rico.eventHandle(window,'img_mouseout'));\r
+  }\r
+  img_popup=document.getElementById('img_popup');\r
+}\r
+\r
+function img_mouseover(e) {\r
+  Rico.eventStop(e);\r
+  var elem=Rico.eventElement(e);\r
+  img_popup.style.display='block';\r
+  var imgPos=Rico.cumulativeOffset(elem);\r
+  img_popup.src=elem.src.replace(/_s\.jpg/,'_m.jpg');\r
+  img_popup.style.left=(imgPos.left+elem.offsetWidth+10)+'px';\r
+  var winHt=Rico.windowHeight();\r
+  window.status='winHt='+winHt+' imgTop='+imgPos.top\r
+  if (imgPos.top > winHt/2) {\r
+    img_popup.style.bottom=(winHt-imgPos.top-elem.offsetHeight)+'px';\r
+    img_popup.style.top='';\r
+  } else {\r
+    img_popup.style.top=(imgPos.top)+'px';\r
+    img_popup.style.bottom='';\r
+  }\r
+}\r
+\r
+function img_mouseout(e) {\r
+  Rico.eventStop(e);\r
+  img_popup.style.display='none';\r
+}\r
+\r
+function UpdateGrid() {\r
+  var tags=$('tags').value;\r
+  if (tags) {\r
+    photogrid['buffer'].options.requestParameters=['tags='+tags];\r
+    photogrid['grid'].filterHandler();\r
+  } else {\r
+    alert('Please enter one or more keywords separated by commas');\r
+  }\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+.ricoLG_bottom div.ricoLG_cell { height:80px; }  /* thumbnails are 75x75 pixels */\r
+#explanation * { font-size: 8pt; }\r
+</style>\r
+\r
+</head>\r
+\r
+<body>\r
+\r
+<div id='explanation'><form onsubmit='UpdateGrid(); return false;'>\r
+<p>Get <a href="http://www.flickr.com">Flickr</a> photos tagged with these keywords (separate words with commas):\r
+<p><input type='text' id='tags'>\r
+<input type='submit' value='Get Photos'>\r
+<p>Then try moving your cursor over each photo...\r
+</form></div>\r
+\r
+<Rico:LiveGrid runat='server' id='photogrid' prefetchBuffer='false' dataProvider='flickrPhotos.aspx' headingSort='hover'>\r
+<GridColumns>\r
+  <Rico:Column runat='server' heading='Photo' width='90' control='new Rico.TableColumn.image()' />\r
+  <Rico:Column runat='server' heading='Title' width='100' />\r
+  <Rico:Column runat='server' heading='Owner' width='100' />\r
+  <Rico:Column runat='server' heading='Date Taken' width='100' DataType='datetime' />\r
+  <Rico:Column runat='server' heading='Tags' width='200' />\r
+</GridColumns>\r
+</Rico:LiveGrid>\r
+\r
+<img id='img_popup' style='display:none;position:absolute;'>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/dotnet/ricoQuery.aspx b/examples/dotnet/ricoQuery.aspx
new file mode 100644 (file)
index 0000000..489217c
--- /dev/null
@@ -0,0 +1,35 @@
+<%@ Page Language="vb" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlParse" Src="../../plugins/dotnet/sqlParse.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="ricoResponse" Src="../../plugins/dotnet/ricoResponse.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  dim sql = session.contents(RespObj.RequestId)\r
+  if IsNothing(sql) then\r
+    RespObj.ErrorMsg="Your connection with the server was idle for too long and timed out. Please refresh this page and try again."\r
+  elseif not app.OpenDB() then\r
+    RespObj.ErrorMsg=app.LastErrorMsg\r
+  else\r
+    RespObj.filters=session.contents(RespObj.RequestId & ".filters")\r
+    if IsReference(sql) and TypeName(sql)<>"String" then\r
+      RespObj.oParse=sql.Clone()\r
+    elseif ucase(left(sql,7))="SELECT " then\r
+      RespObj.oParse=new sqlParse()\r
+      RespObj.oParse.ParseSelect(sql)\r
+    else\r
+      ' stored procedure\r
+      RespObj.sqlText=sql\r
+    end if\r
+    RespObj.dbConnection=app.dbConnection\r
+    RespObj.dbDialect=app.dbDialect\r
+    RespObj.sendDebugMsgs=true   ' true for development, false for production\r
+    RespObj.LogSqlOnError=true   ' true for development, false for production\r
+  end if\r
+End Sub\r
+\r
+</script>\r
+\r
+<Rico:ricoResponse id="RespObj" runat="server"/>\r
diff --git a/examples/dotnet/simplegrid.aspx b/examples/dotnet/simplegrid.aspx
new file mode 100644 (file)
index 0000000..afd1156
--- /dev/null
@@ -0,0 +1,198 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="SimpleGrid" Src="../../plugins/dotnet/SimpleGrid.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="../../plugins/dotnet/GridColumn.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+  dim category,lastCategory,Discounts,Gross,subtotals(1),grandtotals(1),i\r
+  dim command,rdr\r
+\r
+  if not app.OpenDB() then exit sub\r
+  \r
+  for i=0 to 1\r
+    grandtotals(i)=0\r
+  next\r
+\r
+  ' define heading\r
+  ex1.AddHeadingRow(true)\r
+  ex1.AddCell("Product")\r
+  ex1.AddCell("Gross Sales")\r
+  ex1.AddCell("Discounts")\r
+  ex1.AddCell("Net Sales")\r
+  ex1.AddCell("Avg Discount")\r
+\r
+  command = app.dbConnection.CreateCommand()\r
+  command.CommandText="select CategoryName,ProductName, " & _\r
+    "SUM(od.UnitPrice*Quantity) as GrossSales, " & _\r
+    "SUM(od.UnitPrice*Quantity*Discount) as Discounts " & _\r
+    "from ((Order_Details od " & _\r
+    "inner join Products p on p.ProductID=od.ProductID) " & _\r
+    "inner join Categories c on p.CategoryID=c.CategoryID) " & _\r
+    "group by CategoryName,ProductName " & _\r
+    "order by CategoryName,ProductName"\r
+  rdr = command.ExecuteReader()\r
+  while rdr.Read()\r
+    category=rdr("CategoryName")\r
+    Gross=rdr("GrossSales")\r
+    Discounts=rdr("Discounts")\r
+    if category<>lastCategory then\r
+      if not IsNothing(lastCategory) then\r
+        AddRow("Subtotal",subtotals(0),subtotals(1))\r
+        ex1.SetRowAttr("class","Subtotal")\r
+      end if\r
+      ex1.AddDataRow\r
+      ex1.SetRowAttr("class","CatHead")\r
+      ex1.AddCell(category)\r
+      ex1.AddCell("")\r
+      ex1.AddCell("")\r
+      ex1.AddCell("")\r
+      ex1.AddCell("")\r
+      for i=0 to 1\r
+        subtotals(i)=0\r
+      next\r
+      lastCategory=category\r
+    end if\r
+    subtotals(0)+=Gross\r
+    grandtotals(0)+=Gross\r
+    subtotals(1)+=Discounts\r
+    grandtotals(1)+=Discounts\r
+    AddRow(rdr("ProductName"),Gross,Discounts)\r
+  end while\r
+  rdr.Close()\r
+  if not IsNothing(lastCategory) then\r
+    AddRow("Subtotal",subtotals(0),subtotals(1))\r
+    ex1.SetRowAttr("class","Subtotal")\r
+  end if\r
+  AddRow("Grand Total",grandtotals(0),grandtotals(1))\r
+  ex1.SetRowAttr("class","GrandTotal")\r
+End Sub\r
+\r
+sub AddRow(ProductName as String, Gross as Double, Discounts as Double)\r
+  dim pct as double\r
+  ex1.AddDataRow()\r
+  ex1.AddCell(ProductName)\r
+  ex1.AddCell("$" & FormatNumber(Gross,0,-1,0,-1))\r
+  ex1.AddCell("$" & FormatNumber(Discounts,0,-1,0,-1))\r
+  ex1.AddCell("$" & FormatNumber(Gross-Discounts,0,-1,0,-1))\r
+  pct=Discounts/Gross\r
+  ex1.AddCell(pct.toString("0%"))\r
+end sub\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  select case lcase(Request.QueryString("fmt"))\r
+    case "xl":  ex1.RenderExcel("rico.xls")\r
+    case "csv": ex1.RenderDelimited("rico.csv", ",", "")\r
+    case else:  MyBase.Render(writer)   ' output html\r
+  end select\r
+End Sub\r
+\r
+</script>\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico SimpleGrid-Example 1</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('SimpleGrid');\r
+\r
+Rico.onLoad( function() {\r
+  if (!Rico.isIE) document.getElementById('owc').disabled=true;\r
+});\r
+\r
+function ExportGridClient(ExportType) {\r
+  ex1['grid'].printVisible(ExportType);\r
+}\r
+\r
+function ExportGridServer(ExportType) {\r
+  if (Rico.isIE) {\r
+    location.href+='&fmt='+ExportType;\r
+  } else {\r
+    window.open(location.href+'&fmt='+ExportType);\r
+  }\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+.CatHead {\r
+  background:blue;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+.Subtotal {\r
+  background:#888;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+.GrandTotal {\r
+  background:black;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p><strong>Rico: SimpleGrid</strong></p>\r
+<p>Rico's SimpleGrid is an unbuffered grid - all data exists in the DOM.\r
+It shares many of the same characteristics as Rico's better known LiveGrid.\r
+SimpleGrids have resizable columns, frozen columns on the left, and can use the\r
+same CSS styling as LiveGrids. Sorting and filtering can also be enabled\r
+at the developer's discretion. Unlike LiveGrids, each cell in a SimpleGrid\r
+can be formatted individually.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<div>\r
+<button onclick="ExportGridClient('plain')">Export from client<br>to HTML Table</button>\r
+<button onclick="ExportGridClient('owc')" id="owc">Export from client<br>to OWC spreadsheet</button>\r
+<button onclick="ExportGridServer('xl')">Export from server<br>to Excel</button>\r
+<button onclick="ExportGridServer('csv')">Export from server<br>to CSV</button>\r
+</div>\r
+\r
+<Rico:SimpleGrid runat='server' id='ex1' FrozenCols='1'>\r
+<GridColumns>\r
+  <Rico:Column runat='server' width='200' />\r
+  <Rico:Column runat='server' spec='specQty' />\r
+  <Rico:Column runat='server' spec='specQty' />\r
+  <Rico:Column runat='server' spec='specQty' />\r
+  <Rico:Column runat='server' spec='specQty' />\r
+</GridColumns>\r
+</Rico:SimpleGrid>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/dotnet/tree1.aspx b/examples/dotnet/tree1.aspx
new file mode 100644 (file)
index 0000000..d415982
--- /dev/null
@@ -0,0 +1,76 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico-Tree Control</title>\r
+
+<My:LoadRicoClient id='initlibs' runat='server' modules='Tree' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+var tree1;\r
+\r
+// initialize tree\r
+Rico.onLoad( function() {\r
+  tree1=new Rico.TreeControl("tree1", "CustTree.aspx");\r
+  tree1.atLoad();\r
+  tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
+  Rico.eventBind('TreeButton1', 'click', Rico.eventHandle(window,'TreeClick1'));\r
+});\r
+\r
+function TreeClick1(e) {\r
+  if (Rico.visible(tree1.container)) {\r
+    tree1.close();\r
+  } else {\r
+    Rico.positionCtlOverIcon(tree1.container,Rico.$('TreeButton1'));\r
+    tree1.open();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+</script>\r
+
+</head>\r
+\r
+<body>
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p>This example demonstrates a basic, pop-up tree control where the tree nodes are loaded via AJAX.\r
+Only one item is selected from the tree at a time.\r
+Data is from the Northwind customer table.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<p><button id='TreeButton1'>Show Tree</button>\r
+<p><input type='text' id='TreeValue1' size='6'> (selected customer id)\r
+\r
+<pre style='border:1px solid black;padding:3px;font-size:8pt;'>\r
+Rico.onLoad( function() {\r
+  tree1=new Rico.TreeControl("tree1", "CustTree.asp");\r
+  tree1.atLoad();\r
+  tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
+});\r
+</pre>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/dotnet/widgets.aspx b/examples/dotnet/widgets.aspx
new file mode 100644 (file)
index 0000000..a82f1e9
--- /dev/null
@@ -0,0 +1,2073 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\r
+<title>Rico widgets styled user-selectable themes</title>\r
+\r
+<My:LoadRicoClient id='initlibs' runat='server' modules='LiveGridBasic,LiveGridMenu,Calendar' />\r
+\r
+<script>\r
+\r
+var dialog;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {\r
+    defaultWidth : 90,\r
+    useUnformattedColWidth: false,\r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    visibleRows   : 6,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs  : [{width:200},'specQty','specQty','specQty','specQty','specQty']\r
+  };\r
+  var ex1=new Rico.LiveGrid ('population', new Rico.Buffer.Base(document.getElementById('population').tBodies[0]), opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+  new Rico.Accordion( 'accExample', {panelHeight:160});\r
+  new Rico.TabbedPanel( 'tabsExample', {panelHeight:160});\r
+  var cal=new Rico.CalendarControl("ricoCal",{position:'relative'});\r
+  cal.atLoad();\r
+  cal.selectNow();\r
+  cal.openPopup();\r
+  var links=Rico.select('#themeGallery a');\r
+  for (var i=0; i<links.length; i++) {\r
+    links[i].onclick=themeClick;\r
+  }\r
+  dialog=new Rico.Window('',{height:'250px',width:'300px',overflow:'auto'}, 'dialog');\r
+});\r
+\r
+function openWindow(btn) {\r
+  dialog.openPopup();\r
+  Rico.positionCtlOverIcon(dialog.container,btn);\r
+}\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#accExample {\r
+  width: 350px;\r
+}\r
+#tabsExample {\r
+  width: 450px;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body style="font-size:80%;">\r
+  \r
+<table id='explanation' border='0' cellpadding='5' cellspacing='0' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example displays some of the widgets that come with Rico. \r
+The widgets are compatible with all base libraries and themes.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2 style='margin-bottom:1px;'>Rico LiveGrid</h2>\r
+<p style='margin-top:1px;'>Click on a cell to see available actions</p>\r
+\r
+<p class="ricoBookmark"><span id="population_bookmark">&nbsp;</span></p>\r
+<table class="ricoLiveGrid" id="population">\r
+<thead>\r
+ <tr>\r
+  <td class='ricoFrozen'></td>\r
+  <td colspan=5>Population (thousands)</td>\r
+ </tr>\r
+ <tr>\r
+  <td class='ricoFrozen'>Country or area</td>\r
+  <td>1950</td>\r
+  <td>2009</td>\r
+  <td>2015</td>\r
+  <td>2025</td>\r
+  <td>2050</td>\r
+ </tr>\r
+</thead>\r
+<tbody>\r
+ <tr>\r
+  <td>Afghanistan</td>\r
+  <td>8151</td>\r
+  <td>28150</td>\r
+  <td>34246</td>\r
+  <td>44970</td>\r
+  <td>73938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Albania</td>\r
+  <td>1215</td>\r
+  <td>3155</td>\r
+  <td>3256</td>\r
+  <td>3395</td>\r
+  <td>3303</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Algeria</td>\r
+  <td>8753</td>\r
+  <td>34895</td>\r
+  <td>38088</td>\r
+  <td>42882</td>\r
+  <td>49610</td>\r
+ </tr>\r
+ <tr>\r
+  <td>American Samoa</td>\r
+  <td>19</td>\r
+  <td>67</td>\r
+  <td>74</td>\r
+  <td>86</td>\r
+  <td>107</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Andorra</td>\r
+  <td>6</td>\r
+  <td>86</td>\r
+  <td>93</td>\r
+  <td>107</td>\r
+  <td>137</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Angola</td>\r
+  <td>4148</td>\r
+  <td>18498</td>\r
+  <td>21690</td>\r
+  <td>27441</td>\r
+  <td>42267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Anguilla</td>\r
+  <td>5</td>\r
+  <td>15</td>\r
+  <td>17</td>\r
+  <td>18</td>\r
+  <td>20</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Antigua and Barbuda</td>\r
+  <td>46</td>\r
+  <td>88</td>\r
+  <td>93</td>\r
+  <td>101</td>\r
+  <td>112</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Argentina</td>\r
+  <td>17150</td>\r
+  <td>40276</td>\r
+  <td>42548</td>\r
+  <td>45883</td>\r
+  <td>50943</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Armenia</td>\r
+  <td>1354</td>\r
+  <td>3083</td>\r
+  <td>3139</td>\r
+  <td>3181</td>\r
+  <td>3018</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Aruba</td>\r
+  <td>38</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>112</td>\r
+  <td>106</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Australia</td>\r
+  <td>8219</td>\r
+  <td>21293</td>\r
+  <td>22607</td>\r
+  <td>24703</td>\r
+  <td>28724</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Austria</td>\r
+  <td>6936</td>\r
+  <td>8364</td>\r
+  <td>8467</td>\r
+  <td>8600</td>\r
+  <td>8515</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Azerbaijan</td>\r
+  <td>2896</td>\r
+  <td>8832</td>\r
+  <td>9426</td>\r
+  <td>10128</td>\r
+  <td>10579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahamas</td>\r
+  <td>79</td>\r
+  <td>342</td>\r
+  <td>366</td>\r
+  <td>402</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahrain</td>\r
+  <td>116</td>\r
+  <td>791</td>\r
+  <td>882</td>\r
+  <td>1021</td>\r
+  <td>1277</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bangladesh</td>\r
+  <td>43595</td>\r
+  <td>162221</td>\r
+  <td>175217</td>\r
+  <td>195012</td>\r
+  <td>222495</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Barbados</td>\r
+  <td>211</td>\r
+  <td>256</td>\r
+  <td>260</td>\r
+  <td>262</td>\r
+  <td>237</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belarus</td>\r
+  <td>7745</td>\r
+  <td>9634</td>\r
+  <td>9355</td>\r
+  <td>8851</td>\r
+  <td>7275</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belgium</td>\r
+  <td>8628</td>\r
+  <td>10647</td>\r
+  <td>10878</td>\r
+  <td>11191</td>\r
+  <td>11493</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belize</td>\r
+  <td>69</td>\r
+  <td>307</td>\r
+  <td>344</td>\r
+  <td>404</td>\r
+  <td>506</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Benin</td>\r
+  <td>2050</td>\r
+  <td>8935</td>\r
+  <td>10647</td>\r
+  <td>13767</td>\r
+  <td>21982</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bermuda</td>\r
+  <td>37</td>\r
+  <td>65</td>\r
+  <td>65</td>\r
+  <td>66</td>\r
+  <td>63</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bhutan</td>\r
+  <td>168</td>\r
+  <td>697</td>\r
+  <td>770</td>\r
+  <td>865</td>\r
+  <td>1013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bolivia</td>\r
+  <td>2714</td>\r
+  <td>9863</td>\r
+  <td>10854</td>\r
+  <td>12368</td>\r
+  <td>14908</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bosnia and Herzegovina</td>\r
+  <td>2661</td>\r
+  <td>3767</td>\r
+  <td>3727</td>\r
+  <td>3608</td>\r
+  <td>3008</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Botswana</td>\r
+  <td>413</td>\r
+  <td>1950</td>\r
+  <td>2106</td>\r
+  <td>2337</td>\r
+  <td>2758</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brazil</td>\r
+  <td>53975</td>\r
+  <td>193734</td>\r
+  <td>202866</td>\r
+  <td>213802</td>\r
+  <td>218512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>British Virgin Islands</td>\r
+  <td>7</td>\r
+  <td>23</td>\r
+  <td>24</td>\r
+  <td>26</td>\r
+  <td>28</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brunei Darussalam</td>\r
+  <td>48</td>\r
+  <td>400</td>\r
+  <td>443</td>\r
+  <td>513</td>\r
+  <td>658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bulgaria</td>\r
+  <td>7251</td>\r
+  <td>7545</td>\r
+  <td>7263</td>\r
+  <td>6752</td>\r
+  <td>5392</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burkina Faso</td>\r
+  <td>4080</td>\r
+  <td>15757</td>\r
+  <td>19013</td>\r
+  <td>24837</td>\r
+  <td>40830</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burundi</td>\r
+  <td>2456</td>\r
+  <td>8303</td>\r
+  <td>9413</td>\r
+  <td>11161</td>\r
+  <td>14846</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cambodia</td>\r
+  <td>4346</td>\r
+  <td>14805</td>\r
+  <td>16357</td>\r
+  <td>18973</td>\r
+  <td>23795</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cameroon</td>\r
+  <td>4466</td>\r
+  <td>19522</td>\r
+  <td>22169</td>\r
+  <td>26478</td>\r
+  <td>36736</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Canada</td>\r
+  <td>13737</td>\r
+  <td>33573</td>\r
+  <td>35493</td>\r
+  <td>38659</td>\r
+  <td>44414</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cape Verde</td>\r
+  <td>146</td>\r
+  <td>506</td>\r
+  <td>548</td>\r
+  <td>616</td>\r
+  <td>703</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cayman Islands</td>\r
+  <td>7</td>\r
+  <td>56</td>\r
+  <td>59</td>\r
+  <td>63</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Central African Republic</td>\r
+  <td>1327</td>\r
+  <td>4422</td>\r
+  <td>4927</td>\r
+  <td>5747</td>\r
+  <td>7603</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chad</td>\r
+  <td>2429</td>\r
+  <td>11206</td>\r
+  <td>13120</td>\r
+  <td>16906</td>\r
+  <td>27776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Channel Islands</td>\r
+  <td>102</td>\r
+  <td>150</td>\r
+  <td>151</td>\r
+  <td>152</td>\r
+  <td>144</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chile</td>\r
+  <td>6082</td>\r
+  <td>16970</td>\r
+  <td>17926</td>\r
+  <td>19266</td>\r
+  <td>20657</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China</td>\r
+  <td>544951</td>\r
+  <td>1345751</td>\r
+  <td>1395998</td>\r
+  <td>1453140</td>\r
+  <td>1417045</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Hong Kong SAR</td>\r
+  <td>1974</td>\r
+  <td>7022</td>\r
+  <td>7398</td>\r
+  <td>7969</td>\r
+  <td>8623</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Macao SAR</td>\r
+  <td>190</td>\r
+  <td>538</td>\r
+  <td>568</td>\r
+  <td>603</td>\r
+  <td>593</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Colombia</td>\r
+  <td>12000</td>\r
+  <td>45660</td>\r
+  <td>49385</td>\r
+  <td>54920</td>\r
+  <td>62877</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Comoros</td>\r
+  <td>156</td>\r
+  <td>676</td>\r
+  <td>767</td>\r
+  <td>907</td>\r
+  <td>1226</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Congo</td>\r
+  <td>808</td>\r
+  <td>3683</td>\r
+  <td>4225</td>\r
+  <td>5094</td>\r
+  <td>6863</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cook Islands</td>\r
+  <td>15</td>\r
+  <td>20</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>24</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Costa Rica</td>\r
+  <td>966</td>\r
+  <td>4579</td>\r
+  <td>4957</td>\r
+  <td>5521</td>\r
+  <td>6373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Côte d'Ivoire</td>\r
+  <td>2505</td>\r
+  <td>21075</td>\r
+  <td>24210</td>\r
+  <td>29738</td>\r
+  <td>43373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Croatia</td>\r
+  <td>3850</td>\r
+  <td>4416</td>\r
+  <td>4370</td>\r
+  <td>4254</td>\r
+  <td>3825</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cuba</td>\r
+  <td>5920</td>\r
+  <td>11204</td>\r
+  <td>11213</td>\r
+  <td>11148</td>\r
+  <td>9725</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cyprus</td>\r
+  <td>494</td>\r
+  <td>871</td>\r
+  <td>925</td>\r
+  <td>1014</td>\r
+  <td>1175</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Czech Republic</td>\r
+  <td>8925</td>\r
+  <td>10369</td>\r
+  <td>10510</td>\r
+  <td>10573</td>\r
+  <td>10294</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. People's Rep. of Korea</td>\r
+  <td>9737</td>\r
+  <td>23906</td>\r
+  <td>24399</td>\r
+  <td>25128</td>\r
+  <td>24562</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. Republic of the Congo</td>\r
+  <td>12184</td>\r
+  <td>66020</td>\r
+  <td>77419</td>\r
+  <td>98123</td>\r
+  <td>147512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Denmark</td>\r
+  <td>4271</td>\r
+  <td>5470</td>\r
+  <td>5523</td>\r
+  <td>5590</td>\r
+  <td>5551</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Djibouti</td>\r
+  <td>62</td>\r
+  <td>864</td>\r
+  <td>953</td>\r
+  <td>1111</td>\r
+  <td>1469</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominica</td>\r
+  <td>51</td>\r
+  <td>67</td>\r
+  <td>67</td>\r
+  <td>68</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominican Republic</td>\r
+  <td>2427</td>\r
+  <td>10090</td>\r
+  <td>10867</td>\r
+  <td>11973</td>\r
+  <td>13441</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ecuador</td>\r
+  <td>3387</td>\r
+  <td>13625</td>\r
+  <td>14596</td>\r
+  <td>16074</td>\r
+  <td>17989</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Egypt</td>\r
+  <td>21514</td>\r
+  <td>82999</td>\r
+  <td>91778</td>\r
+  <td>104970</td>\r
+  <td>129533</td>\r
+ </tr>\r
+ <tr>\r
+  <td>El Salvador</td>\r
+  <td>2200</td>\r
+  <td>6163</td>\r
+  <td>6383</td>\r
+  <td>6895</td>\r
+  <td>7882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Equatorial Guinea</td>\r
+  <td>226</td>\r
+  <td>676</td>\r
+  <td>781</td>\r
+  <td>971</td>\r
+  <td>1445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Eritrea</td>\r
+  <td>1141</td>\r
+  <td>5073</td>\r
+  <td>6009</td>\r
+  <td>7404</td>\r
+  <td>10787</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Estonia</td>\r
+  <td>1101</td>\r
+  <td>1340</td>\r
+  <td>1337</td>\r
+  <td>1321</td>\r
+  <td>1233</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ethiopia</td>\r
+  <td>18434</td>\r
+  <td>82825</td>\r
+  <td>96237</td>\r
+  <td>119822</td>\r
+  <td>173811</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Faeroe Islands</td>\r
+  <td>32</td>\r
+  <td>50</td>\r
+  <td>52</td>\r
+  <td>55</td>\r
+  <td>58</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Falkland Islands (Malvinas)</td>\r
+  <td>2</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Fiji</td>\r
+  <td>289</td>\r
+  <td>849</td>\r
+  <td>874</td>\r
+  <td>905</td>\r
+  <td>910</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Finland</td>\r
+  <td>4009</td>\r
+  <td>5326</td>\r
+  <td>5432</td>\r
+  <td>5533</td>\r
+  <td>5445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>France</td>\r
+  <td>41832</td>\r
+  <td>62343</td>\r
+  <td>63900</td>\r
+  <td>65769</td>\r
+  <td>67668</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Guiana</td>\r
+  <td>25</td>\r
+  <td>226</td>\r
+  <td>261</td>\r
+  <td>323</td>\r
+  <td>462</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Polynesia</td>\r
+  <td>61</td>\r
+  <td>269</td>\r
+  <td>289</td>\r
+  <td>318</td>\r
+  <td>354</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gabon</td>\r
+  <td>469</td>\r
+  <td>1475</td>\r
+  <td>1639</td>\r
+  <td>1915</td>\r
+  <td>2471</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gambia</td>\r
+  <td>258</td>\r
+  <td>1705</td>\r
+  <td>1985</td>\r
+  <td>2478</td>\r
+  <td>3763</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Georgia</td>\r
+  <td>3527</td>\r
+  <td>4260</td>\r
+  <td>4084</td>\r
+  <td>3888</td>\r
+  <td>3267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Germany</td>\r
+  <td>68376</td>\r
+  <td>82167</td>\r
+  <td>81346</td>\r
+  <td>79258</td>\r
+  <td>70504</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ghana</td>\r
+  <td>4981</td>\r
+  <td>23837</td>\r
+  <td>26925</td>\r
+  <td>32233</td>\r
+  <td>45213</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gibraltar</td>\r
+  <td>20</td>\r
+  <td>31</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>30</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greece</td>\r
+  <td>7566</td>\r
+  <td>11161</td>\r
+  <td>11261</td>\r
+  <td>11274</td>\r
+  <td>10939</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greenland</td>\r
+  <td>23</td>\r
+  <td>57</td>\r
+  <td>57</td>\r
+  <td>56</td>\r
+  <td>50</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Grenada</td>\r
+  <td>77</td>\r
+  <td>104</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guadeloupe</td>\r
+  <td>210</td>\r
+  <td>465</td>\r
+  <td>476</td>\r
+  <td>489</td>\r
+  <td>477</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guam</td>\r
+  <td>60</td>\r
+  <td>178</td>\r
+  <td>191</td>\r
+  <td>211</td>\r
+  <td>242</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guatemala</td>\r
+  <td>3146</td>\r
+  <td>14027</td>\r
+  <td>16227</td>\r
+  <td>19927</td>\r
+  <td>27480</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea</td>\r
+  <td>2619</td>\r
+  <td>10069</td>\r
+  <td>11844</td>\r
+  <td>15158</td>\r
+  <td>23975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea-Bissau</td>\r
+  <td>518</td>\r
+  <td>1611</td>\r
+  <td>1848</td>\r
+  <td>2296</td>\r
+  <td>3555</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guyana</td>\r
+  <td>423</td>\r
+  <td>762</td>\r
+  <td>754</td>\r
+  <td>732</td>\r
+  <td>558</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Haiti</td>\r
+  <td>3221</td>\r
+  <td>10033</td>\r
+  <td>10957</td>\r
+  <td>12476</td>\r
+  <td>15485</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Holy See</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Honduras</td>\r
+  <td>1487</td>\r
+  <td>7466</td>\r
+  <td>8386</td>\r
+  <td>9844</td>\r
+  <td>12402</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Hungary</td>\r
+  <td>9338</td>\r
+  <td>9993</td>\r
+  <td>9874</td>\r
+  <td>9647</td>\r
+  <td>8934</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iceland</td>\r
+  <td>143</td>\r
+  <td>323</td>\r
+  <td>353</td>\r
+  <td>384</td>\r
+  <td>407</td>\r
+ </tr>\r
+ <tr>\r
+  <td>India</td>\r
+  <td>371857</td>\r
+  <td>1198003</td>\r
+  <td>1294192</td>\r
+  <td>1431272</td>\r
+  <td>1613800</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Indonesia</td>\r
+  <td>77152</td>\r
+  <td>229965</td>\r
+  <td>244191</td>\r
+  <td>263287</td>\r
+  <td>288110</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iran (Islamic Republic of)</td>\r
+  <td>16913</td>\r
+  <td>74196</td>\r
+  <td>79454</td>\r
+  <td>87134</td>\r
+  <td>96975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iraq</td>\r
+  <td>5719</td>\r
+  <td>30747</td>\r
+  <td>35884</td>\r
+  <td>44692</td>\r
+  <td>63995</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ireland</td>\r
+  <td>2969</td>\r
+  <td>4515</td>\r
+  <td>4886</td>\r
+  <td>5370</td>\r
+  <td>6295</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Isle of Man</td>\r
+  <td>55</td>\r
+  <td>80</td>\r
+  <td>81</td>\r
+  <td>80</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Israel</td>\r
+  <td>1258</td>\r
+  <td>7170</td>\r
+  <td>7823</td>\r
+  <td>8769</td>\r
+  <td>10649</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Italy</td>\r
+  <td>46367</td>\r
+  <td>59870</td>\r
+  <td>60604</td>\r
+  <td>60018</td>\r
+  <td>57066</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jamaica</td>\r
+  <td>1403</td>\r
+  <td>2719</td>\r
+  <td>2786</td>\r
+  <td>2866</td>\r
+  <td>2683</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Japan</td>\r
+  <td>82824</td>\r
+  <td>127156</td>\r
+  <td>125791</td>\r
+  <td>120793</td>\r
+  <td>101659</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jordan</td>\r
+  <td>472</td>\r
+  <td>6316</td>\r
+  <td>6957</td>\r
+  <td>8088</td>\r
+  <td>10241</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kazakhstan</td>\r
+  <td>6703</td>\r
+  <td>15637</td>\r
+  <td>16289</td>\r
+  <td>17025</td>\r
+  <td>17848</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kenya</td>\r
+  <td>6077</td>\r
+  <td>39802</td>\r
+  <td>46433</td>\r
+  <td>57573</td>\r
+  <td>85410</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kiribati</td>\r
+  <td>26</td>\r
+  <td>98</td>\r
+  <td>107</td>\r
+  <td>123</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kuwait</td>\r
+  <td>152</td>\r
+  <td>2985</td>\r
+  <td>3378</td>\r
+  <td>3988</td>\r
+  <td>5240</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kyrgyzstan</td>\r
+  <td>1740</td>\r
+  <td>5482</td>\r
+  <td>5877</td>\r
+  <td>6378</td>\r
+  <td>6882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lao People's Dem. Republic</td>\r
+  <td>1666</td>\r
+  <td>6320</td>\r
+  <td>7028</td>\r
+  <td>8273</td>\r
+  <td>10744</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Latvia</td>\r
+  <td>1949</td>\r
+  <td>2249</td>\r
+  <td>2197</td>\r
+  <td>2101</td>\r
+  <td>1854</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lebanon</td>\r
+  <td>1443</td>\r
+  <td>4224</td>\r
+  <td>4426</td>\r
+  <td>4736</td>\r
+  <td>5033</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lesotho</td>\r
+  <td>734</td>\r
+  <td>2067</td>\r
+  <td>2168</td>\r
+  <td>2306</td>\r
+  <td>2491</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liberia</td>\r
+  <td>824</td>\r
+  <td>3955</td>\r
+  <td>4665</td>\r
+  <td>5858</td>\r
+  <td>8841</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Libyan Arab Jamahiriya</td>\r
+  <td>1029</td>\r
+  <td>6420</td>\r
+  <td>7158</td>\r
+  <td>8144</td>\r
+  <td>9819</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liechtenstein</td>\r
+  <td>14</td>\r
+  <td>36</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+  <td>45</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lithuania</td>\r
+  <td>2567</td>\r
+  <td>3287</td>\r
+  <td>3143</td>\r
+  <td>2985</td>\r
+  <td>2579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Luxembourg</td>\r
+  <td>296</td>\r
+  <td>486</td>\r
+  <td>520</td>\r
+  <td>582</td>\r
+  <td>733</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Madagascar</td>\r
+  <td>4084</td>\r
+  <td>19625</td>\r
+  <td>22853</td>\r
+  <td>28595</td>\r
+  <td>42693</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malawi</td>\r
+  <td>2881</td>\r
+  <td>15263</td>\r
+  <td>17998</td>\r
+  <td>23194</td>\r
+  <td>36575</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malaysia</td>\r
+  <td>6110</td>\r
+  <td>27468</td>\r
+  <td>30041</td>\r
+  <td>33770</td>\r
+  <td>39664</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Maldives</td>\r
+  <td>82</td>\r
+  <td>309</td>\r
+  <td>338</td>\r
+  <td>384</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mali</td>\r
+  <td>4268</td>\r
+  <td>13010</td>\r
+  <td>14993</td>\r
+  <td>18603</td>\r
+  <td>28260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malta</td>\r
+  <td>312</td>\r
+  <td>409</td>\r
+  <td>417</td>\r
+  <td>426</td>\r
+  <td>413</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Marshall Islands</td>\r
+  <td>13</td>\r
+  <td>62</td>\r
+  <td>70</td>\r
+  <td>79</td>\r
+  <td>92</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Martinique</td>\r
+  <td>222</td>\r
+  <td>405</td>\r
+  <td>411</td>\r
+  <td>418</td>\r
+  <td>393</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritania</td>\r
+  <td>651</td>\r
+  <td>3291</td>\r
+  <td>3732</td>\r
+  <td>4443</td>\r
+  <td>6061</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritius</td>\r
+  <td>493</td>\r
+  <td>1288</td>\r
+  <td>1337</td>\r
+  <td>1400</td>\r
+  <td>1426</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mayotte</td>\r
+  <td>15</td>\r
+  <td>194</td>\r
+  <td>224</td>\r
+  <td>277</td>\r
+  <td>386</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mexico</td>\r
+  <td>27741</td>\r
+  <td>109610</td>\r
+  <td>115528</td>\r
+  <td>123366</td>\r
+  <td>128964</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Micronesia (Fed. States of)</td>\r
+  <td>32</td>\r
+  <td>111</td>\r
+  <td>114</td>\r
+  <td>122</td>\r
+  <td>128</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Moldova (Republic of)</td>\r
+  <td>2341</td>\r
+  <td>3604</td>\r
+  <td>3462</td>\r
+  <td>3291</td>\r
+  <td>2734</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Monaco</td>\r
+  <td>20</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mongolia</td>\r
+  <td>761</td>\r
+  <td>2671</td>\r
+  <td>2855</td>\r
+  <td>3134</td>\r
+  <td>3446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montenegro</td>\r
+  <td>399</td>\r
+  <td>624</td>\r
+  <td>627</td>\r
+  <td>633</td>\r
+  <td>618</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montserrat</td>\r
+  <td>14</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>7</td>\r
+  <td>7</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Morocco</td>\r
+  <td>8953</td>\r
+  <td>31993</td>\r
+  <td>34330</td>\r
+  <td>37865</td>\r
+  <td>42583</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mozambique</td>\r
+  <td>6442</td>\r
+  <td>22894</td>\r
+  <td>25957</td>\r
+  <td>31190</td>\r
+  <td>44148</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Myanmar</td>\r
+  <td>17158</td>\r
+  <td>50020</td>\r
+  <td>53087</td>\r
+  <td>57585</td>\r
+  <td>63373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Namibia</td>\r
+  <td>485</td>\r
+  <td>2171</td>\r
+  <td>2412</td>\r
+  <td>2810</td>\r
+  <td>3588</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nauru</td>\r
+  <td>3</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nepal</td>\r
+  <td>8126</td>\r
+  <td>29331</td>\r
+  <td>32503</td>\r
+  <td>38031</td>\r
+  <td>49028</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands</td>\r
+  <td>10114</td>\r
+  <td>16592</td>\r
+  <td>16915</td>\r
+  <td>17348</td>\r
+  <td>17399</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands Antilles</td>\r
+  <td>112</td>\r
+  <td>198</td>\r
+  <td>207</td>\r
+  <td>210</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Caledonia</td>\r
+  <td>65</td>\r
+  <td>250</td>\r
+  <td>271</td>\r
+  <td>304</td>\r
+  <td>362</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Zealand</td>\r
+  <td>1908</td>\r
+  <td>4266</td>\r
+  <td>4492</td>\r
+  <td>4831</td>\r
+  <td>5349</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nicaragua</td>\r
+  <td>1295</td>\r
+  <td>5743</td>\r
+  <td>6265</td>\r
+  <td>7058</td>\r
+  <td>8143</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niger</td>\r
+  <td>2462</td>\r
+  <td>15290</td>\r
+  <td>19150</td>\r
+  <td>27388</td>\r
+  <td>58216</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nigeria</td>\r
+  <td>36680</td>\r
+  <td>154729</td>\r
+  <td>175928</td>\r
+  <td>210057</td>\r
+  <td>289083</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niue</td>\r
+  <td>5</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Northern Mariana Islands</td>\r
+  <td>7</td>\r
+  <td>87</td>\r
+  <td>96</td>\r
+  <td>111</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Norway</td>\r
+  <td>3265</td>\r
+  <td>4812</td>\r
+  <td>5036</td>\r
+  <td>5365</td>\r
+  <td>5947</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Occupied Palestinian Territory</td>\r
+  <td>1005</td>\r
+  <td>4277</td>\r
+  <td>5090</td>\r
+  <td>6553</td>\r
+  <td>10265</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Oman</td>\r
+  <td>456</td>\r
+  <td>2845</td>\r
+  <td>3198</td>\r
+  <td>3782</td>\r
+  <td>4878</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pakistan</td>\r
+  <td>41177</td>\r
+  <td>180808</td>\r
+  <td>205504</td>\r
+  <td>246286</td>\r
+  <td>335195</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Palau</td>\r
+  <td>7</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>23</td>\r
+  <td>26</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Panama</td>\r
+  <td>860</td>\r
+  <td>3454</td>\r
+  <td>3773</td>\r
+  <td>4267</td>\r
+  <td>5092</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Papua New Guinea</td>\r
+  <td>1798</td>\r
+  <td>6732</td>\r
+  <td>7678</td>\r
+  <td>9265</td>\r
+  <td>12871</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Paraguay</td>\r
+  <td>1473</td>\r
+  <td>6349</td>\r
+  <td>7007</td>\r
+  <td>8026</td>\r
+  <td>9867</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Peru</td>\r
+  <td>7632</td>\r
+  <td>29165</td>\r
+  <td>31197</td>\r
+  <td>34528</td>\r
+  <td>39776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Philippines</td>\r
+  <td>19996</td>\r
+  <td>91983</td>\r
+  <td>101734</td>\r
+  <td>117270</td>\r
+  <td>146156</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pitcairn</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Poland</td>\r
+  <td>24824</td>\r
+  <td>38074</td>\r
+  <td>37788</td>\r
+  <td>36964</td>\r
+  <td>32013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Portugal</td>\r
+  <td>8405</td>\r
+  <td>10707</td>\r
+  <td>10787</td>\r
+  <td>10706</td>\r
+  <td>10015</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Puerto Rico</td>\r
+  <td>2218</td>\r
+  <td>3982</td>\r
+  <td>4074</td>\r
+  <td>4176</td>\r
+  <td>4103</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Qatar</td>\r
+  <td>25</td>\r
+  <td>1409</td>\r
+  <td>1630</td>\r
+  <td>1848</td>\r
+  <td>2316</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Republic of Korea</td>\r
+  <td>19211</td>\r
+  <td>48333</td>\r
+  <td>49153</td>\r
+  <td>49484</td>\r
+  <td>44077</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Réunion</td>\r
+  <td>248</td>\r
+  <td>827</td>\r
+  <td>886</td>\r
+  <td>973</td>\r
+  <td>1096</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Romania</td>\r
+  <td>16311</td>\r
+  <td>21275</td>\r
+  <td>20787</td>\r
+  <td>19961</td>\r
+  <td>17279</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Russian Federation</td>\r
+  <td>102702</td>\r
+  <td>140874</td>\r
+  <td>137983</td>\r
+  <td>132345</td>\r
+  <td>116097</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Rwanda</td>\r
+  <td>2162</td>\r
+  <td>9998</td>\r
+  <td>11743</td>\r
+  <td>14676</td>\r
+  <td>22082</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Helena</td>\r
+  <td>5</td>\r
+  <td>4</td>\r
+  <td>4</td>\r
+  <td>5</td>\r
+  <td>5</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Kitts and Nevis</td>\r
+  <td>46</td>\r
+  <td>52</td>\r
+  <td>56</td>\r
+  <td>61</td>\r
+  <td>69</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Lucia</td>\r
+  <td>83</td>\r
+  <td>172</td>\r
+  <td>182</td>\r
+  <td>198</td>\r
+  <td>217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Pierre and Miquelon</td>\r
+  <td>5</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+ </tr>\r
+ <tr>\r
+  <td>St. Vincent and the Grenadines</td>\r
+  <td>67</td>\r
+  <td>109</td>\r
+  <td>110</td>\r
+  <td>111</td>\r
+  <td>119</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Samoa</td>\r
+  <td>82</td>\r
+  <td>179</td>\r
+  <td>181</td>\r
+  <td>188</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>San Marino</td>\r
+  <td>13</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sao Tome and Principe</td>\r
+  <td>60</td>\r
+  <td>163</td>\r
+  <td>180</td>\r
+  <td>216</td>\r
+  <td>296</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saudi Arabia</td>\r
+  <td>3201</td>\r
+  <td>25721</td>\r
+  <td>28933</td>\r
+  <td>34176</td>\r
+  <td>43658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Senegal</td>\r
+  <td>2416</td>\r
+  <td>12534</td>\r
+  <td>14526</td>\r
+  <td>17861</td>\r
+  <td>26102</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Serbia</td>\r
+  <td>6732</td>\r
+  <td>9850</td>\r
+  <td>9828</td>\r
+  <td>9720</td>\r
+  <td>9193</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Seychelles</td>\r
+  <td>36</td>\r
+  <td>84</td>\r
+  <td>86</td>\r
+  <td>91</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sierra Leone</td>\r
+  <td>1944</td>\r
+  <td>5696</td>\r
+  <td>6557</td>\r
+  <td>8112</td>\r
+  <td>12446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Singapore</td>\r
+  <td>1022</td>\r
+  <td>4737</td>\r
+  <td>5059</td>\r
+  <td>5362</td>\r
+  <td>5221</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovakia</td>\r
+  <td>3463</td>\r
+  <td>5406</td>\r
+  <td>5437</td>\r
+  <td>5413</td>\r
+  <td>4917</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovenia</td>\r
+  <td>1473</td>\r
+  <td>2020</td>\r
+  <td>2044</td>\r
+  <td>2050</td>\r
+  <td>1954</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Solomon Islands</td>\r
+  <td>90</td>\r
+  <td>523</td>\r
+  <td>599</td>\r
+  <td>725</td>\r
+  <td>1007</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Somalia</td>\r
+  <td>2264</td>\r
+  <td>9133</td>\r
+  <td>10731</td>\r
+  <td>13922</td>\r
+  <td>23522</td>\r
+ </tr>\r
+ <tr>\r
+  <td>South Africa</td>\r
+  <td>13683</td>\r
+  <td>50110</td>\r
+  <td>51684</td>\r
+  <td>53766</td>\r
+  <td>56802</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Spain</td>\r
+  <td>28009</td>\r
+  <td>44904</td>\r
+  <td>47203</td>\r
+  <td>49265</td>\r
+  <td>51260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sri Lanka</td>\r
+  <td>8241</td>\r
+  <td>20238</td>\r
+  <td>21167</td>\r
+  <td>22033</td>\r
+  <td>21705</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sudan</td>\r
+  <td>9190</td>\r
+  <td>42272</td>\r
+  <td>47730</td>\r
+  <td>56688</td>\r
+  <td>75884</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Suriname</td>\r
+  <td>215</td>\r
+  <td>520</td>\r
+  <td>547</td>\r
+  <td>586</td>\r
+  <td>619</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Swaziland</td>\r
+  <td>273</td>\r
+  <td>1185</td>\r
+  <td>1287</td>\r
+  <td>1455</td>\r
+  <td>1749</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sweden</td>\r
+  <td>7014</td>\r
+  <td>9249</td>\r
+  <td>9498</td>\r
+  <td>9915</td>\r
+  <td>10571</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Switzerland</td>\r
+  <td>4693</td>\r
+  <td>7568</td>\r
+  <td>7736</td>\r
+  <td>8020</td>\r
+  <td>8514</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Syrian Arab Republic</td>\r
+  <td>3536</td>\r
+  <td>21906</td>\r
+  <td>24494</td>\r
+  <td>28592</td>\r
+  <td>36911</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tajikistan</td>\r
+  <td>1532</td>\r
+  <td>6952</td>\r
+  <td>7761</td>\r
+  <td>9075</td>\r
+  <td>11111</td>\r
+ </tr>\r
+ <tr>\r
+  <td>TFYR Macedonia</td>\r
+  <td>1230</td>\r
+  <td>2042</td>\r
+  <td>2045</td>\r
+  <td>2037</td>\r
+  <td>1857</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Thailand</td>\r
+  <td>20607</td>\r
+  <td>67764</td>\r
+  <td>69939</td>\r
+  <td>72628</td>\r
+  <td>73361</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Timor-Leste</td>\r
+  <td>433</td>\r
+  <td>1134</td>\r
+  <td>1385</td>\r
+  <td>1869</td>\r
+  <td>3217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Togo</td>\r
+  <td>1329</td>\r
+  <td>6619</td>\r
+  <td>7607</td>\r
+  <td>9282</td>\r
+  <td>13196</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tokelau</td>\r
+  <td>2</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tonga</td>\r
+  <td>47</td>\r
+  <td>104</td>\r
+  <td>105</td>\r
+  <td>112</td>\r
+  <td>123</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Trinidad and Tobago</td>\r
+  <td>636</td>\r
+  <td>1339</td>\r
+  <td>1368</td>\r
+  <td>1388</td>\r
+  <td>1278</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tunisia</td>\r
+  <td>3530</td>\r
+  <td>10272</td>\r
+  <td>10884</td>\r
+  <td>11797</td>\r
+  <td>12711</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkey</td>\r
+  <td>21484</td>\r
+  <td>74816</td>\r
+  <td>79966</td>\r
+  <td>87364</td>\r
+  <td>97389</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkmenistan</td>\r
+  <td>1211</td>\r
+  <td>5110</td>\r
+  <td>5509</td>\r
+  <td>6072</td>\r
+  <td>6796</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turks and Caicos Islands</td>\r
+  <td>5</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tuvalu</td>\r
+  <td>5</td>\r
+  <td>10</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uganda</td>\r
+  <td>5158</td>\r
+  <td>32710</td>\r
+  <td>39710</td>\r
+  <td>53406</td>\r
+  <td>91271</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ukraine</td>\r
+  <td>37298</td>\r
+  <td>45708</td>\r
+  <td>44165</td>\r
+  <td>41617</td>\r
+  <td>35026</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Arab Emirates</td>\r
+  <td>70</td>\r
+  <td>4599</td>\r
+  <td>5193</td>\r
+  <td>6109</td>\r
+  <td>8253</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Kingdom</td>\r
+  <td>50616</td>\r
+  <td>61565</td>\r
+  <td>63528</td>\r
+  <td>66601</td>\r
+  <td>72365</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Republic of Tanzania</td>\r
+  <td>7650</td>\r
+  <td>43739</td>\r
+  <td>52109</td>\r
+  <td>67394</td>\r
+  <td>109450</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States of America</td>\r
+  <td>157813</td>\r
+  <td>314659</td>\r
+  <td>332334</td>\r
+  <td>358735</td>\r
+  <td>403932</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States Virgin Islands</td>\r
+  <td>27</td>\r
+  <td>110</td>\r
+  <td>108</td>\r
+  <td>103</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uruguay</td>\r
+  <td>2239</td>\r
+  <td>3361</td>\r
+  <td>3430</td>\r
+  <td>3546</td>\r
+  <td>3637</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uzbekistan</td>\r
+  <td>6314</td>\r
+  <td>27488</td>\r
+  <td>29456</td>\r
+  <td>32715</td>\r
+  <td>36439</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Vanuatu</td>\r
+  <td>48</td>\r
+  <td>240</td>\r
+  <td>276</td>\r
+  <td>338</td>\r
+  <td>482</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Venezuela (Bolivarian Republic of)</td>\r
+  <td>5094</td>\r
+  <td>28583</td>\r
+  <td>31292</td>\r
+  <td>35370</td>\r
+  <td>42042</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Viet Nam</td>\r
+  <td>27367</td>\r
+  <td>88069</td>\r
+  <td>93647</td>\r
+  <td>102054</td>\r
+  <td>111666</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Wallis and Futuna Islands</td>\r
+  <td>7</td>\r
+  <td>15</td>\r
+  <td>16</td>\r
+  <td>17</td>\r
+  <td>17</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Western Sahara</td>\r
+  <td>14</td>\r
+  <td>513</td>\r
+  <td>625</td>\r
+  <td>775</td>\r
+  <td>938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Yemen</td>\r
+  <td>4316</td>\r
+  <td>23580</td>\r
+  <td>27819</td>\r
+  <td>35509</td>\r
+  <td>53689</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zambia</td>\r
+  <td>2340</td>\r
+  <td>12935</td>\r
+  <td>14980</td>\r
+  <td>18890</td>\r
+  <td>28957</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zimbabwe</td>\r
+  <td>2747</td>\r
+  <td>12523</td>\r
+  <td>14029</td>\r
+  <td>16780</td>\r
+  <td>22178</td>\r
+ </tr>\r
+</tbody>\r
+</table>\r
+\r
+<p style='font-size:smaller;'>Data source: <a href="http://www.un.org/esa/population/unpop.htm">Population Division of the \r
+Department of Economic and Social Affairs of the United Nations Secretariat</a> (2009). \r
+<em>World Population Prospects: The 2008 Revision. Highlights.</em> New York: United Nations.  </p>                            \r
+\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Accordion</h2>\r
+\r
+<div id="accExample">\r
+\r
+   <div>\r
+     <div>Stanza 1</div>\r
+     <div>\r
+<p>Two roads diverged in a yellow wood,\r
+<br>And sorry I could not travel both\r
+<br>And be one traveler, long I stood\r
+<br>And looked down one as far as I could\r
+<br>To where it bent in the undergrowth.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 2</div>\r
+     <div>\r
+<p>Then took the other, as just as fair,\r
+<br>And having perhaps the better claim,\r
+<br>Because it was grassy and wanted wear;\r
+<br>Though as for that the passing there\r
+<br>Had worn them really about the same.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 3</div>\r
+     <div>\r
+<p>And both that morning equally lay\r
+<br>In leaves no step had trodden black.\r
+<br>Oh, I kept the first for another day!\r
+<br>Yet knowing how way leads on to way,\r
+<br>I doubted if I should ever come back.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 4</div>\r
+     <div>\r
+<p>I shall be telling this with a sigh\r
+<br>Somewhere ages and ages hence:\r
+<br>Two roads diverged in a wood, and I--\r
+<br>I took the one less traveled by,\r
+<br>And that has made all the difference.\r
+<p style='font-size:9pt;'><strong>Robert Frost: The Road Not Taken (1915)</strong>\r
+     </div>\r
+  </div>\r
+\r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Tabbed Panel</h2>\r
+\r
+<div id="tabsExample">\r
+   <ul>\r
+     <li>Stanza 1</li>\r
+     <li>Stanza 2</li>\r
+     <li>Stanza 3</li>\r
+     <li>Stanza 4</li>\r
+   </ul>\r
+\r
+   <div>\r
+     <div>\r
+<p>Two roads diverged in a yellow wood,\r
+<br>And sorry I could not travel both\r
+<br>And be one traveler, long I stood\r
+<br>And looked down one as far as I could\r
+<br>To where it bent in the undergrowth.\r
+     </div>\r
+     <div>\r
+<p>Then took the other, as just as fair,\r
+<br>And having perhaps the better claim,\r
+<br>Because it was grassy and wanted wear;\r
+<br>Though as for that the passing there\r
+<br>Had worn them really about the same.\r
+     </div>\r
+     <div>\r
+<p>And both that morning equally lay\r
+<br>In leaves no step had trodden black.\r
+<br>Oh, I kept the first for another day!\r
+<br>Yet knowing how way leads on to way,\r
+<br>I doubted if I should ever come back.\r
+     </div>\r
+     <div>\r
+<p>I shall be telling this with a sigh\r
+<br>Somewhere ages and ages hence:\r
+<br>Two roads diverged in a wood, and I--\r
+<br>I took the one less traveled by,\r
+<br>And that has made all the difference.\r
+<p style='font-size:9pt;'><strong>Robert Frost: The Road Not Taken (1915)</strong>\r
+     </div>\r
+  </div>\r
+\r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Dialog Window</h2>\r
+\r
+<p><button onclick='openWindow(this)'>Open Dialog Window</button>\r
+<div id='dialog' title='The Gettysburg Address'>\r
+<p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. \r
+<p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. \r
+<p>But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. \r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Calendar</h2>\r
+\r
+<div id="ricoCal"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/html/LoadRicoClient.js b/examples/html/LoadRicoClient.js
new file mode 100644 (file)
index 0000000..b1f5ab4
--- /dev/null
@@ -0,0 +1,103 @@
+Rico_CONFIG = {\r
+  jsDir: "../../ricoClient/js/",       // directory containing Rico's javascript files\r
+  cssDir: "../../ricoClient/css/",     // directory containing Rico's css files\r
+  imgDir: "../../ricoClient/images/",  // directory containing Rico's image files\r
+  enableLogging: false,    // enable console logging\r
+  grid_striping: true,     // apply row striping to LiveGrids?\r
+  LoadBaseLib: true,       // load base Javascript library (prototype, jQuery, etc) from Rico directory?\r
+  jQuery_theme_path: "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/",\r
+\r
+  initialize: function(checkQueryString) {\r
+    this.transDir=this.jsDir+"translations/";\r
+    this.baselibsDir=this.jsDir+"baselibs/";\r
+    var theme,lib,aParm,log;\r
+    if (checkQueryString) {\r
+      var s=location.search;\r
+      if (s.charAt(0)=='?') s=s.substr(1);\r
+      var aSearch=s.split(/&/);\r
+      for (var i=0; i<aSearch.length; i++) {\r
+        aParm=aSearch[i].split(/=/);\r
+        switch (aParm[0]) {\r
+          case 'theme': theme=aParm[1]; break;\r
+          case 'lib':   lib=aParm[1]; break;\r
+          case 'log':   this.enableLogging=true; break;\r
+        }\r
+      }\r
+    } else {\r
+      // set your production values here\r
+      lib="proto";    // base library (proto, jquery, moo, dojo, ext, or glow)\r
+      theme="j-ui-lightness";  // jquery themes start with j-, rico themes start with r-\r
+    }\r
+    if (lib) this.LoadLib(lib);\r
+    if (theme) this.LoadTheme(theme);\r
+  },\r
+\r
+  LoadLib: function(baseLib) {\r
+    var baseFile,adapter;\r
+    switch (baseLib) {\r
+      case "proto":\r
+        baseFile="prototype"\r
+        adapter="2Proto"\r
+        break;\r
+      case "jquery":\r
+        baseFile="jquery"\r
+        adapter="2jQuery"\r
+        break;\r
+      case "moo":\r
+        baseFile="mootools"\r
+        adapter="2Moo"\r
+        break;\r
+      case "dojo":\r
+        baseFile="dojo"\r
+        adapter="2Dojo"\r
+        break;\r
+      case "ext":\r
+        baseFile="ext-core"\r
+        adapter="2Ext"\r
+        break;\r
+      case "glow":\r
+        baseFile="glow.core"\r
+        adapter="2Glow"\r
+        break;\r
+      default:\r
+        return;\r
+    }\r
+    //alert(baseFile+' '+adapter);\r
+    if (this.LoadBaseLib) document.write("<script src='"+this.baselibsDir+baseFile+".js' type='text/javascript'></script>");\r
+    this.requireRicoJS("");\r
+    this.requireRicoJS(adapter);\r
+    document.write("<script src='"+this.transDir+"ricoLocale_en.js' type='text/javascript'></script>");\r
+    this.requireRicoCSS("rico");\r
+    this.requireRicoJS("UI");\r
+  },\r
+\r
+  // set theme\r
+  // "j-ui-lightness" for a Themeroller theme\r
+  // "r-greenHdg" for a native Rico theme\r
+  LoadTheme: function(theme) {\r
+    var prefix=theme.charAt(0);\r
+    theme=theme.substr(2);\r
+    switch (prefix) {\r
+      case 'j':\r
+        this.requireRicoJS("Themeroller");\r
+        document.write("<link type='text/css' rel='stylesheet' href='"+this.cssDir+"jquery-base/ui.base.css'>");\r
+        document.write("<link type='text/css' rel='Stylesheet' href='"+this.jQuery_theme_path+theme+"/jquery-ui.css'>");\r
+        break;\r
+      case 'r':\r
+        this.requireRicoCSS(theme);\r
+        break;\r
+    }\r
+    if (this.grid_striping) document.write("<link type='text/css' rel='stylesheet' href='"+this.cssDir+"striping/"+theme+".css' />");\r
+  },\r
+\r
+  requireRicoJS: function(filename) {\r
+    document.write("<script src='"+this.jsDir+"rico"+filename+".js' type='text/javascript'></script>\n");\r
+  },\r
+\r
+  requireRicoCSS: function(filename) {\r
+    document.write("<link href='"+this.cssDir+filename+".css' type='text/css' rel='stylesheet'>\n");\r
+  }\r
+\r
+}\r
+\r
+Rico_CONFIG.initialize(true);  // load settings from QueryString? true for demo, false for production\r
diff --git a/examples/html/accordion-grid.html b/examples/html/accordion-grid.html
new file mode 100644 (file)
index 0000000..8546416
--- /dev/null
@@ -0,0 +1,137 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico Accordion &amp; Grid</title>
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Accordion');\r
+Rico.loadModule('LiveGrid','LiveGridMenu');\r
+
+Rico.onLoad( function() {\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5'],\r
+    [5,'Cell 5:2','Cell 5:3','Cell 5:4','Cell 5:5'],\r
+    [6,'Cell 6:2','Cell 6:3','Cell 6:4','Cell 6:5']\r
+  ];\r
+  for (var i=1; i<=3; i++) {
+    var opts = {  \r
+      useUnformattedColWidth: false,\r
+      defaultWidth : 90,\r
+      frozenColumns: 1,
+      windowResize : false,
+      visibleRows  : -4,\r
+      menuEvent    : 'click',\r
+      columnSpecs  : [{Hdg:'Column 1',type:'number', decPlaces:0, ClassName:'alignright'},\r
+                      {Hdg:'Column 2'},\r
+                      {Hdg:'Column 3'},\r
+                      {Hdg:'Column 4'},\r
+                      {Hdg:'Column 5'}]\r
+    };\r
+    var buffer=new Rico.Buffer.Base();\r
+    for (var j=0; j < myData.length; j++)\r
+      myData[j][0]=i*100+j+1;\r
+    buffer.loadRowsFromArray(myData);\r
+    var grid=new Rico.LiveGrid ('ex'+i, buffer, opts);\r
+    grid.menu=new Rico.GridMenu();
+  }
+  alert('The grids have been sized, so now initialize the accordion');\r
+  new Rico.Accordion( 'accordionExample', {panelHeight:200});\r
+});\r
+</script>\r
+<style type="text/css">\r
+.panelContent {
+  overflow: auto;
+  height: 200px; /* allow grids to size during initialization */
+}
+#accordionExample {
+  margin-top : 6px;
+  width: 600px;\r
+}\r
+#panel1 {\r
+  font-size: small;\r
+}\r
+div.ui-accordion-header, .Rico_accTitle {\r
+  font-size: 10pt;\r
+}
+</style>
+</head>
+
+
+<body>
+<h1>Rico Accordion &amp; Grid</h1>
+\r
+<p id='libname'>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<div>
+  <div id="accordionExample">
+
+      <div >
+        <div class="panelheader">
+          Overview
+        </div>
+        <div class="panelContent" id='panel1'>
+This example illustrates how to include LiveGrids in an Accordion.
+<br>
+<br>
+One key is the following grid options:
+<pre>
+windowResize : false, /* don't resize grids if window is resized */
+visibleRows  : -4,    /* size grid to parent element */\r
+</pre>
+combined with the following css:
+<pre>
+.panelContent {
+  height: 200px; /* allow grids to size during initialization */
+}
+</pre>
+
+        </div>
+      </div>
+
+      <div >
+        <div class="panelheader">
+          Grid 1
+        </div>
+        <div class="panelContent">
+<p class="ricoBookmark"><span id="ex1_bookmark">&nbsp;</span></p>\r
+<div id="ex1"></div>\r
+        </div>
+        </div>
+
+      <div>
+        <div class="panelheader">
+          Grid 2
+        </div>
+        <div class="panelContent">
+<p class="ricoBookmark"><span id="ex2_bookmark">&nbsp;</span></p>\r
+<div id="ex2"></div>\r
+        </div>
+      </div>
+
+
+      <div>
+        <div class="panelheader">
+          Grid 3
+        </div>
+        <div class="panelContent">
+<p class="ricoBookmark"><span id="ex3_bookmark">&nbsp;</span></p>\r
+<div id="ex3"></div>\r
+        </div>
+      </div>
+
+
+  </div>
+
+</div>
+</body></html>
\ No newline at end of file
diff --git a/examples/html/accordion0.html b/examples/html/accordion0.html
new file mode 100644 (file)
index 0000000..42f5990
--- /dev/null
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico</title>
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+\r
+Rico.loadModule('Accordion');\r
+
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  new Rico.Accordion( 'accordionExample', {panelHeight:200});
+});\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet">\r
+<style type="text/css">\r
+#accordionExample {
+  margin-top : 6px;
+  width: 500px;\r
+  font-size:small;\r
+}\r
+</style>
+</head>
+
+
+<body>
+<h1>Rico Basic Accordion</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span></p>\r
+\r
+<div id="accordionExample">
+
+    <div>
+      <div>
+        Overview
+      </div>
+      <div>
+       <br>This example illustrates how to use the Rico.Accordion behavior to transform a set of 
+       divs into a first class accordion component.<br><br>
+      Rico.Accordion is actually a very simple component built off of Rico behaviors and effects.
+      It adds the necessary event handlers on the respective divs to handle the visual aspects of expanding, collapsing
+      and hovering.
+      </div>
+    </div>
+
+    <div>
+      <div>
+        HTML Code
+      </div>
+      <div>
+      <br>The example HTML structure is an outer div that holds all of the panels.  Then, each panel is just a
+      couple of DIVs (one for the header and one for the content) wrapped in an outer DIV. The id attribute is\r
+      only required on the outer div.
+  <pre> &lt;div id="accordionID"&gt;
+     &lt;div id="Panel1"&gt;
+       &lt;div id="Header1"&gt;
+         Overview
+        &lt;/div&gt;
+        &lt;div id="Content1"&gt;
+         ... content text ...
+        &lt;/div&gt;
+     &lt;/div&gt;
+  &lt;/div&gt;
+  </pre>
+      </div>
+      </div>
+
+    <div>
+      <div>
+        Rico Code
+      </div>
+      <div>
+      <br>To attach the accordion behavior to the accordion container div, construct a Rico.Accordion
+      object and pass the id of the outer accordion div to it.  This is a bit different than the previous versions.  \r
+    <pre>
+    new Rico.Accordion( 'accordionID', {panelHeight:200} );
+    </pre>
+      There are many other configuration parameters that can be specified to modify various visual aspects of the
+      accordion. The panelHeight is the attribute that is most commonly overridden.
+      </div>
+    </div>
+
+
+    <div>
+      <div>
+        Important Note
+      </div>
+      <div>
+      <br>The accordion is very flexible.  
+      However, you do have to make sure the header and content elements are structured properly.
+      <br>
+      </div>
+    </div>
+
+</div>
+
+</body>\r
+</html>\r
diff --git a/examples/html/accordion3.html b/examples/html/accordion3.html
new file mode 100644 (file)
index 0000000..51cc9b4
--- /dev/null
@@ -0,0 +1,127 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico</title>
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+\r
+Rico.loadModule('Accordion');\r
+
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  new Rico.Accordion( 'OuterAccordion', {panelHeight:200, selectedIndex: 1});\r
+  new Rico.Accordion( 'NestedAccordion', {panelHeight:100});
+});\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#OuterAccordion {
+  margin-top : 6px;
+  width: 500px;\r
+  font-size:small;\r
+}
+</style>
+</head>
+
+
+<body>
+<h1>Rico Nested Accordions</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span>\r
+</p>\r
+\r
+<div id="OuterAccordion">
+
+    <div>
+      <div>
+        Overview
+      </div>
+      <div>
+       <br>This example illustrates how to use the Rico.Accordion behavior to transform a set of
+       divs into a first class accordion component.<br><br>
+      Rico.Accordion is actually a very simple component built off of Rico behaviors and effects.
+      It adds the necessary event handlers on the respective divs to handle the visual aspects of expanding, collapsing
+      and hovering.
+      </div>
+    </div>
+
+               <div>\r
+                 <div>\r
+                       More Info (nested accordion)\r
+                 </div>\r
+                 <div>\r
+            <div id="NestedAccordion">\r
+                <div>\r
+                  <div>\r
+                         Overview of ContentTransition base component\r
+                  </div>\r
+                  <div>\r
+                      The Accordion derives from a base component that applies and manages\r
+                      behaviors and effects.  The effects can be defined at the extended class.\r
+                      This approach results in a very flexible way of managing\r
+                  </div>\r
+                </div>\r
+                <div>\r
+                  <div>\r
+                            Alternative HTML\r
+                  </div>\r
+                    <div>\r
+                        Since the accordion does not parse the html, it can be constructed much looser\r
+                        than in previous versions.  The base ContentTransition can be used to quicly build\r
+                        components such as tabs, master details, and many application specific behaviors.\r
+                        We will be providing examples of building your own soon.\r
+                  </div>\r
+                </div>\r
+                <div>\r
+                  <div>\r
+                            Alternative effects\r
+                  </div>\r
+                    <div>\r
+                    We will be discussing alternative transition effects here.\r
+                    Should be interesting.\r
+                  </div>\r
+                </div>\r
+            </div>\r
+\r
+        </div>\r
+               </div>\r
+
+    <div>
+      <div>
+        Rico Code
+      </div>
+      <div>
+      <br>To attach the accordion behavior to the accordion container div, construct a Rico.Accordion
+      object and pass the id of the outer accordion div to it.  Since there are two accordions in this example, we create two objects:\r
+    <pre>
+  new Rico.Accordion( 'OuterAccordion', \r
+                      { panelHeight : 200, \r
+                        selectedIndex : 1 });\r
+  new Rico.Accordion( 'NestedAccordion', \r
+                      { panelHeight : 100 });\r
+    </pre>
+      Panels are numbered starting with 0. The "selectedIndex:1" option\r
+      ensures that the panel with the nested accordion is open by default.
+      </div>
+    </div>
+
+
+    <div>
+      <div>
+        Important Note
+      </div>
+      <div>
+      <br>The accordion is very flexible.
+      However, you do have to make sure the header and content elements are structured properly.
+      <br>
+      </div>
+    </div>
+
+</div>
+
+</body>\r
+</html>\r
diff --git a/examples/html/accordion4.html b/examples/html/accordion4.html
new file mode 100644 (file)
index 0000000..ff32e32
--- /dev/null
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico</title>
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+\r
+Rico.loadModule('Accordion');\r
+
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  new Rico.Accordion( 'accordionExample', {panelHeight:200, cookieName: 'Rico.AccCookie'});
+});\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#accordionExample {
+  margin-top : 6px;
+  width: 650px;\r
+  font-size:small;\r
+}
+</style>
+</head>
+
+
+<body>
+<h1>Rico Accordion with Memory</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span>\r
+</p>\r
+\r
+<div id="accordionExample">
+
+    <div>
+      <div>
+        Overview
+      </div>
+      <div>
+       <br>This example remembers the panel you had open the\r
+last time you visited. Simply provide a value for options.cookieName. This option\r
+also applies to tabbed panels. By default, the cookie value is only remembered\r
+for the current session. To have it persist longer, also set options.cookieDays.
+      </div>
+    </div>
+
+    <div>
+      <div>
+        HTML Code
+      </div>
+      <div>
+      <br>The example HTML structure is an outer div that holds all of the panels.  Then, each panel is just a
+      couple of DIVs (one for the header and one for the content) wrapped in an outer DIV. The id attribute is\r
+      only required on the outer div.
+  <pre> &lt;div id="accordionID"&gt;
+     &lt;div id="Panel1"&gt;
+       &lt;div id="Header1"&gt;
+         Overview
+        &lt;/div&gt;
+        &lt;div id="Content1"&gt;
+         ... content text ...
+        &lt;/div&gt;
+     &lt;/div&gt;
+  &lt;/div&gt;
+  </pre>
+      </div>
+      </div>
+
+    <div>
+      <div>
+        Rico Code
+      </div>
+      <div>
+      <br>To attach the accordion behavior to the accordion container div, construct a Rico.Accordion
+      object and pass the id of the outer accordion div to it.  This is a bit different than the previous versions.  \r
+    <pre>
+    new Rico.Accordion( 'accordionID', \r
+                        {panelHeight:200, cookieName: 'Rico.AccCookie'} );
+    </pre>
+      The cookieName parameter causes the accordion to remember its current state in a cookie.
+      </div>
+    </div>
+
+
+    <div>
+      <div>
+        Important Note
+      </div>
+      <div>
+      <br>The accordion is very flexible.  
+      However, you do have to make sure the header and content elements are structured properly.
+      <br>
+      </div>
+    </div>
+
+</div>
+
+</body>\r
+</html>\r
diff --git a/examples/html/animate-rico.html b/examples/html/animate-rico.html
new file mode 100644 (file)
index 0000000..b342f72
--- /dev/null
@@ -0,0 +1,135 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<title>Rico 3.0 - Animation</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+
+<script type='text/javascript'>
+var container, step=0, phase=0, offsetX=-5, offsetY=-5, duration=750;
+
+var animData = [
+// R
+[20,25,40,325,'#00F'],
+[40,305,140,325,'#00F'],
+[40,165,140,185,'#00F'],
+[140,185,160,305,'#00F'],
+[140,25,160,60,'#00F'],
+[120,60,140,95,'#00F'],
+[100,95,120,130,'#00F'],
+[80,130,100,165,'#00F'],
+
+// I
+[200,25,220,325,'#F00'],
+
+// C
+[260,45,280,305,'#0F0'],
+[280,305,380,325,'#0F0'],
+[280,25,380,45,'#0F0'],
+
+// O
+[420,45,440,305,'#000'],
+[440,305,540,325,'#000'],
+[440,25,540,45,'#000'],
+[540,45,560,305,'#000']
+];
+
+
+Rico.onLoad( function() {
+  container=Rico.$('animContainer');
+  RunAnim();
+});
+
+
+function RunAnim() {
+  if (step >= animData.length) {
+    switch (phase) {
+      case 0:
+        step=0;
+        offsetX=0;
+        offsetY=0;
+        phase++;
+        RunAnim();
+        break;
+      case 1:
+        StartFadeOut();
+        break;
+    }
+    return;
+  }
+  Rico.log('Running step '+step+' '+typeof(step));
+  var pts=animData[step];
+  Rico.log('  pts = '+animData.length);
+  //Rico.log('  pts = '+pts.join(' '));
+  var elem=container.appendChild(document.createElement("div"));
+  var color=phase ? pts[4] : pts[4].replace(/0/g,'C');
+  var elstyle={left:(pts[0]+offsetX)+'px', position:'absolute', width:'1px', height:'1px', backgroundColor:color}
+  if (pts[3] > pts[1]) {
+    elstyle['bottom']=(pts[1]+offsetY)+'px';
+    endHt=pts[3] - pts[1];
+  } else {
+    elstyle['top']=(pts[1]+offsetY)+'px';
+    endHt=pts[1] - pts[3];
+  }
+  Rico.setStyle(elem,elstyle);
+  var opts={duration:duration,onEnd:RunAnim};
+  var props={width:(pts[2]-pts[0]), height:endHt};
+  Rico.animate(elem,opts,props);
+  step++;
+}
+
+
+function StartFadeOut() {
+  Rico.fadeOut(container,1000,StartFadeIn);
+}
+
+function StartFadeIn() {
+  Rico.fadeIn(container,1000);
+}
+</script>
+
+<style type="text/css">
+#animContainer {
+  position:relative; 
+  border:1px solid black;
+  height:350px;
+  width:600px;
+}
+</style>
+
+</head>
+
+<body>
+
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>
+Base Library: 
+<script type='text/javascript'>
+document.write(Rico.Lib+' '+Rico.LibVersion);
+</script>
+<hr><p>This example demonstrates Rico's 
+ability to animate elements.
+</td>
+<td>
+<script type="text/javascript"><!--
+google_ad_client = "pub-7218597156507462";
+/* 125x125, created 5/11/09 */
+google_ad_slot = "9298106441";
+google_ad_width = 125;
+google_ad_height = 125;
+//-->
+</script>
+<script type="text/javascript"
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>
+</td>
+</tr></table>
+
+
+<div id='animContainer'>
+
+</div>
+
+</body>
+</html>
diff --git a/examples/html/animation-effects.html b/examples/html/animation-effects.html
new file mode 100644 (file)
index 0000000..e7da1f7
--- /dev/null
@@ -0,0 +1,119 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+var div1,div2,enlarge=true,fadeOut=true,moveRight=true;\r
+Rico.onLoad( function() {\r
+  Rico.Corner.round('effect_object_r');\r
+  div1=Rico.$('effect_object');
+  div2=Rico.$('effect_object_r');
+});\r
+\r
+function animateSize() {\r
+  var newsize=enlarge ? 240 : 120;\r
+  enlarge=!enlarge;\r
+  Rico.animate(div1,{duration:500},{width:newsize});\r
+  Rico.animate(div2,{duration:500},{width:newsize});\r
+}\r
+\r
+function animateFade() {\r
+  if (fadeOut) {\r
+    Rico.fadeOut(div1,500);\r
+    Rico.fadeOut(div2,500);\r
+  } else {\r
+    Rico.fadeIn(div1,500);\r
+    Rico.fadeIn(div2,500);\r
+  }\r
+  fadeOut=!fadeOut;\r
+}\r
+\r
+function animatePosition() {\r
+  var newpos=moveRight ? 400 : 0;\r
+  moveRight=!moveRight;\r
+  Rico.animate(div1,{duration:500},{left:newpos});\r
+  Rico.animate(div2,{duration:500},{left:newpos});\r
+}\r
+\r
+function animateSizeAndPosition() {\r
+  var newsize=enlarge ? 240 : 120;\r
+  enlarge=!enlarge;\r
+  var newpos=moveRight ? 400 : 0;\r
+  moveRight=!moveRight;\r
+  Rico.animate(div1,{duration:500},{width:newsize,left:newpos});\r
+  Rico.animate(div2,{duration:500},{width:newsize,left:newpos});\r
+}\r
+\r
+function animatePositionAndFade() {\r
+  var newopacity=fadeOut ? 0 : 1;\r
+  fadeOut=!fadeOut;\r
+  var newpos=moveRight ? 400 : 0;\r
+  moveRight=!moveRight;\r
+  Rico.animate(div1,{duration:500},{opacity:newopacity,left:newpos});\r
+  Rico.animate(div2,{duration:500},{opacity:newopacity,left:newpos});\r
+}\r
+</script>
+
+<link href="../demo.css" type="text/css" rel="stylesheet">\r
+<style type="text/css">\r
+div.sizeMe {\r
+   width            : 120px;\r
+   background-color : #c6c3de;\r
+   padding-top      : 10px;\r
+   padding-bottom   : 10px;\r
+   font-family      : Arial;\r
+   font-size        : 11px;\r
+   text-align       : center;
+   position         : absolute;\r
+   left             : 0px;\r
+}\r
+</style>\r
+\r
+
+</head>
+
+
+<body>
+
+<h1>Rico Animation &amp; Effects</h1>
+\r
+<p id='libname'>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<p>\r
+<table border='0'>\r
+<tr>\r
+<td>\r
+<td><button onclick="animateSize();">Animate Size</button>
+<td><button onclick="animateFade();">Fade Out/Fade In</button>\r
+\r
+<tr>\r
+<td><button onclick="animatePosition();">Animate Position</button>
+<td><button onclick="animateSizeAndPosition();">Animate Position &amp; Size</button>\r
+<td><button onclick="animatePositionAndFade();">Animate Position &amp; Fade</button>\r
+</table>\r
+
+
+<p>&nbsp;
+
+<div id="effect_object" class="sizeMe" style="border: 6px solid black;">
+   <div style="height:50px; background-color:red;">Inner div content
+   </div>
+</div>
+
+<p style="height:100px;">&nbsp;
+\r
+<div id="effect_object_r" class="sizeMe">
+   <div style="height:50px; background-color:red;">Inner div content
+   </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/html/classTest.html b/examples/html/classTest.html
new file mode 100644 (file)
index 0000000..22677f8
--- /dev/null
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<title>CSS Class Test</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+<style type="text/css">
+.class1 {
+  background-color: red;
+  font-weight: bold;
+}
+
+.class2 {
+  color: blue;
+}
+
+#test {
+  border:1px solid black;
+  padding: 3px;
+}
+.css {
+  font-size: smaller;
+}
+</style>
+</head>
+
+<body>
+
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>
+Base Library: 
+<script type='text/javascript'>
+document.write(Rico.Lib+' '+Rico.LibVersion);
+</script>
+<hr>
+<h1>Rico: Classes and Dimensions</h1>
+<p>This example adds and removes classes from the test element.
+</td>
+<td>
+<script type="text/javascript"><!--
+google_ad_client = "pub-7218597156507462";
+/* 125x125, created 5/11/09 */
+google_ad_slot = "9298106441";
+google_ad_width = 125;
+google_ad_height = 125;
+//-->
+</script>
+<script type="text/javascript"
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>
+</td>
+</tr></table>
+
+
+<p>
+<button onclick='Rico.addClass("test","class1");'>Add class 1</button>
+<button onclick='Rico.removeClass("test","class1");'>Remove class 1</button>
+<button onclick='alert(Rico.hasClass("test","class1"));'>Has class 1?</button>
+<span class='css'>(background=red, font=bold)</span>
+<br>
+<button onclick='Rico.addClass("test","class2");'>Add class 2</button>
+<button onclick='Rico.removeClass("test","class2");'>Remove class 2</button>
+<button onclick='alert(Rico.hasClass("test","class2"));'>Has class 2?</button>
+<span class='css'>(text color=blue)</span>
+<br>
+<button onclick='alert(Rico.windowWidth()+"x"+Rico.windowHeight());'>Window size?</button>
+<button onclick='alert("Top: "+Rico.cumulativeOffset("test").top);'>Paragraph position?</button>
+<button onclick='alert(Rico.getStyle("test","background-color"));'>Background color?</button>
+</p>
+
+<p id='test'>
+This is the test element
+</p>
+
+</body>
+</html>
diff --git a/examples/html/controls.html b/examples/html/controls.html
new file mode 100644 (file)
index 0000000..f08e3ec
--- /dev/null
@@ -0,0 +1,234 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico-Popup Controls</title>\r
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Calendar','ColorPicker');\r
+var cal1,cal2,cal3,cal1Box,cal2Box,cal3Box;\r
+var colorpicker,colorBox\r
+\r
+Rico.onLoad( function() {\r
+\r
+  // initialize calendar  (addHoliday calls are optional)\r
+  cal1Box=Rico.$('CalendarValue1');\r
+  cal1=new Rico.CalendarControl("cal1");\r
+  cal1.addHoliday(25,12,0,'Christmas','#F55','white');\r
+  cal1.addHoliday(1,1,0,'New Years','#2F2','white');\r
+  cal1.atLoad();\r
+  cal1.returnValue=function(newVal) { cal1Box.value=newVal; };\r
+  SetDateFormat();\r
+\r
+  // initialize calendar #2 (show week #)\r
+  cal2Box=Rico.$('CalendarValue2');\r
+  cal2=new Rico.CalendarControl("cal2", {showWeekNumber:1});\r
+  cal2.atLoad();\r
+  cal2.returnValue=function(newVal) { cal2Box.value=newVal; };\r
+\r
+  // initialize calendar #3 (no "Today is")\r
+  cal3Box=Rico.$('CalendarValue3');\r
+  cal3=new Rico.CalendarControl("cal3", {showToday:0});\r
+  cal3.atLoad();\r
+  cal3.returnValue=function(newVal) { cal3Box.value=newVal; };\r
+  \r
+  // initialize color picker\r
+  colorpicker=new Rico.ColorPicker("colorpicker1");\r
+  colorpicker.atLoad();\r
+  colorpicker.returnValue=ProcessColorSelection;\r
+  colorBox=Rico.$('ColorValue');\r
+  \r
+  for (var i=1; i<=3; i++) {\r
+    Rico.eventBind('CalendarButton'+i,"click", Rico.eventHandle(window,'CalendarClick'+i));\r
+  };\r
+  Rico.eventBind('ColorButton',"click", Rico.eventHandle(window,'ColorClick'));\r
+  Rico.eventBind('TextButton',"click", Rico.eventHandle(window,'DisplayText'));\r
+  \r
+  Rico.log('onLoad finished');\r
+});\r
+\r
+function CalendarClick1(e) {\r
+  if (Rico.visible(cal1.container)) {\r
+    cal1.close();\r
+  } else {\r
+    cal2.close();\r
+    cal3.close();\r
+    colorpicker.close();\r
+    cal1.open(cal1Box.value);\r
+    Rico.positionCtlOverIcon(cal1.container,'CalendarButton1');\r
+    cal1.move();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+\r
+function SetDateFormat(e) {\r
+  cal1Box.value='';\r
+  var sel=Rico.$('CalFormat');\r
+  cal1.setDateFmt(sel.options[sel.selectedIndex].text);\r
+}\r
+\r
+function CalendarClick2(e) {\r
+  if (Rico.visible(cal2.container)) {\r
+    cal2.close();\r
+  } else {\r
+    cal1.close();\r
+    cal3.close();\r
+    colorpicker.close();\r
+    cal2.open(cal2Box.value);\r
+    Rico.positionCtlOverIcon(cal2.container,'CalendarButton2');\r
+    cal2.move();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+\r
+function CalendarClick3(e) {\r
+  if (Rico.visible(cal3.container)) {\r
+    cal3.close();\r
+  } else {\r
+    cal1.close();\r
+    cal2.close();\r
+    colorpicker.close();\r
+    cal3.open(cal3Box.value);\r
+    Rico.positionCtlOverIcon(cal3.container,'CalendarButton3');\r
+    cal3.move();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+\r
+function ProcessColorSelection(newVal) {\r
+  colorBox.value=newVal;\r
+  // set text box background to the selected color\r
+  colorBox.style.backgroundColor=newVal;\r
+  colorBox.style.color= Rico.isWebKit ? 'black' : TextColor(newVal);\r
+}\r
+\r
+// choose black or white text - whichever gives the best contrast\r
+function TextColor(hexval) {\r
+  var objColor=Rico.Color.createFromHex(hexval);\r
+  return (objColor.rgb.g > 160 || objColor.rgb.r+objColor.rgb.g+objColor.rgb.b > 480) ? 'black' : 'white';\r
+}\r
+\r
+function ColorClick(e) {\r
+  if (Rico.visible(colorpicker.container)) {\r
+    colorpicker.close();\r
+  } else {\r
+    Rico.positionCtlOverIcon(colorpicker.container,'ColorButton');\r
+    cal1.close();\r
+    cal2.close();\r
+    cal3.close();\r
+    colorpicker.open();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+\r
+var PopupCnt=0;\r
+function DisplayText(e) {\r
+  Rico.eventStop(e);\r
+  var txt=Rico.$('TextBox').value;\r
+  if (!txt) {\r
+    alert('Enter some text first!');\r
+    return;\r
+  }\r
+  PopupCnt++;\r
+  var options={\r
+    hideOnClick: false,\r
+    zIndex     : PopupCnt+10,   // ensures shadows layer correctly\r
+    height     : '200px',\r
+    width      : '300px',\r
+    overflow   : 'auto'\r
+  };\r
+  var popup=new Rico.Window('Window #'+PopupCnt,options);\r
+  popup.setContent(txt);\r
+\r
+  // pick a random location in the upper-left quadrant of the screen\r
+  var x=Math.floor(Math.random()*Rico.windowWidth()/2);\r
+  var y=Math.floor(Math.random()*Rico.windowHeight()/2);\r
+  popup.openPopup(x,y);\r
+}\r
+</script>\r
+
+<style>
+body {font-family: Arial, Tahoma, Verdana;}\r
+#row1 span {\r
+  font-size: 8pt;\r
+}\r
+#CalFormat {\r
+  font-size: 8pt;\r
+}\r
+</style>
+</head>\r
+\r
+<body>
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<h1>Rico: Popup Controls</h1>\r
+<p>This example displays the Rico Calendar in various formats and the Rico Color Picker,\r
+as well a displaying a dialog window.\r
+</p>\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<table border='1' cellspacing='0' cellpadding='7'>\r
+<tr id='row1' valign='top'>\r
+<td><button id='CalendarButton1'>Calendar</button>\r
+<br><select id='CalFormat' onchange='SetDateFormat(event)'>\r
+<option>yyyy-mm-dd</option>\r
+<option>dd-mm-yyyy</option>\r
+<option>mm/dd/yyyy</option>\r
+</select>\r
+</td>\r
+<td><button id='CalendarButton2'>Calendar with<br>Week Number</button></td>\r
+<td><button id='CalendarButton3'>Calendar without<br>"Today is"</button></td>\r
+<td><button id='ColorButton'>Color Picker</button></td>\r
+</tr>\r
+<tr>\r
+<td><input type='text' id='CalendarValue1' size='10'></td>\r
+<td><input type='text' id='CalendarValue2' size='10'></td>\r
+<td><input type='text' id='CalendarValue3' size='10'></td>\r
+<td><input type='text' id='ColorValue' size='8'></td>\r
+</tr>\r
+</table>\r
+\r
+<p><table border='1' cellspacing='0' cellpadding='7' style='background-color:#DDD;'>\r
+<tr><td>\r
+<span style='font-size:small;'>\r
+Type or paste some text into the box, then click the button.\r
+<br>Open popups can be dragged around the page.\r
+<br>Type "Esc" to close all popups.\r
+</span>\r
+<br><textarea id='TextBox' rows='6' cols='70'>\r
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, \r
+sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \r
+Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris \r
+nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \r
+reprehenderit in voluptate velit esse cillum dolore eu fugiat \r
+nulla pariatur. Excepteur sint occaecat cupidatat non proident, \r
+sunt in culpa qui officia deserunt mollit anim id est laborum.\r
+</textarea>\r
+<br><button id='TextButton'>Display text in window</button>\r
+</td></tr>\r
+</table>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/html/corners.html b/examples/html/corners.html
new file mode 100644 (file)
index 0000000..104a059
--- /dev/null
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico.Corner</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+Rico.loadModule('Corner');\r
+\r
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  Rico.Corner.round('a0');\r
+  Rico.Corner.round('a',{compact:true});\r
+  Rico.Corner.round('d',{corners:"tl"});\r
+  Rico.Corner.round('e',{corners:"br"});\r
+  Rico.Corner.round('f',{corners:"top"});\r
+  Rico.Corner.round('g',{corners:"bottom"});\r
+  Rico.Corner.round('h',{corners:"tl br"});\r
+  Rico.Corner.round('i',{corners:"all"});\r
+  Rico.Corner.round('j',{corners:"all", compact:true});\r
+});\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+span.code2 {\r
+   font-family : Courier;\r
+   font-size   : 11px;\r
+   margin      : 12px;\r
+}\r
+div.cornerSamples {\r
+   width            : 320px;\r
+   margin-top       : 4px;\r
+   background-color : #ffffee;\r
+   font-family      : Arial;\r
+   font-size        : 11px;\r
+   text-align       : left;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body>\r
+<h1>Rico.Corner</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span></p>\r
+\r
+<table cellspacing="0" cellpadding="7" style="background-color:#1e4552;" >\r
+\r
+<tr>\r
+<td colspan="2"><div id="a0" class="cornerSamples"><span class="code2">Rico.Corner.round(element);<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="a" class="cornerSamples"><span class="code2">Rico.Corner.round(element, {compact:true});<br><br><br><br></span></div></td>\r
+<td><div id="d" class="cornerSamples"><span class="code2">Rico.Corner.round(element, {corners:"tl"});<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="e" class="cornerSamples"><span class="code2">Rico.Corner.round(element, {corners:"br"});<br><br><br><br></span></div></td>\r
+<td><div id="f" class="cornerSamples"><span class="code2">Rico.Corner.round(element, {corners:"top"});<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="g" class="cornerSamples"><span class="code2">Rico.Corner.round(element, {corners:"bottom"});<br><br><br><br></span></div></td>\r
+<td><div id="h" class="cornerSamples"><span class="code2">Rico.Corner.round(element, {corners:"tl br"});<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+\r
+<td><div id="i" class="cornerSamples" style="background-image:url(gradient.jpg)"><span class="code2">Rico.Corner.round(element, {color:"transparent"}</span><br><br><br><br></div></td>\r
+<td><div id="j" class="cornerSamples" style="background-image:url(gradient.jpg)"><span class="code2">Rico.Corner.round(element, {color:"transparent",compact:true}</span><br><br><br><br></div></td>\r
+</tr>\r
+\r
+</table>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/html/corners2.html b/examples/html/corners2.html
new file mode 100644 (file)
index 0000000..d48436a
--- /dev/null
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico.Corner</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+Rico.loadModule('Corner');\r
+\r
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  Rico.Corner.round('a0');\r
+  Rico.Corner.round('a',{compact:true});\r
+  Rico.Corner.round('d',{corners:"tl"});\r
+  Rico.Corner.round('e',{corners:"br"});\r
+  Rico.Corner.round('f',{corners:"top"});\r
+  Rico.Corner.round('g',{corners:"bottom"});\r
+  Rico.Corner.round('h',{corners:"tl br"});\r
+  Rico.Corner.round('i',{corners:"all", color: "transparent"});\r
+  Rico.Corner.round('j',{corners:"all", compact:true, color: "transparent"});\r
+});\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+span.code2 {\r
+   font-family : Courier;\r
+   font-size   : 11px;\r
+   margin      : 12px;\r
+}\r
+div.cornerSamples {\r
+   width            : 320px;\r
+   margin-top       : 4px;\r
+   background-color : #ffffee;\r
+   font-family      : Arial;\r
+   font-size        : 11px;\r
+   text-align       : left;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body>\r
+<h1>Rico.Corner -  using color names</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span></p>\r
+\r
+<table cellspacing="0" cellpadding="7" style="background-color:navy;" >\r
+\r
+<tr>\r
+<td colspan="2"><div id="a0" class="cornerSamples"><span class="code2">Rico.Corner.round(element);<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="a" class="cornerSamples" style='background-color:yellow'><span class="code2">Rico.Corner.round(element, {compact:true});<br><br><br><br></span></div></td>\r
+<td><div id="d" class="cornerSamples" style='background-color:lightgreen'><span class="code2">Rico.Corner.round(element, {corners:"tl"});<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="e" class="cornerSamples" style='background-color:lime'><span class="code2">Rico.Corner.round(element, {corners:"br"});<br><br><br><br></span></div></td>\r
+<td><div id="f" class="cornerSamples" style='background-color:pink'><span class="code2">Rico.Corner.round(element, {corners:"top"});<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="g" class="cornerSamples" style='background-color:lightgrey'><span class="code2">Rico.Corner.round(element, {corners:"bottom"});<br><br><br><br></span></div></td>\r
+<td><div id="h" class="cornerSamples" style='background-color:gold'><span class="code2">Rico.Corner.round(element, {corners:"tl br"});<br><br><br><br></span></div></td>\r
+</tr>\r
+\r
+<tr>\r
+<td><div id="i" class="cornerSamples" style="background-image:url(gradient.jpg)"><span class="code2">Rico.Corner.round(element, {color:"transparent"}</span><br><br><br><br></div></td>\r
+<td><div id="j" class="cornerSamples" style="background-image:url(gradient.jpg)"><span class="code2">Rico.Corner.round(element, {color:"transparent",compact:true}</span><br><br><br><br></div></td>\r
+</tr>\r
+\r
+</table>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/html/cssSelect.html b/examples/html/cssSelect.html
new file mode 100644 (file)
index 0000000..b9abd16
--- /dev/null
@@ -0,0 +1,96 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<title>Rico 3.0 - CSS Selection</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+
+<script type='text/javascript'>
+function ToggleElements(id,cssSelect) {
+  var elements=Rico.select(cssSelect,id);
+  for (var i=0; i<elements.length; i++) {
+    if (Rico.visible(elements[i]))
+      Rico.hide(elements[i]);
+    else
+      Rico.show(elements[i]);
+  }
+}
+</script>
+
+</head>
+
+<body>
+
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>
+Base Library: 
+<script type='text/javascript'>
+document.write(Rico.Lib+' '+Rico.LibVersion);
+</script>
+<hr>
+<h1>Rico: CSS Selection</h1>
+<p>This example demonstrates the library's CSS selector engine.
+Click on a button to toggle the visibility of the specified items.
+</p>
+</td>
+<td>
+<script type="text/javascript"><!--
+google_ad_client = "pub-7218597156507462";
+/* 125x125, created 5/11/09 */
+google_ad_slot = "9298106441";
+google_ad_width = 125;
+google_ad_height = 125;
+//-->
+</script>
+<script type="text/javascript"
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>
+</td>
+</tr></table>
+
+
+<p>
+<button onclick='ToggleElements("test","#list1 li");'>Toggle all items in list 1</button>
+<button onclick='ToggleElements("test","#list2 li:first-child");'>Toggle first item in list 2</button>
+<button onclick='ToggleElements("test","ul li:last-child");'>Toggle last item in all lists</button>
+</p>
+
+<table border='1' cellpadding='4' id='test'>
+<tr>
+
+<td>
+List 1
+<ul id='list1'>
+<li>Apple 1
+<li>Apple 2
+<li>Apple 3
+<li>Apple 4
+</ul>
+</td>
+
+<td>
+List 2
+<ul id='list2'>
+<li>Banana 1
+<li>Banana 2
+<li>Banana 3
+<li>Banana 4
+</ul>
+</td>
+
+<td>
+List 3
+<ul id='list3'>
+<li>Coconut 1
+<li>Coconut 2
+<li>Coconut 3
+<li>Coconut 4
+</ul>
+</td>
+
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/examples/html/down_arrow.png b/examples/html/down_arrow.png
new file mode 100644 (file)
index 0000000..33cb1a9
Binary files /dev/null and b/examples/html/down_arrow.png differ
diff --git a/examples/html/drag-and-drop-dyn.html b/examples/html/drag-and-drop-dyn.html
new file mode 100644 (file)
index 0000000..b01acb5
--- /dev/null
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+
+<html>
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<script type='text/javascript'>\r
+Rico.loadModule('Corner','DragAndDrop');\r
+\r
+var dropCnt=1;
+Rico.onLoad( function() {\r
+   Rico.registerDraggable( new Rico.Draggable('test-rico-dnd','dragme') );\r
+   Rico.registerDropZone( new Rico.Dropzone('droponme') );\r
+});\r
+\r
+function CreateDropZone() {\r
+  var div = document.createElement('div');\r
+  var title = document.createElement('div');\r
+  div.className='simpleDropPanel';\r
+  title.className='title';\r
+  dropCnt++;\r
+  title.innerHTML='Drop On Me #'+dropCnt;\r
+  div.appendChild(title);\r
+  var id='dropzone'+dropCnt\r
+  div.id=id;\r
+  Element.setStyle(div, {backgroundColor:'#c6c3de'});\r
+  document.body.appendChild(div);
+  Rico.registerDropZone( new Rico.Dropzone(id) );\r
+}\r
+</script>
+
+<style type="text/css">\r
+div.title {\r
+   font-family      : Arial;\r
+   font-size        : 10px;\r
+   background-color : #797979;\r
+   color            : #ffffff;\r
+   width            : 200px;\r
+   margin           : 1px;\r
+}\r
+div.box {\r
+   font-family   : Arial;\r
+   font-size     : 14px;\r
+   width         : 100px;\r
+   height        : 40px;\r
+   text-align    : center;\r
+   border-bottom : 1px solid #6b6b6b;\r
+   border-right  : 1px solid #6b6b6b;\r
+}\r
+\r
+div.panel {\r
+   width    : 200px;\r
+   height   : 80px;\r
+   padding  : 2px;\r
+   border   : 1px solid #5b5b5b;\r
+}\r
+\r
+div.simpleDropPanel {\r
+   width    : 200px;\r
+   height   : 80px;\r
+   padding  : 2px;\r
+   border   : 1px solid #5b5b5b;\r
+   margin-top: 3px;\r
+}\r
+</style>\r
+</head>
+
+
+<body>
+
+<h1>Rico Drag &amp; Drop - with dynamically created drop zones</h1>
+\r
+<p id='libname'>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<p><button onclick='CreateDropZone()'>Create Drop Zone</button></p>\r
+\r
+<div style="padding:5px;border:1px solid #5b5b5b;height:50px;">\r
+  <div class="box" style="background:#f7a673" id="dragme">Drag Me</div>\r
+</div>\r
+\r
+<div id="droponme" class="simpleDropPanel" style="background:#ffd773">\r
+  <div class="title">Drop On Me</div>\r
+</div>\r
+\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/examples/html/drag-and-drop-grid.html b/examples/html/drag-and-drop-grid.html
new file mode 100644 (file)
index 0000000..fc4612f
--- /dev/null
@@ -0,0 +1,240 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+
+<html>
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico - Drag and Drop</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridBasic','DragAndDrop');\r
+\r
+Rico.onLoad( function() {\r
+   Rico.Corner.round('exampleContainer');\r
+   logger=Rico.$('logger');\r
+   logger.value='';\r
+\r
+  // initialize all 4 grids with the same options\r
+  \r
+  var opts = {  \r
+    useUnformattedColWidth: false,\r
+    visibleRows  : 'parent',\r
+    columnSpecs  : [{Hdg:'Last Name', canDrag:true},\r
+                    {Hdg:'First Name', canDrag:true}]\r
+  };\r
+  for (var i=0; i<4; i++) {\r
+    buffer[i]=new Rico.Buffer.Base();\r
+    grid[i]=new Rico.LiveGrid (grid_ids[i], buffer[i], opts);\r
+  }\r
+  \r
+  // load data into the first grid\r
+  \r
+  buffer[0].loadRowsFromArray(names);\r
+  buffer[0].fetch(0);\r
+\r
+  // initialize the drop zones (the other 3 grids)\r
+  \r
+  GridDropzone.prototype = Rico.extend(new Rico.Dropzone(), GridDropzoneMethods);\r
+  Rico.registerDropZone( new GridDropzone(grid[1]));\r
+  Rico.registerDropZone( new GridDropzone(grid[2]));\r
+  Rico.registerDropZone( new GridDropzone(grid[3]));\r
+});\r
+\r
+\r
+var names = [ ["Holloman", "Debbie"],\r
+              ["Barnes", "Pat"], \r
+              ["Dampier", "Joan"], \r
+              ["Alvarez", "Randy"],\r
+              ["Neil", "William"], \r
+              ["Hardoway", "Kimber"],\r
+              ["Story", "Leslie"],\r
+              ["Lott", "Charlie"],\r
+              ["Patton", "Sabrina"], \r
+              ["Lopez", "Juan" ] ];\r
+\r
+var grid_ids=['grid1','grid2','grid3','grid4']\r
+var CustomDraggable, logger, grid=[], buffer=[];\r
+\r
+\r
+function GridDropzone(grid) {\r
+  this.initialize(grid);\r
+};\r
+\r
+var GridDropzoneMethods = {\r
+\r
+  initialize: function( grid ) {\r
+    this.liveGrid     = grid;\r
+    this.htmlElement  = grid.outerDiv;\r
+    this.absoluteRect = null;\r
+  },\r
+\r
+  accept: function(draggableObjects) {\r
+    for ( var i = 0 ; i < draggableObjects.length ; i++ ) {\r
+      \r
+      // copy data from drag grid buffer to drop grid buffer\r
+      \r
+      var srcGrid = draggableObjects[i].liveGrid;\r
+      if (srcGrid==this.liveGrid) continue;\r
+      var srcRow  = srcGrid.buffer.bufferRow(draggableObjects[i].dragRow);\r
+      var newRows = this.liveGrid.buffer.appendRows(1);\r
+      for (var c=0; c < srcGrid.columns.length; c++)\r
+        newRows[0][c]=srcGrid.buffer.getValue(srcRow,c)\r
+      logger.value+="GridDropzone.accept: " + draggableObjects[i].htmlElement.innerHTML + " from [" + srcGrid.tableId +"] to [" + this.liveGrid.tableId +"]\n";\r
+      \r
+      // refresh drop grid\r
+\r
+      this.liveGrid.buffer.fetch(0);\r
+      this.liveGrid.scrollToRow(this.liveGrid.buffer.size-1); // scroll to the end\r
+      \r
+      // remove item from drag grid\r
+      \r
+      srcGrid.buffer.deleteRows(srcRow);\r
+      srcGrid.buffer.fetch(Math.min(srcGrid.lastRowPos || 0, srcGrid.topOfLastPage()-1));\r
+    }\r
+  }\r
+\r
+};\r
+</script>
+
+<link href="../demo.css" type="text/css" rel="stylesheet">\r
+<style type="text/css">\r
+p {\r
+  font-size : 8pt;\r
+}\r
+\r
+div.title {\r
+   font-family      : Arial;\r
+   font-size        : 10px;\r
+   background-color : #797979;\r
+   color            : #ffffff;\r
+   width            : 200px;\r
+   margin           : 1px;\r
+}\r
+div.box {\r
+   font-family   : Arial;\r
+   font-size     : 14px;\r
+   width         : 100px;\r
+   height        : 40px;\r
+   text-align    : center;\r
+   border-bottom : 1px solid #6b6b6b;\r
+   border-right  : 1px solid #6b6b6b;\r
+}\r
+\r
+div.panel {\r
+   width    : 200px;\r
+   height   : 80px;\r
+   padding  : 2px;\r
+   border   : 1px solid #5b5b5b;\r
+}\r
+\r
+div.explanation {\r
+   font-family      : Arial;\r
+   font-size        : 12px;\r
+   width            : 600px;\r
+   background-color : #cdd7b5;\r
+}\r
+\r
+div.simpleDropPanel {\r
+   width    : 200px;\r
+   height   : 80px;\r
+   padding  : 2px;\r
+   border   : 1px solid #5b5b5b;\r
+}\r
+.logBox {\r
+  background-color : #ffffee;\r
+  border : 1px solid #888;\r
+  font-size : 8pt;\r
+}\r
+\r
+.zone {\r
+  padding: 0px;\r
+  width:250px;\r
+  height:150px;\r
+  overflow:hidden;\r
+  margin-left:8px;\r
+  margin-bottom:8px;\r
+  float:left;\r
+  position: relative;\r
+}\r
+.catHeader {\r
+  font-family : Arial;\r
+  font-weight : bold;\r
+  font-size : 11px;\r
+  color : #5b5b5b;\r
+  margin-left : 8px;\r
+  margin-top : 12px;\r
+  margin-bottom: 0px;\r
+  display : block;\r
+}\r
+.LiveGridDraggable {\r
+  background-color : #E0DDB5;\r
+  color            : #5b5b5b;\r
+  border           : 1px solid #5b5b5b;\r
+  filter           : alpha(Opacity=70);\r
+  opacity          : 0.7;\r
+  -moz-opacity     : 0.7;\r
+  padding          : 1px 5px 1px 5px;\r
+  font-size        : 11px;\r
+}\r
+div.ricoLG_outerDiv {\r
+  border: 1px solid #888;\r
+  background-color:#FFF;\r
+}\r
+#exampleContainer {\r
+  float:left;\r
+  background-color:#DDD;\r
+}\r
+</style>\r
+</head>
+
+
+<body>
+
+<h1>Rico Drag &amp; Drop Examples</h1>
+\r
+<p>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+\r
+<div id="exampleContainer">\r
+\r
+<p>&nbsp;Drag names from grid to grid</p>\r
+\r
+<div>\r
+<div id="gridzone1" class='zone'>\r
+  <p class="catHeader">Grid 1: <span id="grid1_bookmark">&nbsp;</span></p>\r
+  <div id="grid1"></div>\r
+</div>\r
+\r
+<div id="gridzone2" class='zone'>\r
+  <p class="catHeader">Grid 2: <span id="grid2_bookmark">&nbsp;</span></p>\r
+  <div id="grid2"></div>\r
+</div>\r
+</div>\r
+\r
+<div style='clear:both'>\r
+<div id="gridzone3" class='zone'>\r
+  <p class="catHeader">Grid 3: <span id="grid3_bookmark">&nbsp;</span></p>\r
+  <div id="grid3"></div>\r
+</div>\r
+\r
+<div id="gridzone4" class='zone'>\r
+  <p class="catHeader">Grid 4: <span id="grid4_bookmark">&nbsp;</span></p>\r
+  <div id="grid4"></div>\r
+</div>\r
+</div>\r
+\r
+<div style="clear:both;margin:8px;">\r
+  <span id='loghead' class="catHeader">drag-n-drop message log:</span>\r
+  <textarea class="logBox" id="logger" rows='6' cols='80'></textarea>\r
+</div>\r
+\r
+</div>\r
+\r
+\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/examples/html/drag-and-drop-log.html b/examples/html/drag-and-drop-log.html
new file mode 100644 (file)
index 0000000..72a0163
--- /dev/null
@@ -0,0 +1,152 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>\r
+<head>\r
+<title>Rico TV Networks</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('DragAndDrop');\r
+\r
+var names = [ "CNN", "ZDF", "BBC", "MTV", "CBS", "NHK" ];\r
+var CustomDraggable;\r
+Rico.onLoad( function() {\r
+  Rico.setDebugArea('logger');\r
+  Rico.enableLogging();\r
+  Rico.extend(CustomDraggable.prototype, new Rico.Draggable());\r
+  Rico.extend(CustomDraggable.prototype, CustomDraggableMethods);\r
+\r
+  PopulateZone(names, 'nameList', 0);\r
+  // 0 is the default zone number, so it can be left out in the subsequent calls to registerDropZone\r
+  Rico.registerDropZone( new Rico.Dropzone('dropZone1'));\r
+  Rico.registerDropZone( new Rico.Dropzone('dropZone2'));\r
+  Rico.registerDropZone( new Rico.Dropzone('nameListDeleted'));\r
+});\r
+\r
+function PopulateZone(names, id, zoneNumber) {\r
+  var n=Rico.$(id);\r
+  for ( var i=0; i < names.length; i++ ) {\r
+    var d=document.createElement('div');\r
+    d.className='CustomDraggable';\r
+    d.innerHTML=names[i];\r
+    n.appendChild(d);\r
+    Rico.registerDraggable( new CustomDraggable('Custom', d), zoneNumber );\r
+  }\r
+}\r
+\r
+function CustomDraggable(type, htmlElement) {\r
+  this.initialize(type, htmlElement);\r
+}\r
+\r
+var CustomDraggableMethods = {\r
+\r
+  startDrag: function() {\r
+    this.startParent=this.htmlElement.parentNode;
+    Rico.log("startDragging: " + this.htmlElement.innerHTML + " from [" + this.startParent.id +"]");\r
+  },\r
+  \r
+  endDrag: function() {\r
+    this.endParent=this.htmlElement.parentNode;
+    Rico.log("endDragging: " + this.htmlElement.innerHTML + " from [" + this.startParent.id + "] to [" + this.endParent.id + "]" );\r
+  }\r
+\r
+}\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+p {\r
+  font-size : 8pt;\r
+}\r
+\r
+.logBox {\r
+  background-color : #ffffcc;\r
+  border : 1px solid #8b8b8b;\r
+  font-size : 8pt;\r
+}\r
+\r
+.listBox {\r
+  padding: 5px;\r
+  background-color : #ffffff;\r
+  border : 1px solid #8b8b8b;\r
+  width:200px;\r
+  height:90px;\r
+  overflow:auto;\r
+}\r
+.listBox * {\r
+  margin: 0px;\r
+  padding: 0px;\r
+  font-size : 11px;\r
+  font-family : Arial, Helvetica;\r
+}\r
+span.catHeader {\r
+  font-family : Arial;\r
+  font-weight : bold;\r
+  font-size : 11px;\r
+  color : #5b5b5b;\r
+  margin-left : 8px;\r
+  margin-top : 12px;\r
+  display : block;\r
+}\r
+.zone {\r
+  display:inline;\r
+  margin-left:8px;\r
+  margin-bottom:8px;\r
+  float:left;\r
+}\r
+div.CustomDraggable {\r
+  z-index:10;\r
+  color: blue;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<h1>Rico Drag-and-Drop: TV Networks</h1>\r
+\r
+<p>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<p>This example demonstrates how to track drop-and-drop objects as they are moved by the user. Watch the log messages!</p>\r
+\r
+<div id="exampleContainer" style="float:left;background-color:#DDD;">\r
+\r
+<div>\r
+<div id="dragBox" class='zone'>\r
+  <span class="catHeader">Channels</span>\r
+  <div class="listBox" id="nameList"></div>\r
+</div>\r
+\r
+<div id="deleteZone" class='zone'>\r
+  <span class="catHeader">Delete zone</span>\r
+  <div class="listBox" id="nameListDeleted"></div>\r
+</div>\r
+</div>\r
+\r
+<div style='clear:both'>\r
+<div id="dropBox1" class='zone'>\r
+  <span class="catHeader">Drop1</span>\r
+  <div class="listBox" id="dropZone1"></div>\r
+</div>\r
+\r
+<div id="dropBox2" class='zone'>\r
+  <span class="catHeader">Drop2</span>\r
+  <div class="listBox" id="dropZone2"></div>\r
+</div>\r
+</div>\r
+\r
+<div style="clear:both;margin:8px;">\r
+  <span id='loghead' class="catHeader">drag-n-drop message log:</span>\r
+  <textarea class="logBox" id="logger" rows='7' cols='80'></textarea>\r
+</div>\r
+\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/examples/html/drag-and-drop-simple.html b/examples/html/drag-and-drop-simple.html
new file mode 100644 (file)
index 0000000..027b3d9
--- /dev/null
@@ -0,0 +1,121 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+
+<html>
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Corner','DragAndDrop');
+Rico.onLoad( function() {\r
+   Rico.Corner.round('explanation');\r
+   // first parameter to Rico.Draggable can be anything, second parameter is the element to be dragged\r
+   Rico.registerDraggable( new Rico.Draggable('test-type','dragme') );\r
+   Rico.registerDropZone( new Rico.Dropzone('droponme') );\r
+   Rico.registerDropZone( new Rico.Dropzone('droponme2') );\r
+});\r
+</script>
+
+<link href="../demo.css" type="text/css" rel="stylesheet">\r
+<style type="text/css">\r
+div.title {\r
+   font-family      : Arial;\r
+   font-size        : 10px;\r
+   background-color : #797979;\r
+   color            : #ffffff;\r
+   width            : 200px;\r
+   margin           : 1px;\r
+}\r
+div.box {\r
+   font-family   : Arial;\r
+   font-size     : 14px;\r
+   width         : 100px;\r
+   height        : 40px;\r
+   text-align    : center;\r
+   border-bottom : 1px solid #6b6b6b;\r
+   border-right  : 1px solid #6b6b6b;\r
+}\r
+\r
+div.panel {\r
+   width    : 200px;\r
+   height   : 80px;\r
+   padding  : 2px;\r
+   border   : 1px solid #5b5b5b;\r
+}\r
+\r
+div.explanation {\r
+   font-family      : Arial;\r
+   font-size        : 12px;\r
+   width            : 600px;\r
+   background-color : #cdd7b5;\r
+}\r
+\r
+div.simpleDropPanel {\r
+   width    : 200px;\r
+   height   : 80px;\r
+   padding  : 2px;\r
+   border   : 1px solid #5b5b5b;\r
+}\r
+</style>\r
+</head>
+
+
+<body>
+
+<h1>Rico Simple Drag &amp; Drop Example</h1>
+\r
+<p id='libname'>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<div style="padding:5px;border:1px solid #5b5b5b;height:50px;clear:both;">\r
+\r
+<div class="box" style="background:#f7a673" id="dragme">Drag Me</div>\r
+</div>\r
+\r
+<p><table style="margin-bottom:8px" cellspacing="3" cellpadding="3">\r
+<tr>\r
+   <td>\r
+      <div id="droponme" class="simpleDropPanel" style="background:#ffd773">\r
+         <div class="title">Drop On Me</div>\r
+      </div>\r
+\r
+    </td>\r
+\r
+    <td>\r
+      <div id="droponme2" class="simpleDropPanel" style="background:#c6c3de">\r
+         <div class="title">Drop On Me 2</div>\r
+      </div>\r
+        </td>\r
+</tr>\r
+</table>\r
+\r
+<div id="explanation" class="explanation">\r
+   <pre>\r
+  &lt;div class="box" style="background:#f7a673" id="dragme"&gt;\r
+    Drag Me\r
+  &lt;/div&gt;\r
+\r
+  &lt;div id="droponme" class="simpleDropPanel" style="background:#ffd773"&gt;\r
+     &lt;div class="title">Drop On Me&lt;/div&gt;\r
+  &lt;/div&gt;\r
+\r
+  &lt;div id="droponme2" class="simpleDropPanel" style="background:#c6c3de"&gt;\r
+     &lt;div class="title">Drop On Me 2&lt;/div&gt;\r
+  &lt;/div&gt;\r
+\r
+  &lt;script&gt;\r
+   // first parameter to Rico.Draggable can be anything\r
+   // second parameter is the element to be dragged\r
+   Rico.registerDraggable( new Rico.Draggable('test-type','dragme') );\r
+   Rico.registerDropZone( new Rico.Dropzone('droponme') );\r
+   Rico.registerDropZone( new Rico.Dropzone('droponme2') );\r
+  &lt;/script&gt;</pre>\r
+</div>\r
+\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/examples/html/drag-and-drop-zones.html b/examples/html/drag-and-drop-zones.html
new file mode 100644 (file)
index 0000000..02e25f4
--- /dev/null
@@ -0,0 +1,170 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>\r
+<head>\r
+<title>Rico TV Networks</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('DragAndDrop');\r
+\r
+var seAsia = ['Brunei','Cambodia','East Timor','Indonesia','Laos','Malaysia','Myanmar (Burma)','Philippines','Singapore','Thailand','Vietnam'];\r
+var eastAsia = ['People\'s Republic of China (PRC)','Hong Kong (China)','Japan','Macau (China)','Mongolia','North Korea','South Korea','Republic of China (Taiwan)'];\r
+\r
+var CustomDraggable;\r
+Rico.onLoad( function() {\r
+  Rico.setDebugArea('logger');\r
+  Rico.enableLogging();\r
+  Rico.extend(CustomDraggable.prototype, new Rico.Draggable());\r
+  Rico.extend(CustomDraggable.prototype, CustomDraggableMethods);\r
+  \r
+  // East Asia is zone 0\r
+  PopulateZone(eastAsia, 'eastAsia', 0);\r
+  Rico.registerDropZone( new Rico.Dropzone('EastAsiaDrop1'), 0);\r
+  Rico.registerDropZone( new Rico.Dropzone('EastAsiaDrop2'), 0);\r
+\r
+  // SE Asia is zone 1\r
+  PopulateZone(seAsia, 'seAsia', 1);\r
+  Rico.registerDropZone( new Rico.Dropzone('SEAsiaDrop1'), 1);\r
+  Rico.registerDropZone( new Rico.Dropzone('SEAsiaDrop2'), 1);\r
+});\r
+\r
+function PopulateZone(names, id, zoneNumber) {\r
+  var n=Rico.$(id);\r
+  for ( var i=0; i < names.length; i++ ) {\r
+    var d=document.createElement('div');\r
+    d.id="d" + i;\r
+    d.className='CustomDraggable';\r
+    d.innerHTML=names[i];\r
+    n.appendChild(d);\r
+    Rico.registerDraggable( new CustomDraggable('Custom', d), zoneNumber );\r
+  }\r
+}\r
+\r
+function CustomDraggable(type, htmlElement) {\r
+  this.initialize(type, htmlElement);\r
+}\r
+\r
+var CustomDraggableMethods = {\r
+\r
+  startDrag: function() {\r
+    this.startParent=this.htmlElement.parentNode;
+    Rico.log("startDragging: " + this.htmlElement.innerHTML + " from [" + this.startParent.id +"]");\r
+  },\r
+  \r
+  endDrag: function() {\r
+    this.endParent=this.htmlElement.parentNode;
+    Rico.log("endDragging: " + this.htmlElement.innerHTML + " from [" + this.startParent.id + "] to [" + this.endParent.id + "]" );\r
+  }\r
+\r
+}\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+p {\r
+  font-size : 8pt;\r
+}\r
+\r
+.logBox {\r
+  background-color : #ffffcc;\r
+  border : 1px solid #8b8b8b;\r
+  font-size : 8pt;\r
+}\r
+\r
+.listBox {\r
+  padding: 5px;\r
+  background-color : #ffffff;\r
+  border : 1px solid #8b8b8b;\r
+  width:200px;\r
+  height:90px;\r
+  overflow:auto;\r
+}\r
+.listBox * {\r
+  margin: 0px;\r
+  padding: 0px;\r
+  font-size : 11px;\r
+  font-family : Arial, Helvetica;\r
+}\r
+span.catHeader {\r
+  font-family : Arial;\r
+  font-weight : bold;\r
+  font-size : 11px;\r
+  color : #5b5b5b;\r
+  margin-left : 8px;\r
+  margin-top : 12px;\r
+  display : block;\r
+}\r
+.zone {\r
+  display:inline;\r
+  margin-left:8px;\r
+  margin-bottom:8px;\r
+  float:left;\r
+}\r
+div.CustomDraggable {\r
+  z-index:10;\r
+  color: blue;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<h1>Rico Drag-and-Drop: Separate Drop Zones</h1>\r
+\r
+<p>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<p>This example demonstrates how to set up distinct drop zones. Watch the log messages!</p>\r
+\r
+<div id="exampleContainer" style="float:left;background-color:#DDD; width: 680px;">\r
+\r
+<div>\r
+<div id="drag1" class='zone'>\r
+  <span class="catHeader">East Asia</span>\r
+  <div class="listBox" id="eastAsia"></div>\r
+</div>\r
+\r
+<div id="dropBox1a" class='zone'>\r
+  <span class="catHeader">East Asia Drop 1</span>\r
+  <div class="listBox" id="EastAsiaDrop1"></div>\r
+</div>\r
+\r
+<div id="dropBox1b" class='zone'>\r
+  <span class="catHeader">East Asia Drop 2</span>\r
+  <div class="listBox" id="EastAsiaDrop2"></div>\r
+</div>\r
+\r
+</div>\r
+\r
+<div style='clear:both'>\r
+<div id="drag2" class='zone'>\r
+  <span class="catHeader">SE Asia</span>\r
+  <div class="listBox" id="seAsia"></div>\r
+</div>\r
+\r
+<div id="dropBox2a" class='zone'>\r
+  <span class="catHeader">SE Asia Drop 1</span>\r
+  <div class="listBox" id="SEAsiaDrop1"></div>\r
+</div>\r
+\r
+<div id="dropBox2b" class='zone'>\r
+  <span class="catHeader">SE Asia Drop 2</span>\r
+  <div class="listBox" id="SEAsiaDrop2"></div>\r
+</div>\r
+</div>\r
+\r
+<div style="clear:both;margin:8px;">\r
+  <span id='loghead' class="catHeader">drag-n-drop message log:</span>\r
+  <textarea class="logBox" id="logger" rows='7' cols='80'></textarea>\r
+</div>\r
+\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/examples/html/events.html b/examples/html/events.html
new file mode 100644 (file)
index 0000000..e2730e3
--- /dev/null
@@ -0,0 +1,98 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<title>Rico 3.0 - Events</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+
+<script type='text/javascript'>
+Rico.TestClass=function(name,msg) {
+  this.initialize(name,msg);
+}
+
+Rico.TestClass.prototype = {
+  initialize: function(name,msg) {
+    this.msg=msg;
+    this.addBtn=document.getElementById('add'+name);
+    this.remBtn=document.getElementById('rem'+name);
+    this.tstBtn=document.getElementById('tst'+name);
+    Rico.eventBind(this.addBtn, 'click', Rico.eventHandle(this,'addClick'));
+    Rico.eventBind(this.remBtn, 'click', Rico.eventHandle(this,'remClick'));
+    this.tstHandle=Rico.eventHandle(this,'tstClick');
+    this.isAttached=false;
+  },
+  addClick: function(e) {
+    if (this.isAttached) {
+      alert('already attached!');
+    } else {
+      Rico.eventBind(this.tstBtn, 'click', this.tstHandle);
+      this.isAttached=true;
+    }
+  },
+  remClick: function(e) {
+    if (this.isAttached) {
+      Rico.eventUnbind(this.tstBtn, 'click', this.tstHandle);
+      this.isAttached=false;
+    } else {
+      alert('not attached!');
+    }
+  },
+  tstClick: function(e) {
+    var elem=Rico.eventElement(e);
+    var loc=Rico.eventClient(e);
+    alert(this.msg+'\nElement '+elem.id+' clicked at '+loc.x+','+loc.y);
+  }
+}
+
+Rico.onLoad(function() {
+  var a=new Rico.TestClass('A','i am A king');
+  var b=new Rico.TestClass('B','i am the queen B');
+});
+</script>
+
+</head>
+
+<body>
+
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>
+Base Library: 
+<script type='text/javascript'>
+document.write(Rico.Lib+' '+Rico.LibVersion);
+</script>
+<hr>
+<h1>Rico: Events</h1>
+<p>In this example, the "Add" button adds an event to the "Test" button. 
+Conversely, the "Remove" button removes that event from the "Test" button.
+</p>
+</td>
+<td>
+<script type="text/javascript"><!--
+google_ad_client = "pub-7218597156507462";
+/* 125x125, created 5/11/09 */
+google_ad_slot = "9298106441";
+google_ad_width = 125;
+google_ad_height = 125;
+//-->
+</script>
+<script type="text/javascript"
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>
+</td>
+</tr></table>
+
+<p>
+<button id='addA'>Add event to A</button>
+<button id='remA'>Remove event from A</button>
+<button id='tstA'>Test A</button>
+</p>
+
+<p>
+<button id='addB'>Add event to B</button>
+<button id='remB'>Remove event from B</button>
+<button id='tstB'>Test B</button>
+</p>
+
+</body>
+</html>
diff --git a/examples/html/gradient.jpg b/examples/html/gradient.jpg
new file mode 100644 (file)
index 0000000..5968884
Binary files /dev/null and b/examples/html/gradient.jpg differ
diff --git a/examples/html/gridFromJSarray.html b/examples/html/gridFromJSarray.html
new file mode 100644 (file)
index 0000000..6b99209
--- /dev/null
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 1</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGrid','LiveGridMenu');\r
+\r
+Rico.onLoad( function() {\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5']\r
+  ];\r
+  var opts = {  \r
+    useUnformattedColWidth: false,\r
+    defaultWidth : 90,\r
+    visibleRows  : 'data',\r
+    frozenColumns: 1,\r
+    menuEvent    : 'click',\r
+    columnSpecs  : [{Hdg:'Column 1',type:'number', decPlaces:0, ClassName:'alignright'},\r
+                    {Hdg:'Column 2'},\r
+                    {Hdg:'Column 3'},\r
+                    {Hdg:'Column 4'},\r
+                    {Hdg:'Column 5'}]\r
+  };\r
+  var buffer=new Rico.Buffer.Base();\r
+  buffer.loadRowsFromArray(myData);\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+});\r
+</script>\r
+\r
+\r
+</head>\r
+\r
+<body>\r
+<div id='explanation'>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how to populate a grid from a javascript array.\r
+<pre>\r
+  var myData = [\r
+    [1,'Cell 1:2','Cell 1:3','Cell 1:4','Cell 1:5'],\r
+    [2,'Cell 2:2','Cell 2:3','Cell 2:4','Cell 2:5'],\r
+    [3,'Cell 3:2','Cell 3:3','Cell 3:4','Cell 3:5'],\r
+    [4,'Cell 4:2','Cell 4:3','Cell 4:4','Cell 4:5']\r
+  ];\r
+  var buffer=new Rico.Buffer.Base();\r
+  buffer.loadRowsFromArray(myData);\r
+</pre>\r
+</div>\r
+\r
+<p class="ricoBookmark"><span id="ex1_bookmark">&nbsp;</span></p>\r
+<div id="ex1"></div>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/html/gridFromTable.html b/examples/html/gridFromTable.html
new file mode 100644 (file)
index 0000000..1fda2b2
--- /dev/null
@@ -0,0 +1,211 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 1</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGrid','LiveGridMenu');\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {\r
+    frozenColumns: 1,\r
+    highlightElem: 'cursorRow',\r
+    menuEvent: 'click',\r
+    visibleRows: 'body'\r
+  };\r
+  var buffer=new Rico.Buffer.Base(Rico.$('ex1').tBodies[0]);\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+});\r
+</script>\r
+<style type="text/css">\r
+p.footnote {\r
+  font-size: 8pt;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+<body>\r
+<div id='explanation'>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how to populate a grid from an HTML table.\r
+In this case, the table whose data is to be loaded into the grid\r
+has an id="ex1", and the table's body element is passed\r
+to the buffer constructor which then loads the data.\r
+<pre>\r
+Rico.loadModule('LiveGrid','LiveGridMenu','greenHdg.css');\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {\r
+    frozenColumns: 1,\r
+    highlightElem: 'cursorRow',\r
+    menuEvent: 'click',\r
+    visibleRows: 'body'\r
+  };\r
+  var buffer=new Rico.Buffer.Base(Rico.$('ex1').tBodies[0]);\r
+  var ex1=new Rico.LiveGrid ('ex1', buffer, opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+});\r
+</pre>\r
+</div>\r
+\r
+<p><strong>The Kentucky Derby</strong></p>\r
+<p class="ricoBookmark"><span id="ex1_bookmark">&nbsp;</span></p>\r
+\r
+<table id="ex1" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+<thead>\r
+<tr> <td>Year</td> <td>Horse</td> <td>Jockey</td> </tr> \r
+</thead>\r
+<tbody>\r
+<tr> <td>1875</td> <td>Aristides</td> <td>O. Lewis</td> </tr> \r
+<tr> <td>1876</td> <td>Vagrant</td> <td>B. Swim</td> </tr> \r
+<tr> <td>1877</td> <td>Baden-Baden</td> <td>W. Walker</td> </tr> \r
+<tr> <td>1878</td> <td>Day Star</td> <td>J. Carter</td> </tr> \r
+<tr> <td>1879</td> <td>Lord Murphy</td> <td>C. Shauer</td> </tr> \r
+<tr> <td>1880</td> <td>Fonso</td> <td>G. Lewis</td> </tr> \r
+<tr> <td>1881</td> <td>Hindoo</td> <td>J. McLaughlin</td> </tr> \r
+<tr> <td>1882</td> <td>Apollo</td> <td>B. Hurd</td> </tr> \r
+<tr> <td>1883</td> <td>Leonatus</td> <td>W. Donohue</td> </tr> \r
+<tr> <td>1884</td> <td>Buchanan</td> <td>I. Murphy</td> </tr> \r
+<tr> <td>1885</td> <td>Joe Cotton</td> <td>E. Henderson</td> </tr> \r
+<tr> <td>1886</td> <td>Ben Ali</td> <td>P. Duffy</td> </tr> \r
+<tr> <td>1887</td> <td>Montrose</td> <td>I. Lewis</td> </tr> \r
+<tr> <td>1888</td> <td>Macbeth II</td> <td>G. Covington</td> </tr> \r
+<tr> <td>1889</td> <td>Spokane</td> <td>T. Kiley</td> </tr> \r
+<tr> <td>1890</td> <td>Riley</td> <td>I. Murphy</td> </tr> \r
+<tr> <td>1891</td> <td>Kingman</td> <td>I. Murphy</td> </tr> \r
+<tr> <td>1892</td> <td>Azra</td> <td>A. Clayton</td> </tr> \r
+<tr> <td>1893</td> <td>Lookout</td> <td>E. Kunze</td> </tr> \r
+<tr> <td>1894</td> <td>Chant</td> <td>F. Goodale</td> </tr> \r
+<tr> <td>1895</td> <td>Halma</td> <td>J. Perkins</td> </tr> \r
+<tr> <td>1896</td> <td>Ben Brush</td> <td>W. Simms</td> </tr> \r
+<tr> <td>1897</td> <td>Typhoon II</td> <td>F. Garner</td> </tr> \r
+<tr> <td>1898</td> <td>Plaudit</td> <td>W. Simms</td> </tr> \r
+<tr> <td>1899</td> <td>Manuel</td> <td>F. Taral</td> </tr> \r
+<tr> <td>1900</td> <td>Lieut. Gibson</td> <td>J. Boland</td> </tr> \r
+<tr> <td>1901</td> <td>His Eminence</td> <td>J. Winkfield</td> </tr> \r
+<tr> <td>1902</td> <td>Alan-a-Dale</td> <td>J. Winkfield</td> </tr> \r
+<tr> <td>1903</td> <td>Judge Himes</td> <td>H. Booker</td> </tr> \r
+<tr> <td>1904</td> <td>Elwood</td> <td>F. Prior</td> </tr> \r
+<tr> <td>1905</td> <td>Agile</td> <td>J. Martin</td> </tr> \r
+<tr> <td>1906</td> <td>Sir Huon</td> <td>R. Troxler</td> </tr> \r
+<tr> <td>1907</td> <td>Pink Star</td> <td>A. Minder</td> </tr> \r
+<tr> <td>1908</td> <td>Stone Street</td> <td>A. Pickens</td> </tr> \r
+<tr> <td>1909</td> <td>Wintergreen</td> <td>V. Powers</td> </tr> \r
+<tr> <td>1910</td> <td>Donau</td> <td>F. Herbert</td> </tr> \r
+<tr> <td>1911</td> <td>Meridian</td> <td>G. Archibald</td> </tr> \r
+<tr> <td>1912</td> <td>Worth</td> <td>C.H. Shilling</td> </tr> \r
+<tr> <td>1913</td> <td>Donerail</td> <td>R. Goose</td> </tr> \r
+<tr> <td>1914</td> <td>Old Rosebud</td> <td>J. McCabe</td> </tr> \r
+<tr> <td>1915</td> <td>Regret</td> <td>J. Nolter</td> </tr> \r
+<tr> <td>1916</td> <td>George Smith</td> <td>J. Loftus</td> </tr> \r
+<tr> <td>1917</td> <td>Omar Khayyam</td> <td>C. Borel</td> </tr> \r
+<tr> <td>1918</td> <td>Exterminator</td> <td>W. Knapp</td> </tr> \r
+<tr> <td>1919</td> <td>Sir Barton</td> <td>J. Loftus</td> </tr> \r
+<tr> <td>1920</td> <td>Paul Jones</td> <td>T. Rice</td> </tr> \r
+<tr> <td>1921</td> <td>Behave Yourself</td> <td>C. Thompson</td> </tr> \r
+<tr> <td>1922</td> <td>Morvich</td> <td>A. Johnson</td> </tr> \r
+<tr> <td>1923</td> <td>Zev</td> <td>E. Sande</td> </tr> \r
+<tr> <td>1924</td> <td>Black Gold</td> <td>J.D. Mooney</td> </tr> \r
+<tr> <td>1925</td> <td>Flying Ebony</td> <td>E. Sande</td> </tr> \r
+<tr> <td>1926</td> <td>Bubbling Over</td> <td>A. Johnson</td> </tr> \r
+<tr> <td>1927</td> <td>Whiskery</td> <td>L. McAtee</td> </tr> \r
+<tr> <td>1928</td> <td>Reigh Count</td> <td>C. Lang</td> </tr> \r
+<tr> <td>1929</td> <td>Clyde Van Dusen</td> <td>L. McAtee</td> </tr> \r
+<tr> <td>1930</td> <td>Gallant Fox</td> <td>E. Sande</td> </tr> \r
+<tr> <td>1931</td> <td>Twenty Grand</td> <td>C. Kurtsinger</td> </tr> \r
+<tr> <td>1932</td> <td>Burgoo King</td> <td>E. James</td> </tr> \r
+<tr> <td>1933</td> <td>Brokers Tip</td> <td>D. Meade</td> </tr> \r
+<tr> <td>1934</td> <td>Cavalcade</td> <td>M. Garner</td> </tr> \r
+<tr> <td>1935</td> <td>Omaha</td> <td>W. Saunders</td> </tr> \r
+<tr> <td>1936</td> <td>Bold Venture</td> <td>I. Hanford</td> </tr> \r
+<tr> <td>1937</td> <td>War Admiral</td> <td>C. Kurtsinger</td> </tr> \r
+<tr> <td>1938</td> <td>Lawrin</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1939</td> <td>Johnstown</td> <td>J. Scout</td> </tr> \r
+<tr> <td>1940</td> <td>Gallahadion</td> <td>C. Bierman</td> </tr> \r
+<tr> <td>1941</td> <td>Whirlaway</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1942</td> <td>Shut Out</td> <td>W.D. Wright</td> </tr> \r
+<tr> <td>1943</td> <td>Count Fleet</td> <td>J. Longden</td> </tr> \r
+<tr> <td>1944</td> <td>Pensive</td> <td>C. McCreary</td> </tr> \r
+<tr> <td>1945</td> <td>Hoop Jr.</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1946</td> <td>Assault</td> <td>W. Mehrtens</td> </tr> \r
+<tr> <td>1947</td> <td>Jet Pilot</td> <td>E. Guerin</td> </tr> \r
+<tr> <td>1948</td> <td>Citation</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1949</td> <td>Ponder</td> <td>S. Brooks</td> </tr> \r
+<tr> <td>1950</td> <td>Middleground</td> <td>W. Boland</td> </tr> \r
+<tr> <td>1951</td> <td>Count Turf</td> <td>C. McCreary</td> </tr> \r
+<tr> <td>1952</td> <td>Hill Gail</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1953</td> <td>Dark Star</td> <td>H. Moreno</td> </tr> \r
+<tr> <td>1954</td> <td>Determine</td> <td>R. York</td> </tr> \r
+<tr> <td>1955</td> <td>Swaps</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1956</td> <td>Needles</td> <td>D. Erb</td> </tr> \r
+<tr> <td>1957</td> <td>Iron Liege</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1958</td> <td>Tim Tam</td> <td>I. Valenzuela</td> </tr> \r
+<tr> <td>1959</td> <td>Tomy Lee</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1960</td> <td>Venetian Way</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1961</td> <td>Carry Back</td> <td>J. Sellers</td> </tr> \r
+<tr> <td>1962</td> <td>Decidedly</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1963</td> <td>Chateaugay</td> <td>B. Baeza</td> </tr> \r
+<tr> <td>1964</td> <td>Northern Dancer</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1965</td> <td>Lucky Debonair</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1966</td> <td>Kauai King</td> <td>D. Brumfield</td> </tr> \r
+<tr> <td>1967</td> <td>Proud Clarion</td> <td>R. Ussery</td> </tr> \r
+<tr> <td>1968*</td> <td>Dancer&rsquo;s Image</td> <td>I. Valenzuela</td> </tr> \r
+<tr> <td>1969</td> <td>Majestic Prince</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1970</td> <td>Dust Commander</td> <td>M. Manganello</td> </tr> \r
+<tr> <td>1971</td> <td>Canonero II</td> <td>G. Avila</td> </tr> \r
+<tr> <td>1972</td> <td>Riva Ridge</td> <td>R. Turcotte</td> </tr> \r
+<tr> <td>1973**</td> <td>Secretariat</td> <td>R. Turcotte</td> </tr> \r
+<tr> <td>1974</td> <td>Cannonade</td> <td>A. Cordero, Jr.</td> </tr> \r
+<tr> <td>1975</td> <td>Foolish Pleasure</td> <td>J. Vasquez</td> </tr> \r
+<tr> <td>1976</td> <td>Bold Forbes</td> <td>A. Cordero, Jr.</td> </tr> \r
+<tr> <td>1977</td> <td>Seattle Slew</td> <td>J. Cruguet</td> </tr> \r
+<tr> <td>1978</td> <td>Affirmed</td> <td>S. Cauthen</td> </tr> \r
+<tr> <td>1979</td> <td>Spectacular Bid</td> <td>R. Franklin</td> </tr> \r
+<tr> <td>1980</td> <td>Genuine Risk</td> <td>J. Vasquez</td> </tr> \r
+<tr> <td>1981</td> <td>Pleasant Colony</td> <td>J. Velasquez</td> </tr> \r
+<tr> <td>1982</td> <td>Gato del Sol</td> <td>E. Delahoussaye</td> </tr> \r
+<tr> <td>1983</td> <td>Sunny&rsquo;s Halo</td> <td>E. Delahoussaye</td> </tr> \r
+<tr> <td>1984</td> <td>Swale</td> <td>L. Pincay</td> </tr> \r
+<tr> <td>1985</td> <td>Spend a Buck</td> <td>A. Cordero, Jr.</td> </tr> \r
+<tr> <td>1986</td> <td>Ferdinand</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1987</td> <td>Alysheba</td> <td>C. McCarron</td> </tr> \r
+<tr> <td>1988</td> <td>Winning Colors</td> <td>G. Stevens</td> </tr> \r
+<tr> <td>1989</td> <td>Sunday Silence</td> <td>P. Valenzuela</td> </tr> \r
+<tr> <td>1990</td> <td>Unbridled</td> <td>C. Perret</td> </tr> \r
+<tr> <td>1991</td> <td>Strike the Gold</td> <td>C. Antley</td> </tr> \r
+<tr> <td>1992</td> <td>Lil E. Tee</td> <td>P. Day</td> </tr> \r
+<tr> <td>1993</td> <td>Sea Hero</td> <td>J. Bailey</td> </tr> \r
+<tr> <td>1994</td> <td>Go For Gin</td> <td>C. McCarron</td> </tr> \r
+<tr> <td>1995</td> <td>Thunder Gulch</td> <td>G. Stevens</td> </tr> \r
+<tr> <td>1996</td> <td>Grindstone</td> <td>J. Bailey</td> </tr> \r
+<tr> <td>1997</td> <td>Silver Charm</td> <td>G. Stevens</td> </tr> \r
+<tr> <td>1998</td> <td>Real Quiet</td> <td>K. Desormeaux</td> </tr> \r
+<tr> <td>1999</td> <td>Charismatic</td> <td>C. Antley</td> </tr> \r
+<tr> <td>2000</td> <td>Fusaichi Pegasus</td> <td>K. Desormeaux</td> </tr> \r
+<tr> <td>2001</td> <td>Monarchos</td> <td>J. Chavez</td> </tr> \r
+<tr> <td>2002</td> <td>War Emblem</td> <td>V. Espinoza</td> </tr> \r
+<tr> <td>2003</td> <td>Funny Cide</td> <td>J. Santos</td> </tr> \r
+<tr> <td>2004</td> <td>Smarty Jones</td> <td>S. Elliott</td> </tr> \r
+<tr> <td>2005</td> <td>Giacomo</td> <td>M. Smith</td> </tr> \r
+<tr> <td>2006</td> <td>Barbaro</td> <td>E. Prado</td> </tr> \r
+<tr> <td>2007</td> <td>Street Sense</td> <td>C. Borel</td> </tr> \r
+<tr> <td>2008</td> <td>Big Brown</td> <td>K. Desormeaux</td> </tr> \r
+<tr> <td>2009</td> <td>Mine That Bird</td> <td>C. Borel</td> </tr> \r
+</tbody> \r
+</table>   \r
+\r
+<p class='footnote'>*Dancer&rsquo;s Image disqualified but later reinstated.\r
+<br> **Fastest time&mdash;1 min 59 2/5 s. No other horse has raced the Derby in less than 2 min.</td> \r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/html/gridFromTableResize.html b/examples/html/gridFromTableResize.html
new file mode 100644 (file)
index 0000000..014cb5b
--- /dev/null
@@ -0,0 +1,202 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-User Resize</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGrid','LiveGridMenu');\r
+\r
+var grid;\r
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  var opts = {\r
+    frozenColumns: 1,\r
+    highlightElem: 'cursorRow',\r
+    menuEvent: 'click',\r
+    visibleRows: 'body'\r
+  };\r
+  var buffer=new Rico.Buffer.Base(Rico.$('ex1').tBodies[0]);\r
+  grid=new Rico.LiveGrid ('ex1', buffer, opts);\r
+  grid.menu=new Rico.GridMenu();\r
+});\r
+\r
+function SetGridSize(r) {\r
+  var newsize=grid.setPageSize(r);\r
+}\r
+</script>\r
+<style type="text/css">\r
+p.footnote {\r
+  font-size: 8pt;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+<body>\r
+<div id='explanation'>\r
+Base Library: <span id='BaseLib'></span>\r
+<hr>\r
+This grid is populated from an HTML table.\r
+It can be resized by clicking the various size buttons.\r
+</div>\r
+\r
+<button onclick="SetGridSize(5)">5 rows</button>\r
+<button onclick="SetGridSize(10)">10 rows</button>\r
+<button onclick="SetGridSize(20)">20 rows</button>\r
+\r
+<p><strong>The Kentucky Derby</strong></p>\r
+<p class="ricoBookmark"><span id="ex1_bookmark">&nbsp;</span></p>\r
+\r
+<table id="ex1" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+<thead>\r
+<tr> <td>Year</td> <td>Horse</td> <td>Jockey</td> </tr> \r
+</thead>\r
+<tbody>\r
+<tr> <td>1875</td> <td>Aristides</td> <td>O. Lewis</td> </tr> \r
+<tr> <td>1876</td> <td>Vagrant</td> <td>B. Swim</td> </tr> \r
+<tr> <td>1877</td> <td>Baden-Baden</td> <td>W. Walker</td> </tr> \r
+<tr> <td>1878</td> <td>Day Star</td> <td>J. Carter</td> </tr> \r
+<tr> <td>1879</td> <td>Lord Murphy</td> <td>C. Shauer</td> </tr> \r
+<tr> <td>1880</td> <td>Fonso</td> <td>G. Lewis</td> </tr> \r
+<tr> <td>1881</td> <td>Hindoo</td> <td>J. McLaughlin</td> </tr> \r
+<tr> <td>1882</td> <td>Apollo</td> <td>B. Hurd</td> </tr> \r
+<tr> <td>1883</td> <td>Leonatus</td> <td>W. Donohue</td> </tr> \r
+<tr> <td>1884</td> <td>Buchanan</td> <td>I. Murphy</td> </tr> \r
+<tr> <td>1885</td> <td>Joe Cotton</td> <td>E. Henderson</td> </tr> \r
+<tr> <td>1886</td> <td>Ben Ali</td> <td>P. Duffy</td> </tr> \r
+<tr> <td>1887</td> <td>Montrose</td> <td>I. Lewis</td> </tr> \r
+<tr> <td>1888</td> <td>Macbeth II</td> <td>G. Covington</td> </tr> \r
+<tr> <td>1889</td> <td>Spokane</td> <td>T. Kiley</td> </tr> \r
+<tr> <td>1890</td> <td>Riley</td> <td>I. Murphy</td> </tr> \r
+<tr> <td>1891</td> <td>Kingman</td> <td>I. Murphy</td> </tr> \r
+<tr> <td>1892</td> <td>Azra</td> <td>A. Clayton</td> </tr> \r
+<tr> <td>1893</td> <td>Lookout</td> <td>E. Kunze</td> </tr> \r
+<tr> <td>1894</td> <td>Chant</td> <td>F. Goodale</td> </tr> \r
+<tr> <td>1895</td> <td>Halma</td> <td>J. Perkins</td> </tr> \r
+<tr> <td>1896</td> <td>Ben Brush</td> <td>W. Simms</td> </tr> \r
+<tr> <td>1897</td> <td>Typhoon II</td> <td>F. Garner</td> </tr> \r
+<tr> <td>1898</td> <td>Plaudit</td> <td>W. Simms</td> </tr> \r
+<tr> <td>1899</td> <td>Manuel</td> <td>F. Taral</td> </tr> \r
+<tr> <td>1900</td> <td>Lieut. Gibson</td> <td>J. Boland</td> </tr> \r
+<tr> <td>1901</td> <td>His Eminence</td> <td>J. Winkfield</td> </tr> \r
+<tr> <td>1902</td> <td>Alan-a-Dale</td> <td>J. Winkfield</td> </tr> \r
+<tr> <td>1903</td> <td>Judge Himes</td> <td>H. Booker</td> </tr> \r
+<tr> <td>1904</td> <td>Elwood</td> <td>F. Prior</td> </tr> \r
+<tr> <td>1905</td> <td>Agile</td> <td>J. Martin</td> </tr> \r
+<tr> <td>1906</td> <td>Sir Huon</td> <td>R. Troxler</td> </tr> \r
+<tr> <td>1907</td> <td>Pink Star</td> <td>A. Minder</td> </tr> \r
+<tr> <td>1908</td> <td>Stone Street</td> <td>A. Pickens</td> </tr> \r
+<tr> <td>1909</td> <td>Wintergreen</td> <td>V. Powers</td> </tr> \r
+<tr> <td>1910</td> <td>Donau</td> <td>F. Herbert</td> </tr> \r
+<tr> <td>1911</td> <td>Meridian</td> <td>G. Archibald</td> </tr> \r
+<tr> <td>1912</td> <td>Worth</td> <td>C.H. Shilling</td> </tr> \r
+<tr> <td>1913</td> <td>Donerail</td> <td>R. Goose</td> </tr> \r
+<tr> <td>1914</td> <td>Old Rosebud</td> <td>J. McCabe</td> </tr> \r
+<tr> <td>1915</td> <td>Regret</td> <td>J. Nolter</td> </tr> \r
+<tr> <td>1916</td> <td>George Smith</td> <td>J. Loftus</td> </tr> \r
+<tr> <td>1917</td> <td>Omar Khayyam</td> <td>C. Borel</td> </tr> \r
+<tr> <td>1918</td> <td>Exterminator</td> <td>W. Knapp</td> </tr> \r
+<tr> <td>1919</td> <td>Sir Barton</td> <td>J. Loftus</td> </tr> \r
+<tr> <td>1920</td> <td>Paul Jones</td> <td>T. Rice</td> </tr> \r
+<tr> <td>1921</td> <td>Behave Yourself</td> <td>C. Thompson</td> </tr> \r
+<tr> <td>1922</td> <td>Morvich</td> <td>A. Johnson</td> </tr> \r
+<tr> <td>1923</td> <td>Zev</td> <td>E. Sande</td> </tr> \r
+<tr> <td>1924</td> <td>Black Gold</td> <td>J.D. Mooney</td> </tr> \r
+<tr> <td>1925</td> <td>Flying Ebony</td> <td>E. Sande</td> </tr> \r
+<tr> <td>1926</td> <td>Bubbling Over</td> <td>A. Johnson</td> </tr> \r
+<tr> <td>1927</td> <td>Whiskery</td> <td>L. McAtee</td> </tr> \r
+<tr> <td>1928</td> <td>Reigh Count</td> <td>C. Lang</td> </tr> \r
+<tr> <td>1929</td> <td>Clyde Van Dusen</td> <td>L. McAtee</td> </tr> \r
+<tr> <td>1930</td> <td>Gallant Fox</td> <td>E. Sande</td> </tr> \r
+<tr> <td>1931</td> <td>Twenty Grand</td> <td>C. Kurtsinger</td> </tr> \r
+<tr> <td>1932</td> <td>Burgoo King</td> <td>E. James</td> </tr> \r
+<tr> <td>1933</td> <td>Brokers Tip</td> <td>D. Meade</td> </tr> \r
+<tr> <td>1934</td> <td>Cavalcade</td> <td>M. Garner</td> </tr> \r
+<tr> <td>1935</td> <td>Omaha</td> <td>W. Saunders</td> </tr> \r
+<tr> <td>1936</td> <td>Bold Venture</td> <td>I. Hanford</td> </tr> \r
+<tr> <td>1937</td> <td>War Admiral</td> <td>C. Kurtsinger</td> </tr> \r
+<tr> <td>1938</td> <td>Lawrin</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1939</td> <td>Johnstown</td> <td>J. Scout</td> </tr> \r
+<tr> <td>1940</td> <td>Gallahadion</td> <td>C. Bierman</td> </tr> \r
+<tr> <td>1941</td> <td>Whirlaway</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1942</td> <td>Shut Out</td> <td>W.D. Wright</td> </tr> \r
+<tr> <td>1943</td> <td>Count Fleet</td> <td>J. Longden</td> </tr> \r
+<tr> <td>1944</td> <td>Pensive</td> <td>C. McCreary</td> </tr> \r
+<tr> <td>1945</td> <td>Hoop Jr.</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1946</td> <td>Assault</td> <td>W. Mehrtens</td> </tr> \r
+<tr> <td>1947</td> <td>Jet Pilot</td> <td>E. Guerin</td> </tr> \r
+<tr> <td>1948</td> <td>Citation</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1949</td> <td>Ponder</td> <td>S. Brooks</td> </tr> \r
+<tr> <td>1950</td> <td>Middleground</td> <td>W. Boland</td> </tr> \r
+<tr> <td>1951</td> <td>Count Turf</td> <td>C. McCreary</td> </tr> \r
+<tr> <td>1952</td> <td>Hill Gail</td> <td>E. Arcaro</td> </tr> \r
+<tr> <td>1953</td> <td>Dark Star</td> <td>H. Moreno</td> </tr> \r
+<tr> <td>1954</td> <td>Determine</td> <td>R. York</td> </tr> \r
+<tr> <td>1955</td> <td>Swaps</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1956</td> <td>Needles</td> <td>D. Erb</td> </tr> \r
+<tr> <td>1957</td> <td>Iron Liege</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1958</td> <td>Tim Tam</td> <td>I. Valenzuela</td> </tr> \r
+<tr> <td>1959</td> <td>Tomy Lee</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1960</td> <td>Venetian Way</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1961</td> <td>Carry Back</td> <td>J. Sellers</td> </tr> \r
+<tr> <td>1962</td> <td>Decidedly</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1963</td> <td>Chateaugay</td> <td>B. Baeza</td> </tr> \r
+<tr> <td>1964</td> <td>Northern Dancer</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1965</td> <td>Lucky Debonair</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1966</td> <td>Kauai King</td> <td>D. Brumfield</td> </tr> \r
+<tr> <td>1967</td> <td>Proud Clarion</td> <td>R. Ussery</td> </tr> \r
+<tr> <td>1968*</td> <td>Dancer&rsquo;s Image</td> <td>I. Valenzuela</td> </tr> \r
+<tr> <td>1969</td> <td>Majestic Prince</td> <td>W. Hartack</td> </tr> \r
+<tr> <td>1970</td> <td>Dust Commander</td> <td>M. Manganello</td> </tr> \r
+<tr> <td>1971</td> <td>Canonero II</td> <td>G. Avila</td> </tr> \r
+<tr> <td>1972</td> <td>Riva Ridge</td> <td>R. Turcotte</td> </tr> \r
+<tr> <td>1973**</td> <td>Secretariat</td> <td>R. Turcotte</td> </tr> \r
+<tr> <td>1974</td> <td>Cannonade</td> <td>A. Cordero, Jr.</td> </tr> \r
+<tr> <td>1975</td> <td>Foolish Pleasure</td> <td>J. Vasquez</td> </tr> \r
+<tr> <td>1976</td> <td>Bold Forbes</td> <td>A. Cordero, Jr.</td> </tr> \r
+<tr> <td>1977</td> <td>Seattle Slew</td> <td>J. Cruguet</td> </tr> \r
+<tr> <td>1978</td> <td>Affirmed</td> <td>S. Cauthen</td> </tr> \r
+<tr> <td>1979</td> <td>Spectacular Bid</td> <td>R. Franklin</td> </tr> \r
+<tr> <td>1980</td> <td>Genuine Risk</td> <td>J. Vasquez</td> </tr> \r
+<tr> <td>1981</td> <td>Pleasant Colony</td> <td>J. Velasquez</td> </tr> \r
+<tr> <td>1982</td> <td>Gato del Sol</td> <td>E. Delahoussaye</td> </tr> \r
+<tr> <td>1983</td> <td>Sunny&rsquo;s Halo</td> <td>E. Delahoussaye</td> </tr> \r
+<tr> <td>1984</td> <td>Swale</td> <td>L. Pincay</td> </tr> \r
+<tr> <td>1985</td> <td>Spend a Buck</td> <td>A. Cordero, Jr.</td> </tr> \r
+<tr> <td>1986</td> <td>Ferdinand</td> <td>W. Shoemaker</td> </tr> \r
+<tr> <td>1987</td> <td>Alysheba</td> <td>C. McCarron</td> </tr> \r
+<tr> <td>1988</td> <td>Winning Colors</td> <td>G. Stevens</td> </tr> \r
+<tr> <td>1989</td> <td>Sunday Silence</td> <td>P. Valenzuela</td> </tr> \r
+<tr> <td>1990</td> <td>Unbridled</td> <td>C. Perret</td> </tr> \r
+<tr> <td>1991</td> <td>Strike the Gold</td> <td>C. Antley</td> </tr> \r
+<tr> <td>1992</td> <td>Lil E. Tee</td> <td>P. Day</td> </tr> \r
+<tr> <td>1993</td> <td>Sea Hero</td> <td>J. Bailey</td> </tr> \r
+<tr> <td>1994</td> <td>Go For Gin</td> <td>C. McCarron</td> </tr> \r
+<tr> <td>1995</td> <td>Thunder Gulch</td> <td>G. Stevens</td> </tr> \r
+<tr> <td>1996</td> <td>Grindstone</td> <td>J. Bailey</td> </tr> \r
+<tr> <td>1997</td> <td>Silver Charm</td> <td>G. Stevens</td> </tr> \r
+<tr> <td>1998</td> <td>Real Quiet</td> <td>K. Desormeaux</td> </tr> \r
+<tr> <td>1999</td> <td>Charismatic</td> <td>C. Antley</td> </tr> \r
+<tr> <td>2000</td> <td>Fusaichi Pegasus</td> <td>K. Desormeaux</td> </tr> \r
+<tr> <td>2001</td> <td>Monarchos</td> <td>J. Chavez</td> </tr> \r
+<tr> <td>2002</td> <td>War Emblem</td> <td>V. Espinoza</td> </tr> \r
+<tr> <td>2003</td> <td>Funny Cide</td> <td>J. Santos</td> </tr> \r
+<tr> <td>2004</td> <td>Smarty Jones</td> <td>S. Elliott</td> </tr> \r
+<tr> <td>2005</td> <td>Giacomo</td> <td>M. Smith</td> </tr> \r
+<tr> <td>2006</td> <td>Barbaro</td> <td>E. Prado</td> </tr> \r
+<tr> <td>2007</td> <td>Street Sense</td> <td>C. Borel</td> </tr> \r
+<tr> <td>2008</td> <td>Big Brown</td> <td>K. Desormeaux</td> </tr> \r
+<tr> <td>2009</td> <td>Mine That Bird</td> <td>C. Borel</td> </tr> \r
+</tbody> \r
+</table>   \r
+\r
+<p class='footnote'>*Dancer&rsquo;s Image disqualified but later reinstated.\r
+<br> **Fastest time&mdash;1 min 59 2/5 s. No other horse has raced the Derby in less than 2 min.</td> \r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/html/gridJSbuffer.html b/examples/html/gridJSbuffer.html
new file mode 100644 (file)
index 0000000..aca717d
--- /dev/null
@@ -0,0 +1,90 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-JavaScript Buffer</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var grid, buffer;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    frozenColumns : 1,
+    useUnformattedColWidth: false,\r
+    menuEvent: 'click',\r
+    columnSpecs  : [{width:200}]\r
+  };\r
+  buffer=new Rico.Buffer.AjaxXML(jsfetch);\r
+  grid=new Rico.LiveGrid ('jsgrid', buffer, opts);\r
+  grid.menu=new Rico.GridMenu();\r
+});\r
+\r
+function jsfetch(options) {\r
+  Rico.writeDebugMsg("jsfetch");\r
+  var newRows=[];\r
+  var offset=options.parameters.offset;\r
+  for (var r=0; r<100; r++) {\r
+    var row=[];\r
+    row.push(new Date().toString());\r
+    row.push(offset.toString());\r
+    for (var c=2; c<5; c++)\r
+      row.push('cell '+r+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows);
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell { white-space: nowrap; }\r
+</style>\r
+</head>\r
+\r
+<body>\r
+<div id='explanation'>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how to substitute a javascript\r
+call for an AJAX request in the AjaxXML buffer. Rather than\r
+passing a string containing the url to the data provider,\r
+you pass a function to the Rico.Buffer.AjaxXML constructor.\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxXML(<strong>jsfetch</strong>);\r
+function <strong>jsfetch</strong>(options) {\r
+  Rico.writeDebugMsg("jsfetch");\r
+  var newRows=[], offset=options.parameters.offset;\r
+  for (var r=0; r<100; r++) {\r
+    var row=[];\r
+    row.push(offset.toString());\r
+    row.push(new Date().toString());\r
+    for (var c=2; c<5; c++) row.push('cell '+r+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows);
+}\r
+</pre>\r
+</div>\r
+\r
+<p class="ricoBookmark"><span id="jsgrid_bookmark">&nbsp;</span></p>\r
+<table id="jsgrid" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+  <tr>\r
+         <th>Time of Data Fetch</th>\r
+         <th>Offset</th>\r
+         <th>Column 3</th>\r
+         <th>Column 4</th>\r
+         <th>Column 5</th>\r
+  </tr>\r
+</table>\r
+\r
+<!--\r
+<textarea id='jsgrid_debugmsgs' rows='5' cols='100' style='font-size:x-small;'></textarea>\r
+-->\r
+</body>\r
+</html>\r
diff --git a/examples/html/gridJSbuffer2.html b/examples/html/gridJSbuffer2.html
new file mode 100644 (file)
index 0000000..8e7f2cf
--- /dev/null
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-JavaScript Buffer</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var grid, buffer;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    frozenColumns : 1,
+    useUnformattedColWidth: false,\r
+    menuEvent: 'click',\r
+    columnSpecs  : [{width:200}]\r
+  };\r
+  buffer=new Rico.Buffer.AjaxSQL(jsfetch);\r
+  grid=new Rico.LiveGrid ('jsgrid', buffer, opts);\r
+  grid.menu=new Rico.GridMenu();\r
+});\r
+\r
+function jsfetch(options) {\r
+  Rico.writeDebugMsg("jsfetch");\r
+  var newRows=[], totrows=500;\r
+  var offset=options.parameters.offset;\r
+  var limit=Math.min(totrows-offset,options.parameters.page_size)\r
+  for (var r=0; r<limit; r++) {\r
+    var row=[];\r
+    row.push(new Date().toString());\r
+    row.push(offset.toString());\r
+    for (var c=2; c<5; c++)\r
+      row.push('cell '+(r+offset)+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows,false,totrows);
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell { white-space: nowrap; }\r
+</style>\r
+</head>\r
+\r
+<body>\r
+<div id='explanation'>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how to substitute a javascript\r
+call for an AJAX request in the AjaxSQL buffer. Rather than\r
+passing a string containing the url to the data provider,\r
+you pass a function to the Rico.Buffer.AjaxSQL constructor.\r
+<pre>\r
+buffer=new Rico.Buffer.AjaxSQL(<strong>jsfetch</strong>);\r
+function <strong>jsfetch</strong>(options) {\r
+  var newRows=[], totrows=500;\r
+  var offset=options.parameters.offset;\r
+  var limit=Math.min(totrows-offset,options.parameters.page_size)\r
+  for (var r=0; r&lt;limit; r++) {\r
+    var row=[];\r
+    row.push(new Date().toString());\r
+    row.push(offset.toString());\r
+    for (var c=2; c&lt;5; c++) row.push('cell '+(r+offset)+':'+c);\r
+    newRows.push(row);\r
+  }\r
+  options.onComplete(newRows,false,totrows);
+}\r
+</pre>\r
+</div>\r
+\r
+<p class="ricoBookmark"><span id="jsgrid_bookmark">&nbsp;</span></p>\r
+<table id="jsgrid" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+  <tr>\r
+         <th>Time of Data Fetch</th>\r
+         <th>Offset</th>\r
+         <th>Column 3</th>\r
+         <th>Column 4</th>\r
+         <th>Column 5</th>\r
+  </tr>\r
+</table>\r
+\r
+<!--\r
+<textarea id='jsgrid_debugmsgs' rows='5' cols='100' style='font-size:x-small;'></textarea>\r
+-->\r
+</body>\r
+</html>\r
diff --git a/examples/html/index.html b/examples/html/index.html
new file mode 100644 (file)
index 0000000..8383d34
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\r
+<html>\r
+<HEAD>\r
+<title>Rico 3.0 HTML Examples</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+</HEAD>\r
+<frameset cols="300, *">\r
+  <frame name="menu" src="menu.html">\r
+  <frame name="content" src="../welcome.html" scrolling="yes">\r
+</frameset>\r
+</html>\r
diff --git a/examples/html/menu.html b/examples/html/menu.html
new file mode 100644 (file)
index 0000000..b0e015b
--- /dev/null
@@ -0,0 +1,218 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
+<html>\r
+<head>\r
+<title>Rico 3.0</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<base target="content">\r
+\r
+<script src="../../ricoClient/js/baselibs/prototype.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico2Proto.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<link href="../../ricoClient/css/rico.css" type="text/css" rel="stylesheet" />\r
+\r
+<script src="../menu.js" type="text/javascript"></script>\r
+<link href="../menu.css" type="text/css" rel="stylesheet">\r
+\r
+<!--[if lt IE 7]>\r
+  <style type="text/css">\r
+ul li {
+   height: 1%;\r
+}
+ </style>\r
+<![endif]-->\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<div id="menuheader">
+<p>Rico <span id='RicoVersion'></span> <span id='RicoDir'></span> Demo</p>\r
+</div>
+\r
+<div class='top'>\r
+<form action='' method='get' id='form1'>\r
+<ul>\r
+<li id='demolist'>Example: <span id='demospan'></span>\r
+<li>Theme: <span id='themespan'></span><input type='hidden' name='theme' id='theme' value=''>\r
+<li>Base Lib: <span id='libspan'></span><input type='hidden' name='lib' id='lib' value=''>\r
+<li><input type='checkbox' name='log'>&nbsp; Enable logging\r
+</ul>\r
+</form>\r
+</div>\r
+\r
+\r
+<div id="accordion1">\r
+\r
+<div>\r
+  <div>Choose the Example</div>\r
+  <div>\r
+\r
+<p>Accordions &amp; Tabs\r
+<ul>\r
+<li><a id="demo_accordion0.html">Basic Accordion</a>\r
+<li><a id="demo_accordion3.html">Nested accordions</a>\r
+<li><a id="demo_accordion4.html">Accordion with memory</a>\r
+<li><a id="demo_panel1.html">Tabbed panel - fixed height</a>\r
+<li><a id="demo_panel2.html">Tabbed panel - variable height</a>\r
+</ul>\r
+\r
+<p>Drag and Drop\r
+<ul>\r
+<li><a id="demo_drag-and-drop-simple.html">Drag &amp; Drop-Simple</a>\r
+<li><a id="demo_drag-and-drop-dyn.html">Drag &amp; Drop-dynamically created drop zones</a>\r
+<li><a id="demo_drag-and-drop-log.html">Drag &amp; Drop-log from/to elements</a>\r
+<li><a id="demo_drag-and-drop-zones.html">Drag &amp; Drop-multiple zones</a>\r
+<li><a id="demo_drag-and-drop-grid.html">Drag &amp; Drop between LiveGrids</a>\r
+</ul>\r
+\r
+<p>Grids\r
+<ul>\r
+<li><a id="demo_gridFromJSarray.html">LiveGrid populated from a javascript array</a>\r
+<li><a id="demo_gridFromTable.html">LiveGrid populated from an HTML table</a>\r
+<li><a id="demo_gridFromTableResize.html">LiveGrid that can be resized by the user</a>\r
+<li><a id="demo_gridJSbuffer.html">LiveGrid with AjaxXML buffer and javascript callback</a>\r
+<li><a id="demo_gridJSbuffer2.html">LiveGrid with AjaxSQL buffer and javascript callback</a>\r
+<li><a id="demo_accordion-grid.html">LiveGrids in an accordion</a>\r
+</ul>\r
+\r
+<p>Animation\r
+<ul>\r
+<li><a id="demo_animation-effects.html">Basic Animation</a>\r
+<li><a id="demo_animate-rico.html">Animated Logo</a>\r
+<li><a id="demo_pull-down.html">Animated Pull-down</a>\r
+</ul>\r
+\r
+<p>Unit Tests\r
+<ul>\r
+<li><a id="demo_classTest.html">Classes and dimensions</a>\r
+<li><a id="demo_events.html">Events</a>\r
+<li><a id="demo_cssSelect.html">CSS selection</a>\r
+<li><a id="demo_corners.html">Corners</a>\r
+<li><a id="demo_corners2.html">Corners using color names</a>\r
+<li><a id="demo_shadow.html">Shadows</a>\r
+<li><a id="demo_controls.html">Calendar, Color-picker, and popup window controls</a>\r
+<li><a id="demo_popups.html">Auto-sizing popup windows</a>\r
+</ul>\r
+\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Theme</div>\r
+  <div>\r
+  <table border='0'>\r
+  <tr>\r
+  <td>Themeroller<br>Themes</td><td>Rico<br>Themes</td>\r
+  </tr>\r
+  <tr valign='top'>\r
+  <td>\r
+\r
+    <ul>\r
+<li><a id="theme_j-ui-lightness"><img src="../images/themeroller/theme_30_ui_light.png" alt="UI Lightness" title="UI Lightness" />\r
+<br><span class="themeName">UI lightness</span></a></li>\r
+\r
+<li><a id="theme_j-ui-darkness"><img src="../images/themeroller/theme_30_ui_dark.png" alt="UI Darkness" title="UI Darkness" />\r
+<br><span class="themeName">UI darkness</span></a></li>\r
+\r
+<li><a id="theme_j-smoothness"><img src="../images/themeroller/theme_30_smoothness.png" alt="Smoothness" title="Smoothness" />\r
+<br><span class="themeName">Smoothness</span></a></li>\r
+\r
+<li><a id="theme_j-start"><img src="../images/themeroller/theme_30_start_menu.png" alt="Start" title="Start" />\r
+<br><span class="themeName">Start</span></a></li>\r
+\r
+<li><a id="theme_j-redmond"><img src="../images/themeroller/theme_30_windoze.png" alt="Redmond" title="Redmond" />\r
+<br><span class="themeName">Redmond</span></a></li>\r
+\r
+<li><a id="theme_j-sunny"><img src="../images/themeroller/theme_30_sunny.png" alt="Sunny" title="Sunny" />\r
+<br><span class="themeName">Sunny</span></a></li>\r
+\r
+<li><a  id="theme_j-overcast"><img src="../images/themeroller/theme_30_overcast.png" alt="Overcast" title="Overcast" />\r
+<br><span class="themeName">Overcast</span></a></li>\r
+\r
+<li><a  id="theme_j-le-frog"><img src="../images/themeroller/theme_30_le_frog.png" alt="Le Frog" title="Le Frog" />\r
+<br><span class="themeName">Le Frog</span></a></li>\r
+\r
+<li><a  id="theme_j-flick"><img src="../images/themeroller/theme_30_flick.png" alt="Flick" title="Flick" />\r
+<br><span class="themeName">Flick</span></a></li>\r
+\r
+<li><a  id="theme_j-pepper-grinder"><img src="../images/themeroller/theme_30_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" />\r
+<br><span class="themeName">Pepper Grinder</span></a></li>\r
+\r
+<li><a  id="theme_j-eggplant"><img src="../images/themeroller/theme_30_eggplant.png" alt="Eggplant" title="Eggplant" />\r
+<br><span class="themeName">Eggplant</span></a></li>\r
+\r
+<li><a  id="theme_j-dark-hive"><img src="../images/themeroller/theme_30_dark_hive.png" alt="Dark Hive" title="Dark Hive" />\r
+<br><span class="themeName">Dark Hive</span></a></li>\r
+\r
+<li><a  id="theme_j-cupertino"><img src="../images/themeroller/theme_30_cupertino.png" alt="Cupertino" title="Cupertino" />\r
+<br><span class="themeName">Cupertino</span></a></li>\r
+\r
+<li><a  id="theme_j-south-street"><img src="../images/themeroller/theme_30_south_street.png" alt="South St" title="South St" />\r
+<br><span class="themeName">South Street</span></a></li>\r
+\r
+<li><a  id="theme_j-blitzer"><img src="../images/themeroller/theme_30_blitzer.png" alt="Blitzer" title="Blitzer" />\r
+<br><span class="themeName">Blitzer</span></a></li>    \r
+\r
+<li><a  id="theme_j-humanity"><img src="../images/themeroller/theme_30_humanity.png" alt="Humanity" title="Humanity" />\r
+<br><span class="themeName">Humanity</span></a></li>\r
+\r
+<li><a  id="theme_j-hot-sneaks"><img src="../images/themeroller/theme_30_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" />\r
+<br><span class="themeName">Hot sneaks</span></a></li>\r
+\r
+<li><a  id="theme_j-excite-bike"><img src="../images/themeroller/theme_30_excite_bike.png" alt="Excite Bike" title="Excite Bike" />\r
+<br><span class="themeName">Excite Bike</span></a></li>\r
+\r
+<li><a  id="theme_j-vader"><img src="../images/themeroller/theme_30_black_matte.png" alt="Vader" title="Vader" />\r
+<br><span class="themeName">Vader</span></a></li>\r
+\r
+<li><a  id="theme_j-dot-luv"><img src="../images/themeroller/theme_30_dot_luv.png" alt="Dot Luv" title="Dot Luv" />\r
+<br><span class="themeName">Dot Luv</span></a></li>\r
+\r
+<li><a  id="theme_j-mint-choc"><img src="../images/themeroller/theme_30_mint_choco.png" alt="Mint Choc" title="Mint Choc" />\r
+<br><span class="themeName">Mint Choc</span></a></li>\r
+\r
+<li><a  id="theme_j-black-tie"><img src="../images/themeroller/theme_30_black_tie.png" alt="Black Tie" title="Black Tie" />\r
+<br><span class="themeName">Black Tie</span></a></li>\r
+\r
+<li><a  id="theme_j-trontastic"><img src="../images/themeroller/theme_30_trontastic.png" alt="Trontastic" title="Trontastic" />\r
+<br><span class="themeName">Trontastic</span></a></li>\r
+\r
+<li><a  id="theme_j-swanky-purse"><img src="../images/themeroller/theme_30_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" />\r
+<br><span class="themeName">Swanky Purse</span></a></li>\r
+    </ul>\r
+\r
+    </td><td>\r
+\r
+    <ul>\r
+  <li><a id='theme_r-greenHdg'>Green Heading</a></li>\r
+  <li><a id='theme_r-warmfall'>Warm Fall</a></li>\r
+  <li><a id='theme_r-seaglass'>Sea Glass</a></li>\r
+  <li><a id='theme_r-coffee-with-milk'>Coffee with milk</a></li>\r
+  <li><a id='theme_r-grayedout'>Grayed out</a></li>\r
+    </ul>\r
+\r
+  </td>\r
+  </tr>\r
+  </table>\r
+\r
+\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Base Library</div>\r
+  <div>\r
+<ul>\r
+<li><a id='lib_proto'>Prototype</a>\r
+<li><a id='lib_jquery'>jQuery</a>\r
+<li><a id='lib_moo'>MooTools</a>\r
+<li><a id='lib_dojo'>dojo</a>\r
+<li><a id='lib_ext'>Ext</a>\r
+<li><a id='lib_glow'>Glow</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+</div>\r
+</body></html>\r
diff --git a/examples/html/panel1.html b/examples/html/panel1.html
new file mode 100644 (file)
index 0000000..bb9d054
--- /dev/null
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico Tabbed Panel Example</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Accordion','Corner');\r
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  new Rico.TabbedPanel( 'tab1', {panelHeight  : 200});
+});
+</script>\r
+
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#tab1 {
+  width: 650px;\r
+  font-size:small;\r
+}\r
+.Rico_tabContentContainer {\r
+  font-size:small;\r
+}
+</style>
+</head>
+
+<body>
+
+<h1>Rico Tabbed Panel - Fixed Height</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span></p>\r
+\r
+<div id='tab1'>
+   <ul>
+     <li>Overview</li>
+     <li>HTML Code</li>
+     <li>Rico Code</li>
+   </ul>
+
+   <div>
+     <div>
+      <br>This example illustrates how to use Rico.TabbedPanel to transform a set of 
+      divs into a first class tabbed panel component.<br><br>
+     The Rico.TabbedPanel is actually a very simple component built off of Rico behaviors and effects.
+     It adds the necessary event handlers on the respective divs to handle the visual aspects of switching tabs.
+     </div>
+     <div>
+     <br>The HTML structure for tabbed panels is an outer div that contains an unordered list (ul)\r
+     to contain the titles and a div to contain the contents.  Inside the unordered list is a LI element for each title.\r
+     Inside the content container is a DIV element for each panel. Make sure the number of LI title elements\r
+     matches the number of panel content DIV elements!\r
+     <br><br>If you are only using Rico themes, then alternatively, you can use DIV elements instead of UL/LI\r
+     elements to specify the titles. This method is compatible with older versions of Rico.
+  <pre>\r
+  &lt;div id="tabContainer"&gt;
+    &lt;ul&gt;
+      &lt;li&gt;Title 1\r
+      &lt;li&gt;Title 2\r
+      &lt;li&gt;Title 3\r
+    &lt;/ul&gt;
+    &lt;div&gt;
+      &lt;div&gt;\r
+        Content 1 ...\r
+      &lt;/div&gt;\r
+      &lt;div&gt;\r
+        Content 2 ...\r
+      &lt;/div&gt;\r
+      &lt;div&gt;\r
+        Content 3 ...\r
+      &lt;/div&gt;\r
+    &lt;/div&gt;
+  &lt;/div&gt;
+  </pre>
+          </div>
+          <div>
+          <br>To attach the tabbed panel behavior to the tabbed panel container div, construct a Rico.TabbedPanel
+      object and pass the id of the outer div to it.  This is a bit different than the previous versions.  \r
+<pre>
+  new Rico.TabbedPanel( 'tabContainer', {panelHeight  : 200});
+</pre>
+    There are many other configuration parameters that can be specified to modify various visual aspects of the
+    tabbed panel. The panelHeight is the attribute that is most commonly overridden.
+    </div>
+  </div>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/html/panel2.html b/examples/html/panel2.html
new file mode 100644 (file)
index 0000000..ceea670
--- /dev/null
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico Tabbed Panel Example</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Accordion','Corner');\r
+Rico.onLoad( function() {\r
+  var label=Rico.$('BaseLib');\r
+  if (label) label.innerHTML=Rico.Lib+' '+Rico.LibVersion;\r
+  new Rico.TabbedPanel( 'tab1');
+});
+</script>\r
+
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#tab1 {
+  width: 650px;\r
+  font-size:small;\r
+}\r
+.Rico_tabContentContainer {\r
+  font-size:small;\r
+}
+</style>
+</head>
+
+<body>
+
+<h1>Rico Tabbed Panel - Variable Height</h1>
+\r
+<p id='libname'>Base Library: <span id='BaseLib'></span></p>\r
+\r
+<div id='tab1'>
+   <ul>
+     <li>Overview</li>
+     <li>HTML Code</li>
+     <li>Rico Code</li>
+   </ul>
+
+   <div>
+     <div>
+      <br>This example illustrates how to use Rico.TabbedPanel to transform a set of 
+      divs into a first class tabbed panel component.<br><br>
+     The Rico.TabbedPanel is actually a very simple component built off of Rico behaviors and effects.
+     It adds the necessary event handlers on the respective divs to handle the visual aspects of switching tabs.
+     </div>
+     <div>
+     <br>The HTML structure for tabbed panels is an outer div that contains an unordered list (ul)\r
+     to contain the titles and a div to contain the contents.  Inside the unordered list is a LI element for each title.\r
+     Inside the content container is a DIV element for each panel. Make sure the number of LI title elements\r
+     matches the number of panel content DIV elements!\r
+     <br><br>If you are only using Rico themes, then alternatively, you can use DIV elements instead of UL/LI\r
+     elements to specify the titles. This method is compatible with older versions of Rico.
+  <pre>\r
+  &lt;div id="tabContainer"&gt;
+    &lt;ul&gt;
+      &lt;li&gt;Title 1\r
+      &lt;li&gt;Title 2\r
+      &lt;li&gt;Title 3\r
+    &lt;/ul&gt;
+    &lt;div&gt;
+      &lt;div&gt;\r
+        Content 1 ...\r
+      &lt;/div&gt;\r
+      &lt;div&gt;\r
+        Content 2 ...\r
+      &lt;/div&gt;\r
+      &lt;div&gt;\r
+        Content 3 ...\r
+      &lt;/div&gt;\r
+    &lt;/div&gt;
+  &lt;/div&gt;
+  </pre>
+          </div>
+          <div>
+          <br>To attach the tabbed panel behavior to the tabbed panel container div, construct a Rico.TabbedPanel
+      object and pass the id of the outer div to it.  This is a bit different than the previous versions.  \r
+<pre>
+  new Rico.TabbedPanel( 'tabContainer');
+</pre>
+    There are many other configuration parameters that can be specified to modify various visual aspects of the
+    tabbed panel. The panelHeight is the attribute that is most commonly overridden.
+    </div>
+  </div>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/html/popups.html b/examples/html/popups.html
new file mode 100644 (file)
index 0000000..2c54498
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico: Auto-sizing Window</title>\r
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+var popup;\r
+\r
+Rico.onLoad( function() {\r
+  Rico.eventBind('btnWinCreate',"click", Rico.eventHandle(window,'DisplayText'));\r
+  Rico.eventBind('btnSmall',"click", Rico.eventHandle(window,'setSmall'));\r
+  Rico.eventBind('btnMedium',"click", Rico.eventHandle(window,'setMedium'));\r
+  Rico.eventBind('btnLarge',"click", Rico.eventHandle(window,'setLarge'));\r
+  Rico.$('btnWinCreate').disabled=false;\r
+  Rico.$('btnSmall').disabled=true;\r
+  Rico.$('btnMedium').disabled=true;\r
+  Rico.$('btnLarge').disabled=true;\r
+  Rico.log('onLoad finished');\r
+});\r
+\r
+function setSmall(e) {\r
+  popup.setContent("<table border='1' cellpadding='10'><tr><td>A<td>B<tr><td>C<td>D</table>");\r
+}\r
+\r
+function setMedium(e) {\r
+  popup.setContent("<p><input type='text'><p><input type='text'>");\r
+}\r
+\r
+function setLarge(e) {\r
+  popup.setContent("<p><input type='text'>&nbsp;&nbsp;<input type='text'><p><input type='text'>&nbsp;&nbsp;<input type='text'><p><input type='text'>&nbsp;&nbsp;<input type='text'>");\r
+}\r
+\r
+function DisplayText(e) {\r
+  Rico.eventStop(e);\r
+  var options={\r
+    hideOnClick: false,\r
+    overflow   : 'auto'\r
+  };\r
+  popup=new Rico.Window('Auto-sizing Window',options);\r
+  popup.setContent('Hello World!');\r
+  popup.openPopup(100,250);\r
+  Rico.eventElement(e).disabled=true;\r
+  Rico.$('btnSmall').disabled=false;\r
+  Rico.$('btnMedium').disabled=false;\r
+  Rico.$('btnLarge').disabled=false;\r
+}\r
+</script>\r
+
+</head>\r
+\r
+\r
+<body>
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p>This example displays an dialog window, then allows you to change the window contents - demonstrating how the window automatically resizes.\r
+</p>\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<button id='btnWinCreate'>Display popup window</button>\r
+<button id='btnSmall'>Content=ABCD</button>\r
+<button id='btnMedium'>Content=2 inputs</button>\r
+<button id='btnLarge'>Content=6 inputs</button>\r
+\r
+<p>Here are some select boxes to show that there is no bleed-through in IE6.\r
+\r
+<p style='margin-left:5em;'>\r
+<select>\r
+<option>Rome</option>\r
+<option>London</option>\r
+<option>Houston</option>\r
+<option selected>Hong Kong</option>\r
+</select>\r
+\r
+<p>&nbsp;\r
+\r
+<p style='margin-left:10em;'>\r
+<select>\r
+<option>Rome</option>\r
+<option selected>London</option>\r
+<option>Houston</option>\r
+<option>Hong Kong</option>\r
+</select>\r
+\r
+<p>&nbsp;\r
+\r
+<p style='margin-left:15em;'>\r
+<select>\r
+<option>Rome</option>\r
+<option>London</option>\r
+<option selected>Houston</option>\r
+<option>Hong Kong</option>\r
+</select>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/html/pull-down.html b/examples/html/pull-down.html
new file mode 100644 (file)
index 0000000..039da1d
--- /dev/null
@@ -0,0 +1,95 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+\r
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Rico Pull-Down Example</title>
+
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<script type='text/javascript'>\r
+function slidepanel(id, maxht) {\r
+  var p=Rico.$(id);\r
+  var ht=parseInt(p.style.height);\r
+  var newht=ht > 0 ? 0 : maxht;\r
+  Rico.animate(p,{duration:500},{height:newht});\r
+}\r
+</script>\r
+
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#header{
+  margin: 10px;
+  position: relative;
+}\r
+#top-panel {\r
+  background-color : #6b795a;\r
+  height: 17px;\r
+  margin: 0px;\r
+  padding:0px;\r
+  position: relative;\r
+  width: 570px;\r
+  font-size: 8pt;\r
+}\r
+#inner_panel {\r
+  position: relative;\r
+  top: 0px;\r
+  background-color: #adba8c;\r
+  margin:0px;\r
+  border: 1px solid #6b795a;\r
+}\r
+#outer_panel {
+  overflow: hidden;
+  position: absolute;
+  z-index: 1;
+  padding-left: 15px;
+  top: 17px;
+  width: 530px
+}\r
+pre {font-size: 11px;}
+a img { border: none;vertical-align:top; }\r
+a { \r
+  text-decoration:none; \r
+  color: Bisque;\r
+}
+</style>
+</head>
+
+<body>
+
+<h1>Rico Pull-Down Example</h1>
+\r
+<p id='libname'>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+</p>\r
+\r
+<div id="header">\r
+  <div id="top-panel">\r
+    <a href="javascript:void(0);" onclick="slidepanel('outer_panel',200); return false;">\r
+        <img alt="code" src="down_arrow.png">\r
+    &nbsp;View the code...\r
+    </a>\r
+  </div>\r
+       <div id="outer_panel" style='height:0px'>\r
+               <div id="inner_panel">\r
+           <div style="font-size:14px">\r
+           Pull down demonstration</div>\r
+           <br><br>\r
+<pre>
+function slidepanel(id, maxht) {\r
+  var p=Rico.$(id);\r
+  var ht=parseInt(p.style.height);\r
+  var newht=ht > 0 ? 0 : maxht;\r
+  Rico.animate(p,{duration:500},{height:newht});\r
+}\r
+</pre>\r
+<br>\r
+       </div>\r
+  </div>\r
+</div>\r
+\r
+<h1>Welcome to Rico!</h1>\r
+
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/html/shadow.html b/examples/html/shadow.html
new file mode 100644 (file)
index 0000000..ec37139
--- /dev/null
@@ -0,0 +1,152 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >\r
+<title>Rico</title>\r
+\r
+<script src="LoadRicoClient.js" type="text/javascript"></script>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<script type='text/javascript'>\r
+Rico.onLoad( function() {\r
+  var images=Rico.select('#thumbnails img');\r
+  for (var i=0; i<images.length; i++) {\r
+    Rico.applyShadow(images[i]);\r
+  }\r
+});\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet">\r
+<style type="text/css">\r
+#thumbnails p {\r
+  font-size:small;\r
+  margin: 0px;\r
+}\r
+#thumbnails img {\r
+  display: block;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p>\r
+This example demonstrates how apply Rico shadows to static elements.\r
+<pre>\r
+Rico.onLoad( function() {\r
+  var images=Rico.select('#thumbnails img');\r
+  for (var i=0; i&lt;images.length; i++) {\r
+    Rico.applyShadow(images[i]);\r
+  }\r
+});\r
+</pre>\r
+</p>\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<table id='thumbnails' border='0' cellspacing='0' cellpadding='10'>\r
+\r
+<tr>\r
+\r
+<td><img src="../images/themeroller/theme_30_ui_light.png" alt="UI Lightness" title="UI Lightness" />\r
+<p>UI lightness</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_ui_dark.png" alt="UI Darkness" title="UI Darkness" />\r
+<p>UI darkness</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_smoothness.png" alt="Smoothness" title="Smoothness" />\r
+<p>Smoothness</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_start_menu.png" alt="Start" title="Start" />\r
+<p>Start</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_windoze.png" alt="Redmond" title="Redmond" />\r
+<p>Redmond</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_sunny.png" alt="Sunny" title="Sunny" />\r
+<p>Sunny</p></td>\r
+\r
+</tr><tr>\r
+\r
+<td><img src="../images/themeroller/theme_30_overcast.png" alt="Overcast" title="Overcast" />\r
+<p>Overcast</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_le_frog.png" alt="Le Frog" title="Le Frog" />\r
+<p>Le Frog</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_flick.png" alt="Flick" title="Flick" />\r
+<p>Flick</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" />\r
+<p>Pepper Grinder</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_eggplant.png" alt="Eggplant" title="Eggplant" />\r
+<p>Eggplant</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_dark_hive.png" alt="Dark Hive" title="Dark Hive" />\r
+<p>Dark Hive</p></td>\r
+\r
+</tr><tr>\r
+\r
+<td><img src="../images/themeroller/theme_30_cupertino.png" alt="Cupertino" title="Cupertino" />\r
+<p>Cupertino</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_south_street.png" alt="South St" title="South St" />\r
+<p>South Street</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_blitzer.png" alt="Blitzer" title="Blitzer" />\r
+<p>Blitzer</p></td>    \r
+\r
+<td><img src="../images/themeroller/theme_30_humanity.png" alt="Humanity" title="Humanity" />\r
+<p>Humanity</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" />\r
+<p>Hot sneaks</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_excite_bike.png" alt="Excite Bike" title="Excite Bike" />\r
+<p>Excite Bike</p></td>\r
+\r
+</tr><tr>\r
+\r
+<td><img src="../images/themeroller/theme_30_black_matte.png" alt="Vader" title="Vader" />\r
+<p>Vader</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_dot_luv.png" alt="Dot Luv" title="Dot Luv" />\r
+<p>Dot Luv</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_mint_choco.png" alt="Mint Choc" title="Mint Choc" />\r
+<p>Mint Choc</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_black_tie.png" alt="Black Tie" title="Black Tie" />\r
+<p>Black Tie</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_trontastic.png" alt="Trontastic" title="Trontastic" />\r
+<p>Trontastic</p></td>\r
+\r
+<td><img src="../images/themeroller/theme_30_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" />\r
+<p>Swanky Purse</p></td>\r
+\r
+</tr>\r
+</table>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/images/themeroller/theme_30_black_matte.png b/examples/images/themeroller/theme_30_black_matte.png
new file mode 100644 (file)
index 0000000..f109d07
Binary files /dev/null and b/examples/images/themeroller/theme_30_black_matte.png differ
diff --git a/examples/images/themeroller/theme_30_black_tie.png b/examples/images/themeroller/theme_30_black_tie.png
new file mode 100644 (file)
index 0000000..33b59fe
Binary files /dev/null and b/examples/images/themeroller/theme_30_black_tie.png differ
diff --git a/examples/images/themeroller/theme_30_blitzer.png b/examples/images/themeroller/theme_30_blitzer.png
new file mode 100644 (file)
index 0000000..dba2bdd
Binary files /dev/null and b/examples/images/themeroller/theme_30_blitzer.png differ
diff --git a/examples/images/themeroller/theme_30_cupertino.png b/examples/images/themeroller/theme_30_cupertino.png
new file mode 100644 (file)
index 0000000..5bfa024
Binary files /dev/null and b/examples/images/themeroller/theme_30_cupertino.png differ
diff --git a/examples/images/themeroller/theme_30_dark_hive.png b/examples/images/themeroller/theme_30_dark_hive.png
new file mode 100644 (file)
index 0000000..c6db40a
Binary files /dev/null and b/examples/images/themeroller/theme_30_dark_hive.png differ
diff --git a/examples/images/themeroller/theme_30_dot_luv.png b/examples/images/themeroller/theme_30_dot_luv.png
new file mode 100644 (file)
index 0000000..b03472b
Binary files /dev/null and b/examples/images/themeroller/theme_30_dot_luv.png differ
diff --git a/examples/images/themeroller/theme_30_eggplant.png b/examples/images/themeroller/theme_30_eggplant.png
new file mode 100644 (file)
index 0000000..cd5b485
Binary files /dev/null and b/examples/images/themeroller/theme_30_eggplant.png differ
diff --git a/examples/images/themeroller/theme_30_excite_bike.png b/examples/images/themeroller/theme_30_excite_bike.png
new file mode 100644 (file)
index 0000000..3e1ec9c
Binary files /dev/null and b/examples/images/themeroller/theme_30_excite_bike.png differ
diff --git a/examples/images/themeroller/theme_30_flick.png b/examples/images/themeroller/theme_30_flick.png
new file mode 100644 (file)
index 0000000..e0fca78
Binary files /dev/null and b/examples/images/themeroller/theme_30_flick.png differ
diff --git a/examples/images/themeroller/theme_30_hot_sneaks.png b/examples/images/themeroller/theme_30_hot_sneaks.png
new file mode 100644 (file)
index 0000000..70aaf1f
Binary files /dev/null and b/examples/images/themeroller/theme_30_hot_sneaks.png differ
diff --git a/examples/images/themeroller/theme_30_humanity.png b/examples/images/themeroller/theme_30_humanity.png
new file mode 100644 (file)
index 0000000..7a5e044
Binary files /dev/null and b/examples/images/themeroller/theme_30_humanity.png differ
diff --git a/examples/images/themeroller/theme_30_le_frog.png b/examples/images/themeroller/theme_30_le_frog.png
new file mode 100644 (file)
index 0000000..fc95e6b
Binary files /dev/null and b/examples/images/themeroller/theme_30_le_frog.png differ
diff --git a/examples/images/themeroller/theme_30_mint_choco.png b/examples/images/themeroller/theme_30_mint_choco.png
new file mode 100644 (file)
index 0000000..1eae9de
Binary files /dev/null and b/examples/images/themeroller/theme_30_mint_choco.png differ
diff --git a/examples/images/themeroller/theme_30_overcast.png b/examples/images/themeroller/theme_30_overcast.png
new file mode 100644 (file)
index 0000000..0c27341
Binary files /dev/null and b/examples/images/themeroller/theme_30_overcast.png differ
diff --git a/examples/images/themeroller/theme_30_pepper_grinder.png b/examples/images/themeroller/theme_30_pepper_grinder.png
new file mode 100644 (file)
index 0000000..26a4b76
Binary files /dev/null and b/examples/images/themeroller/theme_30_pepper_grinder.png differ
diff --git a/examples/images/themeroller/theme_30_smoothness.png b/examples/images/themeroller/theme_30_smoothness.png
new file mode 100644 (file)
index 0000000..ac7adeb
Binary files /dev/null and b/examples/images/themeroller/theme_30_smoothness.png differ
diff --git a/examples/images/themeroller/theme_30_south_street.png b/examples/images/themeroller/theme_30_south_street.png
new file mode 100644 (file)
index 0000000..f278200
Binary files /dev/null and b/examples/images/themeroller/theme_30_south_street.png differ
diff --git a/examples/images/themeroller/theme_30_start_menu.png b/examples/images/themeroller/theme_30_start_menu.png
new file mode 100644 (file)
index 0000000..02101ea
Binary files /dev/null and b/examples/images/themeroller/theme_30_start_menu.png differ
diff --git a/examples/images/themeroller/theme_30_sunny.png b/examples/images/themeroller/theme_30_sunny.png
new file mode 100644 (file)
index 0000000..d111379
Binary files /dev/null and b/examples/images/themeroller/theme_30_sunny.png differ
diff --git a/examples/images/themeroller/theme_30_swanky_purse.png b/examples/images/themeroller/theme_30_swanky_purse.png
new file mode 100644 (file)
index 0000000..2c2094c
Binary files /dev/null and b/examples/images/themeroller/theme_30_swanky_purse.png differ
diff --git a/examples/images/themeroller/theme_30_trontastic.png b/examples/images/themeroller/theme_30_trontastic.png
new file mode 100644 (file)
index 0000000..efa6aae
Binary files /dev/null and b/examples/images/themeroller/theme_30_trontastic.png differ
diff --git a/examples/images/themeroller/theme_30_ui_dark.png b/examples/images/themeroller/theme_30_ui_dark.png
new file mode 100644 (file)
index 0000000..d068579
Binary files /dev/null and b/examples/images/themeroller/theme_30_ui_dark.png differ
diff --git a/examples/images/themeroller/theme_30_ui_light.png b/examples/images/themeroller/theme_30_ui_light.png
new file mode 100644 (file)
index 0000000..4e9e3e2
Binary files /dev/null and b/examples/images/themeroller/theme_30_ui_light.png differ
diff --git a/examples/images/themeroller/theme_30_windoze.png b/examples/images/themeroller/theme_30_windoze.png
new file mode 100644 (file)
index 0000000..858e88f
Binary files /dev/null and b/examples/images/themeroller/theme_30_windoze.png differ
diff --git a/examples/menu.css b/examples/menu.css
new file mode 100644 (file)
index 0000000..a2e3a3f
--- /dev/null
@@ -0,0 +1,106 @@
+html {\r
+  padding: 10px;\r
+}\r
+body {\r
+  font-family: Arial, Tahoma, Verdana;\r
+  background: #4f4f4f;\r
+  color: #fff;\r
+  margin: 2px;\r
+  overflow: hidden;\r
+}\r
+div.top {\r
+  margin: 6px 0px;\r
+  padding-left: 5px;\r
+  font-size: 12px;\r
+}\r
+\r
+#accordion1 {\r
+  width: 99%;\r
+}\r
+\r
+div.selected, div.hover {\r
+  background-color:#63699C;\r
+  color:#FFFFFF;\r
+  font-weight:bold;\r
+  height: 22px;\r
+  padding-left: 5px;\r
+}\r
+\r
+.Rico_accTitle {\r
+  background-color:#6B79A5;\r
+  color:#CED7EF;\r
+  height: 22px;\r
+  font-weight : normal;\r
+  padding-left: 5px;\r
+  padding-top: 5px;\r
+  overflow: hidden;\r
+\r
+  border-bottom:1px solid #182052;\r
+  border-style:solid none;\r
+  border-top:1px solid #BDC7E7;\r
+  border-width:1px 0px;\r
+  font-size:12px;\r
+  white-space:nowrap;\r
+}\r
+\r
+.Rico_accContent {\r
+  font-size: 12px;\r
+  padding-left: 5px;\r
+  overflow: auto;\r
+}\r
+\r
+#menuheader {\r
+  background-color: #1381d4;\r
+  border: 0px none;\r
+  overflow:visible;\r
+  width: 97%;\r
+}\r
+\r
+#menuheader p {\r
+  padding: 1em;\r
+  margin: 0px;\r
+  font-weight: bold;\r
+  font-size:11pt;\r
+}\r
+\r
+ul {\r
+  margin:3px 0 0 0;\r
+  padding: 0px;\r
+}\r
+#accordion1 ul li {\r
+  list-style: none;\r
+  padding: 0 0 0 16px;\r
+  margin: 4px 0;\r
+  font-size: 12px;\r
+}\r
+\r
+form ul li {\r
+  list-style: none;\r
+  padding: 0px;\r
+  margin: 4px 0;\r
+  font-size: 12px;\r
+}\r
+\r
+a {\r
+  color: #9999ff;\r
+  text-decoration: none;\r
+}\r
+a:hover {\r
+  text-decoration: underline;\r
+}\r
+div.subhead {\r
+  font-weight: bold;\r
+  margin-top:18px;\r
+  margin-bottom:3px;\r
+}\r
+img {\r
+  border: 0px;\r
+}\r
+\r
+#RicoDir {\r
+  margin: 0px 0.3em;\r
+}\r
+\r
+#demolist {\r
+  height:3em;\r
+}
\ No newline at end of file
diff --git a/examples/menu.js b/examples/menu.js
new file mode 100644 (file)
index 0000000..99efcce
--- /dev/null
@@ -0,0 +1,57 @@
+var acc;\r
+Rico.onLoad( function() {\r
+  $('RicoVersion').innerHTML=Rico.Version;\r
+  arPath=location.pathname.split('/');\r
+  $('RicoDir').innerHTML=arPath[arPath.length-2].toUpperCase().replace(/DOT/,'.');\r
+  Rico.Corner.round('menuheader');\r
+  acc=new Rico.Accordion( 'accordion1', {panelHeight:100} );\r
+  //WinResize();\r
+  setLinks(Rico.select('#accordion1 ul a'));\r
+  setParm(Rico.$('lib_proto'));\r
+  setParm(Rico.$('theme_j-ui-lightness'));\r
+  setTimeout(WinResize,5);\r
+  setTimeout(function() {Event.observe(top, "resize", WinResize, false);},100);\r
+});\r
+\r
+function setLinks(links) {\r
+  for (var i=0; i<links.length; i++) {\r
+    links[i].href='javascript:void(0)';\r
+    Rico.eventBind(links[i],"click", Rico.eventHandle(window,'processClick'));\r
+  }\r
+};\r
+\r
+function CalcAccHt() {\r
+  var winht=Rico.windowHeight();\r
+  var txtht=$('accordion1').offsetTop;\r
+  var titleht=acc.titles.length * (acc.titles[0].offsetHeight + 5);\r
+  return Math.max(winht-txtht-titleht-35,60);\r
+}\r
+\r
+function WinResize(e) {\r
+  acc.setPanelHeight(CalcAccHt());\r
+}\r
+\r
+function processClick(e) {\r
+  var elem=Rico.eventElement(e);\r
+  if (elem.tagName != 'A') elem=Rico.getParentByTagName(elem,'a');\r
+  //alert(elem.tagName+' '+elem.id);\r
+  setParm(elem);\r
+  var form=document.forms[0];\r
+  if (!form.action) return;\r
+  //alert(form.id+': '+form.action);\r
+  // IE6 requires a delay\r
+  setTimeout(function() { form.submit(); return false; }, 20);\r
+}\r
+\r
+function setParm(elem) {\r
+  var parms=elem.id.split(/_/);\r
+  //alert(parms.join(' * '));\r
+  var form=document.forms[0];\r
+  if (parms[0]=='demo') {\r
+    form.action=parms[1];\r
+  } else {\r
+    Rico.$(parms[0]).value=parms[1];\r
+  }\r
+  var spanid=parms[0]+'span';\r
+  Rico.$(spanid).innerHTML=Rico.stripTags(elem.innerHTML);\r
+}\r
diff --git a/examples/php/CustTree.php b/examples/php/CustTree.php
new file mode 100644 (file)
index 0000000..aa973c6
--- /dev/null
@@ -0,0 +1,46 @@
+<?php\r
+header("Cache-Control: no-cache");\r
+header("Pragma: no-cache");\r
+header("Expires: ".gmdate("D, d M Y H:i:s",time()+(-1*60))." GMT");\r
+header("Content-type: text/xml");\r
+echo "<?xml version='1.0' encoding='UTF-8'?".">\n";\r
+\r
+require "dbConnect.php";\r
+require "../../plugins/php/ricoResponse.php";\r
+\r
+$id=isset($_GET["id"]) ? $_GET["id"] : "";\r
+$parent=isset($_GET["Parent"]) ? $_GET["Parent"] : "";\r
+echo "\n<ajax-response><response type='object' id='".$id."_updater'>";\r
+if ($id == "") {\r
+  echo "\n<rows update_ui='false' /><error>";\r
+  echo "\nNo ID provided!";\r
+  echo "\n</error>";\r
+}\r
+elseif (!OpenDB()) {\r
+  echo "\n<rows update_ui='false' /><error>";\r
+  echo "\n".htmlspecialchars($oDB->LastErrorMsg);\r
+  echo "\n</error>";\r
+}\r
+else {\r
+  $oDB->DisplayErrors=false;\r
+  $oDB->ErrMsgFmt="MULTILINE";\r
+  $oXmlResp=new ricoXmlResponse();\r
+  $oXmlResp->convertCharSet=true;  // MySQL sample database is encoded with ISO-8859-1\r
+  echo "\n<rows update_ui='true' offset='0'>";\r
+  if ($parent) {\r
+    $oXmlResp->Query2xmlRaw("SELECT '$parent',CustomerID,CompanyName,'L',1 FROM customers where CompanyName like '$parent%'",0,99);\r
+  } else {\r
+    $oXmlResp->WriteTreeRow("","root","Customer names starting with...","C",0);\r
+    $oXmlResp->Query2xmlRaw("SELECT distinct 'root',left(CompanyName,1),left(CompanyName,1),'C',0 FROM customers",0,99);\r
+  }\r
+  print "\n"."</rows>";\r
+  if (!empty($oDB->LastErrorMsg)) {\r
+    echo "\n<error>";\r
+    echo "\n".htmlspecialchars($oDB->LastErrorMsg);\r
+    echo "\n</error>";\r
+  }\r
+  $oXmlResp=NULL;\r
+}\r
+echo "\n</response></ajax-response>";\r
+\r
+?>
\ No newline at end of file
diff --git a/examples/php/LoadRicoClient.php b/examples/php/LoadRicoClient.php
new file mode 100644 (file)
index 0000000..c2969db
--- /dev/null
@@ -0,0 +1,136 @@
+<?php\r
+\r
+$jsDir="../../ricoClient/js/";       // directory containing Rico's javascript files\r
+$cssDir="../../ricoClient/css/";     // directory containing Rico's css files\r
+$imgDir="../../ricoClient/images/";  // directory containing Rico's image files\r
+$transDir=$jsDir."translations/";\r
+$baselibsDir=$jsDir."baselibs/";\r
+$grid_striping=true;       // apply row striping to LiveGrids?\r
+$checkQueryString = true;  // load settings from QueryString? true for demo, false for production\r
+$LoadBaseLib = true;       // load base Javascript library (prototype, jQuery, etc) from Rico directory?\r
+$jQuery_theme_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/";\r
+\r
+if ($checkQueryString) {\r
+  $ricoLib=$_GET['lib'];\r
+  $ricoTheme=$_GET["theme"];\r
+  $ricoLogging=isset($_GET["log"]);\r
+} else {\r
+  // set your production values here\r
+  $ricoLib="proto";    // base library (proto, jquery, moo, dojo, ext, or glow)\r
+  $ricoTheme="j-ui-lightness";  // jquery themes start with j-, rico themes start with r-\r
+  $ricoLogging=false;\r
+}\r
+\r
+SetConfig();\r
+LoadLib($ricoLib, $LoadBaseLib);\r
+setLang();\r
+LoadTheme($ricoTheme);\r
+\r
+\r
+// initialize Rico\r
+function SetConfig() {\r
+  global $jsDir,$cssDir,$imgDir,$ricoLogging;\r
+  echo "\n<script type='text/javascript'>\n";\r
+  echo "Rico_CONFIG = {\n";\r
+  if ($ricoLogging) echo "enableLogging: true,\n";\r
+  echo "jsDir: '" . $jsDir . "',\n";\r
+  echo "cssDir: '" . $cssDir . "',\n";\r
+  echo "imgDir: '" . $imgDir . "'\n";\r
+  echo "};";\r
+  echo "</script>\n";\r
+}\r
+\r
+\r
+function LoadLib($baseLib, $baseLoadFlag) {\r
+  global $baselibsDir,$transDir;\r
+  switch ($baseLib) {\r
+    case 'proto':\r
+      $baselib='prototype';\r
+      $adapter='2Proto';\r
+      break;\r
+    case 'jquery':\r
+      $baselib='jquery';\r
+      $adapter='2jQuery';\r
+      break;\r
+    case 'moo':\r
+      $baselib='mootools';\r
+      $adapter='2Moo';\r
+      break;\r
+    case 'dojo':\r
+      $baselib='dojo';\r
+      $adapter='2Dojo';\r
+      break;\r
+    case 'ext':\r
+      $baselib='ext-core';\r
+      $adapter='2Ext';\r
+      break;\r
+    case 'glow':\r
+      $baselib='glow.core';\r
+      $adapter='2Glow';\r
+      break;\r
+    default:\r
+      exit();\r
+  }\r
+  if ($baseLoadFlag) echo "<script src='".$baselibsDir.$baselib.".js' type='text/javascript'></script>\n";\r
+  requireRicoJS("");\r
+  requireRicoJS($adapter);\r
+  echo "<script src='".$transDir."ricoLocale_en.js' type='text/javascript'></script>\n";\r
+  requireRicoCSS("rico");\r
+  requireRicoJS("UI");\r
+}\r
+\r
+\r
+// -------------------------------------------------------------\r
+// Check languages accepted by browser\r
+// and see if there is a match\r
+// -------------------------------------------------------------\r
+function setLang() {\r
+  global $transDir;\r
+  $lang=strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]);\r
+  $arLang=explode(",",$lang);\r
+  for ($i=0; $i<count($arLang); $i++) {\r
+    $lang2=strtolower(substr(trim($arLang[$i]),0,2));\r
+    if ($lang2=='en') break; // already included\r
+    $fname=$transDir."ricoLocale_".$lang2.".js";\r
+    if (file_exists($fname)) {\r
+      echo "<script src='".$fname."' type='text/javascript'></script>";\r
+      break;\r
+    } \r
+  }\r
+}\r
+\r
+\r
+// set theme\r
+// "j-ui-lightness" for a Themeroller theme\r
+// "r-greenHdg" for a native Rico theme\r
+function LoadTheme($theme) {\r
+  global $cssDir,$grid_striping,$jQuery_theme_path;\r
+  $prefix=substr($theme,0,1);\r
+  $theme=substr($theme,2);\r
+  switch ($prefix) {\r
+    case 'j':\r
+      requireRicoJS("Themeroller");\r
+      echo "<link type='text/css' rel='stylesheet' href='".$cssDir."jquery-base/ui.base.css' />";\r
+      echo "<link type='text/css' rel='Stylesheet' href='" . $jQuery_theme_path . $theme."/jquery-ui.css' />";\r
+      break;\r
+    case 'r':\r
+      requireRicoCSS($theme);\r
+      break;\r
+  }\r
+  if ($grid_striping) {\r
+    echo "<link type='text/css' rel='stylesheet' href='".$cssDir."striping/".$theme.".css' />";\r
+  }\r
+}\r
+\r
+function requireRicoJS($filename) {\r
+  global $jsDir;\r
+  echo "<script src='".$jsDir."rico".$filename.".js' type='text/javascript'></script>\n";\r
+}\r
+\r
+function requireRicoCSS($filename) {\r
+  global $cssDir;\r
+  echo "<link href='".$cssDir.$filename.".css' type='text/css' rel='stylesheet' />\n";\r
+}\r
+\r
+?>\r
+\r
diff --git a/examples/php/RicoDbViewer.php b/examples/php/RicoDbViewer.php
new file mode 100644 (file)
index 0000000..8a9fcd7
--- /dev/null
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico-Table List</title>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<style type="text/css">\r
+html, body {\r
+  height:97%;\r
+  margin: 0px;\r
+  padding: 0px;\r
+  border: none;\r
+}\r
+\r
+#tablist {\r
+  height:100%;\r
+  width:25%;\r
+  overflow:auto;\r
+  float:left;\r
+  border: 1px solid #EEE;\r
+  font-size:smaller;\r
+}\r
+\r
+#detail {\r
+  height:100%;\r
+  width:70%;\r
+  float:left;\r
+  border: 1px solid #EEE;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<div id='tablist'>\r
+<p><strong>Rico Raw Data Viewer</strong>\r
+<?php\r
+require "dbConnect.php";\r
+\r
+OpenDB();\r
+DisplaysObjects("TABLE");\r
+DisplaysObjects("VIEW");\r
+CloseApp();\r
+\r
+function DisplaysObjects($ObjType) {\r
+  global $oDB;\r
+  $qs=$_SERVER['QUERY_STRING'];\r
+  $arTables=$oDB->GetTableList($ObjType);\r
+  echo "<p><strong>" . $ObjType . "S</strong>";\r
+  if (!is_array($arTables)) return;\r
+  echo "<ul>";\r
+  foreach ($arTables as $tabName) {\r
+    echo "<li><a href='RicoDbViewerDetail.php?id=".urlencode($tabName)."&".$qs."' target='detail'>".$tabName."</a>";\r
+  }\r
+  echo "</ul>";\r
+}\r
+?>\r
+</div>\r
+\r
+<iframe id='detail' name='detail'>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/php/RicoDbViewerDetail.php b/examples/php/RicoDbViewerDetail.php
new file mode 100644 (file)
index 0000000..235ab25
--- /dev/null
@@ -0,0 +1,78 @@
+<?php\r
+if (!isset ($_SESSION)) session_start();\r
+?>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico-Table Detail</title>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<?php\r
+require "dbConnect.php";\r
+require "LoadRicoClient.php";\r
+\r
+\r
+$arColumns=array();\r
+$columnlist="";\r
+$colspecs="";\r
+if (isset($_GET["id"]) && OpenDB()) {\r
+  $id=trim($_GET["id"]);\r
+  $arColumns=$oDB->GetColumnInfo($id);\r
+  for ($i=0; $i<count($arColumns); $i++) {\r
+    $coltype=$arColumns[$i]->ColType;\r
+    if ($coltype=='image' || $coltype=='text' || $coltype=='ntext') continue;\r
+    if (!empty($columnlist)) {\r
+      $columnlist.=",";\r
+      $colspecs.=",";\r
+    }\r
+    $columnlist.=$arColumns[$i]->ColName;\r
+    //$colspecs.="{Hdg:'".$coltype."'";   // for debugging\r
+    $colspecs.="{Hdg:'".$arColumns[$i]->ColName."'";\r
+    if ($coltype == "DATETIME") {\r
+      $colspecs.=",type:'datetime'";\r
+    }\r
+    $colspecs.="}";\r
+  }\r
+  $_SESSION[$id]="select ".$columnlist." from ".$id." order by ".$arColumns[0]->ColName;\r
+  CloseApp();\r
+}\r
+?>\r
+\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    useUnformattedColWidth: false,\r
+    menuEvent: 'click',\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs: [\r
+<?php\r
+echo $colspecs;\r
+?>\r
+    ]\r
+  };\r
+  var buffer=new Rico.Buffer.AjaxSQL('ricoQuery.php', {TimeOut:<?php print array_shift(session_get_cookie_params())/60 ?>});\r
+  var grid=new Rico.LiveGrid ('<?php echo $id; ?>', buffer, opts);\r
+  grid.menu = new Rico.GridMenu();\r
+});\r
+</script>\r
+\r
+<style type="text/css">\r
+html { border: none; }\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+\r
+<body>\r
+<p><strong><?php echo $id; ?></strong>\r
+<p class="ricoBookmark"><span id='<?php echo $id; ?>_timer' class='ricoSessionTimer'></span><span id="<?php echo $id; ?>_bookmark">&nbsp;</span></p>\r
+<div id="<?php echo $id; ?>"></div>\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/php/ShipperEdit.php b/examples/php/ShipperEdit.php
new file mode 100644 (file)
index 0000000..137ad91
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+if (!isset ($_SESSION)) session_start();
+header("Cache-Control: no-cache");
+header("Pragma: no-cache");
+header("Expires: ".gmdate("D, d M Y H:i:s",time()+(-1*60))." GMT");
+header('Content-type: text/html; charset=utf-8');
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Rico LiveGrid-Shippers (editable)</title>
+
+<?php
+require "dbConnect.php";
+require "LoadRicoClient.php";
+require "../../plugins/php/ricoLiveGridForms.php";
+?>
+<script type='text/javascript'>
+Rico.loadModule('LiveGridForms');
+</script>
+
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+<style type="text/css">
+div.ricoLG_cell {
+  white-space:nowrap;
+}
+#explanation * { font-size: 8pt; }
+</style>
+</head>
+<body>
+
+<?php
+//************************************************************************************************************
+//  LiveGrid-Edit Example
+//************************************************************************************************************
+//  Matt Brown
+//************************************************************************************************************
+if (OpenGridForm("", "shippers")) {
+  if ($oForm->action == "table") {
+    DisplayTable();
+  }
+  else {
+    DefineFields();
+  }
+} else {
+  echo 'open failed';
+}
+CloseApp();
+
+function DisplayTable() {
+  global $oForm,$oDB;
+  
+  echo "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>";
+  echo "Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>";
+  echo "<hr>The data on this grid can be edited using pop-up forms. ";
+  echo "Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. ";
+  echo "The Add and Edit forms are automatically generated by LiveGrid. ";
+  echo "Updates are disabled on the database, so you will get an error message if you try to save.";
+  echo "</td><td>";
+  echo "<script type='text/javascript'><!--\n";
+  echo "google_ad_client = 'pub-7218597156507462';\n";
+  echo "/* 125x125, created 5/11/09 */\n";
+  echo "google_ad_slot = '9298106441';\n";
+  echo "google_ad_width = 125;\n";
+  echo "google_ad_height = 125;\n";
+  echo "//-->\n";
+  echo "</script>\n";
+  echo "<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>\n";
+  echo "</td></tr></table>";
+
+  echo "<p><strong>Shippers Table</strong></p>";
+  $oForm->options["frozenColumns"]=1;
+  $oForm->options["menuEvent"]='click';
+  $oForm->options["highlightElem"]='cursorRow';
+  DefineFields();
+  //echo "<p><textarea id='shippers_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>";
+}
+
+function DefineFields() {
+  global $oForm,$oDB;
+
+  $oForm->AddEntryFieldW("ShipperID", "ID", "B", "<auto>",50);
+  $oForm->AddEntryFieldW("CompanyName", "Company Name", "B", "", 150);
+  $oForm->ConfirmDeleteColumn();
+  $oForm->SortAsc();
+  $oForm->AddEntryFieldW("Phone", "Phone Number", "B", "", 150);
+
+  $oForm->DisplayPage();
+}
+?>
+
+</body>
+</html>
diff --git a/examples/php/dbConnect.php b/examples/php/dbConnect.php
new file mode 100644 (file)
index 0000000..a525c9f
--- /dev/null
@@ -0,0 +1,90 @@
+<?php\r
+require "../../plugins/php/dbClass3.php";\r
+$appName="Northwind";\r
+$appDB="northwind";\r
+\r
+function CreateDbClass() {\r
+  global $oDB;\r
+  $oDB = new dbClass();\r
+}\r
+\r
+function OpenDB() {\r
+  global $oDB,$appDB;\r
+  CreateDbClass();\r
+\r
+  // MySQL\r
+  return $oDB->MySqlLogon($appDB, "userid", "password");\r
+\r
+  // MS SQL\r
+  //$oDB->Dialect="TSQL";\r
+  //return $oDB->MSSqlLogon("mbrown27", $appDB, "userid", "password");\r
+\r
+  // ODBC - MS Access\r
+  //$oDB->Dialect="Access";\r
+  //return $oDB->OdbcLogon("northwindDSN","Northwind","userid","password");\r
+\r
+  // Oracle\r
+  //$oDB->Dialect="Oracle";\r
+  //return $oDB->OracleLogon("XE","northwind","password");\r
+}\r
+\r
+\r
+function OpenApp($title) {\r
+  $_retval=false;\r
+  if (!OpenDB()) {\r
+    return $_retval;\r
+  }\r
+  if (!empty($title)) {\r
+    AppHeader($GLOBALS['appName']."-".$title);\r
+  }\r
+  $GLOBALS['accessRights']="rw";\r
+  // CHECK APPLICATION SECURITY HERE  (in this example, "r" gives read-only access and "rw" gives read/write access)\r
+  if (empty($GLOBALS['accessRights']) || !isset($GLOBALS['accessRights']) || substr($GLOBALS['accessRights'],0,1) != "r") {\r
+    echo "<p class='error'>You do not have permission to access this application";\r
+  }\r
+  else {\r
+    $_retval=true;\r
+  }\r
+  return $_retval;\r
+}\r
+\r
+\r
+function OpenTableEdit($tabname) {\r
+  $obj= new TableEditClass();\r
+  $obj->SetTableName($tabname);\r
+  $obj->options["XMLprovider"]="ricoQuery.php";\r
+  $obj->convertCharSet=true;   // because sample database is ISO-8859-1 encoded\r
+  return $obj;\r
+}\r
+\r
+\r
+function OpenGridForm($title, $tabname) {\r
+  $_retval=false;\r
+  if (!OpenApp($title)) {\r
+    return $_retval;\r
+  }\r
+  $GLOBALS['oForm']= OpenTableEdit($tabname);\r
+  $CanModify=($GLOBALS['accessRights'] == "rw");\r
+  $GLOBALS['oForm']->options["canAdd"]=$CanModify;\r
+  $GLOBALS['oForm']->options["canEdit"]=$CanModify;\r
+  $GLOBALS['oForm']->options["canDelete"]=$CanModify;\r
+  session_set_cookie_params(60*60);\r
+  $GLOBALS['sqltext']='.';\r
+  return true;\r
+}\r
+\r
+\r
+function CloseApp() {\r
+  global $oDB;\r
+  if (is_object($oDB)) $oDB->dbClose();\r
+  $oDB=NULL;\r
+  $GLOBALS['oForm']=NULL;\r
+}\r
+\r
+\r
+function AppHeader($hdg) {\r
+  echo "<h2 class='appHeader'>".str_replace("<dialect>",$GLOBALS['oDB']->Dialect,$hdg)."</h2>";\r
+}\r
+\r
+?>\r
+\r
diff --git a/examples/php/ex1.php b/examples/php/ex1.php
new file mode 100644 (file)
index 0000000..614b78d
--- /dev/null
@@ -0,0 +1,1926 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\r
+<title>Rico LiveGrid sourced from HTML table</title>\r
+\r
+<?php\r
+require "LoadRicoClient.php";\r
+?>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridBasic','LiveGridMenu');\r
+\r
+Rico.onLoad( function() {\r
+  //alert('We are stopping here, at the start of the onLoad event, to show you that the grid is populated with data from a regular HTML table. This is what browsers with javascript disabled would display.');\r
+  var opts = {\r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    defaultWidth : 90,\r
+    useUnformattedColWidth: false,\r
+    columnSpecs  : [{width:200},'specQty','specQty','specQty','specQty','specQty']\r
+  };\r
+  var ex1=new Rico.LiveGrid ('population', new Rico.Buffer.Base(document.getElementById('population').tBodies[0]), opts);\r
+  ex1.menu=new Rico.GridMenu({});\r
+});\r
+</script>\r
+\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example demonstrates how Rico can convert an existing HTML table into\r
+a much more usable LiveGrid. \r
+LiveGrid provides scrolling, column resizing, filtering, and sorting capabilities.\r
+Click on a cell to see available actions.\r
+<p style='font-size:smaller;'>Data source: <a href="http://www.un.org/esa/population/unpop.htm">Population Division of the \r
+Department of Economic and Social Affairs of the United Nations Secretariat</a> (2009). \r
+<em>World Population Prospects: The 2008 Revision. Highlights.</em> New York: United Nations.  </p>                            \r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id="population_bookmark">&nbsp;</span></p>\r
+<table class="ricoLiveGrid" id="population">\r
+<thead>\r
+ <tr>\r
+  <td class='ricoFrozen'></td>\r
+  <td colspan=5>Population (thousands)</td>\r
+ </tr>\r
+ <tr>\r
+  <td class='ricoFrozen'>Country or area</td>\r
+  <td>1950</td>\r
+  <td>2009</td>\r
+  <td>2015</td>\r
+  <td>2025</td>\r
+  <td>2050</td>\r
+ </tr>\r
+</thead>\r
+<tbody>\r
+ <tr>\r
+  <td>Afghanistan</td>\r
+  <td>8151</td>\r
+  <td>28150</td>\r
+  <td>34246</td>\r
+  <td>44970</td>\r
+  <td>73938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Albania</td>\r
+  <td>1215</td>\r
+  <td>3155</td>\r
+  <td>3256</td>\r
+  <td>3395</td>\r
+  <td>3303</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Algeria</td>\r
+  <td>8753</td>\r
+  <td>34895</td>\r
+  <td>38088</td>\r
+  <td>42882</td>\r
+  <td>49610</td>\r
+ </tr>\r
+ <tr>\r
+  <td>American Samoa</td>\r
+  <td>19</td>\r
+  <td>67</td>\r
+  <td>74</td>\r
+  <td>86</td>\r
+  <td>107</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Andorra</td>\r
+  <td>6</td>\r
+  <td>86</td>\r
+  <td>93</td>\r
+  <td>107</td>\r
+  <td>137</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Angola</td>\r
+  <td>4148</td>\r
+  <td>18498</td>\r
+  <td>21690</td>\r
+  <td>27441</td>\r
+  <td>42267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Anguilla</td>\r
+  <td>5</td>\r
+  <td>15</td>\r
+  <td>17</td>\r
+  <td>18</td>\r
+  <td>20</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Antigua and Barbuda</td>\r
+  <td>46</td>\r
+  <td>88</td>\r
+  <td>93</td>\r
+  <td>101</td>\r
+  <td>112</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Argentina</td>\r
+  <td>17150</td>\r
+  <td>40276</td>\r
+  <td>42548</td>\r
+  <td>45883</td>\r
+  <td>50943</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Armenia</td>\r
+  <td>1354</td>\r
+  <td>3083</td>\r
+  <td>3139</td>\r
+  <td>3181</td>\r
+  <td>3018</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Aruba</td>\r
+  <td>38</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>112</td>\r
+  <td>106</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Australia</td>\r
+  <td>8219</td>\r
+  <td>21293</td>\r
+  <td>22607</td>\r
+  <td>24703</td>\r
+  <td>28724</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Austria</td>\r
+  <td>6936</td>\r
+  <td>8364</td>\r
+  <td>8467</td>\r
+  <td>8600</td>\r
+  <td>8515</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Azerbaijan</td>\r
+  <td>2896</td>\r
+  <td>8832</td>\r
+  <td>9426</td>\r
+  <td>10128</td>\r
+  <td>10579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahamas</td>\r
+  <td>79</td>\r
+  <td>342</td>\r
+  <td>366</td>\r
+  <td>402</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahrain</td>\r
+  <td>116</td>\r
+  <td>791</td>\r
+  <td>882</td>\r
+  <td>1021</td>\r
+  <td>1277</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bangladesh</td>\r
+  <td>43595</td>\r
+  <td>162221</td>\r
+  <td>175217</td>\r
+  <td>195012</td>\r
+  <td>222495</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Barbados</td>\r
+  <td>211</td>\r
+  <td>256</td>\r
+  <td>260</td>\r
+  <td>262</td>\r
+  <td>237</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belarus</td>\r
+  <td>7745</td>\r
+  <td>9634</td>\r
+  <td>9355</td>\r
+  <td>8851</td>\r
+  <td>7275</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belgium</td>\r
+  <td>8628</td>\r
+  <td>10647</td>\r
+  <td>10878</td>\r
+  <td>11191</td>\r
+  <td>11493</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belize</td>\r
+  <td>69</td>\r
+  <td>307</td>\r
+  <td>344</td>\r
+  <td>404</td>\r
+  <td>506</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Benin</td>\r
+  <td>2050</td>\r
+  <td>8935</td>\r
+  <td>10647</td>\r
+  <td>13767</td>\r
+  <td>21982</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bermuda</td>\r
+  <td>37</td>\r
+  <td>65</td>\r
+  <td>65</td>\r
+  <td>66</td>\r
+  <td>63</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bhutan</td>\r
+  <td>168</td>\r
+  <td>697</td>\r
+  <td>770</td>\r
+  <td>865</td>\r
+  <td>1013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bolivia</td>\r
+  <td>2714</td>\r
+  <td>9863</td>\r
+  <td>10854</td>\r
+  <td>12368</td>\r
+  <td>14908</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bosnia and Herzegovina</td>\r
+  <td>2661</td>\r
+  <td>3767</td>\r
+  <td>3727</td>\r
+  <td>3608</td>\r
+  <td>3008</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Botswana</td>\r
+  <td>413</td>\r
+  <td>1950</td>\r
+  <td>2106</td>\r
+  <td>2337</td>\r
+  <td>2758</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brazil</td>\r
+  <td>53975</td>\r
+  <td>193734</td>\r
+  <td>202866</td>\r
+  <td>213802</td>\r
+  <td>218512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>British Virgin Islands</td>\r
+  <td>7</td>\r
+  <td>23</td>\r
+  <td>24</td>\r
+  <td>26</td>\r
+  <td>28</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brunei Darussalam</td>\r
+  <td>48</td>\r
+  <td>400</td>\r
+  <td>443</td>\r
+  <td>513</td>\r
+  <td>658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bulgaria</td>\r
+  <td>7251</td>\r
+  <td>7545</td>\r
+  <td>7263</td>\r
+  <td>6752</td>\r
+  <td>5392</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burkina Faso</td>\r
+  <td>4080</td>\r
+  <td>15757</td>\r
+  <td>19013</td>\r
+  <td>24837</td>\r
+  <td>40830</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burundi</td>\r
+  <td>2456</td>\r
+  <td>8303</td>\r
+  <td>9413</td>\r
+  <td>11161</td>\r
+  <td>14846</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cambodia</td>\r
+  <td>4346</td>\r
+  <td>14805</td>\r
+  <td>16357</td>\r
+  <td>18973</td>\r
+  <td>23795</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cameroon</td>\r
+  <td>4466</td>\r
+  <td>19522</td>\r
+  <td>22169</td>\r
+  <td>26478</td>\r
+  <td>36736</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Canada</td>\r
+  <td>13737</td>\r
+  <td>33573</td>\r
+  <td>35493</td>\r
+  <td>38659</td>\r
+  <td>44414</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cape Verde</td>\r
+  <td>146</td>\r
+  <td>506</td>\r
+  <td>548</td>\r
+  <td>616</td>\r
+  <td>703</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cayman Islands</td>\r
+  <td>7</td>\r
+  <td>56</td>\r
+  <td>59</td>\r
+  <td>63</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Central African Republic</td>\r
+  <td>1327</td>\r
+  <td>4422</td>\r
+  <td>4927</td>\r
+  <td>5747</td>\r
+  <td>7603</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chad</td>\r
+  <td>2429</td>\r
+  <td>11206</td>\r
+  <td>13120</td>\r
+  <td>16906</td>\r
+  <td>27776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Channel Islands</td>\r
+  <td>102</td>\r
+  <td>150</td>\r
+  <td>151</td>\r
+  <td>152</td>\r
+  <td>144</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chile</td>\r
+  <td>6082</td>\r
+  <td>16970</td>\r
+  <td>17926</td>\r
+  <td>19266</td>\r
+  <td>20657</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China</td>\r
+  <td>544951</td>\r
+  <td>1345751</td>\r
+  <td>1395998</td>\r
+  <td>1453140</td>\r
+  <td>1417045</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Hong Kong SAR</td>\r
+  <td>1974</td>\r
+  <td>7022</td>\r
+  <td>7398</td>\r
+  <td>7969</td>\r
+  <td>8623</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Macao SAR</td>\r
+  <td>190</td>\r
+  <td>538</td>\r
+  <td>568</td>\r
+  <td>603</td>\r
+  <td>593</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Colombia</td>\r
+  <td>12000</td>\r
+  <td>45660</td>\r
+  <td>49385</td>\r
+  <td>54920</td>\r
+  <td>62877</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Comoros</td>\r
+  <td>156</td>\r
+  <td>676</td>\r
+  <td>767</td>\r
+  <td>907</td>\r
+  <td>1226</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Congo</td>\r
+  <td>808</td>\r
+  <td>3683</td>\r
+  <td>4225</td>\r
+  <td>5094</td>\r
+  <td>6863</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cook Islands</td>\r
+  <td>15</td>\r
+  <td>20</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>24</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Costa Rica</td>\r
+  <td>966</td>\r
+  <td>4579</td>\r
+  <td>4957</td>\r
+  <td>5521</td>\r
+  <td>6373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Côte d'Ivoire</td>\r
+  <td>2505</td>\r
+  <td>21075</td>\r
+  <td>24210</td>\r
+  <td>29738</td>\r
+  <td>43373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Croatia</td>\r
+  <td>3850</td>\r
+  <td>4416</td>\r
+  <td>4370</td>\r
+  <td>4254</td>\r
+  <td>3825</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cuba</td>\r
+  <td>5920</td>\r
+  <td>11204</td>\r
+  <td>11213</td>\r
+  <td>11148</td>\r
+  <td>9725</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cyprus</td>\r
+  <td>494</td>\r
+  <td>871</td>\r
+  <td>925</td>\r
+  <td>1014</td>\r
+  <td>1175</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Czech Republic</td>\r
+  <td>8925</td>\r
+  <td>10369</td>\r
+  <td>10510</td>\r
+  <td>10573</td>\r
+  <td>10294</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. People's Rep. of Korea</td>\r
+  <td>9737</td>\r
+  <td>23906</td>\r
+  <td>24399</td>\r
+  <td>25128</td>\r
+  <td>24562</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. Republic of the Congo</td>\r
+  <td>12184</td>\r
+  <td>66020</td>\r
+  <td>77419</td>\r
+  <td>98123</td>\r
+  <td>147512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Denmark</td>\r
+  <td>4271</td>\r
+  <td>5470</td>\r
+  <td>5523</td>\r
+  <td>5590</td>\r
+  <td>5551</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Djibouti</td>\r
+  <td>62</td>\r
+  <td>864</td>\r
+  <td>953</td>\r
+  <td>1111</td>\r
+  <td>1469</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominica</td>\r
+  <td>51</td>\r
+  <td>67</td>\r
+  <td>67</td>\r
+  <td>68</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominican Republic</td>\r
+  <td>2427</td>\r
+  <td>10090</td>\r
+  <td>10867</td>\r
+  <td>11973</td>\r
+  <td>13441</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ecuador</td>\r
+  <td>3387</td>\r
+  <td>13625</td>\r
+  <td>14596</td>\r
+  <td>16074</td>\r
+  <td>17989</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Egypt</td>\r
+  <td>21514</td>\r
+  <td>82999</td>\r
+  <td>91778</td>\r
+  <td>104970</td>\r
+  <td>129533</td>\r
+ </tr>\r
+ <tr>\r
+  <td>El Salvador</td>\r
+  <td>2200</td>\r
+  <td>6163</td>\r
+  <td>6383</td>\r
+  <td>6895</td>\r
+  <td>7882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Equatorial Guinea</td>\r
+  <td>226</td>\r
+  <td>676</td>\r
+  <td>781</td>\r
+  <td>971</td>\r
+  <td>1445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Eritrea</td>\r
+  <td>1141</td>\r
+  <td>5073</td>\r
+  <td>6009</td>\r
+  <td>7404</td>\r
+  <td>10787</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Estonia</td>\r
+  <td>1101</td>\r
+  <td>1340</td>\r
+  <td>1337</td>\r
+  <td>1321</td>\r
+  <td>1233</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ethiopia</td>\r
+  <td>18434</td>\r
+  <td>82825</td>\r
+  <td>96237</td>\r
+  <td>119822</td>\r
+  <td>173811</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Faeroe Islands</td>\r
+  <td>32</td>\r
+  <td>50</td>\r
+  <td>52</td>\r
+  <td>55</td>\r
+  <td>58</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Falkland Islands (Malvinas)</td>\r
+  <td>2</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Fiji</td>\r
+  <td>289</td>\r
+  <td>849</td>\r
+  <td>874</td>\r
+  <td>905</td>\r
+  <td>910</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Finland</td>\r
+  <td>4009</td>\r
+  <td>5326</td>\r
+  <td>5432</td>\r
+  <td>5533</td>\r
+  <td>5445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>France</td>\r
+  <td>41832</td>\r
+  <td>62343</td>\r
+  <td>63900</td>\r
+  <td>65769</td>\r
+  <td>67668</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Guiana</td>\r
+  <td>25</td>\r
+  <td>226</td>\r
+  <td>261</td>\r
+  <td>323</td>\r
+  <td>462</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Polynesia</td>\r
+  <td>61</td>\r
+  <td>269</td>\r
+  <td>289</td>\r
+  <td>318</td>\r
+  <td>354</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gabon</td>\r
+  <td>469</td>\r
+  <td>1475</td>\r
+  <td>1639</td>\r
+  <td>1915</td>\r
+  <td>2471</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gambia</td>\r
+  <td>258</td>\r
+  <td>1705</td>\r
+  <td>1985</td>\r
+  <td>2478</td>\r
+  <td>3763</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Georgia</td>\r
+  <td>3527</td>\r
+  <td>4260</td>\r
+  <td>4084</td>\r
+  <td>3888</td>\r
+  <td>3267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Germany</td>\r
+  <td>68376</td>\r
+  <td>82167</td>\r
+  <td>81346</td>\r
+  <td>79258</td>\r
+  <td>70504</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ghana</td>\r
+  <td>4981</td>\r
+  <td>23837</td>\r
+  <td>26925</td>\r
+  <td>32233</td>\r
+  <td>45213</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gibraltar</td>\r
+  <td>20</td>\r
+  <td>31</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>30</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greece</td>\r
+  <td>7566</td>\r
+  <td>11161</td>\r
+  <td>11261</td>\r
+  <td>11274</td>\r
+  <td>10939</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greenland</td>\r
+  <td>23</td>\r
+  <td>57</td>\r
+  <td>57</td>\r
+  <td>56</td>\r
+  <td>50</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Grenada</td>\r
+  <td>77</td>\r
+  <td>104</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guadeloupe</td>\r
+  <td>210</td>\r
+  <td>465</td>\r
+  <td>476</td>\r
+  <td>489</td>\r
+  <td>477</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guam</td>\r
+  <td>60</td>\r
+  <td>178</td>\r
+  <td>191</td>\r
+  <td>211</td>\r
+  <td>242</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guatemala</td>\r
+  <td>3146</td>\r
+  <td>14027</td>\r
+  <td>16227</td>\r
+  <td>19927</td>\r
+  <td>27480</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea</td>\r
+  <td>2619</td>\r
+  <td>10069</td>\r
+  <td>11844</td>\r
+  <td>15158</td>\r
+  <td>23975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea-Bissau</td>\r
+  <td>518</td>\r
+  <td>1611</td>\r
+  <td>1848</td>\r
+  <td>2296</td>\r
+  <td>3555</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guyana</td>\r
+  <td>423</td>\r
+  <td>762</td>\r
+  <td>754</td>\r
+  <td>732</td>\r
+  <td>558</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Haiti</td>\r
+  <td>3221</td>\r
+  <td>10033</td>\r
+  <td>10957</td>\r
+  <td>12476</td>\r
+  <td>15485</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Holy See</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Honduras</td>\r
+  <td>1487</td>\r
+  <td>7466</td>\r
+  <td>8386</td>\r
+  <td>9844</td>\r
+  <td>12402</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Hungary</td>\r
+  <td>9338</td>\r
+  <td>9993</td>\r
+  <td>9874</td>\r
+  <td>9647</td>\r
+  <td>8934</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iceland</td>\r
+  <td>143</td>\r
+  <td>323</td>\r
+  <td>353</td>\r
+  <td>384</td>\r
+  <td>407</td>\r
+ </tr>\r
+ <tr>\r
+  <td>India</td>\r
+  <td>371857</td>\r
+  <td>1198003</td>\r
+  <td>1294192</td>\r
+  <td>1431272</td>\r
+  <td>1613800</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Indonesia</td>\r
+  <td>77152</td>\r
+  <td>229965</td>\r
+  <td>244191</td>\r
+  <td>263287</td>\r
+  <td>288110</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iran (Islamic Republic of)</td>\r
+  <td>16913</td>\r
+  <td>74196</td>\r
+  <td>79454</td>\r
+  <td>87134</td>\r
+  <td>96975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iraq</td>\r
+  <td>5719</td>\r
+  <td>30747</td>\r
+  <td>35884</td>\r
+  <td>44692</td>\r
+  <td>63995</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ireland</td>\r
+  <td>2969</td>\r
+  <td>4515</td>\r
+  <td>4886</td>\r
+  <td>5370</td>\r
+  <td>6295</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Isle of Man</td>\r
+  <td>55</td>\r
+  <td>80</td>\r
+  <td>81</td>\r
+  <td>80</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Israel</td>\r
+  <td>1258</td>\r
+  <td>7170</td>\r
+  <td>7823</td>\r
+  <td>8769</td>\r
+  <td>10649</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Italy</td>\r
+  <td>46367</td>\r
+  <td>59870</td>\r
+  <td>60604</td>\r
+  <td>60018</td>\r
+  <td>57066</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jamaica</td>\r
+  <td>1403</td>\r
+  <td>2719</td>\r
+  <td>2786</td>\r
+  <td>2866</td>\r
+  <td>2683</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Japan</td>\r
+  <td>82824</td>\r
+  <td>127156</td>\r
+  <td>125791</td>\r
+  <td>120793</td>\r
+  <td>101659</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jordan</td>\r
+  <td>472</td>\r
+  <td>6316</td>\r
+  <td>6957</td>\r
+  <td>8088</td>\r
+  <td>10241</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kazakhstan</td>\r
+  <td>6703</td>\r
+  <td>15637</td>\r
+  <td>16289</td>\r
+  <td>17025</td>\r
+  <td>17848</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kenya</td>\r
+  <td>6077</td>\r
+  <td>39802</td>\r
+  <td>46433</td>\r
+  <td>57573</td>\r
+  <td>85410</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kiribati</td>\r
+  <td>26</td>\r
+  <td>98</td>\r
+  <td>107</td>\r
+  <td>123</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kuwait</td>\r
+  <td>152</td>\r
+  <td>2985</td>\r
+  <td>3378</td>\r
+  <td>3988</td>\r
+  <td>5240</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kyrgyzstan</td>\r
+  <td>1740</td>\r
+  <td>5482</td>\r
+  <td>5877</td>\r
+  <td>6378</td>\r
+  <td>6882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lao People's Dem. Republic</td>\r
+  <td>1666</td>\r
+  <td>6320</td>\r
+  <td>7028</td>\r
+  <td>8273</td>\r
+  <td>10744</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Latvia</td>\r
+  <td>1949</td>\r
+  <td>2249</td>\r
+  <td>2197</td>\r
+  <td>2101</td>\r
+  <td>1854</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lebanon</td>\r
+  <td>1443</td>\r
+  <td>4224</td>\r
+  <td>4426</td>\r
+  <td>4736</td>\r
+  <td>5033</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lesotho</td>\r
+  <td>734</td>\r
+  <td>2067</td>\r
+  <td>2168</td>\r
+  <td>2306</td>\r
+  <td>2491</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liberia</td>\r
+  <td>824</td>\r
+  <td>3955</td>\r
+  <td>4665</td>\r
+  <td>5858</td>\r
+  <td>8841</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Libyan Arab Jamahiriya</td>\r
+  <td>1029</td>\r
+  <td>6420</td>\r
+  <td>7158</td>\r
+  <td>8144</td>\r
+  <td>9819</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liechtenstein</td>\r
+  <td>14</td>\r
+  <td>36</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+  <td>45</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lithuania</td>\r
+  <td>2567</td>\r
+  <td>3287</td>\r
+  <td>3143</td>\r
+  <td>2985</td>\r
+  <td>2579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Luxembourg</td>\r
+  <td>296</td>\r
+  <td>486</td>\r
+  <td>520</td>\r
+  <td>582</td>\r
+  <td>733</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Madagascar</td>\r
+  <td>4084</td>\r
+  <td>19625</td>\r
+  <td>22853</td>\r
+  <td>28595</td>\r
+  <td>42693</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malawi</td>\r
+  <td>2881</td>\r
+  <td>15263</td>\r
+  <td>17998</td>\r
+  <td>23194</td>\r
+  <td>36575</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malaysia</td>\r
+  <td>6110</td>\r
+  <td>27468</td>\r
+  <td>30041</td>\r
+  <td>33770</td>\r
+  <td>39664</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Maldives</td>\r
+  <td>82</td>\r
+  <td>309</td>\r
+  <td>338</td>\r
+  <td>384</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mali</td>\r
+  <td>4268</td>\r
+  <td>13010</td>\r
+  <td>14993</td>\r
+  <td>18603</td>\r
+  <td>28260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malta</td>\r
+  <td>312</td>\r
+  <td>409</td>\r
+  <td>417</td>\r
+  <td>426</td>\r
+  <td>413</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Marshall Islands</td>\r
+  <td>13</td>\r
+  <td>62</td>\r
+  <td>70</td>\r
+  <td>79</td>\r
+  <td>92</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Martinique</td>\r
+  <td>222</td>\r
+  <td>405</td>\r
+  <td>411</td>\r
+  <td>418</td>\r
+  <td>393</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritania</td>\r
+  <td>651</td>\r
+  <td>3291</td>\r
+  <td>3732</td>\r
+  <td>4443</td>\r
+  <td>6061</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritius</td>\r
+  <td>493</td>\r
+  <td>1288</td>\r
+  <td>1337</td>\r
+  <td>1400</td>\r
+  <td>1426</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mayotte</td>\r
+  <td>15</td>\r
+  <td>194</td>\r
+  <td>224</td>\r
+  <td>277</td>\r
+  <td>386</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mexico</td>\r
+  <td>27741</td>\r
+  <td>109610</td>\r
+  <td>115528</td>\r
+  <td>123366</td>\r
+  <td>128964</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Micronesia (Fed. States of)</td>\r
+  <td>32</td>\r
+  <td>111</td>\r
+  <td>114</td>\r
+  <td>122</td>\r
+  <td>128</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Moldova (Republic of)</td>\r
+  <td>2341</td>\r
+  <td>3604</td>\r
+  <td>3462</td>\r
+  <td>3291</td>\r
+  <td>2734</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Monaco</td>\r
+  <td>20</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mongolia</td>\r
+  <td>761</td>\r
+  <td>2671</td>\r
+  <td>2855</td>\r
+  <td>3134</td>\r
+  <td>3446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montenegro</td>\r
+  <td>399</td>\r
+  <td>624</td>\r
+  <td>627</td>\r
+  <td>633</td>\r
+  <td>618</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montserrat</td>\r
+  <td>14</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>7</td>\r
+  <td>7</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Morocco</td>\r
+  <td>8953</td>\r
+  <td>31993</td>\r
+  <td>34330</td>\r
+  <td>37865</td>\r
+  <td>42583</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mozambique</td>\r
+  <td>6442</td>\r
+  <td>22894</td>\r
+  <td>25957</td>\r
+  <td>31190</td>\r
+  <td>44148</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Myanmar</td>\r
+  <td>17158</td>\r
+  <td>50020</td>\r
+  <td>53087</td>\r
+  <td>57585</td>\r
+  <td>63373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Namibia</td>\r
+  <td>485</td>\r
+  <td>2171</td>\r
+  <td>2412</td>\r
+  <td>2810</td>\r
+  <td>3588</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nauru</td>\r
+  <td>3</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nepal</td>\r
+  <td>8126</td>\r
+  <td>29331</td>\r
+  <td>32503</td>\r
+  <td>38031</td>\r
+  <td>49028</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands</td>\r
+  <td>10114</td>\r
+  <td>16592</td>\r
+  <td>16915</td>\r
+  <td>17348</td>\r
+  <td>17399</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands Antilles</td>\r
+  <td>112</td>\r
+  <td>198</td>\r
+  <td>207</td>\r
+  <td>210</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Caledonia</td>\r
+  <td>65</td>\r
+  <td>250</td>\r
+  <td>271</td>\r
+  <td>304</td>\r
+  <td>362</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Zealand</td>\r
+  <td>1908</td>\r
+  <td>4266</td>\r
+  <td>4492</td>\r
+  <td>4831</td>\r
+  <td>5349</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nicaragua</td>\r
+  <td>1295</td>\r
+  <td>5743</td>\r
+  <td>6265</td>\r
+  <td>7058</td>\r
+  <td>8143</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niger</td>\r
+  <td>2462</td>\r
+  <td>15290</td>\r
+  <td>19150</td>\r
+  <td>27388</td>\r
+  <td>58216</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nigeria</td>\r
+  <td>36680</td>\r
+  <td>154729</td>\r
+  <td>175928</td>\r
+  <td>210057</td>\r
+  <td>289083</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niue</td>\r
+  <td>5</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Northern Mariana Islands</td>\r
+  <td>7</td>\r
+  <td>87</td>\r
+  <td>96</td>\r
+  <td>111</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Norway</td>\r
+  <td>3265</td>\r
+  <td>4812</td>\r
+  <td>5036</td>\r
+  <td>5365</td>\r
+  <td>5947</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Occupied Palestinian Territory</td>\r
+  <td>1005</td>\r
+  <td>4277</td>\r
+  <td>5090</td>\r
+  <td>6553</td>\r
+  <td>10265</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Oman</td>\r
+  <td>456</td>\r
+  <td>2845</td>\r
+  <td>3198</td>\r
+  <td>3782</td>\r
+  <td>4878</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pakistan</td>\r
+  <td>41177</td>\r
+  <td>180808</td>\r
+  <td>205504</td>\r
+  <td>246286</td>\r
+  <td>335195</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Palau</td>\r
+  <td>7</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>23</td>\r
+  <td>26</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Panama</td>\r
+  <td>860</td>\r
+  <td>3454</td>\r
+  <td>3773</td>\r
+  <td>4267</td>\r
+  <td>5092</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Papua New Guinea</td>\r
+  <td>1798</td>\r
+  <td>6732</td>\r
+  <td>7678</td>\r
+  <td>9265</td>\r
+  <td>12871</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Paraguay</td>\r
+  <td>1473</td>\r
+  <td>6349</td>\r
+  <td>7007</td>\r
+  <td>8026</td>\r
+  <td>9867</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Peru</td>\r
+  <td>7632</td>\r
+  <td>29165</td>\r
+  <td>31197</td>\r
+  <td>34528</td>\r
+  <td>39776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Philippines</td>\r
+  <td>19996</td>\r
+  <td>91983</td>\r
+  <td>101734</td>\r
+  <td>117270</td>\r
+  <td>146156</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pitcairn</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Poland</td>\r
+  <td>24824</td>\r
+  <td>38074</td>\r
+  <td>37788</td>\r
+  <td>36964</td>\r
+  <td>32013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Portugal</td>\r
+  <td>8405</td>\r
+  <td>10707</td>\r
+  <td>10787</td>\r
+  <td>10706</td>\r
+  <td>10015</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Puerto Rico</td>\r
+  <td>2218</td>\r
+  <td>3982</td>\r
+  <td>4074</td>\r
+  <td>4176</td>\r
+  <td>4103</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Qatar</td>\r
+  <td>25</td>\r
+  <td>1409</td>\r
+  <td>1630</td>\r
+  <td>1848</td>\r
+  <td>2316</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Republic of Korea</td>\r
+  <td>19211</td>\r
+  <td>48333</td>\r
+  <td>49153</td>\r
+  <td>49484</td>\r
+  <td>44077</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Réunion</td>\r
+  <td>248</td>\r
+  <td>827</td>\r
+  <td>886</td>\r
+  <td>973</td>\r
+  <td>1096</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Romania</td>\r
+  <td>16311</td>\r
+  <td>21275</td>\r
+  <td>20787</td>\r
+  <td>19961</td>\r
+  <td>17279</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Russian Federation</td>\r
+  <td>102702</td>\r
+  <td>140874</td>\r
+  <td>137983</td>\r
+  <td>132345</td>\r
+  <td>116097</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Rwanda</td>\r
+  <td>2162</td>\r
+  <td>9998</td>\r
+  <td>11743</td>\r
+  <td>14676</td>\r
+  <td>22082</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Helena</td>\r
+  <td>5</td>\r
+  <td>4</td>\r
+  <td>4</td>\r
+  <td>5</td>\r
+  <td>5</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Kitts and Nevis</td>\r
+  <td>46</td>\r
+  <td>52</td>\r
+  <td>56</td>\r
+  <td>61</td>\r
+  <td>69</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Lucia</td>\r
+  <td>83</td>\r
+  <td>172</td>\r
+  <td>182</td>\r
+  <td>198</td>\r
+  <td>217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Pierre and Miquelon</td>\r
+  <td>5</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+ </tr>\r
+ <tr>\r
+  <td>St. Vincent and the Grenadines</td>\r
+  <td>67</td>\r
+  <td>109</td>\r
+  <td>110</td>\r
+  <td>111</td>\r
+  <td>119</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Samoa</td>\r
+  <td>82</td>\r
+  <td>179</td>\r
+  <td>181</td>\r
+  <td>188</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>San Marino</td>\r
+  <td>13</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sao Tome and Principe</td>\r
+  <td>60</td>\r
+  <td>163</td>\r
+  <td>180</td>\r
+  <td>216</td>\r
+  <td>296</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saudi Arabia</td>\r
+  <td>3201</td>\r
+  <td>25721</td>\r
+  <td>28933</td>\r
+  <td>34176</td>\r
+  <td>43658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Senegal</td>\r
+  <td>2416</td>\r
+  <td>12534</td>\r
+  <td>14526</td>\r
+  <td>17861</td>\r
+  <td>26102</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Serbia</td>\r
+  <td>6732</td>\r
+  <td>9850</td>\r
+  <td>9828</td>\r
+  <td>9720</td>\r
+  <td>9193</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Seychelles</td>\r
+  <td>36</td>\r
+  <td>84</td>\r
+  <td>86</td>\r
+  <td>91</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sierra Leone</td>\r
+  <td>1944</td>\r
+  <td>5696</td>\r
+  <td>6557</td>\r
+  <td>8112</td>\r
+  <td>12446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Singapore</td>\r
+  <td>1022</td>\r
+  <td>4737</td>\r
+  <td>5059</td>\r
+  <td>5362</td>\r
+  <td>5221</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovakia</td>\r
+  <td>3463</td>\r
+  <td>5406</td>\r
+  <td>5437</td>\r
+  <td>5413</td>\r
+  <td>4917</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovenia</td>\r
+  <td>1473</td>\r
+  <td>2020</td>\r
+  <td>2044</td>\r
+  <td>2050</td>\r
+  <td>1954</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Solomon Islands</td>\r
+  <td>90</td>\r
+  <td>523</td>\r
+  <td>599</td>\r
+  <td>725</td>\r
+  <td>1007</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Somalia</td>\r
+  <td>2264</td>\r
+  <td>9133</td>\r
+  <td>10731</td>\r
+  <td>13922</td>\r
+  <td>23522</td>\r
+ </tr>\r
+ <tr>\r
+  <td>South Africa</td>\r
+  <td>13683</td>\r
+  <td>50110</td>\r
+  <td>51684</td>\r
+  <td>53766</td>\r
+  <td>56802</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Spain</td>\r
+  <td>28009</td>\r
+  <td>44904</td>\r
+  <td>47203</td>\r
+  <td>49265</td>\r
+  <td>51260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sri Lanka</td>\r
+  <td>8241</td>\r
+  <td>20238</td>\r
+  <td>21167</td>\r
+  <td>22033</td>\r
+  <td>21705</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sudan</td>\r
+  <td>9190</td>\r
+  <td>42272</td>\r
+  <td>47730</td>\r
+  <td>56688</td>\r
+  <td>75884</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Suriname</td>\r
+  <td>215</td>\r
+  <td>520</td>\r
+  <td>547</td>\r
+  <td>586</td>\r
+  <td>619</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Swaziland</td>\r
+  <td>273</td>\r
+  <td>1185</td>\r
+  <td>1287</td>\r
+  <td>1455</td>\r
+  <td>1749</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sweden</td>\r
+  <td>7014</td>\r
+  <td>9249</td>\r
+  <td>9498</td>\r
+  <td>9915</td>\r
+  <td>10571</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Switzerland</td>\r
+  <td>4693</td>\r
+  <td>7568</td>\r
+  <td>7736</td>\r
+  <td>8020</td>\r
+  <td>8514</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Syrian Arab Republic</td>\r
+  <td>3536</td>\r
+  <td>21906</td>\r
+  <td>24494</td>\r
+  <td>28592</td>\r
+  <td>36911</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tajikistan</td>\r
+  <td>1532</td>\r
+  <td>6952</td>\r
+  <td>7761</td>\r
+  <td>9075</td>\r
+  <td>11111</td>\r
+ </tr>\r
+ <tr>\r
+  <td>TFYR Macedonia</td>\r
+  <td>1230</td>\r
+  <td>2042</td>\r
+  <td>2045</td>\r
+  <td>2037</td>\r
+  <td>1857</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Thailand</td>\r
+  <td>20607</td>\r
+  <td>67764</td>\r
+  <td>69939</td>\r
+  <td>72628</td>\r
+  <td>73361</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Timor-Leste</td>\r
+  <td>433</td>\r
+  <td>1134</td>\r
+  <td>1385</td>\r
+  <td>1869</td>\r
+  <td>3217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Togo</td>\r
+  <td>1329</td>\r
+  <td>6619</td>\r
+  <td>7607</td>\r
+  <td>9282</td>\r
+  <td>13196</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tokelau</td>\r
+  <td>2</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tonga</td>\r
+  <td>47</td>\r
+  <td>104</td>\r
+  <td>105</td>\r
+  <td>112</td>\r
+  <td>123</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Trinidad and Tobago</td>\r
+  <td>636</td>\r
+  <td>1339</td>\r
+  <td>1368</td>\r
+  <td>1388</td>\r
+  <td>1278</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tunisia</td>\r
+  <td>3530</td>\r
+  <td>10272</td>\r
+  <td>10884</td>\r
+  <td>11797</td>\r
+  <td>12711</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkey</td>\r
+  <td>21484</td>\r
+  <td>74816</td>\r
+  <td>79966</td>\r
+  <td>87364</td>\r
+  <td>97389</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkmenistan</td>\r
+  <td>1211</td>\r
+  <td>5110</td>\r
+  <td>5509</td>\r
+  <td>6072</td>\r
+  <td>6796</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turks and Caicos Islands</td>\r
+  <td>5</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tuvalu</td>\r
+  <td>5</td>\r
+  <td>10</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uganda</td>\r
+  <td>5158</td>\r
+  <td>32710</td>\r
+  <td>39710</td>\r
+  <td>53406</td>\r
+  <td>91271</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ukraine</td>\r
+  <td>37298</td>\r
+  <td>45708</td>\r
+  <td>44165</td>\r
+  <td>41617</td>\r
+  <td>35026</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Arab Emirates</td>\r
+  <td>70</td>\r
+  <td>4599</td>\r
+  <td>5193</td>\r
+  <td>6109</td>\r
+  <td>8253</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Kingdom</td>\r
+  <td>50616</td>\r
+  <td>61565</td>\r
+  <td>63528</td>\r
+  <td>66601</td>\r
+  <td>72365</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Republic of Tanzania</td>\r
+  <td>7650</td>\r
+  <td>43739</td>\r
+  <td>52109</td>\r
+  <td>67394</td>\r
+  <td>109450</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States of America</td>\r
+  <td>157813</td>\r
+  <td>314659</td>\r
+  <td>332334</td>\r
+  <td>358735</td>\r
+  <td>403932</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States Virgin Islands</td>\r
+  <td>27</td>\r
+  <td>110</td>\r
+  <td>108</td>\r
+  <td>103</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uruguay</td>\r
+  <td>2239</td>\r
+  <td>3361</td>\r
+  <td>3430</td>\r
+  <td>3546</td>\r
+  <td>3637</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uzbekistan</td>\r
+  <td>6314</td>\r
+  <td>27488</td>\r
+  <td>29456</td>\r
+  <td>32715</td>\r
+  <td>36439</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Vanuatu</td>\r
+  <td>48</td>\r
+  <td>240</td>\r
+  <td>276</td>\r
+  <td>338</td>\r
+  <td>482</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Venezuela (Bolivarian Republic of)</td>\r
+  <td>5094</td>\r
+  <td>28583</td>\r
+  <td>31292</td>\r
+  <td>35370</td>\r
+  <td>42042</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Viet Nam</td>\r
+  <td>27367</td>\r
+  <td>88069</td>\r
+  <td>93647</td>\r
+  <td>102054</td>\r
+  <td>111666</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Wallis and Futuna Islands</td>\r
+  <td>7</td>\r
+  <td>15</td>\r
+  <td>16</td>\r
+  <td>17</td>\r
+  <td>17</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Western Sahara</td>\r
+  <td>14</td>\r
+  <td>513</td>\r
+  <td>625</td>\r
+  <td>775</td>\r
+  <td>938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Yemen</td>\r
+  <td>4316</td>\r
+  <td>23580</td>\r
+  <td>27819</td>\r
+  <td>35509</td>\r
+  <td>53689</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zambia</td>\r
+  <td>2340</td>\r
+  <td>12935</td>\r
+  <td>14980</td>\r
+  <td>18890</td>\r
+  <td>28957</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zimbabwe</td>\r
+  <td>2747</td>\r
+  <td>12523</td>\r
+  <td>14029</td>\r
+  <td>16780</td>\r
+  <td>22178</td>\r
+ </tr>\r
+</tbody>\r
+</table>\r
+\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/php/ex2editfilter.php b/examples/php/ex2editfilter.php
new file mode 100644 (file)
index 0000000..6f20ab5
--- /dev/null
@@ -0,0 +1,146 @@
+<?php
+if (!isset ($_SESSION)) session_start();
+header("Cache-Control: no-cache");
+header("Pragma: no-cache");
+header("Expires: ".gmdate("D, d M Y H:i:s",time()+(-1*60))." GMT");
+header('Content-type: text/html; charset=utf-8');
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Rico LiveGrid-Example 2 (editable)</title>
+<?php
+require "dbConnect.php";
+require "LoadRicoClient.php";
+require "../../plugins/php/ricoLiveGridForms.php";
+?>
+
+<script type='text/javascript'>
+Rico.loadModule('LiveGridForms','Calendar','Tree');
+
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.
+
+function orders_FormInit() {
+  var cal=new Rico.CalendarControl("Cal");
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');
+  
+  var CustTree=new Rico.TreeControl("CustomerTree","CustTree.php");
+  Rico.EditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');
+}
+</script>
+
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+<style type="text/css">
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {
+       height:1.5em;
+}
+div.ricoLG_cell {
+  white-space:nowrap;
+}
+</style>
+</head>
+<body>
+
+<?php
+//************************************************************************************************************
+//  LiveGrid Plus-Edit Example
+//************************************************************************************************************
+//  Matt Brown
+//************************************************************************************************************
+if (OpenGridForm("", "orders")) {
+  if ($oForm->action == "table") {
+    DisplayTable();
+  }
+  else {
+    DefineFields();
+  }
+} else {
+  echo 'open failed';
+}
+CloseApp();
+
+function DisplayTable() {
+  global $oForm,$oDB;
+  echo "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>";
+  echo "Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>";
+  echo "<hr>The data on this grid can be edited using pop-up forms. ";
+  echo "Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. ";
+  echo "The Add and Edit forms are automatically generated by LiveGrid. ";
+  echo "Notice on the Add form how you use the Rico Tree control to select the customer. ";
+  echo "Notice on the Edit form how the Rico Calendar is used to change dates. ";
+  echo "Updates are disabled on the database, so you will get an error message if you try to save.";
+  echo "</td><td>";
+  echo "<script type='text/javascript'><!--\n";
+  echo "google_ad_client = 'pub-7218597156507462';\n";
+  echo "/* 125x125, created 5/11/09 */\n";
+  echo "google_ad_slot = '9298106441';\n";
+  echo "google_ad_width = 125;\n";
+  echo "google_ad_height = 125;\n";
+  echo "//-->\n";
+  echo "</script>\n";
+  echo "<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>\n";
+  echo "</td></tr></table>";
+  echo "<p><strong>Orders Table</strong></p>";
+
+  $oForm->options["panelWidth"]=500;
+  $oForm->options["frozenColumns"]=1;
+  $oForm->options["menuEvent"]='click';
+  $oForm->options["highlightElem"]='cursorRow';
+  //$GLOBALS['oForm']->options["DebugFlag"]=true;
+  //$GLOBALS['oDB']->debug=true;
+  DefineFields();
+  //echo "<p><textarea id='orders_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>";
+}
+
+function DefineFields() {
+  global $oForm,$oDB;
+  $oForm->options["FilterLocation"]=-1;
+
+  $oForm->AddPanel("Basic Info");
+  $oForm->AddEntryFieldW("OrderID", "Order ID", "B", "<auto>", 50);
+  $oForm->ConfirmDeleteColumn();
+  $oForm->SortAsc();
+
+  $LookupSQL="select CustomerID,CompanyName from customers order by CompanyName";
+  $oForm->AddLookupField("CustomerID",null,"CustID","Customer","CL","",$LookupSQL);
+  $oForm->LookupField["SelectCtl"]="CustomerTree";
+  $oForm->LookupField["InsertOnly"]=true;   // do not allow customer to be changed once an order is entered
+  $oForm->CurrentField["width"]=160;
+  $oForm->CurrentField["filterUI"]="t";
+
+  $LookupSQL="select EmployeeID,".$oDB->concat(array("LastName", "', '", "FirstName"), false)." from employees order by LastName,FirstName";
+  $oForm->AddLookupField("EmployeeID",null,"EmployeeID","Sales Person","SL","",$LookupSQL);
+  $oForm->CurrentField["width"]=140;
+  $oForm->CurrentField["filterUI"]="m";
+
+  $oForm->AddEntryField("OrderDate", "Order Date", "D", strftime('%Y-%m-%d'));
+  $oForm->CurrentField["SelectCtl"]="Cal";
+  $oForm->CurrentField["width"]=90;
+  $oForm->AddEntryField("RequiredDate", "Required Date", "D", strftime('%Y-%m-%d'));
+  $oForm->CurrentField["SelectCtl"]="Cal";
+  $oForm->CurrentField["width"]=90;
+  $oForm->AddCalculatedField("select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID","Net Sale");
+  $oForm->CurrentField["format"]="DOLLAR";
+  $oForm->CurrentField["width"]=80;
+
+  $oForm->AddPanel("Ship To");
+  $oForm->AddEntryFieldW("ShipName", "Name", "B", "",140);
+  $oForm->AddEntryFieldW("ShipAddress", "Address", "B", "",140);
+  $oForm->AddEntryFieldW("ShipCity", "City", "B", "",120);
+  $oForm->CurrentField["filterUI"]="s";
+  $oForm->AddEntryFieldW("ShipRegion", "Region", "T", "",60);
+  $oForm->AddEntryFieldW("ShipPostalCode", "Postal Code", "T", "",100);
+  
+  // display ShipCountry with a link to wikipedia
+  $colnum=$oForm->AddEntryFieldW("ShipCountry", "Country", "N", "",100);
+  $oForm->CurrentField["control"]="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{".$colnum."}','_blank')";
+  $oForm->CurrentField["filterUI"]="s";
+
+  $oForm->DisplayPage();
+}
+?>
+
+
+</body>
+</html>
diff --git a/examples/php/ex2json.php b/examples/php/ex2json.php
new file mode 100644 (file)
index 0000000..0605da3
--- /dev/null
@@ -0,0 +1,108 @@
+<?php\r
+if (!isset ($_SESSION)) session_start();\r
+?>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2</title>\r
+\r
+<?php\r
+require "dbConnect.php";\r
+require "LoadRicoClient.php";\r
+\r
+session_set_cookie_params(60*60);\r
+$sqltext="select OrderID,CustomerID,ShipName,ShipCity,ShipCountry,OrderDate,ShippedDate from orders order by OrderID";\r
+if (isset($_GET["id"])) {\r
+  OpenDB(); // the addQuotes function requires a db connection when using MySQL\r
+  $id=trim($_GET["id"]);\r
+  if (strlen($id) == 5) $sqltext.=" where CustomerID=".$GLOBALS['oDB']->addQuotes($id);\r
+  CloseApp();\r
+}\r
+$_SESSION['ex2']=$sqltext;\r
+?>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var orderGrid,buffer;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs   : [,,,,,{type:'date'},{type:'date'}]\r
+  };\r
+  buffer=new Rico.Buffer.AjaxSQL('ricoQuery.php', {fmt:'json', TimeOut:<?php print array_shift(session_get_cookie_params())/60 ?>});\r
+  orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);\r
+  orderGrid.menu=new Rico.GridMenu({});\r
+});\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example uses AJAX to fetch order data, as required, from the server. \r
+Notice how the number of visible rows is set automatically based\r
+on the size of the window. Try the different grid styles that\r
+are available. \r
+Click on a cell to see available actions.\r
+<a href='ricoQuery.php?id=ex2&offset=0&page_size=10&_fmt=json'>View the AJAX response (JSON)</a>\r
+(requires JSONview or similar extension in FF).\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id='ex2_timer' class='ricoSessionTimer'></span><span id="ex2_bookmark">&nbsp;</span></p>\r
+<table id="ex2" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+<colgroup>\r
+<col style='width:40px;' >\r
+<col style='width:60px;' >\r
+<col style='width:150px;'>\r
+<col style='width:80px;' >\r
+<col style='width:90px;' >\r
+<col style='width:100px;'>\r
+<col style='width:100px;'>\r
+</colgroup>\r
+  <tr>\r
+         <th>Order#</th>\r
+         <th>Customer#</th>\r
+         <th>Ship Name</th>\r
+         <th>Ship City</th>\r
+         <th>Ship Country</th>\r
+         <th>Order Date</th>\r
+         <th>Ship Date</th>\r
+  </tr>\r
+</table>\r
+<!--\r
+<textarea id='ex2_debugmsgs' rows='5' cols='80'></textarea>\r
+-->\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/php/ex2nosession.php b/examples/php/ex2nosession.php
new file mode 100644 (file)
index 0000000..1cffedc
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+header("Cache-Control: no-cache");
+header("Pragma: no-cache");
+header("Expires: ".gmdate("D, d M Y H:i:s",time()+(-1*60))." GMT");
+header('Content-type: text/html; charset=utf-8');
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Rico LiveGrid-Example 2 (editable)</title>
+<?php
+require "dbConnect.php";
+require "../../plugins/php/ricoLiveGridForms.php";
+require "../../plugins/php/ricoResponse.php";
+
+//************************************************************************************************************
+//  LiveGrid Plus-Edit Example
+//************************************************************************************************************
+//  Matt Brown
+//************************************************************************************************************
+if (OpenGridForm("", "orders")) {
+  switch ($oForm->action) {
+    case "table":
+      break;
+    case "query":
+      DefineFields();
+      $oXmlResp= new ricoXmlResponse();
+      $oXmlResp->sendDebugMsgs=true;
+      $oXmlResp->convertCharSet=true;  // MySQL sample database is encoded with ISO-8859-1
+      $oXmlResp->ProcessQuery($oForm->gridID, $oForm->SqlSelectData());
+      $oXmlResp=NULL;
+      ob_end_flush();
+      exit();
+    default:
+      DefineFields();
+      $oForm->DisplayPage();
+      ob_end_flush();
+      exit();
+  }
+} else {
+  echo 'open failed';
+  ob_end_flush();
+  exit();
+}
+require "LoadRicoClient.php";
+?>
+
+<script type='text/javascript'>
+Rico.loadModule('LiveGridForms','Calendar','Tree');
+
+// ricoLiveGridForms will call orders_FormInit right before grid & form initialization.
+
+function orders_FormInit() {
+  var cal=new Rico.CalendarControl("Cal");
+  Rico.EditControls.register(cal, Rico.imgDir+'calarrow.png');
+  
+  var CustTree=new Rico.TreeControl("CustomerTree","CustTree.php");
+  Rico.EditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');
+}
+</script>
+
+<link href="../demo.css" type="text/css" rel="stylesheet" />
+<style type="text/css">
+div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {
+       height:1.5em;
+}
+div.ricoLG_cell {
+  white-space:nowrap;
+}
+</style>
+</head>
+<body>
+
+
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>
+Base Library: <script type='text/javascript'>document.write(Rico.Lib+' '+Rico.LibVersion);</script>
+<hr>The data on this grid can be edited using pop-up forms. 
+Just click on a grid cell and then select Edit, Delete, or Add from the pop-up menu. 
+The Add and Edit forms are automatically generated by LiveGrid. 
+Notice on the Add form how you use the Rico Tree control to select the customer. 
+Notice on the Edit form how the Rico Calendar is used to change dates. 
+Updates are disabled on the database, so you will get an error message if you try to save.
+</td><td>
+<script type='text/javascript'><!--
+google_ad_client = 'pub-7218597156507462';
+/* 125x125, created 5/11/09 */
+google_ad_slot = '9298106441';
+google_ad_width = 125;
+google_ad_height = 125;
+//-->
+</script>
+<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>
+</td></tr></table>
+
+<p><strong>Orders Table</strong></p>
+
+<?php
+DefineFields();
+$oForm->DisplayPage();
+//echo "<p><textarea id='orders_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>";
+CloseApp();
+
+
+function DefineFields() {
+  global $oForm,$oDB;
+  $oForm->options["FilterLocation"]=-1;
+  $oForm->options["panelWidth"]=500;
+  $oForm->options["frozenColumns"]=1;
+  $oForm->options["menuEvent"]='click';
+  $oForm->options["highlightElem"]='cursorRow';
+  $oForm->options["XMLprovider"]=$_SERVER['SCRIPT_NAME'];
+  $oForm->sessions=false;
+  //$GLOBALS['oForm']->options["DebugFlag"]=true;
+  //$GLOBALS['oDB']->debug=true;
+
+  $oForm->AddPanel("Basic Info");
+  $oForm->AddEntryFieldW("OrderID", "Order ID", "B", "<auto>", 50);
+  $oForm->ConfirmDeleteColumn();
+  $oForm->SortAsc();
+
+  $LookupSQL="select CustomerID,CompanyName from customers order by CompanyName";
+  $oForm->AddLookupField("CustomerID",null,"CustID","Customer","CL","",$LookupSQL);
+  $oForm->LookupField["SelectCtl"]="CustomerTree";
+  $oForm->LookupField["InsertOnly"]=true;   // do not allow customer to be changed once an order is entered
+  $oForm->CurrentField["width"]=160;
+  $oForm->CurrentField["filterUI"]="t";
+
+  $LookupSQL="select EmployeeID,".$oDB->concat(array("LastName", "', '", "FirstName"), false)." from employees order by LastName,FirstName";
+  $oForm->AddLookupField("EmployeeID",null,"EmployeeID","Sales Person","SL","",$LookupSQL);
+  $oForm->CurrentField["width"]=140;
+  $oForm->CurrentField["filterUI"]="s";
+
+  $oForm->AddEntryField("OrderDate", "Order Date", "D", strftime('%Y-%m-%d'));
+  $oForm->CurrentField["SelectCtl"]="Cal";
+  $oForm->CurrentField["width"]=90;
+  $oForm->AddEntryField("RequiredDate", "Required Date", "D", strftime('%Y-%m-%d'));
+  $oForm->CurrentField["SelectCtl"]="Cal";
+  $oForm->CurrentField["width"]=90;
+  $oForm->AddCalculatedField("select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID","Net Sale");
+  $oForm->CurrentField["format"]="DOLLAR";
+  $oForm->CurrentField["width"]=80;
+
+  $oForm->AddPanel("Ship To");
+  $oForm->AddEntryFieldW("ShipName", "Name", "B", "",140);
+  $oForm->AddEntryFieldW("ShipAddress", "Address", "B", "",140);
+  $oForm->AddEntryFieldW("ShipCity", "City", "B", "",120);
+  $oForm->CurrentField["filterUI"]="s";
+  $oForm->AddEntryFieldW("ShipRegion", "Region", "T", "",60);
+  $oForm->AddEntryFieldW("ShipPostalCode", "Postal Code", "T", "",100);
+  
+  // display ShipCountry with a link to wikipedia
+  $colnum=$oForm->AddEntryFieldW("ShipCountry", "Country", "N", "",100);
+  $oForm->CurrentField["control"]="new Rico.TableColumn.link('http://en.wikipedia.org/wiki/{".$colnum."}','_blank')";
+  $oForm->CurrentField["filterUI"]="s";
+}
+?>
+
+
+</body>
+</html>
diff --git a/examples/php/ex2xml.php b/examples/php/ex2xml.php
new file mode 100644 (file)
index 0000000..0835b95
--- /dev/null
@@ -0,0 +1,107 @@
+<?php\r
+if (!isset ($_SESSION)) session_start();\r
+?>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Example 2</title>\r
+\r
+<?php\r
+require "dbConnect.php";\r
+require "LoadRicoClient.php";\r
+\r
+session_set_cookie_params(60*60);\r
+$sqltext="select OrderID,CustomerID,ShipName,ShipCity,ShipCountry,OrderDate,ShippedDate from orders order by OrderID";\r
+if (isset($_GET["id"])) {\r
+  OpenDB(); // the addQuotes function requires a db connection when using MySQL\r
+  $id=trim($_GET["id"]);\r
+  if (strlen($id) == 5) $sqltext.=" where CustomerID=".$GLOBALS['oDB']->addQuotes($id);\r
+  CloseApp();\r
+}\r
+$_SESSION['ex2']=$sqltext;\r
+?>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var orderGrid,buffer;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs   : [,,,,,{type:'date'},{type:'date'}]\r
+  };\r
+  buffer=new Rico.Buffer.AjaxSQL('ricoQuery.php', {TimeOut:<?php print array_shift(session_get_cookie_params())/60 ?>});\r
+  orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);\r
+  orderGrid.menu=new Rico.GridMenu({});\r
+});\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example uses AJAX to fetch order data, as required, from the server. \r
+Notice how the number of visible rows is set automatically based\r
+on the size of the window. Try the different grid styles that\r
+are available. \r
+Click on a cell to see available actions.\r
+<a href='ricoQuery.php?id=ex2&offset=0&page_size=10&get_total=true'>View the AJAX response (XML)</a>.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id='ex2_timer' class='ricoSessionTimer'></span><span id="ex2_bookmark">&nbsp;</span></p>\r
+<table id="ex2" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+<colgroup>\r
+<col style='width:40px;' >\r
+<col style='width:60px;' >\r
+<col style='width:150px;'>\r
+<col style='width:80px;' >\r
+<col style='width:90px;' >\r
+<col style='width:100px;'>\r
+<col style='width:100px;'>\r
+</colgroup>\r
+  <tr>\r
+         <th>Order#</th>\r
+         <th>Customer#</th>\r
+         <th>Ship Name</th>\r
+         <th>Ship City</th>\r
+         <th>Ship Country</th>\r
+         <th>Order Date</th>\r
+         <th>Ship Date</th>\r
+  </tr>\r
+</table>\r
+<!--\r
+<textarea id='ex2_debugmsgs' rows='5' cols='80'></textarea>\r
+-->\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/php/flickrPhotos.php b/examples/php/flickrPhotos.php
new file mode 100644 (file)
index 0000000..20a1883
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+header("Cache-Control: no-cache");\r
+header("Pragma: no-cache");\r
+header("Expires: ".gmdate("D, d M Y H:i:s",time()+(-1*60))." GMT");\r
+header("Content-type: text/xml");\r
+echo "<"."?xml version='1.0' encoding='UTF-8'?".">\n";\r
+\r
+include("../../plugins/php/class.xml.parser.php");
+
+// -----------------------------------------------------------------------------
+// This script takes a "tags" parameter from the query string
+// and returns a list of flickr photos with that tag in the Rico LiveGrid format
+//
+// PLEASE USE YOUR OWN FLICKR API KEY
+// Get one at: http://flickr.com/services/
+//
+// Created by Matt Brown, Dec 2007
+// -----------------------------------------------------------------------------
+
+$flickrKey="3773d42a5766f0bd27caa1d584ae0bc9";\r
+$id=isset($_GET["id"]) ? $_GET["id"] : "";\r
+$tags=isset($_GET["tags"]) ? $_GET["tags"] : "";
+
+echo "\n<ajax-response><response type='object' id='".$id."_updater'>";\r
+
+print "\n<rows update_ui='true'>";
+
+$url="http://api.flickr.com/services/rest/?method=flickr.photos.search";
+$cnt=0;
+if ($tags != "") {
+  $url.="&safe_search=1";
+  $url.="&tag_mode=all";
+  $url.="&sort=interestingness-desc";
+  $url.="&extras=date_taken,owner_name,geo,tags";
+  $url.="&tags=".$tags;
+  $url.="&api_key=".$flickrKey;
+  $parser = new xmlParser();
+  $parser->parse($url);
+  $status=$parser->output[0]['attrs']['STAT'];
+  
+  // FOR DEBUGGING PURPOSES
+  //print $status;
+  //print "<hr><pre>";
+  //print_r($parser->output);
+  //print "</pre>";
+
+  $content=&$parser->output[0]['child'][0]['child'];
+  foreach ($content as $item) {
+    if ($item['name'] == "PHOTO") {
+      print "<tr>";
+      // "_s" suffix specifies a 75x75 pixel format
+      $photourl="http://farm".$item['attrs']['FARM'].".static.flickr.com/".$item['attrs']['SERVER']."/".$item['attrs']['ID']."_".$item['attrs']['SECRET']."_s.jpg";
+      //print "<p><img src='".$photourl."'>";
+      print XmlCell($photourl);
+      print XmlCell($item['attrs']['TITLE']);
+      print XmlCell($item['attrs']['OWNERNAME']);
+      print XmlCell($item['attrs']['DATETAKEN']);
+      print XmlCell($item['attrs']['TAGS']);
+      print "</tr>";
+      $cnt++;
+    }
+  }
+}
+
+print "\n"."</rows>";\r
+echo "\n</response></ajax-response>";
+
+function XmlCell($value) {\r
+  return "<td>".htmlspecialchars($value)."</td>";\r
+}\r
+
+?>
diff --git a/examples/php/index.html b/examples/php/index.html
new file mode 100644 (file)
index 0000000..5404317
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\r
+<html>\r
+<HEAD>\r
+<title>Rico 3.0 PHP Examples</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+</HEAD>\r
+<frameset cols="300, *">\r
+  <frame name="menu" src="menu.html">\r
+  <frame name="content" src="../welcome.html" scrolling="yes">\r
+</frameset>\r
+</html>\r
diff --git a/examples/php/menu.html b/examples/php/menu.html
new file mode 100644 (file)
index 0000000..1457d8b
--- /dev/null
@@ -0,0 +1,183 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
+<html>\r
+<head>\r
+<title>Rico 3.0</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<base target="content">\r
+\r
+<script src="../../ricoClient/js/baselibs/prototype.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico2Proto.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<link href="../../ricoClient/css/rico.css" type="text/css" rel="stylesheet" />\r
+\r
+<script src="../menu.js" type="text/javascript"></script>\r
+<link href="../menu.css" type="text/css" rel="stylesheet">\r
+\r
+<!--[if lt IE 7]>\r
+  <style type="text/css">\r
+ul li {
+   height: 1%;\r
+}
+ </style>\r
+<![endif]-->\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<div id="menuheader">
+<p>Rico <span id='RicoVersion'></span> <span id='RicoDir'></span> Demo</p>\r
+</div>
+\r
+<div class='top'>\r
+<form action='' method='get' id='form1'>\r
+<ul>\r
+<li id='demolist'>Example: <span id='demospan'></span>\r
+<li>Theme: <span id='themespan'></span><input type='hidden' name='theme' id='theme' value=''>\r
+<li>Base Lib: <span id='libspan'></span><input type='hidden' name='lib' id='lib' value=''>\r
+<li><input type='checkbox' name='log'>&nbsp; Enable logging\r
+</ul>\r
+</form>\r
+</div>\r
+\r
+\r
+<div id="accordion1">\r
+\r
+<div>\r
+  <div>Choose the Example</div>\r
+  <div>\r
+<ul>\r
+<li><a id="demo_widgets.php">Rico Widget Overview</a>\r
+<li><a id="demo_ex1.php">LiveGrid sourced from HTML table</a>\r
+<li><a id="demo_ex2xml.php">LiveGrid sourced from SQL database (xml)</a>\r
+<li><a id="demo_ex2json.php">LiveGrid sourced from SQL database (json)</a>\r
+<li><a id="demo_ShipperEdit.php">Editable LiveGrid (basic)</a>\r
+<li><a id="demo_ex2editfilter.php">Editable LiveGrid (advanced)</a>\r
+<li><a id="demo_ex2nosession.php">Editable LiveGrid without session vars</a>\r
+<li><a id="demo_photos.php">LiveGrid sourced from flickr</a>\r
+<li><a id="demo_simplegrid.php">SimpleGrid</a>\r
+<li><a id="demo_tree1.php">Tree control</a>\r
+<li><a id="demo_RicoDbViewer.php">Northwind data browser</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Theme</div>\r
+  <div>\r
+  <table border='0'>\r
+  <tr>\r
+  <td>Themeroller<br>Themes</td><td>Rico<br>Themes</td>\r
+  </tr>\r
+  <tr valign='top'>\r
+  <td>\r
+\r
+    <ul>\r
+<li><a id="theme_j-ui-lightness"><img src="../images/themeroller/theme_30_ui_light.png" alt="UI Lightness" title="UI Lightness" />\r
+<br><span class="themeName">UI lightness</span></a></li>\r
+\r
+<li><a id="theme_j-ui-darkness"><img src="../images/themeroller/theme_30_ui_dark.png" alt="UI Darkness" title="UI Darkness" />\r
+<br><span class="themeName">UI darkness</span></a></li>\r
+\r
+<li><a id="theme_j-smoothness"><img src="../images/themeroller/theme_30_smoothness.png" alt="Smoothness" title="Smoothness" />\r
+<br><span class="themeName">Smoothness</span></a></li>\r
+\r
+<li><a id="theme_j-start"><img src="../images/themeroller/theme_30_start_menu.png" alt="Start" title="Start" />\r
+<br><span class="themeName">Start</span></a></li>\r
+\r
+<li><a id="theme_j-redmond"><img src="../images/themeroller/theme_30_windoze.png" alt="Redmond" title="Redmond" />\r
+<br><span class="themeName">Redmond</span></a></li>\r
+\r
+<li><a id="theme_j-sunny"><img src="../images/themeroller/theme_30_sunny.png" alt="Sunny" title="Sunny" />\r
+<br><span class="themeName">Sunny</span></a></li>\r
+\r
+<li><a  id="theme_j-overcast"><img src="../images/themeroller/theme_30_overcast.png" alt="Overcast" title="Overcast" />\r
+<br><span class="themeName">Overcast</span></a></li>\r
+\r
+<li><a  id="theme_j-le-frog"><img src="../images/themeroller/theme_30_le_frog.png" alt="Le Frog" title="Le Frog" />\r
+<br><span class="themeName">Le Frog</span></a></li>\r
+\r
+<li><a  id="theme_j-flick"><img src="../images/themeroller/theme_30_flick.png" alt="Flick" title="Flick" />\r
+<br><span class="themeName">Flick</span></a></li>\r
+\r
+<li><a  id="theme_j-pepper-grinder"><img src="../images/themeroller/theme_30_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" />\r
+<br><span class="themeName">Pepper Grinder</span></a></li>\r
+\r
+<li><a  id="theme_j-eggplant"><img src="../images/themeroller/theme_30_eggplant.png" alt="Eggplant" title="Eggplant" />\r
+<br><span class="themeName">Eggplant</span></a></li>\r
+\r
+<li><a  id="theme_j-dark-hive"><img src="../images/themeroller/theme_30_dark_hive.png" alt="Dark Hive" title="Dark Hive" />\r
+<br><span class="themeName">Dark Hive</span></a></li>\r
+\r
+<li><a  id="theme_j-cupertino"><img src="../images/themeroller/theme_30_cupertino.png" alt="Cupertino" title="Cupertino" />\r
+<br><span class="themeName">Cupertino</span></a></li>\r
+\r
+<li><a  id="theme_j-south-street"><img src="../images/themeroller/theme_30_south_street.png" alt="South St" title="South St" />\r
+<br><span class="themeName">South Street</span></a></li>\r
+\r
+<li><a  id="theme_j-blitzer"><img src="../images/themeroller/theme_30_blitzer.png" alt="Blitzer" title="Blitzer" />\r
+<br><span class="themeName">Blitzer</span></a></li>    \r
+\r
+<li><a  id="theme_j-humanity"><img src="../images/themeroller/theme_30_humanity.png" alt="Humanity" title="Humanity" />\r
+<br><span class="themeName">Humanity</span></a></li>\r
+\r
+<li><a  id="theme_j-hot-sneaks"><img src="../images/themeroller/theme_30_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" />\r
+<br><span class="themeName">Hot sneaks</span></a></li>\r
+\r
+<li><a  id="theme_j-excite-bike"><img src="../images/themeroller/theme_30_excite_bike.png" alt="Excite Bike" title="Excite Bike" />\r
+<br><span class="themeName">Excite Bike</span></a></li>\r
+\r
+<li><a  id="theme_j-vader"><img src="../images/themeroller/theme_30_black_matte.png" alt="Vader" title="Vader" />\r
+<br><span class="themeName">Vader</span></a></li>\r
+\r
+<li><a  id="theme_j-dot-luv"><img src="../images/themeroller/theme_30_dot_luv.png" alt="Dot Luv" title="Dot Luv" />\r
+<br><span class="themeName">Dot Luv</span></a></li>\r
+\r
+<li><a  id="theme_j-mint-choc"><img src="../images/themeroller/theme_30_mint_choco.png" alt="Mint Choc" title="Mint Choc" />\r
+<br><span class="themeName">Mint Choc</span></a></li>\r
+\r
+<li><a  id="theme_j-black-tie"><img src="../images/themeroller/theme_30_black_tie.png" alt="Black Tie" title="Black Tie" />\r
+<br><span class="themeName">Black Tie</span></a></li>\r
+\r
+<li><a  id="theme_j-trontastic"><img src="../images/themeroller/theme_30_trontastic.png" alt="Trontastic" title="Trontastic" />\r
+<br><span class="themeName">Trontastic</span></a></li>\r
+\r
+<li><a  id="theme_j-swanky-purse"><img src="../images/themeroller/theme_30_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" />\r
+<br><span class="themeName">Swanky Purse</span></a></li>\r
+    </ul>\r
+\r
+    </td><td>\r
+\r
+    <ul>\r
+  <li><a id='theme_r-greenHdg'>Green Heading</a></li>\r
+  <li><a id='theme_r-warmfall'>Warm Fall</a></li>\r
+  <li><a id='theme_r-seaglass'>Sea Glass</a></li>\r
+  <li><a id='theme_r-coffee-with-milk'>Coffee with milk</a></li>\r
+  <li><a id='theme_r-grayedout'>Grayed out</a></li>\r
+    </ul>\r
+\r
+  </td>\r
+  </tr>\r
+  </table>\r
+\r
+\r
+  </div>\r
+</div>\r
+\r
+<div>\r
+  <div>Choose the Base Library</div>\r
+  <div>\r
+<ul>\r
+<li><a id='lib_proto'>Prototype</a>\r
+<li><a id='lib_jquery'>jQuery</a>\r
+<li><a id='lib_moo'>MooTools</a>\r
+<li><a id='lib_dojo'>dojo</a>\r
+<li><a id='lib_ext'>Ext</a>\r
+<li><a id='lib_glow'>Glow</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+</div>\r
+</body></html>\r
diff --git a/examples/php/photos.php b/examples/php/photos.php
new file mode 100644 (file)
index 0000000..ba5316e
--- /dev/null
@@ -0,0 +1,129 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-Photo Example</title>\r
+\r
+<?php\r
+require "LoadRicoClient.php";\r
+?>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
+\r
+var photoGrid, photoBuffer, imgctl, img_popup, animator;\r
+\r
+Rico.onLoad( function() {\r
+  imgctl=new Rico.TableColumn.image();\r
+  var opts = {  \r
+    prefetchBuffer: false,\r
+    defaultWidth  : 100,\r
+    useUnformattedColWidth:false,\r
+    headingSort   : 'hover',\r
+    columnSpecs   : [{control:imgctl,width:90},,,\r
+                     {type:'datetime'},{width:200}]\r
+  };\r
+  photoBuffer=new Rico.Buffer.AjaxXML('flickrPhotos.php');\r
+  photoGrid=new Rico.LiveGrid ('photogrid', photoBuffer, opts);\r
+  photoGrid.menu=new Rico.GridMenu();\r
+  \r
+  // do something special when the mouse hovers over an image\r
+  for (var i=0; i<imgctl._img.length; i++) {\r
+    Rico.eventBind(imgctl._img[i],'mouseover',Rico.eventHandle(window,'img_mouseover'));\r
+    Rico.eventBind(imgctl._img[i],'mouseout',Rico.eventHandle(window,'img_mouseout'));\r
+  }\r
+  img_popup=document.getElementById('img_popup');\r
+});\r
+\r
+function img_mouseover(e) {\r
+  Rico.eventStop(e);\r
+  var elem=Rico.eventElement(e);\r
+  img_popup.style.display='block';\r
+  var imgPos=Rico.cumulativeOffset(elem);\r
+  img_popup.src=elem.src.replace(/_s\.jpg/,'_m.jpg');\r
+  img_popup.style.left=(imgPos.left+elem.offsetWidth+10)+'px';\r
+  var winHt=Rico.windowHeight();\r
+  window.status='winHt='+winHt+' imgTop='+imgPos.top\r
+  if (imgPos.top > winHt/2) {\r
+    img_popup.style.bottom=(winHt-imgPos.top-elem.offsetHeight)+'px';\r
+    img_popup.style.top='';\r
+  } else {\r
+    img_popup.style.top=(imgPos.top)+'px';\r
+    img_popup.style.bottom='';\r
+  }
+}\r
+\r
+function img_mouseout(e) {\r
+  Rico.eventStop(e);\r
+  img_popup.style.display='none';\r
+}\r
+\r
+function UpdateGrid() {\r
+  var tags=document.getElementById('tags').value;\r
+  if (tags) {\r
+    photoGrid.resetContents(false);\r
+    photoBuffer.fetchData=true;  // force another XML fetch\r
+    photoBuffer.options.requestParameters=[{name:'tags',value:tags}];\r
+    photoGrid.filterHandler();\r
+  } else {\r
+    alert('Please enter one or more keywords separated by commas');\r
+  }\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+.ricoLG_bottom div.ricoLG_cell { height:80px; }  /* thumbnails are 75x75 pixels */\r
+#explanation * { font-size: 8pt; }\r
+</style>\r
+\r
+</head>\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+<form onsubmit='UpdateGrid(); return false;'>\r
+<p>Get <a href="http://www.flickr.com">Flickr</a> photos tagged with these keywords (separate words with commas):\r
+<p><input type='text' id='tags'>\r
+<input type='submit' value='Get Photos'>\r
+</form>\r
+</td><td>\r
+<p>Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+When fetching data, this script issues an XMLHttpRequest to a proxy script which uses the Flickr API\r
+to process the query and format the response in the Rico LiveGrid XML format.\r
+<p>Try moving your cursor over each photo...\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+<p class="ricoBookmark"><span id="photogrid_bookmark">&nbsp;</span></p>\r
+<table id="photogrid" class="ricoLiveGrid" cellspacing="0" cellpadding="0">\r
+  <tr>\r
+         <th>Photo</th>\r
+         <th>Title</th>\r
+         <th>Owner</th>\r
+         <th>Date Taken</th>\r
+         <th>Tags</th>\r
+  </tr>\r
+</table>\r
+\r
+<img id='img_popup' style='display:none;position:absolute;'>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/php/ricoQuery.php b/examples/php/ricoQuery.php
new file mode 100644 (file)
index 0000000..513221d
--- /dev/null
@@ -0,0 +1,28 @@
+<?php\r
+if (!isset ($_SESSION)) session_start();\r
+\r
+require "dbConnect.php";\r
+require "../../plugins/php/ricoResponse.php";\r
+\r
+$id=isset($_GET["id"]) ? $_GET["id"] : "";\r
+$oXmlResp= new ricoXmlResponse();\r
+$errmsg='';\r
+$query='';\r
+$filters=array();\r
+\r
+if (!isset($_SESSION[$id])) {\r
+  $errmsg="Your connection with the server was idle for too long and timed out. Please refresh this page and try again.";\r
+} elseif (!OpenDB()) {\r
+  $errmsg=$oDB->LastErrorMsg;\r
+} else {\r
+  $query=$_SESSION[$id];\r
+  if (isset($_SESSION[$id . ".filters"])) $filters=$_SESSION[$id . ".filters"];\r
+  $oXmlResp->SetDbConn($oDB);\r
+  $oXmlResp->sendDebugMsgs=true;\r
+  $oXmlResp->convertCharSet=true;  // MySQL sample database is encoded with ISO-8859-1\r
+}\r
+$oXmlResp->ProcessQuery($id, $query, $filters, $errmsg);\r
+$oXmlResp=NULL;\r
+CloseApp();\r
+\r
+?>
\ No newline at end of file
diff --git a/examples/php/simplegrid.php b/examples/php/simplegrid.php
new file mode 100644 (file)
index 0000000..9db57e3
--- /dev/null
@@ -0,0 +1,195 @@
+<?php \r
+ob_start(); \r
+header('Content-type: text/html; charset=utf-8');\r
+?>\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico SimpleGrid-Example 1</title>\r
+\r
+<?php\r
+require "dbConnect.php";\r
+require "LoadRicoClient.php";\r
+require "../../plugins/php/SimpleGrid.php";\r
+?>\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('SimpleGrid');\r
+\r
+var ex1;\r
+Rico.onLoad( function() {\r
+  var opts = {  \r
+    columnSpecs   : [{width:200},'specQty','specQty','specQty','specQty']\r
+  };\r
+  ex1=new Rico.SimpleGrid ('ex1', opts);\r
+  if (!Rico.isIE) document.getElementById('owc').disabled=true;\r
+});\r
+\r
+function ExportGridClient(ExportType) {\r
+  ex1.printVisible(ExportType);\r
+}\r
+\r
+function ExportGridServer(ExportType) {\r
+  if (Rico.isIE) {\r
+    location.href+='&fmt='+ExportType;\r
+  } else {\r
+    window.open(location.href+'&fmt='+ExportType);\r
+  }\r
+}\r
+</script>\r
+\r
+<style type="text/css">\r
+.CatHead {\r
+  background:blue;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+.Subtotal {\r
+  background:#888;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+.GrandTotal {\r
+  background:black;\r
+  color:white;\r
+  font-weight:bold !important;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body>\r
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p><strong>Rico: SimpleGrid</strong></p>\r
+<p>Rico's SimpleGrid is an unbuffered grid - all data exists in the DOM.\r
+It shares many of the same characteristics as Rico's better known LiveGrid.\r
+SimpleGrids have resizable columns, frozen columns on the left, and can use the\r
+same CSS styling as LiveGrids. Sorting and filtering can also be enabled\r
+at the developer's discretion. Unlike LiveGrids, each cell in a SimpleGrid\r
+can be formatted individually.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<div>\r
+<button onclick="ExportGridClient('plain')">Export from client<br>to HTML Table</button>\r
+<button onclick="ExportGridClient('owc')" id="owc">Export from client<br>to OWC spreadsheet</button>\r
+<button onclick="ExportGridServer('xl')">Export from server<br>to Excel</button>\r
+<button onclick="ExportGridServer('csv')">Export from server<br>to CSV</button>\r
+</div>\r
+\r
+<?php\r
+\r
+if (!OpenDB()) {\r
+  echo "<p>ERROR opening database!";\r
+} else {\r
+  $grid=new SimpleGrid();\r
+  FillGrid();\r
+  $fmt=isset($_GET["fmt"]) ? $_GET["fmt"] : "";\r
+  switch (strtolower($fmt)) {\r
+    case "xl": \r
+      $grid->RenderExcel("rico.xls");\r
+      break;\r
+    case "csv":\r
+      $grid->RenderDelimited("rico.csv", ",", "");\r
+      break;\r
+    default:\r
+      $grid->Render("ex1", 0);   // output html\r
+      break;\r
+  }\r
+}\r
+\r
+\r
+\r
+function FillGrid() {\r
+  global $oDB,$grid;\r
+  $subtotals=array();\r
+  $grandtotals=array();\r
+  for ($i=0; $i<=1; $i++) {\r
+    $grandtotals[$i]=0;\r
+  }\r
+  // define heading\r
+  $grid->AddHeadingRow(true);\r
+  $grid->AddCell("Product");\r
+  $grid->AddCell("Gross Sales");\r
+  $grid->AddCell("Discounts");\r
+  $grid->AddCell("Net Sales");\r
+  $grid->AddCell("Avg Discount");\r
+  $sqltext="select CategoryName,ProductName, SUM(od.UnitPrice*Quantity) as GrossSales, SUM(od.UnitPrice*Quantity*Discount) as Discounts from (Order_Details od inner join Products p on p.ProductID=od.ProductID) inner join Categories c on p.CategoryID=c.CategoryID group by CategoryName,ProductName order by CategoryName,ProductName";\r
+  $rsMain=$oDB->RunQuery($sqltext);\r
+  while ($oDB->db->FetchRow($rsMain,$row)) {\r
+    $category=$row[0];\r
+    $Gross=$row[2];\r
+    $Discounts=$row[3];\r
+    if ($category != $lastCategory) {\r
+      if (!empty($lastCategory)) {\r
+        AddRow("Subtotal", $subtotals[0], $subtotals[1]);\r
+        $grid->SetRowAttr("class", "Subtotal");\r
+      }\r
+      $grid->AddDataRow();\r
+      $grid->SetRowAttr("class", "CatHead");\r
+      $grid->AddCell($category);\r
+      $grid->AddCell("");\r
+      $grid->AddCell("");\r
+      $grid->AddCell("");\r
+      $grid->AddCell("");\r
+      for ($i=0; $i<=1; $i++) {\r
+        $subtotals[$i]=0;\r
+      }\r
+      $lastCategory=$category;\r
+    }\r
+    $subtotals[0]+=$Gross;\r
+    $grandtotals[0]+=$Gross;\r
+    $subtotals[1]+=$Discounts;\r
+    $grandtotals[1]+=$Discounts;\r
+    AddRow($row[1], $Gross, $Discounts);\r
+  }\r
+  $oDB->rsClose($rsMain);\r
+  if (!empty($lastCategory)) {\r
+    AddRow("Subtotal", $subtotals[0], $subtotals[1]);\r
+    $grid->SetRowAttr("class", "Subtotal");\r
+  }\r
+  AddRow("Grand Total", $grandtotals[0], $grandtotals[1]);\r
+  $grid->SetRowAttr("class", "GrandTotal");\r
+}\r
+\r
+function AddRow($ProductName, $Gross, $Discounts) {\r
+  global $grid;\r
+  $grid->AddDataRow();\r
+  $grid->AddCell(htmlspecialchars(utf8_encode($ProductName), ENT_COMPAT, 'UTF-8'));\r
+  $grid->AddCell("$".number_format($Gross)); \r
+  $grid->AddCell("$".number_format($Discounts));\r
+  $grid->AddCell("$".number_format($Gross-$Discounts));\r
+  $grid->AddCell(round($Discounts / $Gross * 100.0)."%");\r
+}\r
+\r
+\r
+?>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/examples/php/tree1.php b/examples/php/tree1.php
new file mode 100644 (file)
index 0000000..edf5932
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico-Tree Control</title>\r
+
+<?php\r
+require "LoadRicoClient.php";\r
+?>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type='text/javascript'>\r
+Rico.loadModule('Tree');\r
+var tree1;\r
+\r
+// initialize tree\r
+Rico.onLoad( function() {\r
+  tree1=new Rico.TreeControl("tree1", "CustTree.php");\r
+  tree1.atLoad();\r
+  tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
+  Rico.eventBind('TreeButton1', 'click', Rico.eventHandle(window,'TreeClick1'));\r
+});\r
+\r
+function TreeClick1(e) {\r
+  if (Rico.visible(tree1.container)) {\r
+    tree1.close();\r
+  } else {\r
+    Rico.positionCtlOverIcon(tree1.container,Rico.$('TreeButton1'));\r
+    tree1.open();\r
+  }\r
+  Rico.eventStop(e);\r
+}\r
+</script>\r
+
+</head>\r
+\r
+<body>
+\r
+<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p>This example demonstrates a basic, pop-up tree control where the tree nodes are loaded via AJAX.\r
+Only one item is selected from the tree at a time.\r
+Data is from the Northwind customer table.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<p><button id='TreeButton1'>Show Tree</button>\r
+<p><input type='text' id='TreeValue1' size='6'> (selected customer id)\r
+\r
+<pre style='border:1px solid black;padding:3px;font-size:8pt;'>\r
+Rico.onLoad( function() {\r
+  tree1=new Rico.TreeControl("tree1", "CustTree.php");\r
+  tree1.atLoad();\r
+  tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
+});\r
+</pre>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/php/widgets.php b/examples/php/widgets.php
new file mode 100644 (file)
index 0000000..6546256
--- /dev/null
@@ -0,0 +1,2073 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\r
+<title>Rico widgets styled user-selectable themes</title>\r
+<?php\r
+require "LoadRicoClient.php";\r
+?>\r
+\r
+<script>\r
+Rico.loadModule('LiveGridBasic','LiveGridMenu','Calendar');\r
+\r
+var dialog;\r
+\r
+Rico.onLoad( function() {\r
+  var opts = {\r
+    defaultWidth : 90,\r
+    useUnformattedColWidth: false,\r
+    menuEvent     : 'click',\r
+    frozenColumns : 1,\r
+    visibleRows   : 6,\r
+    highlightElem: 'cursorRow',\r
+    columnSpecs  : [{width:200},'specQty','specQty','specQty','specQty','specQty']\r
+  };\r
+  var ex1=new Rico.LiveGrid ('population', new Rico.Buffer.Base(document.getElementById('population').tBodies[0]), opts);\r
+  ex1.menu=new Rico.GridMenu();\r
+  new Rico.Accordion( 'accExample', {panelHeight:160});\r
+  new Rico.TabbedPanel( 'tabsExample', {panelHeight:160});\r
+  var cal=new Rico.CalendarControl("ricoCal",{position:'relative'});\r
+  cal.atLoad();\r
+  cal.selectNow();\r
+  cal.openPopup();\r
+  var links=Rico.select('#themeGallery a');\r
+  for (var i=0; i<links.length; i++) {\r
+    links[i].onclick=themeClick;\r
+  }\r
+  dialog=new Rico.Window('',{height:'250px',width:'300px',overflow:'auto'}, 'dialog');\r
+});\r
+\r
+function openWindow(btn) {\r
+  dialog.openPopup();\r
+  Rico.positionCtlOverIcon(dialog.container,btn);\r
+}\r
+</script>\r
+\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+<style type="text/css">\r
+#accExample {\r
+  width: 400px;\r
+}\r
+#tabsExample {\r
+  width: 450px;\r
+}\r
+div.ricoLG_cell {\r
+  white-space:nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+<body style="font-size:80%;">\r
+  \r
+<table id='explanation' border='0' cellpadding='5' cellspacing='0' style='clear:both'><tr valign='top'><td>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+This example displays some of the widgets that come with Rico. \r
+The widgets are compatible with all base libraries and themes.\r
+</td>\r
+<td>\r
+<script type="text/javascript"><!--\r
+google_ad_client = "pub-7218597156507462";\r
+/* 125x125, created 5/11/09 */\r
+google_ad_slot = "9298106441";\r
+google_ad_width = 125;\r
+google_ad_height = 125;\r
+//-->\r
+</script>\r
+<script type="text/javascript"\r
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+</script>\r
+</td>\r
+</tr></table>\r
+\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2 style='margin-bottom:1px;'>Rico LiveGrid</h2>\r
+<p style='margin-top:1px;'>Click on a cell to see available actions</p>\r
+\r
+<p class="ricoBookmark"><span id="population_bookmark">&nbsp;</span></p>\r
+<table class="ricoLiveGrid" id="population">\r
+<thead>\r
+ <tr>\r
+  <td class='ricoFrozen'></td>\r
+  <td colspan=5>Population (thousands)</td>\r
+ </tr>\r
+ <tr>\r
+  <td class='ricoFrozen'>Country or area</td>\r
+  <td>1950</td>\r
+  <td>2009</td>\r
+  <td>2015</td>\r
+  <td>2025</td>\r
+  <td>2050</td>\r
+ </tr>\r
+</thead>\r
+<tbody>\r
+ <tr>\r
+  <td>Afghanistan</td>\r
+  <td>8151</td>\r
+  <td>28150</td>\r
+  <td>34246</td>\r
+  <td>44970</td>\r
+  <td>73938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Albania</td>\r
+  <td>1215</td>\r
+  <td>3155</td>\r
+  <td>3256</td>\r
+  <td>3395</td>\r
+  <td>3303</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Algeria</td>\r
+  <td>8753</td>\r
+  <td>34895</td>\r
+  <td>38088</td>\r
+  <td>42882</td>\r
+  <td>49610</td>\r
+ </tr>\r
+ <tr>\r
+  <td>American Samoa</td>\r
+  <td>19</td>\r
+  <td>67</td>\r
+  <td>74</td>\r
+  <td>86</td>\r
+  <td>107</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Andorra</td>\r
+  <td>6</td>\r
+  <td>86</td>\r
+  <td>93</td>\r
+  <td>107</td>\r
+  <td>137</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Angola</td>\r
+  <td>4148</td>\r
+  <td>18498</td>\r
+  <td>21690</td>\r
+  <td>27441</td>\r
+  <td>42267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Anguilla</td>\r
+  <td>5</td>\r
+  <td>15</td>\r
+  <td>17</td>\r
+  <td>18</td>\r
+  <td>20</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Antigua and Barbuda</td>\r
+  <td>46</td>\r
+  <td>88</td>\r
+  <td>93</td>\r
+  <td>101</td>\r
+  <td>112</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Argentina</td>\r
+  <td>17150</td>\r
+  <td>40276</td>\r
+  <td>42548</td>\r
+  <td>45883</td>\r
+  <td>50943</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Armenia</td>\r
+  <td>1354</td>\r
+  <td>3083</td>\r
+  <td>3139</td>\r
+  <td>3181</td>\r
+  <td>3018</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Aruba</td>\r
+  <td>38</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>112</td>\r
+  <td>106</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Australia</td>\r
+  <td>8219</td>\r
+  <td>21293</td>\r
+  <td>22607</td>\r
+  <td>24703</td>\r
+  <td>28724</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Austria</td>\r
+  <td>6936</td>\r
+  <td>8364</td>\r
+  <td>8467</td>\r
+  <td>8600</td>\r
+  <td>8515</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Azerbaijan</td>\r
+  <td>2896</td>\r
+  <td>8832</td>\r
+  <td>9426</td>\r
+  <td>10128</td>\r
+  <td>10579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahamas</td>\r
+  <td>79</td>\r
+  <td>342</td>\r
+  <td>366</td>\r
+  <td>402</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bahrain</td>\r
+  <td>116</td>\r
+  <td>791</td>\r
+  <td>882</td>\r
+  <td>1021</td>\r
+  <td>1277</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bangladesh</td>\r
+  <td>43595</td>\r
+  <td>162221</td>\r
+  <td>175217</td>\r
+  <td>195012</td>\r
+  <td>222495</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Barbados</td>\r
+  <td>211</td>\r
+  <td>256</td>\r
+  <td>260</td>\r
+  <td>262</td>\r
+  <td>237</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belarus</td>\r
+  <td>7745</td>\r
+  <td>9634</td>\r
+  <td>9355</td>\r
+  <td>8851</td>\r
+  <td>7275</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belgium</td>\r
+  <td>8628</td>\r
+  <td>10647</td>\r
+  <td>10878</td>\r
+  <td>11191</td>\r
+  <td>11493</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Belize</td>\r
+  <td>69</td>\r
+  <td>307</td>\r
+  <td>344</td>\r
+  <td>404</td>\r
+  <td>506</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Benin</td>\r
+  <td>2050</td>\r
+  <td>8935</td>\r
+  <td>10647</td>\r
+  <td>13767</td>\r
+  <td>21982</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bermuda</td>\r
+  <td>37</td>\r
+  <td>65</td>\r
+  <td>65</td>\r
+  <td>66</td>\r
+  <td>63</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bhutan</td>\r
+  <td>168</td>\r
+  <td>697</td>\r
+  <td>770</td>\r
+  <td>865</td>\r
+  <td>1013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bolivia</td>\r
+  <td>2714</td>\r
+  <td>9863</td>\r
+  <td>10854</td>\r
+  <td>12368</td>\r
+  <td>14908</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bosnia and Herzegovina</td>\r
+  <td>2661</td>\r
+  <td>3767</td>\r
+  <td>3727</td>\r
+  <td>3608</td>\r
+  <td>3008</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Botswana</td>\r
+  <td>413</td>\r
+  <td>1950</td>\r
+  <td>2106</td>\r
+  <td>2337</td>\r
+  <td>2758</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brazil</td>\r
+  <td>53975</td>\r
+  <td>193734</td>\r
+  <td>202866</td>\r
+  <td>213802</td>\r
+  <td>218512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>British Virgin Islands</td>\r
+  <td>7</td>\r
+  <td>23</td>\r
+  <td>24</td>\r
+  <td>26</td>\r
+  <td>28</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Brunei Darussalam</td>\r
+  <td>48</td>\r
+  <td>400</td>\r
+  <td>443</td>\r
+  <td>513</td>\r
+  <td>658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Bulgaria</td>\r
+  <td>7251</td>\r
+  <td>7545</td>\r
+  <td>7263</td>\r
+  <td>6752</td>\r
+  <td>5392</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burkina Faso</td>\r
+  <td>4080</td>\r
+  <td>15757</td>\r
+  <td>19013</td>\r
+  <td>24837</td>\r
+  <td>40830</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Burundi</td>\r
+  <td>2456</td>\r
+  <td>8303</td>\r
+  <td>9413</td>\r
+  <td>11161</td>\r
+  <td>14846</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cambodia</td>\r
+  <td>4346</td>\r
+  <td>14805</td>\r
+  <td>16357</td>\r
+  <td>18973</td>\r
+  <td>23795</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cameroon</td>\r
+  <td>4466</td>\r
+  <td>19522</td>\r
+  <td>22169</td>\r
+  <td>26478</td>\r
+  <td>36736</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Canada</td>\r
+  <td>13737</td>\r
+  <td>33573</td>\r
+  <td>35493</td>\r
+  <td>38659</td>\r
+  <td>44414</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cape Verde</td>\r
+  <td>146</td>\r
+  <td>506</td>\r
+  <td>548</td>\r
+  <td>616</td>\r
+  <td>703</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cayman Islands</td>\r
+  <td>7</td>\r
+  <td>56</td>\r
+  <td>59</td>\r
+  <td>63</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Central African Republic</td>\r
+  <td>1327</td>\r
+  <td>4422</td>\r
+  <td>4927</td>\r
+  <td>5747</td>\r
+  <td>7603</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chad</td>\r
+  <td>2429</td>\r
+  <td>11206</td>\r
+  <td>13120</td>\r
+  <td>16906</td>\r
+  <td>27776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Channel Islands</td>\r
+  <td>102</td>\r
+  <td>150</td>\r
+  <td>151</td>\r
+  <td>152</td>\r
+  <td>144</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Chile</td>\r
+  <td>6082</td>\r
+  <td>16970</td>\r
+  <td>17926</td>\r
+  <td>19266</td>\r
+  <td>20657</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China</td>\r
+  <td>544951</td>\r
+  <td>1345751</td>\r
+  <td>1395998</td>\r
+  <td>1453140</td>\r
+  <td>1417045</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Hong Kong SAR</td>\r
+  <td>1974</td>\r
+  <td>7022</td>\r
+  <td>7398</td>\r
+  <td>7969</td>\r
+  <td>8623</td>\r
+ </tr>\r
+ <tr>\r
+  <td>China, Macao SAR</td>\r
+  <td>190</td>\r
+  <td>538</td>\r
+  <td>568</td>\r
+  <td>603</td>\r
+  <td>593</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Colombia</td>\r
+  <td>12000</td>\r
+  <td>45660</td>\r
+  <td>49385</td>\r
+  <td>54920</td>\r
+  <td>62877</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Comoros</td>\r
+  <td>156</td>\r
+  <td>676</td>\r
+  <td>767</td>\r
+  <td>907</td>\r
+  <td>1226</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Congo</td>\r
+  <td>808</td>\r
+  <td>3683</td>\r
+  <td>4225</td>\r
+  <td>5094</td>\r
+  <td>6863</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cook Islands</td>\r
+  <td>15</td>\r
+  <td>20</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>24</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Costa Rica</td>\r
+  <td>966</td>\r
+  <td>4579</td>\r
+  <td>4957</td>\r
+  <td>5521</td>\r
+  <td>6373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Côte d'Ivoire</td>\r
+  <td>2505</td>\r
+  <td>21075</td>\r
+  <td>24210</td>\r
+  <td>29738</td>\r
+  <td>43373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Croatia</td>\r
+  <td>3850</td>\r
+  <td>4416</td>\r
+  <td>4370</td>\r
+  <td>4254</td>\r
+  <td>3825</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cuba</td>\r
+  <td>5920</td>\r
+  <td>11204</td>\r
+  <td>11213</td>\r
+  <td>11148</td>\r
+  <td>9725</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Cyprus</td>\r
+  <td>494</td>\r
+  <td>871</td>\r
+  <td>925</td>\r
+  <td>1014</td>\r
+  <td>1175</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Czech Republic</td>\r
+  <td>8925</td>\r
+  <td>10369</td>\r
+  <td>10510</td>\r
+  <td>10573</td>\r
+  <td>10294</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. People's Rep. of Korea</td>\r
+  <td>9737</td>\r
+  <td>23906</td>\r
+  <td>24399</td>\r
+  <td>25128</td>\r
+  <td>24562</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dem. Republic of the Congo</td>\r
+  <td>12184</td>\r
+  <td>66020</td>\r
+  <td>77419</td>\r
+  <td>98123</td>\r
+  <td>147512</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Denmark</td>\r
+  <td>4271</td>\r
+  <td>5470</td>\r
+  <td>5523</td>\r
+  <td>5590</td>\r
+  <td>5551</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Djibouti</td>\r
+  <td>62</td>\r
+  <td>864</td>\r
+  <td>953</td>\r
+  <td>1111</td>\r
+  <td>1469</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominica</td>\r
+  <td>51</td>\r
+  <td>67</td>\r
+  <td>67</td>\r
+  <td>68</td>\r
+  <td>66</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Dominican Republic</td>\r
+  <td>2427</td>\r
+  <td>10090</td>\r
+  <td>10867</td>\r
+  <td>11973</td>\r
+  <td>13441</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ecuador</td>\r
+  <td>3387</td>\r
+  <td>13625</td>\r
+  <td>14596</td>\r
+  <td>16074</td>\r
+  <td>17989</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Egypt</td>\r
+  <td>21514</td>\r
+  <td>82999</td>\r
+  <td>91778</td>\r
+  <td>104970</td>\r
+  <td>129533</td>\r
+ </tr>\r
+ <tr>\r
+  <td>El Salvador</td>\r
+  <td>2200</td>\r
+  <td>6163</td>\r
+  <td>6383</td>\r
+  <td>6895</td>\r
+  <td>7882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Equatorial Guinea</td>\r
+  <td>226</td>\r
+  <td>676</td>\r
+  <td>781</td>\r
+  <td>971</td>\r
+  <td>1445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Eritrea</td>\r
+  <td>1141</td>\r
+  <td>5073</td>\r
+  <td>6009</td>\r
+  <td>7404</td>\r
+  <td>10787</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Estonia</td>\r
+  <td>1101</td>\r
+  <td>1340</td>\r
+  <td>1337</td>\r
+  <td>1321</td>\r
+  <td>1233</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ethiopia</td>\r
+  <td>18434</td>\r
+  <td>82825</td>\r
+  <td>96237</td>\r
+  <td>119822</td>\r
+  <td>173811</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Faeroe Islands</td>\r
+  <td>32</td>\r
+  <td>50</td>\r
+  <td>52</td>\r
+  <td>55</td>\r
+  <td>58</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Falkland Islands (Malvinas)</td>\r
+  <td>2</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+  <td>3</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Fiji</td>\r
+  <td>289</td>\r
+  <td>849</td>\r
+  <td>874</td>\r
+  <td>905</td>\r
+  <td>910</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Finland</td>\r
+  <td>4009</td>\r
+  <td>5326</td>\r
+  <td>5432</td>\r
+  <td>5533</td>\r
+  <td>5445</td>\r
+ </tr>\r
+ <tr>\r
+  <td>France</td>\r
+  <td>41832</td>\r
+  <td>62343</td>\r
+  <td>63900</td>\r
+  <td>65769</td>\r
+  <td>67668</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Guiana</td>\r
+  <td>25</td>\r
+  <td>226</td>\r
+  <td>261</td>\r
+  <td>323</td>\r
+  <td>462</td>\r
+ </tr>\r
+ <tr>\r
+  <td>French Polynesia</td>\r
+  <td>61</td>\r
+  <td>269</td>\r
+  <td>289</td>\r
+  <td>318</td>\r
+  <td>354</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gabon</td>\r
+  <td>469</td>\r
+  <td>1475</td>\r
+  <td>1639</td>\r
+  <td>1915</td>\r
+  <td>2471</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gambia</td>\r
+  <td>258</td>\r
+  <td>1705</td>\r
+  <td>1985</td>\r
+  <td>2478</td>\r
+  <td>3763</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Georgia</td>\r
+  <td>3527</td>\r
+  <td>4260</td>\r
+  <td>4084</td>\r
+  <td>3888</td>\r
+  <td>3267</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Germany</td>\r
+  <td>68376</td>\r
+  <td>82167</td>\r
+  <td>81346</td>\r
+  <td>79258</td>\r
+  <td>70504</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ghana</td>\r
+  <td>4981</td>\r
+  <td>23837</td>\r
+  <td>26925</td>\r
+  <td>32233</td>\r
+  <td>45213</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Gibraltar</td>\r
+  <td>20</td>\r
+  <td>31</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>30</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greece</td>\r
+  <td>7566</td>\r
+  <td>11161</td>\r
+  <td>11261</td>\r
+  <td>11274</td>\r
+  <td>10939</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Greenland</td>\r
+  <td>23</td>\r
+  <td>57</td>\r
+  <td>57</td>\r
+  <td>56</td>\r
+  <td>50</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Grenada</td>\r
+  <td>77</td>\r
+  <td>104</td>\r
+  <td>107</td>\r
+  <td>109</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guadeloupe</td>\r
+  <td>210</td>\r
+  <td>465</td>\r
+  <td>476</td>\r
+  <td>489</td>\r
+  <td>477</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guam</td>\r
+  <td>60</td>\r
+  <td>178</td>\r
+  <td>191</td>\r
+  <td>211</td>\r
+  <td>242</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guatemala</td>\r
+  <td>3146</td>\r
+  <td>14027</td>\r
+  <td>16227</td>\r
+  <td>19927</td>\r
+  <td>27480</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea</td>\r
+  <td>2619</td>\r
+  <td>10069</td>\r
+  <td>11844</td>\r
+  <td>15158</td>\r
+  <td>23975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guinea-Bissau</td>\r
+  <td>518</td>\r
+  <td>1611</td>\r
+  <td>1848</td>\r
+  <td>2296</td>\r
+  <td>3555</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Guyana</td>\r
+  <td>423</td>\r
+  <td>762</td>\r
+  <td>754</td>\r
+  <td>732</td>\r
+  <td>558</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Haiti</td>\r
+  <td>3221</td>\r
+  <td>10033</td>\r
+  <td>10957</td>\r
+  <td>12476</td>\r
+  <td>15485</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Holy See</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Honduras</td>\r
+  <td>1487</td>\r
+  <td>7466</td>\r
+  <td>8386</td>\r
+  <td>9844</td>\r
+  <td>12402</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Hungary</td>\r
+  <td>9338</td>\r
+  <td>9993</td>\r
+  <td>9874</td>\r
+  <td>9647</td>\r
+  <td>8934</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iceland</td>\r
+  <td>143</td>\r
+  <td>323</td>\r
+  <td>353</td>\r
+  <td>384</td>\r
+  <td>407</td>\r
+ </tr>\r
+ <tr>\r
+  <td>India</td>\r
+  <td>371857</td>\r
+  <td>1198003</td>\r
+  <td>1294192</td>\r
+  <td>1431272</td>\r
+  <td>1613800</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Indonesia</td>\r
+  <td>77152</td>\r
+  <td>229965</td>\r
+  <td>244191</td>\r
+  <td>263287</td>\r
+  <td>288110</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iran (Islamic Republic of)</td>\r
+  <td>16913</td>\r
+  <td>74196</td>\r
+  <td>79454</td>\r
+  <td>87134</td>\r
+  <td>96975</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Iraq</td>\r
+  <td>5719</td>\r
+  <td>30747</td>\r
+  <td>35884</td>\r
+  <td>44692</td>\r
+  <td>63995</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ireland</td>\r
+  <td>2969</td>\r
+  <td>4515</td>\r
+  <td>4886</td>\r
+  <td>5370</td>\r
+  <td>6295</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Isle of Man</td>\r
+  <td>55</td>\r
+  <td>80</td>\r
+  <td>81</td>\r
+  <td>80</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Israel</td>\r
+  <td>1258</td>\r
+  <td>7170</td>\r
+  <td>7823</td>\r
+  <td>8769</td>\r
+  <td>10649</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Italy</td>\r
+  <td>46367</td>\r
+  <td>59870</td>\r
+  <td>60604</td>\r
+  <td>60018</td>\r
+  <td>57066</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jamaica</td>\r
+  <td>1403</td>\r
+  <td>2719</td>\r
+  <td>2786</td>\r
+  <td>2866</td>\r
+  <td>2683</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Japan</td>\r
+  <td>82824</td>\r
+  <td>127156</td>\r
+  <td>125791</td>\r
+  <td>120793</td>\r
+  <td>101659</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Jordan</td>\r
+  <td>472</td>\r
+  <td>6316</td>\r
+  <td>6957</td>\r
+  <td>8088</td>\r
+  <td>10241</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kazakhstan</td>\r
+  <td>6703</td>\r
+  <td>15637</td>\r
+  <td>16289</td>\r
+  <td>17025</td>\r
+  <td>17848</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kenya</td>\r
+  <td>6077</td>\r
+  <td>39802</td>\r
+  <td>46433</td>\r
+  <td>57573</td>\r
+  <td>85410</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kiribati</td>\r
+  <td>26</td>\r
+  <td>98</td>\r
+  <td>107</td>\r
+  <td>123</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kuwait</td>\r
+  <td>152</td>\r
+  <td>2985</td>\r
+  <td>3378</td>\r
+  <td>3988</td>\r
+  <td>5240</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Kyrgyzstan</td>\r
+  <td>1740</td>\r
+  <td>5482</td>\r
+  <td>5877</td>\r
+  <td>6378</td>\r
+  <td>6882</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lao People's Dem. Republic</td>\r
+  <td>1666</td>\r
+  <td>6320</td>\r
+  <td>7028</td>\r
+  <td>8273</td>\r
+  <td>10744</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Latvia</td>\r
+  <td>1949</td>\r
+  <td>2249</td>\r
+  <td>2197</td>\r
+  <td>2101</td>\r
+  <td>1854</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lebanon</td>\r
+  <td>1443</td>\r
+  <td>4224</td>\r
+  <td>4426</td>\r
+  <td>4736</td>\r
+  <td>5033</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lesotho</td>\r
+  <td>734</td>\r
+  <td>2067</td>\r
+  <td>2168</td>\r
+  <td>2306</td>\r
+  <td>2491</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liberia</td>\r
+  <td>824</td>\r
+  <td>3955</td>\r
+  <td>4665</td>\r
+  <td>5858</td>\r
+  <td>8841</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Libyan Arab Jamahiriya</td>\r
+  <td>1029</td>\r
+  <td>6420</td>\r
+  <td>7158</td>\r
+  <td>8144</td>\r
+  <td>9819</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Liechtenstein</td>\r
+  <td>14</td>\r
+  <td>36</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+  <td>45</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Lithuania</td>\r
+  <td>2567</td>\r
+  <td>3287</td>\r
+  <td>3143</td>\r
+  <td>2985</td>\r
+  <td>2579</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Luxembourg</td>\r
+  <td>296</td>\r
+  <td>486</td>\r
+  <td>520</td>\r
+  <td>582</td>\r
+  <td>733</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Madagascar</td>\r
+  <td>4084</td>\r
+  <td>19625</td>\r
+  <td>22853</td>\r
+  <td>28595</td>\r
+  <td>42693</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malawi</td>\r
+  <td>2881</td>\r
+  <td>15263</td>\r
+  <td>17998</td>\r
+  <td>23194</td>\r
+  <td>36575</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malaysia</td>\r
+  <td>6110</td>\r
+  <td>27468</td>\r
+  <td>30041</td>\r
+  <td>33770</td>\r
+  <td>39664</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Maldives</td>\r
+  <td>82</td>\r
+  <td>309</td>\r
+  <td>338</td>\r
+  <td>384</td>\r
+  <td>455</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mali</td>\r
+  <td>4268</td>\r
+  <td>13010</td>\r
+  <td>14993</td>\r
+  <td>18603</td>\r
+  <td>28260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Malta</td>\r
+  <td>312</td>\r
+  <td>409</td>\r
+  <td>417</td>\r
+  <td>426</td>\r
+  <td>413</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Marshall Islands</td>\r
+  <td>13</td>\r
+  <td>62</td>\r
+  <td>70</td>\r
+  <td>79</td>\r
+  <td>92</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Martinique</td>\r
+  <td>222</td>\r
+  <td>405</td>\r
+  <td>411</td>\r
+  <td>418</td>\r
+  <td>393</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritania</td>\r
+  <td>651</td>\r
+  <td>3291</td>\r
+  <td>3732</td>\r
+  <td>4443</td>\r
+  <td>6061</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mauritius</td>\r
+  <td>493</td>\r
+  <td>1288</td>\r
+  <td>1337</td>\r
+  <td>1400</td>\r
+  <td>1426</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mayotte</td>\r
+  <td>15</td>\r
+  <td>194</td>\r
+  <td>224</td>\r
+  <td>277</td>\r
+  <td>386</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mexico</td>\r
+  <td>27741</td>\r
+  <td>109610</td>\r
+  <td>115528</td>\r
+  <td>123366</td>\r
+  <td>128964</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Micronesia (Fed. States of)</td>\r
+  <td>32</td>\r
+  <td>111</td>\r
+  <td>114</td>\r
+  <td>122</td>\r
+  <td>128</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Moldova (Republic of)</td>\r
+  <td>2341</td>\r
+  <td>3604</td>\r
+  <td>3462</td>\r
+  <td>3291</td>\r
+  <td>2734</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Monaco</td>\r
+  <td>20</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mongolia</td>\r
+  <td>761</td>\r
+  <td>2671</td>\r
+  <td>2855</td>\r
+  <td>3134</td>\r
+  <td>3446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montenegro</td>\r
+  <td>399</td>\r
+  <td>624</td>\r
+  <td>627</td>\r
+  <td>633</td>\r
+  <td>618</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Montserrat</td>\r
+  <td>14</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>7</td>\r
+  <td>7</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Morocco</td>\r
+  <td>8953</td>\r
+  <td>31993</td>\r
+  <td>34330</td>\r
+  <td>37865</td>\r
+  <td>42583</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Mozambique</td>\r
+  <td>6442</td>\r
+  <td>22894</td>\r
+  <td>25957</td>\r
+  <td>31190</td>\r
+  <td>44148</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Myanmar</td>\r
+  <td>17158</td>\r
+  <td>50020</td>\r
+  <td>53087</td>\r
+  <td>57585</td>\r
+  <td>63373</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Namibia</td>\r
+  <td>485</td>\r
+  <td>2171</td>\r
+  <td>2412</td>\r
+  <td>2810</td>\r
+  <td>3588</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nauru</td>\r
+  <td>3</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nepal</td>\r
+  <td>8126</td>\r
+  <td>29331</td>\r
+  <td>32503</td>\r
+  <td>38031</td>\r
+  <td>49028</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands</td>\r
+  <td>10114</td>\r
+  <td>16592</td>\r
+  <td>16915</td>\r
+  <td>17348</td>\r
+  <td>17399</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Netherlands Antilles</td>\r
+  <td>112</td>\r
+  <td>198</td>\r
+  <td>207</td>\r
+  <td>210</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Caledonia</td>\r
+  <td>65</td>\r
+  <td>250</td>\r
+  <td>271</td>\r
+  <td>304</td>\r
+  <td>362</td>\r
+ </tr>\r
+ <tr>\r
+  <td>New Zealand</td>\r
+  <td>1908</td>\r
+  <td>4266</td>\r
+  <td>4492</td>\r
+  <td>4831</td>\r
+  <td>5349</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nicaragua</td>\r
+  <td>1295</td>\r
+  <td>5743</td>\r
+  <td>6265</td>\r
+  <td>7058</td>\r
+  <td>8143</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niger</td>\r
+  <td>2462</td>\r
+  <td>15290</td>\r
+  <td>19150</td>\r
+  <td>27388</td>\r
+  <td>58216</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Nigeria</td>\r
+  <td>36680</td>\r
+  <td>154729</td>\r
+  <td>175928</td>\r
+  <td>210057</td>\r
+  <td>289083</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Niue</td>\r
+  <td>5</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Northern Mariana Islands</td>\r
+  <td>7</td>\r
+  <td>87</td>\r
+  <td>96</td>\r
+  <td>111</td>\r
+  <td>151</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Norway</td>\r
+  <td>3265</td>\r
+  <td>4812</td>\r
+  <td>5036</td>\r
+  <td>5365</td>\r
+  <td>5947</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Occupied Palestinian Territory</td>\r
+  <td>1005</td>\r
+  <td>4277</td>\r
+  <td>5090</td>\r
+  <td>6553</td>\r
+  <td>10265</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Oman</td>\r
+  <td>456</td>\r
+  <td>2845</td>\r
+  <td>3198</td>\r
+  <td>3782</td>\r
+  <td>4878</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pakistan</td>\r
+  <td>41177</td>\r
+  <td>180808</td>\r
+  <td>205504</td>\r
+  <td>246286</td>\r
+  <td>335195</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Palau</td>\r
+  <td>7</td>\r
+  <td>20</td>\r
+  <td>21</td>\r
+  <td>23</td>\r
+  <td>26</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Panama</td>\r
+  <td>860</td>\r
+  <td>3454</td>\r
+  <td>3773</td>\r
+  <td>4267</td>\r
+  <td>5092</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Papua New Guinea</td>\r
+  <td>1798</td>\r
+  <td>6732</td>\r
+  <td>7678</td>\r
+  <td>9265</td>\r
+  <td>12871</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Paraguay</td>\r
+  <td>1473</td>\r
+  <td>6349</td>\r
+  <td>7007</td>\r
+  <td>8026</td>\r
+  <td>9867</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Peru</td>\r
+  <td>7632</td>\r
+  <td>29165</td>\r
+  <td>31197</td>\r
+  <td>34528</td>\r
+  <td>39776</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Philippines</td>\r
+  <td>19996</td>\r
+  <td>91983</td>\r
+  <td>101734</td>\r
+  <td>117270</td>\r
+  <td>146156</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Pitcairn</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+  <td>0</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Poland</td>\r
+  <td>24824</td>\r
+  <td>38074</td>\r
+  <td>37788</td>\r
+  <td>36964</td>\r
+  <td>32013</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Portugal</td>\r
+  <td>8405</td>\r
+  <td>10707</td>\r
+  <td>10787</td>\r
+  <td>10706</td>\r
+  <td>10015</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Puerto Rico</td>\r
+  <td>2218</td>\r
+  <td>3982</td>\r
+  <td>4074</td>\r
+  <td>4176</td>\r
+  <td>4103</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Qatar</td>\r
+  <td>25</td>\r
+  <td>1409</td>\r
+  <td>1630</td>\r
+  <td>1848</td>\r
+  <td>2316</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Republic of Korea</td>\r
+  <td>19211</td>\r
+  <td>48333</td>\r
+  <td>49153</td>\r
+  <td>49484</td>\r
+  <td>44077</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Réunion</td>\r
+  <td>248</td>\r
+  <td>827</td>\r
+  <td>886</td>\r
+  <td>973</td>\r
+  <td>1096</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Romania</td>\r
+  <td>16311</td>\r
+  <td>21275</td>\r
+  <td>20787</td>\r
+  <td>19961</td>\r
+  <td>17279</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Russian Federation</td>\r
+  <td>102702</td>\r
+  <td>140874</td>\r
+  <td>137983</td>\r
+  <td>132345</td>\r
+  <td>116097</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Rwanda</td>\r
+  <td>2162</td>\r
+  <td>9998</td>\r
+  <td>11743</td>\r
+  <td>14676</td>\r
+  <td>22082</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Helena</td>\r
+  <td>5</td>\r
+  <td>4</td>\r
+  <td>4</td>\r
+  <td>5</td>\r
+  <td>5</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Kitts and Nevis</td>\r
+  <td>46</td>\r
+  <td>52</td>\r
+  <td>56</td>\r
+  <td>61</td>\r
+  <td>69</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Lucia</td>\r
+  <td>83</td>\r
+  <td>172</td>\r
+  <td>182</td>\r
+  <td>198</td>\r
+  <td>217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saint Pierre and Miquelon</td>\r
+  <td>5</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+  <td>6</td>\r
+ </tr>\r
+ <tr>\r
+  <td>St. Vincent and the Grenadines</td>\r
+  <td>67</td>\r
+  <td>109</td>\r
+  <td>110</td>\r
+  <td>111</td>\r
+  <td>119</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Samoa</td>\r
+  <td>82</td>\r
+  <td>179</td>\r
+  <td>181</td>\r
+  <td>188</td>\r
+  <td>192</td>\r
+ </tr>\r
+ <tr>\r
+  <td>San Marino</td>\r
+  <td>13</td>\r
+  <td>31</td>\r
+  <td>32</td>\r
+  <td>33</td>\r
+  <td>33</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sao Tome and Principe</td>\r
+  <td>60</td>\r
+  <td>163</td>\r
+  <td>180</td>\r
+  <td>216</td>\r
+  <td>296</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Saudi Arabia</td>\r
+  <td>3201</td>\r
+  <td>25721</td>\r
+  <td>28933</td>\r
+  <td>34176</td>\r
+  <td>43658</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Senegal</td>\r
+  <td>2416</td>\r
+  <td>12534</td>\r
+  <td>14526</td>\r
+  <td>17861</td>\r
+  <td>26102</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Serbia</td>\r
+  <td>6732</td>\r
+  <td>9850</td>\r
+  <td>9828</td>\r
+  <td>9720</td>\r
+  <td>9193</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Seychelles</td>\r
+  <td>36</td>\r
+  <td>84</td>\r
+  <td>86</td>\r
+  <td>91</td>\r
+  <td>97</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sierra Leone</td>\r
+  <td>1944</td>\r
+  <td>5696</td>\r
+  <td>6557</td>\r
+  <td>8112</td>\r
+  <td>12446</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Singapore</td>\r
+  <td>1022</td>\r
+  <td>4737</td>\r
+  <td>5059</td>\r
+  <td>5362</td>\r
+  <td>5221</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovakia</td>\r
+  <td>3463</td>\r
+  <td>5406</td>\r
+  <td>5437</td>\r
+  <td>5413</td>\r
+  <td>4917</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Slovenia</td>\r
+  <td>1473</td>\r
+  <td>2020</td>\r
+  <td>2044</td>\r
+  <td>2050</td>\r
+  <td>1954</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Solomon Islands</td>\r
+  <td>90</td>\r
+  <td>523</td>\r
+  <td>599</td>\r
+  <td>725</td>\r
+  <td>1007</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Somalia</td>\r
+  <td>2264</td>\r
+  <td>9133</td>\r
+  <td>10731</td>\r
+  <td>13922</td>\r
+  <td>23522</td>\r
+ </tr>\r
+ <tr>\r
+  <td>South Africa</td>\r
+  <td>13683</td>\r
+  <td>50110</td>\r
+  <td>51684</td>\r
+  <td>53766</td>\r
+  <td>56802</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Spain</td>\r
+  <td>28009</td>\r
+  <td>44904</td>\r
+  <td>47203</td>\r
+  <td>49265</td>\r
+  <td>51260</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sri Lanka</td>\r
+  <td>8241</td>\r
+  <td>20238</td>\r
+  <td>21167</td>\r
+  <td>22033</td>\r
+  <td>21705</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sudan</td>\r
+  <td>9190</td>\r
+  <td>42272</td>\r
+  <td>47730</td>\r
+  <td>56688</td>\r
+  <td>75884</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Suriname</td>\r
+  <td>215</td>\r
+  <td>520</td>\r
+  <td>547</td>\r
+  <td>586</td>\r
+  <td>619</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Swaziland</td>\r
+  <td>273</td>\r
+  <td>1185</td>\r
+  <td>1287</td>\r
+  <td>1455</td>\r
+  <td>1749</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Sweden</td>\r
+  <td>7014</td>\r
+  <td>9249</td>\r
+  <td>9498</td>\r
+  <td>9915</td>\r
+  <td>10571</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Switzerland</td>\r
+  <td>4693</td>\r
+  <td>7568</td>\r
+  <td>7736</td>\r
+  <td>8020</td>\r
+  <td>8514</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Syrian Arab Republic</td>\r
+  <td>3536</td>\r
+  <td>21906</td>\r
+  <td>24494</td>\r
+  <td>28592</td>\r
+  <td>36911</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tajikistan</td>\r
+  <td>1532</td>\r
+  <td>6952</td>\r
+  <td>7761</td>\r
+  <td>9075</td>\r
+  <td>11111</td>\r
+ </tr>\r
+ <tr>\r
+  <td>TFYR Macedonia</td>\r
+  <td>1230</td>\r
+  <td>2042</td>\r
+  <td>2045</td>\r
+  <td>2037</td>\r
+  <td>1857</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Thailand</td>\r
+  <td>20607</td>\r
+  <td>67764</td>\r
+  <td>69939</td>\r
+  <td>72628</td>\r
+  <td>73361</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Timor-Leste</td>\r
+  <td>433</td>\r
+  <td>1134</td>\r
+  <td>1385</td>\r
+  <td>1869</td>\r
+  <td>3217</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Togo</td>\r
+  <td>1329</td>\r
+  <td>6619</td>\r
+  <td>7607</td>\r
+  <td>9282</td>\r
+  <td>13196</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tokelau</td>\r
+  <td>2</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+  <td>1</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tonga</td>\r
+  <td>47</td>\r
+  <td>104</td>\r
+  <td>105</td>\r
+  <td>112</td>\r
+  <td>123</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Trinidad and Tobago</td>\r
+  <td>636</td>\r
+  <td>1339</td>\r
+  <td>1368</td>\r
+  <td>1388</td>\r
+  <td>1278</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tunisia</td>\r
+  <td>3530</td>\r
+  <td>10272</td>\r
+  <td>10884</td>\r
+  <td>11797</td>\r
+  <td>12711</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkey</td>\r
+  <td>21484</td>\r
+  <td>74816</td>\r
+  <td>79966</td>\r
+  <td>87364</td>\r
+  <td>97389</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turkmenistan</td>\r
+  <td>1211</td>\r
+  <td>5110</td>\r
+  <td>5509</td>\r
+  <td>6072</td>\r
+  <td>6796</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Turks and Caicos Islands</td>\r
+  <td>5</td>\r
+  <td>33</td>\r
+  <td>35</td>\r
+  <td>38</td>\r
+  <td>40</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Tuvalu</td>\r
+  <td>5</td>\r
+  <td>10</td>\r
+  <td>10</td>\r
+  <td>11</td>\r
+  <td>11</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uganda</td>\r
+  <td>5158</td>\r
+  <td>32710</td>\r
+  <td>39710</td>\r
+  <td>53406</td>\r
+  <td>91271</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Ukraine</td>\r
+  <td>37298</td>\r
+  <td>45708</td>\r
+  <td>44165</td>\r
+  <td>41617</td>\r
+  <td>35026</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Arab Emirates</td>\r
+  <td>70</td>\r
+  <td>4599</td>\r
+  <td>5193</td>\r
+  <td>6109</td>\r
+  <td>8253</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Kingdom</td>\r
+  <td>50616</td>\r
+  <td>61565</td>\r
+  <td>63528</td>\r
+  <td>66601</td>\r
+  <td>72365</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United Republic of Tanzania</td>\r
+  <td>7650</td>\r
+  <td>43739</td>\r
+  <td>52109</td>\r
+  <td>67394</td>\r
+  <td>109450</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States of America</td>\r
+  <td>157813</td>\r
+  <td>314659</td>\r
+  <td>332334</td>\r
+  <td>358735</td>\r
+  <td>403932</td>\r
+ </tr>\r
+ <tr>\r
+  <td>United States Virgin Islands</td>\r
+  <td>27</td>\r
+  <td>110</td>\r
+  <td>108</td>\r
+  <td>103</td>\r
+  <td>75</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uruguay</td>\r
+  <td>2239</td>\r
+  <td>3361</td>\r
+  <td>3430</td>\r
+  <td>3546</td>\r
+  <td>3637</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Uzbekistan</td>\r
+  <td>6314</td>\r
+  <td>27488</td>\r
+  <td>29456</td>\r
+  <td>32715</td>\r
+  <td>36439</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Vanuatu</td>\r
+  <td>48</td>\r
+  <td>240</td>\r
+  <td>276</td>\r
+  <td>338</td>\r
+  <td>482</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Venezuela (Bolivarian Republic of)</td>\r
+  <td>5094</td>\r
+  <td>28583</td>\r
+  <td>31292</td>\r
+  <td>35370</td>\r
+  <td>42042</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Viet Nam</td>\r
+  <td>27367</td>\r
+  <td>88069</td>\r
+  <td>93647</td>\r
+  <td>102054</td>\r
+  <td>111666</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Wallis and Futuna Islands</td>\r
+  <td>7</td>\r
+  <td>15</td>\r
+  <td>16</td>\r
+  <td>17</td>\r
+  <td>17</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Western Sahara</td>\r
+  <td>14</td>\r
+  <td>513</td>\r
+  <td>625</td>\r
+  <td>775</td>\r
+  <td>938</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Yemen</td>\r
+  <td>4316</td>\r
+  <td>23580</td>\r
+  <td>27819</td>\r
+  <td>35509</td>\r
+  <td>53689</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zambia</td>\r
+  <td>2340</td>\r
+  <td>12935</td>\r
+  <td>14980</td>\r
+  <td>18890</td>\r
+  <td>28957</td>\r
+ </tr>\r
+ <tr>\r
+  <td>Zimbabwe</td>\r
+  <td>2747</td>\r
+  <td>12523</td>\r
+  <td>14029</td>\r
+  <td>16780</td>\r
+  <td>22178</td>\r
+ </tr>\r
+</tbody>\r
+</table>\r
+\r
+<p style='font-size:smaller;'>Data source: <a href="http://www.un.org/esa/population/unpop.htm">Population Division of the \r
+Department of Economic and Social Affairs of the United Nations Secretariat</a> (2009). \r
+<em>World Population Prospects: The 2008 Revision. Highlights.</em> New York: United Nations.  </p>                            \r
+\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Accordion</h2>\r
+\r
+<div id="accExample">\r
+\r
+   <div>\r
+     <div>Stanza 1</div>\r
+     <div>\r
+<p>Two roads diverged in a yellow wood,\r
+<br>And sorry I could not travel both\r
+<br>And be one traveler, long I stood\r
+<br>And looked down one as far as I could\r
+<br>To where it bent in the undergrowth.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 2</div>\r
+     <div>\r
+<p>Then took the other, as just as fair,\r
+<br>And having perhaps the better claim,\r
+<br>Because it was grassy and wanted wear;\r
+<br>Though as for that the passing there\r
+<br>Had worn them really about the same.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 3</div>\r
+     <div>\r
+<p>And both that morning equally lay\r
+<br>In leaves no step had trodden black.\r
+<br>Oh, I kept the first for another day!\r
+<br>Yet knowing how way leads on to way,\r
+<br>I doubted if I should ever come back.\r
+     </div>\r
+   </div>\r
+   <div>\r
+     <div>Stanza 4</div>\r
+     <div>\r
+<p>I shall be telling this with a sigh\r
+<br>Somewhere ages and ages hence:\r
+<br>Two roads diverged in a wood, and I--\r
+<br>I took the one less traveled by,\r
+<br>And that has made all the difference.\r
+<p style='font-size:9pt;'><strong>Robert Frost: The Road Not Taken (1915)</strong>\r
+     </div>\r
+  </div>\r
+\r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Tabbed Panel</h2>\r
+\r
+<div id="tabsExample">\r
+   <ul>\r
+     <li>Stanza 1</li>\r
+     <li>Stanza 2</li>\r
+     <li>Stanza 3</li>\r
+     <li>Stanza 4</li>\r
+   </ul>\r
+\r
+   <div>\r
+     <div>\r
+<p>Two roads diverged in a yellow wood,\r
+<br>And sorry I could not travel both\r
+<br>And be one traveler, long I stood\r
+<br>And looked down one as far as I could\r
+<br>To where it bent in the undergrowth.\r
+     </div>\r
+     <div>\r
+<p>Then took the other, as just as fair,\r
+<br>And having perhaps the better claim,\r
+<br>Because it was grassy and wanted wear;\r
+<br>Though as for that the passing there\r
+<br>Had worn them really about the same.\r
+     </div>\r
+     <div>\r
+<p>And both that morning equally lay\r
+<br>In leaves no step had trodden black.\r
+<br>Oh, I kept the first for another day!\r
+<br>Yet knowing how way leads on to way,\r
+<br>I doubted if I should ever come back.\r
+     </div>\r
+     <div>\r
+<p>I shall be telling this with a sigh\r
+<br>Somewhere ages and ages hence:\r
+<br>Two roads diverged in a wood, and I--\r
+<br>I took the one less traveled by,\r
+<br>And that has made all the difference.\r
+<p style='font-size:9pt;'><strong>Robert Frost: The Road Not Taken (1915)</strong>\r
+     </div>\r
+  </div>\r
+\r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Dialog Window</h2>\r
+\r
+<p><button onclick='openWindow(this)'>Open Dialog Window</button>\r
+<div id='dialog' title='The Gettysburg Address'>\r
+<p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. \r
+<p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. \r
+<p>But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. \r
+</div>\r
+\r
+<p>&nbsp;</p>\r
+\r
+<h2>Rico Calendar</h2>\r
+\r
+<div id="ricoCal"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/ricologo.gif b/examples/ricologo.gif
new file mode 100644 (file)
index 0000000..9b14203
Binary files /dev/null and b/examples/ricologo.gif differ
diff --git a/examples/welcome.html b/examples/welcome.html
new file mode 100644 (file)
index 0000000..44bee13
--- /dev/null
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Rico 3.0</title>
+<style type="text/css">
+#welcome img {
+  vertical-align: middle; 
+  float: left; 
+  margin: 0px 8px 8px 0px;
+}
+#welcome span {
+  font-family: Trebuchet MS, Arial, Tahoma, Verdana, Helvetica, sans-serif; 
+  font-size: 60px;
+  font-weight: bold;
+  margin: 0px; 
+  padding-top: 5px;
+}
+.important, .important a {
+  font-size: 12pt !important;
+  font-weight: bold;
+}
+p, li {
+  font-family: Arial, Tahoma, Verdana;
+}
+li { margin-bottom : 5px }
+</style>
+</head>
+
+<body>
+
+<div id='welcome'><img alt="Rico Logo" src="ricologo.gif"><span>Welcome to Rico 3!</span></div>
+
+<p style="clear:both;">Rico is an open source JavaScript framework 
+used to create rich, highly interactive web applications. 
+Rico is released under the Apache Licence, Version 2.0.
+This allows you to use Rico in nearly all circumstances, commercial and non-commercial, and to modify it as you see fit.
+Read the full license description at <a href="http://www.apache.org/licenses/LICENSE-2.0">the Apache web site</a>. 
+
+<p>Previous versions of Rico have relied on the excellent 
+<a href="http://www.prototypejs.org" target="_top">Prototype</a>
+library to provide a base level of cross-browser functions.
+Rico 3 has been redesigned to work
+with a variety of popular Javascript libraries using a small
+adapter layer to bridge the differences between each library.
+Thus, you are no longer be required to load Prototype in order to run Rico.
+Of course you can if you choose to, but you can also run it with 
+<a href="http://jquery.com" target="_top">jQuery</a> instead,
+or <a href="http://mootools.net" target="_top">MooTools</a>, 
+or <a href="http://www.dojotoolkit.org/" target="_top">dojo</a>, 
+or <a href="http://extjs.com/products/extcore/" target="_top">ext</a>, 
+or <a href="http://www.bbc.co.uk/glow/" target="_top">BBC Glow</a>.
+</p>
+
+
+<p>Functions supported by Rico 3 include:
+<ul>
+<li>Event model, Ajax model, Animation model, and CSS selector model tied to the base library, but adapters
+provide common calling conventions (since Prototype does not include animation support,
+the adapter for Prototype provides this support).
+<li>pop-up "windows" (div's) and menus with shadows
+<li>scrolling grids with frozen columns and headings that can be
+populated with static content or dynamically loaded via AJAX.
+<li>localization support functions, with calendars and standard grid menus provided in 
+English, French, German, Italian, Portugese, Spanish, Chinese, Japanese, Korean, Russian, and Ukranian
+<li>number and date formatting
+<li>A variety of Rico themes are included, or you can use <a href="http://jqueryui.com/themeroller/">jQuery Themeroller</a> themes, 
+or you can create your own
+<li>Console logging to support debugging
+</ul>
+</p>
+
+<p>Rico resources:
+<ul>
+<li><a href="http://sourceforge.net/projects/openrico/" target="_top">OpenRico@SourceForge</a> - home of OpenRico!
+<li><a href="http://dowdybrown.com/dbprod/" target="_top">dowdybrown.com</a> - online demos &amp; javascript reference
+<li><a href="http://openrico.org/" target="_top">openrico.org</a> - original forums &amp; demos
+</ul>
+</p>
+
+
+</body>
+</html>
diff --git a/html_blk.gif b/html_blk.gif
new file mode 100644 (file)
index 0000000..3b29a2f
Binary files /dev/null and b/html_blk.gif differ
diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..d3dab8d
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
+<html>\r
+<head>\r
+<title>Rico 3.0</title>\r
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
+<base target="_blank">\r
+\r
+<style type="text/css">\r
+#welcome img {\r
+  vertical-align: middle; \r
+  float: left; \r
+  margin: 0px 8px 8px 0px;\r
+}\r
+#welcome span {\r
+  font-family: Trebuchet MS, Arial, Tahoma, Verdana, Helvetica, sans-serif; \r
+  font-size: 60px;\r
+  font-weight: bold;\r
+  margin: 0px; \r
+  padding-top: 5px;\r
+}\r
+div img { vertical-align: middle; margin-right:1em; }\r
+div a { font-weight: bold; }\r
+</style>\r
+</head>\r
+<body>\r
+<div id='welcome'><img alt="Rico Logo" src="examples/ricologo.gif"><span>Welcome to Rico!</span></div>\r
+<p style="clear:both;font-size:larger;">Rico is an open source JavaScript framework used to create\r
+rich, highly interactive web applications. \r
+Rico is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License</a>.\r
+<p>\r
+<div style='padding: 15px 0px 15px 45px'><img src='documentation.jpg'><a href="documentation/index.html">Documentation</a></div>\r
+<div style='padding: 15px 0px 15px 85px'><img src='php_logo.jpg' valign=middle><a href="examples/php/index.html">PHP Examples</a></div>\r
+<div style='padding: 15px 0px 15px 125px'><img src='dotnet_logo.gif'><a href="examples/dotnet/index.html">.net Examples</a></div>\r
+<div style='padding: 15px 0px 15px 165px'><img src='asp_logo.jpg'><a href="examples/asp/index.html">ASP Examples</a></div>\r
+<div style='padding: 15px 0px 15px 205px'><img src='html_blk.gif'><a href="examples/html/index.html">HTML Examples</a></div>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/php_logo.jpg b/php_logo.jpg
new file mode 100644 (file)
index 0000000..c8d1362
Binary files /dev/null and b/php_logo.jpg differ
diff --git a/plugins/asp/SimpleGrid.vbs b/plugins/asp/SimpleGrid.vbs
new file mode 100644 (file)
index 0000000..c508ef0
--- /dev/null
@@ -0,0 +1,284 @@
+<%\r
+\r
+class SimpleGridCell\r
+  public content\r
+  private attr\r
+\r
+  Private Sub Class_Initialize\r
+    set attr = CreateObject("Scripting.Dictionary")\r
+  End sub\r
+\r
+  Private Sub Class_Terminate\r
+    set attr = Nothing\r
+  End sub\r
+\r
+  Public Function HeadingCell()\r
+    Dim s, span\r
+    s="<td"\r
+    span=1\r
+    If attr.exists("colspan") Then\r
+      span=attr("colspan")\r
+      s=s & " colspan='" & span & "'"\r
+    End If\r
+    HeadingCell = Array(s & "><div class='ricoLG_col'>" & DataCell("") & "</div></td>", span)\r
+  End Function\r
+\r
+  Public Function DataCell(rowclass)\r
+    dim s,k\r
+    s = "<div"\r
+    attr("class")=trim("ricoLG_cell " & attr("class") & " " & rowclass)\r
+    for each k in attr.keys\r
+      If k<>"colspan" Then s=s & " " & k & "='" & attr(k) & "'"\r
+    next\r
+    s=s & ">" & content & "</div>"\r
+    DataCell=s\r
+  End Function\r
+\r
+  Public Function HtmlCell()\r
+    dim s,k\r
+    s = "<td"\r
+    for each k in attr.keys\r
+      s=s & " " & k & "='" & attr(k) & "'"\r
+    next\r
+    s=s & ">" & content & "</td>"\r
+    HtmlCell=s\r
+  End Function\r
+\r
+  Public Sub SetAttr(name,value)\r
+    attr(name)=value\r
+  End Sub\r
+End class\r
+\r
+\r
+class SimpleGridRow\r
+  public cells()\r
+  private attr, CurrentCell\r
+\r
+  Private Sub Class_Initialize\r
+    redim cells(-1)\r
+    set attr = CreateObject("Scripting.Dictionary")\r
+  end sub\r
+\r
+  Private Sub Class_Terminate\r
+    set attr = Nothing\r
+  end sub\r
+  \r
+  Public Sub AddCell(ByVal content)\r
+    ReDim Preserve cells(ubound(cells)+1)\r
+    set CurrentCell=new SimpleGridCell\r
+    set cells(ubound(cells))=CurrentCell\r
+    CurrentCell.content=content\r
+  End Sub\r
+  \r
+  Public Function HeadingRow(ByVal c1, ByVal c2)\r
+    dim cellidx,colidx,s,a\r
+    cellidx=0\r
+    colidx=0\r
+    while colidx < c1 and cellidx <= ubound(cells)\r
+      a=cells(cellidx).HeadingCell()\r
+      colidx=colidx+CInt(a(1))\r
+      cellidx=cellidx+1\r
+    Wend\r
+    while (colidx <= c2) and cellidx <= ubound(cells)\r
+      a=cells(cellidx).HeadingCell()\r
+      s=s & a(0)\r
+      colidx=colidx+CInt(a(1))\r
+      cellidx=cellidx+1\r
+    wend\r
+    HeadingRow = s\r
+  End Function\r
+  \r
+  Public Function HeadingClass()\r
+    HeadingClass=trim("ricoLG_hdg " & attr("class"))\r
+  End Function\r
+  \r
+  Public Function CellCount()\r
+    CellCount=ubound(cells)+1\r
+  End Function\r
+\r
+  Public Function GetRowAttr(ByVal name)\r
+    GetRowAttr=attr(name)\r
+  End Function\r
+\r
+  Public Sub SetRowAttr(ByVal name, ByVal value)\r
+    attr(name)=value\r
+  End Sub\r
+\r
+  Public Sub SetCellAttr(ByVal name, ByVal value)\r
+    CurrentCell.SetAttr name,value\r
+  End Sub\r
+end class\r
+\r
+\r
+class SimpleGrid\r
+  public rows()\r
+  private LastRow,LastHeadingRow,ResizeRowIdx\r
+\r
+  Private Sub Class_Initialize\r
+    redim rows(-1)\r
+  End sub\r
+\r
+  Public Function AddHeadingRow(ResizeRowFlag)\r
+    LastHeadingRow=AddDataRow\r
+    if ResizeRowFlag then ResizeRowIdx=LastHeadingRow\r
+    AddHeadingRow=LastHeadingRow\r
+  End Function\r
+  \r
+  Public Function AddDataRow()\r
+    ReDim Preserve rows(ubound(rows)+1)\r
+    set rows(ubound(rows))=new SimpleGridRow\r
+    LastRow=ubound(rows)\r
+    AddDataRow=LastRow\r
+  End Function\r
+  \r
+  Public Function HeadingRowCount()\r
+    if IsEmpty(LastHeadingRow) then\r
+      HeadingRowCount=0\r
+    else\r
+      HeadingRowCount=LastHeadingRow+1\r
+    end if\r
+  End Function\r
+  \r
+  Public Function DataRowCount()\r
+    if IsEmpty(LastRow) then\r
+      DataRowCount=0\r
+    else\r
+      DataRowCount=LastRow+1-HeadingRowCount()\r
+    end if\r
+  End Function\r
+  \r
+  ' returns # of cells in the current row\r
+  Public Function CellCount()\r
+    CellCount=rows(LastRow).CellCount\r
+  End Function\r
+\r
+  Public Sub AddCell(ByVal content)\r
+    rows(LastRow).AddCell content\r
+  End Sub\r
+  \r
+  Public Sub AddCellToRow(ByVal RowIdx, ByVal content)\r
+    LastRow=RowIdx\r
+    AddCell content\r
+  End Sub\r
+  \r
+  Public Sub SetRowAttr(ByVal name, ByVal value)\r
+    rows(LastRow).SetRowAttr name,value\r
+  End Sub\r
+\r
+  Public Sub SetCellAttr(ByVal name, ByVal value)\r
+    rows(LastRow).SetCellAttr name,value\r
+  End Sub\r
+\r
+  Private Function RenderColumns(ByVal c1, ByVal c2)\r
+    dim r,c\r
+    for c=c1 to c2\r
+      response.write vbLf & "<td><div class='ricoLG_col'>"\r
+      for r=LastHeadingRow+1 to ubound(rows)\r
+        response.write rows(r).cells(c).DataCell(rows(r).GetRowAttr("class"))\r
+      next\r
+      response.write "</div></td>"\r
+    next\r
+  End Function\r
+\r
+  ' Response.Buffer must be true\r
+  Public Sub RenderExcel(fileName)\r
+    dim r,c\r
+    Response.Clear\r
+    if fileName<>"" then Response.AddHeader "content-disposition", "attachment; filename=" & fileName\r
+    'Response.ContentType = "application/vnd.ms-excel"\r
+    Response.ContentType = "application/ms-excel"\r
+\r
+    response.write vbLf & "<table>"\r
+    for r=0 to ubound(rows)\r
+      response.write vbLf & "<tr>"\r
+      for c=0 to ubound(rows(r).cells)\r
+        response.write rows(r).cells(c).HtmlCell\r
+      next\r
+      response.write vbLf & "</tr>"\r
+    next\r
+    response.write vbLf & "</table>"\r
+    Response.End\r
+  End Sub\r
+\r
+  ' Response.Buffer must be true\r
+  Public Sub RenderDelimited(fileName,delim,SubstituteChar)\r
+    dim r,c\r
+    Response.Clear\r
+    if fileName<>"" then Response.AddHeader "content-disposition", "attachment; filename=" & fileName\r
+    Response.ContentType = "text/csv"\r
+\r
+    for r=0 to ubound(rows)\r
+      for c=0 to ubound(rows(r).cells)\r
+        if c > 0 then response.write delim\r
+        response.write replace(rows(r).cells(c).content,delim,SubstituteChar)\r
+      next\r
+      response.write vbLf\r
+    next\r
+    Response.End\r
+  End Sub\r
+\r
+  Public Sub Render(ByVal id, FrozenCols)\r
+    dim colcnt,r,c\r
+    if IsEmpty(ResizeRowIdx) then exit sub\r
+    colcnt=rows(ResizeRowIdx).CellCount\r
+    response.write vbLf & "<div id='" & id & "_outerDiv'>"\r
+\r
+    '-------------------\r
+    ' frozen columns\r
+    '-------------------\r
+    response.write vbLf & "<div id='" & id & "_frozenTabsDiv'>"\r
+\r
+    ' upper left\r
+    response.write vbLf & "<table id='" & id & "_tab0h' class='ricoLG_table ricoLG_top ricoLG_left' cellspacing='0' cellpadding='0'><thead>"\r
+    for r=0 to LastHeadingRow\r
+      response.write vbLf & "<tr class='" & rows(r).HeadingClass & "'"\r
+      if r=ResizeRowIdx then response.write " id='" & id & "_tab0h_main'"\r
+      response.write ">"\r
+      response.write rows(r).HeadingRow(0,FrozenCols-1)\r
+      response.write vbLf & "</tr>"\r
+    next\r
+    response.write vbLf & "</thead></table>"\r
+\r
+    ' lower left\r
+    response.write "<table id='" & id & "_tab0' class='ricoLG_table ricoLG_bottom ricoLG_left' cellspacing='0' cellpadding='0'>"\r
+    response.write vbLf & "<tr>"\r
+    RenderColumns 0,FrozenCols-1\r
+    response.write vbLf & "</tr>"\r
+    response.write vbLf & "</table>"\r
+\r
+    response.write vbLf & "</div>"\r
+\r
+\r
+    '-------------------\r
+    ' scrolling columns\r
+    '-------------------\r
+\r
+    ' upper right\r
+    response.write vbLf & "<div id='" & id & "_innerDiv'>"\r
+    response.write vbLf & "<div id='" & id & "_scrollTabsDiv'>"\r
+    response.write vbLf & "<table id='" & id & "_tab1h' class='ricoLG_table ricoLG_top ricoLG_right' cellspacing='0' cellpadding='0'><thead>"\r
+    for r=0 to LastHeadingRow\r
+      response.write vbLf & "<tr class='" & rows(r).HeadingClass & "'"\r
+      if r=ResizeRowIdx then response.write " id='" & id & "_tab1h_main'"\r
+      response.write ">"\r
+      response.write rows(r).HeadingRow(FrozenCols,colcnt-1)\r
+      response.write vbLf & "</tr>"\r
+    next\r
+    response.write vbLf & "</thead></table>"\r
+    response.write vbLf & "</div>"\r
+    response.write vbLf & "</div>"\r
+\r
+    ' lower right\r
+    response.write vbLf & "<div id='" & id & "_scrollDiv'>"\r
+    response.write vbLf & "<table id='" & id & "_tab1' class='ricoLG_table ricoLG_bottom ricoLG_right' cellspacing='0' cellpadding='0'>"\r
+    response.write vbLf & "<tr>"\r
+    RenderColumns FrozenCols,colcnt-1\r
+    response.write vbLf & "</tr>"\r
+    response.write vbLf & "</table>"\r
+    response.write vbLf & "</div>"\r
+\r
+    response.write vbLf & "</div>"\r
+  End Sub\r
+end class\r
+\r
+%>\r
diff --git a/plugins/asp/dbClass3.vbs b/plugins/asp/dbClass3.vbs
new file mode 100644 (file)
index 0000000..df10625
--- /dev/null
@@ -0,0 +1,1125 @@
+<%\r
+\r
+' ----------------------------------------------------------------------\r
+'\r
+' Page        : dbClass2.vbs\r
+' Description : Routines to access a SQL database using ADO\r
+' Author      : Matt Brown (dowdybrown@yahoo.com)\r
+' Copyright (C) 2006-2008 Matt Brown\r
+'\r
+' Rico is 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
+'\r
+' ----------------------------------------------------------------------\r
+\r
+'********************************************************************************************************\r
+' Parse SQL a statement\r
+'********************************************************************************************************\r
+class sqlParse\r
+\r
+public arSelList,arSelListAs,FromClause,WhereClause,arGroupBy,HavingClause,arOrderBy,IsDistinct\r
+\r
+\r
+Public function ToArray()\r
+  ToArray=Array(arSelList,arSelListAs,FromClause,WhereClause,arGroupBy,HavingClause,arOrderBy,IsDistinct)\r
+end function\r
+\r
+Public Sub LoadArray(a)\r
+  arSelList=a(0)\r
+  arSelListAs=a(1)\r
+  FromClause=a(2)\r
+  WhereClause=a(3)\r
+  arGroupBy=a(4)\r
+  HavingClause=a(5)\r
+  arOrderBy=a(6)\r
+  IsDistinct=a(7)\r
+end Sub\r
+\r
+' -------------------------------------------------------------\r
+' Rebuilds a SQL select statement that was parsed by ParseSelect\r
+' -------------------------------------------------------------\r
+Private function Unparse(arSkipCols)\r
+  dim sqltext\r
+  sqltext="SELECT "\r
+  if IsDistinct then sqltext=sqltext & "DISTINCT "\r
+  sqltext=sqltext & UnparseColumnListSkip(arSkipCols) & " FROM " & FromClause\r
+  if not IsEmpty(WhereClause) then sqltext=sqltext & " WHERE " & WhereClause\r
+  if IsArray(arGroupBy) then\r
+    if UBound(arGroupBy)>=0 then sqltext=sqltext & " GROUP BY " & join(arGroupBy,",")\r
+  end if\r
+  if not IsEmpty(HavingClause) then sqltext=sqltext & " HAVING " & HavingClause\r
+  if IsArray(arOrderBy) then\r
+    if UBound(arOrderBy)>=0 then sqltext=sqltext & " ORDER BY " & join(arOrderBy,",")\r
+  end If\r
+  Unparse=sqltext\r
+end Function\r
+\r
+\r
+Public function UnparseSelect()\r
+  UnparseSelect=Unparse(array())\r
+end Function\r
+\r
+\r
+Public function UnparseSelectSkip(arSkipCols)\r
+  UnparseSelectSkip=Unparse(arSkipCols)\r
+end Function\r
+\r
+\r
+Public function UnparseSelectDistinct()\r
+  IsDistinct=true\r
+  UnparseSelectDistinct=Unparse(array())\r
+end Function\r
+\r
+\r
+Public function UnparseDistinctColumn(colnum)\r
+  dim sqltext\r
+  sqltext="SELECT DISTINCT " & arSelList(colnum) & " FROM " & FromClause\r
+  if not IsEmpty(WhereClause) then sqltext=sqltext & " WHERE " & WhereClause\r
+  sqltext=sqltext & " ORDER BY " & arSelList(colnum)\r
+  UnparseDistinctColumn=sqltext\r
+end Function\r
+\r
+\r
+Public function UnparseColumn(ByVal i)\r
+  dim s\r
+  s=arSelList(i)\r
+  if not IsEmpty(arSelListAs(i)) then s=s & " AS " & arSelListAs(i)\r
+  UnparseColumn=s\r
+end Function\r
+\r
+\r
+Public function UnparseColumnList()\r
+  UnparseColumnList=UnparseColumnListSkip(array())\r
+end Function\r
+\r
+\r
+Public function UnparseColumnListSkip(arSkipCols)\r
+  dim sqltext,i,SkipIdx,skip\r
+  SkipIdx=0\r
+  for i=0 to ubound(arSelList)\r
+    skip=false\r
+    if SkipIdx <= ubound(arSkipCols) then\r
+      skip=CBool(arSkipCols(SkipIdx)=CStr(i))\r
+      if skip then SkipIdx=SkipIdx+1\r
+    end if\r
+    if not skip then\r
+      if not IsEmpty(sqltext) then sqltext=sqltext & ","\r
+      sqltext=sqltext & arSelList(i) & " AS rico_col" & i\r
+    end if\r
+  next\r
+  UnparseColumnListSkip=sqltext\r
+end Function\r
+\r
+\r
+Public Sub DebugPrint()\r
+  dim i\r
+  response.write "<p>Parse Result:"\r
+  response.write "<table border='1'>"\r
+  if IsDistinct then response.write "<tr valign='top'><td>DISTINCT<td>&nbsp;"\r
+  response.write "<tr valign='top'><td>COLUMNS:<td><ol>"\r
+  for i=0 to ubound(arSelList)\r
+    response.write "<li>" & UnparseColumn(i)\r
+  next\r
+  response.write "</ol><tr valign='top'><td>FROM:<td>" & FromClause\r
+  if not IsEmpty(WhereClause) then response.write "<tr valign='top'><td>WHERE:<td>" & WhereClause\r
+  if IsArray(arGroupBy) then\r
+    if UBound(arGroupBy)>=0 then response.write "<tr valign='top'><td>GROUP BY:<td>" & join(arGroupBy,"<br>")\r
+  end if\r
+  if not IsEmpty(HavingClause) then response.write "<tr valign='top'><td>HAVING:<td>" & HavingClause\r
+  if IsArray(arOrderBy) then\r
+    if UBound(arOrderBy)>=0 then response.write "<tr valign='top'><td>ORDER BY:<td>" & join(arOrderBy,"<br>")\r
+  end If\r
+  response.write "</table>"\r
+End Sub\r
+\r
+\r
+Public sub Init(ub)\r
+  redim arSelList(ub),arSelListAs(ub),arGroupBy(-1),arOrderBy(-1)\r
+  FromClause=empty\r
+  WhereClause=empty\r
+  HavingClause=empty\r
+  IsDistinct=false\r
+end sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Parse a SQL select statement into its major components\r
+' Does not handle:\r
+' 1) union queries\r
+' 2) select into\r
+' 3) more than one space between "group" and "by", or "order" and "by"\r
+' If distinct is specified, it will be part of the first item in arSelList\r
+' -------------------------------------------------------------\r
+Public function ParseSelect(ByVal sqltext)\r
+  dim i,j,l,idx,clause,parencnt,inquote,endquote,ch,curfield,nexttoken\r
+  Init(-1)\r
+  ParseSelect=false\r
+  sqltext=replace(sqltext,vbLf," ")\r
+  sqltext=" " & replace(sqltext,vbCr," ") & " SELECT "   ' SELECT suffix forces last curfield to be saved\r
+  'response.write "<p>ParseSelect: " & sqltext & "</p>"\r
+  l=len(sqltext)\r
+  parencnt=0\r
+  inquote=false\r
+  i=1\r
+  curfield=""\r
+  while i<l\r
+    ch=mid(sqltext,i,1)\r
+    if inquote then\r
+      if ch=endquote then\r
+        if endquote="'" and mid(sqltext,i,2)="''" then\r
+          curfield=curfield & "'"\r
+          i=i+1\r
+        else\r
+          inquote=false\r
+        end if\r
+      end if\r
+      curfield=curfield & ch\r
+    elseif ch="'" or ch="""" or ch="`" then\r
+      inquote=true\r
+      endquote=ch\r
+      curfield=curfield & ch\r
+    elseif ch="[" then\r
+      inquote=true\r
+      endquote="]"\r
+      curfield=curfield & ch\r
+    elseif ch="(" then\r
+      parencnt=parencnt+1\r
+      curfield=curfield & ch\r
+    elseif ch=")" then\r
+      if parencnt=0 then exit function  ' sql statement has a syntax error\r
+      parencnt=parencnt-1\r
+      curfield=curfield & ch\r
+    elseif parencnt > 0 then\r
+      curfield=curfield & ch\r
+    elseif ch="," then\r
+      'response.write "<p>" & clause & ": " & server.htmlencode(curfield) & "</p>"\r
+      select case clause\r
+        case "SELECT":\r
+          SetParseField arSelList,curfield\r
+          Push arSelListAs,Empty\r
+        case "AS":\r
+          arSelListAs(ubound(arSelList))=curfield\r
+          curfield=""\r
+          clause="SELECT"\r
+        case "GROUP BY": SetParseField arGroupBy,curfield\r
+        case "ORDER BY": SetParseField arOrderBy,curfield\r
+        case else: curfield=curfield & ch\r
+      end select\r
+    elseif ch=" " then\r
+      j=InStr(i+1,sqltext," ")\r
+      if j<1 then\r
+        curfield=curfield & ch\r
+      else\r
+        if ucase(mid(sqltext,j+1,3))="BY " then j=j+3\r
+        nexttoken=ucase(mid(sqltext,i+1,j-i-1))\r
+        'wscript.echo "'" & nexttoken & "'"\r
+        'response.write "<p>" & clause & " : " & nexttoken & " : " & server.htmlencode(curfield) & "</p>"\r
+        select case nexttoken\r
+          case "SELECT","INTO","FROM","WHERE","GROUP BY","HAVING","ORDER BY":\r
+            select case clause\r
+              case "SELECT":\r
+                AddColumn curfield,Empty\r
+                curfield=""\r
+              case "AS":\r
+                arSelListAs(ubound(arSelList))=curfield\r
+                curfield=""\r
+              case "FROM":     SetParseField FromClause,curfield\r
+              case "WHERE":    SetParseField WhereClause,curfield\r
+              case "GROUP BY": SetParseField arGroupBy,curfield\r
+              case "HAVING":   SetParseField HavingClause,curfield\r
+              case "ORDER BY": SetParseField arOrderBy,curfield\r
+            end select\r
+            clause=nexttoken\r
+            i=j-1\r
+          case "AS":\r
+            if clause="SELECT" then\r
+              AddColumn curfield,Empty\r
+              curfield=""\r
+              clause=nexttoken\r
+              i=j\r
+            elseif curfield<>"" then\r
+              curfield=curfield & ch\r
+            end if\r
+          case "DISTINCT":\r
+            if clause="SELECT" then\r
+              IsDistinct=true\r
+              curfield=""\r
+              i=j\r
+            elseif curfield<>"" then\r
+              curfield=curfield & ch\r
+            end if\r
+          case else: if curfield<>"" then curfield=curfield & ch\r
+        end select\r
+      end if\r
+    else\r
+      curfield=curfield & ch\r
+    end if\r
+    i=i+1\r
+  wend\r
+  ParseSelect=true\r
+end function\r
+\r
+\r
+Private sub Push(f, ByVal newvalue)\r
+  ReDim Preserve f(ubound(f)+1)\r
+  f(ubound(f))=newvalue\r
+end sub\r
+\r
+Private sub SetParseField(f, ByRef newvalue)\r
+  if IsArray(f) then\r
+    Push f,newvalue\r
+  else\r
+    f=newvalue\r
+  end if\r
+  newvalue=""\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Add column to select list\r
+' -------------------------------------------------------------\r
+Public Sub AddColumn(ByVal ColumnSql, ByVal ColumnName)\r
+  Push arSelList,ColumnSql\r
+  Push arSelListAs,ColumnName\r
+end sub\r
+\r
+Public Function LastColumn()\r
+  LastColumn=arSelList(ubound(arSelList))\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Add a join to the from clause\r
+' -------------------------------------------------------------\r
+Public Sub AddJoin(ByVal JoinClause)\r
+  if InStr(FromClause," join ")>0 then FromClause="(" & FromClause & ")"  ' required by Access\r
+  FromClause=FromClause & " " & JoinClause\r
+end sub\r
+\r
+Private Sub SplitSortSpec(ByVal sortspec, ByRef sortcol, ByRef sortdir)\r
+  sortspec=ucase(sortspec)\r
+  if right(sortspec,3)="ASC" then\r
+    sortcol=trim(left(sortspec,len(sortspec)-3))\r
+    sortdir="ASC"\r
+  elseif right(sortspec,4)="DESC" then\r
+    sortcol=trim(left(sortspec,len(sortspec)-4))\r
+    sortdir="DESC"\r
+  else\r
+    sortcol=trim(sortspec)\r
+    sortdir=""\r
+  end if\r
+End Sub\r
+\r
+Private Function FindSortColumn(ByVal sortspec)\r
+  dim i, findcol, finddir, sortcol, sortdir\r
+  FindSortColumn=-1\r
+  SplitSortSpec sortspec, findcol, finddir\r
+  for i=0 to ubound(arOrderBy)\r
+    SplitSortSpec arOrderBy(i), sortcol, sortdir\r
+    if sortcol=findcol then\r
+      FindSortColumn=i\r
+      exit for\r
+    end if\r
+  next\r
+End Function\r
+\r
+' -------------------------------------------------------------\r
+' Add sort criteria to the beginning of the order by clause\r
+' -------------------------------------------------------------\r
+Public Sub AddSort(ByVal NewSort)\r
+  dim i, colidx\r
+  colidx=FindSortColumn(NewSort)\r
+  if colidx>=0 then\r
+    for i=colidx to 1 step -1\r
+      arOrderBy(i)=arOrderBy(i-1)\r
+    next\r
+    arOrderBy(0)=NewSort\r
+  else\r
+    ReDim Preserve arOrderBy(ubound(arOrderBy)+1)\r
+    for i=ubound(arOrderBy) to 1 step -1\r
+      arOrderBy(i)=arOrderBy(i-1)\r
+    next\r
+    arOrderBy(0)=NewSort\r
+  end if\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Append sort criteria to the order by clause\r
+' -------------------------------------------------------------\r
+Public Sub AppendSort(ByVal NewSort)\r
+  Push arOrderBy,NewSort\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Add a condition to the where clause\r
+' -------------------------------------------------------------\r
+Public Sub AddWhereCondition(ByVal NewCondition)\r
+  AddCondition WhereClause,NewCondition\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Add a condition to the having clause\r
+' -------------------------------------------------------------\r
+Public Sub AddHavingCondition(ByVal NewCondition)\r
+  AddCondition HavingClause,NewCondition\r
+end sub\r
+\r
+Private Sub AddCondition(ByRef Clause, ByVal NewCondition)\r
+  if IsEmpty(NewCondition) then exit sub\r
+  If IsEmpty(Clause) Then\r
+    Clause="(" & NewCondition & ")"\r
+  Else\r
+    Clause=Clause & " AND (" & NewCondition & ")"\r
+  End If\r
+End Sub\r
+\r
+end class\r
+\r
+\r
+'********************************************************************************************************\r
+' created by dbClass.GetColumnInfo()\r
+'********************************************************************************************************\r
+class dbColumn\r
+  Public ColName,Nullable,ColType,ColLength,Writeable,IsPKey,FixedLength\r
+end class\r
+\r
+\r
+'********************************************************************************************************\r
+' Manage a database connection\r
+'********************************************************************************************************\r
+class dbClass\r
+\r
+Public SqlSvr,debug,ConnTimeout,CmdTimeout,LockTimeout,Provider,OdbcDriver\r
+Public ErrMsgFmt     ' empty=errors not shown, otherwise "HTML" or "MULTILINE" or "1LINE"\r
+Public DisplayErrors ' true/false\r
+Public LastErrorMsg,Dialect\r
+\r
+Private dbMain,DisplayFunc,dbDefault\r
+\r
+' -------------------------------------------------------------\r
+' Class Constructor\r
+' -------------------------------------------------------------\r
+Private Sub Class_Initialize   ' Setup Initialize event.\r
+  dim tw,tr\r
+  SqlSvr = "localhost"\r
+  Use_TSQL\r
+  debug=false\r
+  ConnTimeout=30        ' seconds\r
+  LockTimeout=5000      ' milliseconds\r
+  DisplayErrors=true\r
+  on error resume next  ' if running with option explicit, then the next lines cause an error\r
+  tw=TypeName(wscript)\r
+  tr=TypeName(response)\r
+  if tw<>"Empty" then\r
+    if IsObject(wscript) then\r
+      ErrMsgFmt="1LINE"\r
+      CmdTimeout = 3600   ' 60 minutes for wsh/cscript\r
+      DisplayFunc="wscript.echo "\r
+    end if\r
+  elseif tr<>"Empty" then\r
+    if IsObject(response) then\r
+      ErrMsgFmt="HTML"\r
+      CmdTimeout = 120    ' 2 minutes for asp pages\r
+      DisplayFunc="response.write "\r
+    end if\r
+  else\r
+    ErrMsgFmt="MULTILINE"\r
+    CmdTimeout = 30\r
+    DisplayFunc="msgbox "\r
+  End If\r
+  'DisplayMsg "Message format set to " & ErrMsgFmt\r
+End Sub\r
+\r
+Public function Connection()\r
+  set Connection=dbMain\r
+end function\r
+\r
+Public Sub Use_TSQL()\r
+  Dialect="TSQL"\r
+  Provider="SQLOLEDB"\r
+End Sub\r
+\r
+Public Sub Use_Access(FileName)\r
+  Dialect="Access"\r
+  Provider="Microsoft.Jet.OLEDB.4.0"\r
+  SqlSvr=FileName\r
+End Sub\r
+\r
+Public Sub Use_MySQL()\r
+  Dialect="MySQL"\r
+  OdbcDriver="{MySQL ODBC 3.51 Driver}"\r
+End Sub\r
+\r
+Public Sub Use_Oracle(SIM)\r
+  Dialect="Oracle"\r
+  'Provider="MSDAORA"\r
+  Provider="OraOLEDB.Oracle"\r
+  SqlSvr=SIM\r
+End Sub\r
+\r
+Public function CurrentTime()\r
+  select case Dialect\r
+    case "TSQL","DB2": CurrentTime="CURRENT_TIMESTAMP"\r
+    case "Access": CurrentTime="Now()"\r
+    case else: CurrentTime="LOCALTIMESTAMP"\r
+  end select\r
+end function\r
+\r
+Public function Convert2Char(s)\r
+  select case Dialect\r
+    case "TSQL"  : Convert2Char="cast(" & s & " as varchar)"\r
+    case "Access": Convert2Char="CStr(" & s & ")"\r
+    case "DB2"   : Convert2Char="CHAR(" & s & ")"\r
+    case "MySQL" : Convert2Char="{fn CONVERT(" & s & ",CHAR)}"   ' use ODBC's convert function\r
+    case "Oracle": Convert2Char="cast(" & s & " as varchar2(20))"\r
+    case else: Convert2Char=s   ' implicit conversion\r
+  end select\r
+end function\r
+\r
+Public function SqlDay(s)\r
+  select case Dialect\r
+    case "Oracle": SqlDay="to_char(" & s & ",'DD')"\r
+    case "MySQL":  SqlDay="dayofmonth(" & s & ")"\r
+    case else: SqlDay="day(" & s & ")"\r
+  end select\r
+end function\r
+\r
+Public function SqlMonth(s)\r
+  select case Dialect\r
+    case "Oracle": SqlMonth="to_char(" & s & ",'MM')"\r
+    case else: SqlMonth="month(" & s & ")"\r
+  end select\r
+end function\r
+\r
+Public function SqlYear(s)\r
+  select case Dialect\r
+    case "Oracle": SqlYear="to_char(" & s & ",'YYYY')"\r
+    case else: SqlYear="year(" & s & ")"\r
+  end select\r
+end function\r
+\r
+Public function Wildcard()\r
+  Wildcard="%"\r
+end function\r
+\r
+Public function addQuotes(s)\r
+  select case Dialect\r
+    case "Access":\r
+      if IsDate(s) then\r
+        addQuotes="#" & s & "#"\r
+      else\r
+        addQuotes="""" & replace(s,"""","""""") & """"\r
+      end if\r
+    case "MySQL":  addQuotes="'" & replace(replace(s,"\","\\"),"'","\'") & "'"\r
+    case else:     addQuotes="'" & replace(s,"'","''") & "'"\r
+  end select\r
+end function\r
+\r
+Public function Concat(arStrings,addQuotes)\r
+  dim i\r
+  if addQuotes then\r
+    for i=0 to ubound(arStrings)\r
+      arStrings(i)=addQuotes(arStrings(i))\r
+    next\r
+  end if\r
+  select case Dialect\r
+    case "TSQL": Concat=join(arStrings,"+")\r
+    case "Access": Concat=join(arStrings," & ")\r
+    case "MySQL": Concat="concat(" & join(arStrings,",") & ")"\r
+    case else: Concat=join(arStrings," || ")\r
+  end select\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Class Destructor\r
+' -------------------------------------------------------------\r
+Private Sub Class_Terminate   ' Setup Terminate event.\r
+  dbClose\r
+End Sub\r
+\r
+' -------------------------------------------------------------\r
+' If the database is down, then an explanation can be placed here\r
+' -------------------------------------------------------------\r
+Public function MaintenanceMsg()\r
+  MaintenanceMsg=""\r
+end function\r
+\r
+Public function DefaultDB()\r
+  DefaultDB=dbDefault\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Attempts to connect to the database using Windows security. \r
+' Returns true on success.\r
+' For use with MS SQL Server\r
+' -------------------------------------------------------------\r
+Public function WinLogon(ByVal DefDB)\r
+  dim connstr\r
+  dbDefault=DefDB\r
+  if IsEmpty(OdbcDriver) Then\r
+    connstr="Provider=" & Provider & ";Data Source=" & SqlSvr & ";Integrated Security=SSPI;"\r
+    if DefDB<>"" then connstr=connstr & "Initial Catalog=" & DefDB & ";"\r
+  else\r
+    connstr="DRIVER=" & OdbcDriver & ";SERVER=" & SqlSvr & ";Trusted_Connection=Yes;"\r
+    if DefDB<>"" then connstr=connstr & "DATABASE=" & DefDB & ";"\r
+  end if\r
+  WinLogon=dbConnect(connstr)\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Attempts to connect to the database using sql security model. \r
+' Returns true on success.\r
+' -------------------------------------------------------------\r
+Public function SqlLogon(ByVal DefDB, ByVal userid, ByVal pw)\r
+  dim connstr\r
+  dbDefault=DefDB\r
+  if IsEmpty(OdbcDriver) then\r
+    connstr="Provider=" & Provider & ";Data Source=" & SqlSvr & ";"\r
+    if userid<>"" then connstr=connstr & "User Id=" & userid & ";Password=" & pw & ";"\r
+    if DefDB<>"" then connstr=connstr & "Initial Catalog=" & DefDB & ";"\r
+  else\r
+    connstr="DRIVER=" & OdbcDriver & ";SERVER=" & SqlSvr & ";"\r
+    if userid<>"" then connstr=connstr & "USER=" & userid & ";PASSWORD=" & pw & ";"\r
+    if DefDB<>"" then connstr=connstr & "DATABASE=" & DefDB & ";"\r
+  end if\r
+  SqlLogon=dbConnect(connstr)\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Attempts to connect to the Database. Returns true on success.\r
+' -------------------------------------------------------------\r
+Public function dbConnect(ByVal ConnStr)\r
+  if MaintenanceMsg<>"" then\r
+       HandleError MaintenanceMsg\r
+       exit function\r
+  end if\r
+  On Error Resume Next\r
+  dbConnect=false\r
+  if not IsObject(dbMain) then\r
+    set dbMain = CreateObject("ADODB.Connection")\r
+    if CheckForError("creating ADODB object") then exit function\r
+  end if\r
+  if debug then DisplayMsg "Connect String: " & ConnStr\r
+  dbMain.ConnectionTimeout = ConnTimeout\r
+  dbMain.Open ConnStr\r
+  if CheckForError("opening connection: " & ConnStr) then exit function\r
+  dbMain.CommandTimeout = CmdTimeout\r
+  if Dialect="TSQL" then RunActionQuery "SET LOCK_TIMEOUT " & LockTimeout\r
+  dbConnect=true\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Close database connection\r
+' -------------------------------------------------------------\r
+Public sub dbClose\r
+  if IsObject(dbMain) then\r
+    if dbMain.state <> 0 then dbMain.Close\r
+    set dbMain = Nothing    ' releases memory, but still an object\r
+    dbMain = Empty          ' cause IsObject to return false\r
+  end if\r
+End sub\r
+\r
+' -------------------------------------------------------------\r
+' return true if database connection is open\r
+' -------------------------------------------------------------\r
+Public Function dbIsOpen\r
+  dbIsOpen=false\r
+  if IsObject(dbMain) then\r
+    if dbMain.state <> 0 then dbIsOpen=true\r
+  end if\r
+End Function\r
+\r
+' -------------------------------------------------------------\r
+' Return a string containing an error message\r
+' String format is based on ErrMsgFmt\r
+' -------------------------------------------------------------\r
+Private Function FormatErrorMsg(ByVal ContextMsg)\r
+  select case ErrMsgFmt\r
+    case "HTML": FormatErrorMsg = "<p class='dberror' id='dbError'>Error # " & Hex(err.number) & " was generated by " & err.Source & "<br />" & FixHtmlStr(err.Description) & "</p>" & _\r
+                                  "<p class='dberror' id='dbErrorDetail'><u>Operation that caused the error:</u><br />" & FixHtmlStr(ContextMsg) & "</p>"\r
+    case "MULTILINE": FormatErrorMsg = "Error # " & Hex(err.number) & " was generated by " & err.Source & vbLf & err.Description & vbLf & vbLf & _\r
+                                       "Operation that caused the error:" & vbLf & ContextMsg\r
+    case "1LINE": FormatErrorMsg = "Error # " & hex(Err.Number) & " was generated by " & Err.Source & ":  " & Err.Description & "  (" & ContextMsg & ")"\r
+  end select\r
+End Function\r
+\r
+Private Function FixHtmlStr(s)\r
+  FixHtmlStr=replace(replace(replace(s,"&","&amp;"),"<","&lt;"),"""","&quot;")\r
+End Function\r
+\r
+Private sub DisplayMsg(msg)\r
+  if not IsEmpty(DisplayFunc) then\r
+    if ErrMsgFmt="HTML" and left(msg,1)<>"<" then\r
+      msg="<p>" & Server.HTMLEncode(replace(msg,vbLf,"<br>"))\r
+    else\r
+      msg=replace(msg,vbLf," ")\r
+    end if\r
+    execute DisplayFunc & """" & replace(msg,"""","""""") & """"\r
+  End If\r
+end sub\r
+\r
+Private sub HandleError(msg)\r
+  LastErrorMsg=msg\r
+  if DisplayErrors then DisplayMsg LastErrorMsg\r
+End sub\r
+\r
+' -------------------------------------------------------------\r
+' Checks if an error has occurred, and if so, displays a message & returns true\r
+' -------------------------------------------------------------\r
+Private function CheckForError(msg)\r
+  CheckForError=false\r
+  If err.number = 0 Then exit function\r
+  CheckForError=true\r
+  if IsEmpty(ErrMsgFmt) Then exit function\r
+  HandleError FormatErrorMsg(msg)\r
+End function\r
+\r
+' -------------------------------------------------------------\r
+' Runs a query and moves to the first record.\r
+' Use only for queries that return records (no updates or deletes).\r
+' If the query generated an error then Nothing is returned, otherwise it returns a new recordset object.\r
+' -------------------------------------------------------------\r
+Public Function RunQuery(sqltext)\r
+  Dim rsLookUp\r
+  On Error Resume Next\r
+  Set rsLookUp = dbMain.Execute(sqltext)\r
+  If CheckForError(sqltext) Then\r
+    Set RunQuery = Nothing\r
+    Exit Function\r
+  End If\r
+  If debug then DisplayMsg sqltext\r
+  If Not rsLookUp.EOF Then rsLookUp.MoveFirst\r
+  Set RunQuery = rsLookUp\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Runs a parameterized query (put ? in sqltext to indicate where parameters should be inserted)\r
+' Use only for queries that return records (no updates or deletes).\r
+' If the query generated an error then Nothing is returned, otherwise it returns a new recordset object.\r
+' -------------------------------------------------------------\r
+Public Function RunParamQuery(sqltext, arParams)\r
+  Dim rsLookUp,cmd,RecordsAffected\r
+  On Error Resume Next\r
+  set objCmd = CreateObject("ADODB.Command")\r
+  Set objCmd.ActiveConnection = dbMain\r
+  objCmd.CommandText = sqltext\r
+  objCmd.CommandType = 1 ' adCmdText \r
+  Set rsLookUp = objCmd.Execute(RecordsAffected,arParams)\r
+  If CheckForError(sqltext) Then\r
+    Set RunParamQuery = Nothing\r
+    Exit Function\r
+  End If\r
+  If debug then DisplayMsg sqltext\r
+  set objCmd = Nothing\r
+  Set RunParamQuery = rsLookUp\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Safely close a recordset\r
+' -------------------------------------------------------------\r
+Public Sub rsClose(ByRef rsLookUp)\r
+  If IsObject(rsLookUp) Then\r
+    If Not (rsLookUp Is Nothing) Then\r
+      If rsLookUp.State <> 0 Then      ' adStateClosed=0\r
+        rsLookUp.Close\r
+      End If\r
+      Set rsLookUp = Nothing\r
+    End If\r
+  End If\r
+End Sub\r
+\r
+' -------------------------------------------------------------\r
+' Runs a query and returns results from the first record in dicData.\r
+' Returns true if dicData is modified (ie. a record exists).\r
+' If the query generates an error then dicData is left unchanged\r
+' dicData can be a dictionary object, an array, or a scalar\r
+' If dicData is a scalar, it will be assigned the value of the first field in the first row.\r
+' -------------------------------------------------------------\r
+Public Function SingleRecordQuery(ByVal sqltext, ByRef dicData)\r
+  Dim rsMain, i\r
+  SingleRecordQuery = False\r
+  Set rsMain = RunQuery(sqltext)\r
+  If rsMain Is Nothing Then Exit Function\r
+  If Not rsMain.EOF Then\r
+    If IsObject(dicData) Then\r
+      For i = 0 To rsMain.Fields.Count - 1\r
+        dicData(rsMain.Fields(i).name) = rsMain.Fields(i).Value\r
+      Next\r
+    ElseIf IsArray(dicData) Then\r
+      For i = 0 To rsMain.Fields.Count - 1\r
+        dicData(i) = rsMain.Fields(i).Value\r
+      Next\r
+    Else\r
+      dicData = rsMain.Fields(0).Value\r
+    End If\r
+    SingleRecordQuery = True\r
+  End If\r
+  rsClose rsMain\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Runs a query where no result set is expected (updates, deletes, etc)\r
+'   - returns the number of records affected by the action query\r
+' -------------------------------------------------------------\r
+Public Function RunActionQuery(ByVal sqltext)\r
+  Dim RecordsAffected, spflag\r
+  On Error Resume Next\r
+  RunActionQuery = 0\r
+  spflag = (UCase(Left(sqltext, 4)) = "EXEC")\r
+  If spflag Then dbMain.Execute "SET NOCOUNT ON"\r
+  dbMain.Execute sqltext, RecordsAffected, &H80     ' adExecuteNoRecords (hard coded so that adovbs.inc is not required)\r
+  If CheckForError(sqltext) Then\r
+    Exit Function\r
+  ElseIf debug then\r
+    DisplayMsg sqltext\r
+    if not IsEmpty(RecordsAffected) and not IsNull(RecordsAffected) then\r
+      DisplayMsg RecordsAffected & " records affected"\r
+    end if\r
+  End If\r
+  RunActionQuery = RecordsAffected\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Runs a query where no result set is expected (updates, deletes, etc) \r
+'   - if an error occurs, then the message is returned in errmsg\r
+' -------------------------------------------------------------\r
+Public function RunActionQueryReturnMsg (ByVal sqltext, ByRef errmsg)\r
+  dim tmpDisplayErrors\r
+  tmpDisplayErrors=DisplayErrors\r
+  DisplayErrors=false\r
+  LastErrorMsg=Empty\r
+  RunActionQueryReturnMsg=RunActionQuery(sqltext)\r
+  if not IsEmpty(LastErrorMsg) then errmsg=LastErrorMsg\r
+  DisplayErrors=tmpDisplayErrors\r
+end function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Takes a sql create (table or view) statement and performs:\r
+'   1) a conditional drop (if it already exists)\r
+'   2) the create\r
+'   3) grants select access to public (if not a temp table)\r
+'\r
+' for views, all actions must occur on the default database for the connection\r
+' -------------------------------------------------------------\r
+Public sub DropCreate (sqlcreate)\r
+  dim sqltext,shortname,parsed,arName,db\r
+  parsed=split(sqlcreate," ",4)\r
+  arName=split(parsed(2),".")\r
+  shortname=arName(ubound(arName))\r
+  if ubound(arName)=2 then db=arName(0) else db=dbDefault\r
+  sqltext="IF EXISTS (SELECT * from " & db & ".dbo.sysobjects WHERE name='" & shortname & "') DROP " & parsed(1) & " " & parsed(2)\r
+  RunActionQuery sqltext\r
+  RunActionQuery sqlcreate\r
+  if left(shortname,1) <> "#" and db=dbDefault then\r
+    sqltext="GRANT SELECT ON " & parsed(2) & " TO public"\r
+    RunActionQuery sqltext\r
+  end if\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Returns a recordset that will enumerate the columns in a table or view\r
+' objname may be a fully qualified object name\r
+' -------------------------------------------------------------\r
+Public function EnumColumns (ByVal objname)\r
+  select case Dialect\r
+    case "TSQL":   set EnumColumns=RunQuery("exec sp_columns " & TabName2SpParms(objname))\r
+    case "Access": set EnumColumns=empty\r
+    case "MySQL":  set EnumColumns=RunQuery("show full columns from " & objname)\r
+    case else:     set EnumColumns=RunQuery("describe " & objname)\r
+  end select\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Convert the numeric value returned by DB to Enum, so\r
+' that at least the user could have a guess of what it is.\r
+' -------------------------------------------------------------\r
+Public Function ConvType(ByVal TypeVal)\r
+  Select Case TypeVal\r
+      Case 20    ConvType = "adBigInt"\r
+      Case 128   ConvType = "adBinary"\r
+      Case 11    ConvType = "adBoolean"\r
+      Case 8     ConvType = "adBSTR"    '  i.e. null terminated string\r
+      Case 129   ConvType = "adChar"\r
+      Case 6     ConvType = "adCurrency"\r
+      Case 7     ConvType = "adDate"\r
+      Case 133   ConvType = "adDBDate"\r
+      Case 134   ConvType = "adDBTime"\r
+      Case 135   ConvType = "adDBTimeStamp"\r
+      Case 14    ConvType = "adDecimal"\r
+      Case 5     ConvType = "adDouble"\r
+      Case 0     ConvType = "adEmpty"\r
+      Case 10    ConvType = "adError"\r
+      Case 72    ConvType = "adGUID"\r
+      Case 9     ConvType = "adIDispatch"\r
+      Case 3     ConvType = "adInteger"\r
+      Case 13    ConvType = "adIUnknown"\r
+      Case 205   ConvType = "adLongVarBinary"\r
+      Case 201   ConvType = "adLongVarChar"\r
+      Case 203   ConvType = "adLongVarWChar"\r
+      Case 131   ConvType = "adNumeric"\r
+      Case 4     ConvType = "adSingle"\r
+      Case 2     ConvType = "adSmallInt"\r
+      Case 16    ConvType = "adTinyInt"\r
+      Case 21    ConvType = "adUnsignedBigInt"\r
+      Case 19    ConvType = "adUnsignedInt"\r
+      Case 18    ConvType = "adUnsignedSmallInt"\r
+      Case 17    ConvType = "adUnsignedTinyInt"\r
+      Case 132   ConvType = "adUserDefined"\r
+      Case 204   ConvType = "adVarBinary"\r
+      Case 200   ConvType = "adVarChar"\r
+      Case 12    ConvType = "adVariant"\r
+      Case 202   ConvType = "adVarWChar"\r
+      Case 130   ConvType = "adWChar"\r
+   End Select\r
+End Function\r
+\r
+' -------------------------------------------------------------\r
+' Refresh View - in case the tables on which the view is based have changed\r
+' -------------------------------------------------------------\r
+Public sub RefreshView (ByVal viewname)\r
+  dim sqltext,rsLookUp\r
+  sqltext="SELECT * FROM " & dbDefault & ".dbo.sysobjects o " & vbLf & _\r
+          "WHERE (o.xtype='V') AND (o.name='" & viewname & "')"\r
+  set rsLookUp = RunQuery(sqltext)\r
+  if rsLookUp.EOF then\r
+    rsClose rsLookUp\r
+  else\r
+    rsClose rsLookUp\r
+    sqltext="sp_helptext '" & viewname & "'"\r
+    set rsLookUp = RunQuery(sqltext)\r
+    sqltext=""\r
+    Do while not rsLookUp.EOF\r
+      sqltext=sqltext & rsLookUp("Text")\r
+       rsLookUp.movenext\r
+    Loop\r
+    rsClose rsLookUp\r
+    sqltext=replace(sqltext,"CREATE VIEW ","ALTER VIEW ",1,-1,1)\r
+    RunActionQuery sqltext\r
+  end if\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Split a fully or partially qualified table name into\r
+' its component parts (db,owner,table)\r
+' -------------------------------------------------------------\r
+Public sub SplitTabName (ByVal objname, ByRef dbname, ByRef owner, ByRef table)\r
+  dim arNames,last\r
+\r
+  arNames=split(objname,".")\r
+  last=ubound(arNames)\r
+  table=arNames(last)\r
+  if Dialect="Access" or Dialect="Oracle" then\r
+    owner=empty\r
+    dbname=empty\r
+    table=ucase(table)\r
+    exit sub\r
+  end if\r
+  if last>0 then\r
+    owner=arNames(last-1)\r
+  else\r
+    owner="dbo"\r
+  end if\r
+  if last>1 then\r
+    dbname=arNames(last-2)\r
+  else\r
+    dbname=dbDefault\r
+  end if\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Converts objname (db.owner.table) to format used by\r
+' stored procedures ('table','owner','db')\r
+' -------------------------------------------------------------\r
+Public function TabName2SpParms (ByVal objname)\r
+  dim table,owner,dbname\r
+  SplitTabName objname,dbname,owner,table\r
+  TabName2SpParms="'" & table & "','" & owner & "','" & dbname & "'"\r
+end function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Safely add a column to a table\r
+' -------------------------------------------------------------\r
+Public sub AddColumnIfMissing(TableName,ColumnName,ColumnType)\r
+  dim sqltext,db,ShortName,arTableName\r
+  db=dbDefault\r
+  arTableName=split(TableName,".")\r
+  ShortName=arTableName(ubound(arTableName))       ' the last element is the unqualified table name\r
+  if ubound(arTableName)=2 then db=arTableName(0)  ' if TableName was a fully qualified name, then use the db name that came with it\r
+  sqltext="IF NOT EXISTS (SELECT c.name FROM " & db & ".dbo.syscolumns c, " & db & ".dbo.sysobjects o " & vbLf & _\r
+          "WHERE c.id = o.id AND (o.xtype='U') AND (o.name='" & ShortName & "') AND (c.name='" & ColumnName & "')) " & vbLf & _\r
+          "ALTER TABLE " & TableName & " ADD " & ColumnName & " " & ColumnType\r
+  RunActionQuery sqltext\r
+end sub\r
+\r
+\r
+Private function ADOColType(typenum)\r
+  select case typenum\r
+    case 2,3,16,17,18,19,20,21,139: ADOColType="INT"\r
+    case 7,133,134,135: ADOColType="DATETIME"\r
+    case 129,130:   ADOColType="CHAR"\r
+    case 8,200,202: ADOColType="VARCHAR"\r
+    case 201,203:   ADOColType="TEXT"\r
+    case 4,5,6,14:  ADOColType="FLOAT"\r
+    case 11:        ADOColType="BOOLEAN"\r
+    case else:      ADOColType="???" & typenum\r
+  end select\r
+end function\r
+\r
+' -------------------------------------------------------------\r
+' Returns a recordset that will enumerate the columns in a table or view\r
+' objname may be a fully qualified object name\r
+' querytype: 4=adSchemaColumns, 27=adSchemaForeignKeys, 28=adSchemaPrimaryKeys\r
+' -------------------------------------------------------------\r
+Public function EnumColumnsADO (ByVal querytype, ByVal objname)\r
+  dim table,owner,dbname,reval\r
+  on error resume next\r
+  SplitTabName objname,dbname,owner,table\r
+  If debug then DisplayMsg "Getting ADO column info for: " & querytype & ", " & objname\r
+  Set reval = dbMain.OpenSchema (querytype, Array(dbname, owner, table))\r
+  if CheckForError("OpenSchema: " & querytype & "," & dbname & "," & owner & "," & table) then\r
+    Set reval = Nothing\r
+  end if\r
+  Set EnumColumnsADO = reval\r
+end function\r
+\r
+\r
+'********************************************************************************************************\r
+' Returns a comma-separated list of column names that make up the primary key\r
+' Returns empty if no primary key has been defined\r
+'********************************************************************************************************\r
+Public function PrimaryKey(TableName)\r
+  Dim rs,colnames\r
+  If debug then DisplayMsg "Getting primary key for: " & TableName\r
+  Set rs = EnumColumnsADO(28,TableName)\r
+  if rs is Nothing Then exit function\r
+  While Not rs.EOF\r
+    if IsEmpty(colnames) then colnames=rs("COLUMN_NAME") else colnames=colnames & "," & rs("COLUMN_NAME")\r
+    rs.MoveNext\r
+  Wend\r
+  rs.Close\r
+  PrimaryKey=colnames\r
+end function\r
+\r
+\r
+' returns number of columns, or -1 if there was en error\r
+Public function GetColumnInfo (ByVal TableName, ByRef arColumns)\r
+  dim rs,cnt,i\r
+  GetColumnInfo=-1\r
+  If debug then DisplayMsg "Getting column info for: " & TableName\r
+  SplitTabName TableName,dbname,owner,table\r
+  cnt=0\r
+  Set rs = EnumColumnsADO(4,TableName)\r
+  if rs is Nothing Then exit function\r
+  If debug and rs.EOF then DisplayMsg "EOF column info"\r
+  While Not rs.EOF\r
+    if not IsEmpty(arColumns(cnt)) then set arColumns(cnt)=Nothing\r
+    'DisplayMsg "Loading column #" & cnt & " " & rs("TABLE_CATALOG") & "." & rs("TABLE_NAME") & "." & rs("COLUMN_NAME") & " " & rs("DATA_TYPE") & " " & hex(rs("COLUMN_FLAGS"))\r
+    set arColumns(cnt)=new dbColumn\r
+    with arColumns(cnt)\r
+      .ColName=rs("COLUMN_NAME")\r
+      .ColType=ADOColType(clng(rs("DATA_TYPE")))\r
+      if .ColType="INT" then\r
+        .ColLength=rs("NUMERIC_PRECISION")\r
+      else\r
+        .ColLength=rs("CHARACTER_MAXIMUM_LENGTH")\r
+      end if\r
+      .Nullable=rs("IS_NULLABLE")\r
+      .Writeable=((rs("COLUMN_FLAGS") and &H000000C) <> 0)\r
+      .FixedLength=((rs("COLUMN_FLAGS") and &H0000010) <> 0)\r
+      .IsPKey=false\r
+    end with\r
+    cnt=cnt+1\r
+    rs.MoveNext\r
+  Wend\r
+  rs.Close\r
+\r
+  Set rs = EnumColumnsADO(28,TableName)\r
+  if rs is Nothing Then exit function\r
+  While Not rs.EOF\r
+    for i=0 to cnt-1\r
+      if arColumns(i).ColName=rs("COLUMN_NAME") then\r
+        arColumns(i).IsPKey=true\r
+        exit for\r
+      end if\r
+    next\r
+    rs.MoveNext\r
+  Wend\r
+  rs.Close\r
+  GetColumnInfo=cnt\r
+  if Dialect <> "Access" then exit function\r
+\r
+  ' check for AutoNumber columns\r
+  dim ADOXcat,cols\r
+  Set ADOXcat = CreateObject("ADOX.Catalog")\r
+  Set ADOXcat.ActiveConnection = dbMain\r
+  Set cols=ADOXcat.Tables(table).Columns\r
+  for i=0 to cnt-1\r
+    If cols(arColumns(i).ColName).Properties("Autoincrement").Value = True Then\r
+      'DisplayMsg arColumns(i).ColName & " is Autoincrement"\r
+      arColumns(i).Writeable = false\r
+    End If\r
+  next\r
+  Set ADOXcat = Nothing\r
+end function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Returns a SQL create statement based on the structure of an existing table\r
+' but with a new table name substituted on the create line.\r
+' Returns an empty string if there is an error (e.g. OldTableName doesn't exist)\r
+' -------------------------------------------------------------\r
+Public function GenCreateFromTable (ByVal OldTableName, ByVal NewTableName)\r
+  dim rsLookUp,sqltext,coltype\r
+  \r
+  GenCreateFromTable=""\r
+  sqltext=""\r
+  set rsLookUp = EnumColumns(OldTableName)\r
+  if rsLookUp is Nothing then exit function\r
+  if rsLookUp.EOF then exit function\r
+  Do while not rsLookUp.EOF\r
+    coltype=ucase(trim(rsLookUp("TYPE_NAME")))\r
+    if sqltext = "" then\r
+      sqltext="create table " & NewTableName & " (" & vbLf\r
+    else\r
+      sqltext=sqltext & "," & vbLf\r
+    end if\r
+    sqltext=sqltext & "  [" & trim(rsLookUp("COLUMN_NAME")) & "] " & coltype\r
+    if InStr(coltype,"CHAR") > 0 or InStr(coltype,"BINARY") > 0 then\r
+      sqltext=sqltext & "(" & rsLookUp("LENGTH") & ")"\r
+    elseif coltype="DECIMAL" or coltype="NUMERIC" then\r
+      sqltext=sqltext & "(" & rsLookUp("PRECISION") & "," & rsLookUp("SCALE") & ")"\r
+    end if\r
+    if rsLookUp("NULLABLE") = 0 then\r
+      sqltext=sqltext & " NOT NULL"\r
+    else\r
+      sqltext=sqltext & " NULL"\r
+    end if\r
+       rsLookUp.movenext\r
+  Loop\r
+  sqltext=sqltext & vbLf & ")"\r
+  rsClose rsLookUp\r
+  GenCreateFromTable=sqltext\r
+end function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Add a condition to a where or having clause\r
+' -------------------------------------------------------------\r
+Public Sub AddCondition(ByRef WhereClause, ByVal NewCondition)\r
+  if IsEmpty(NewCondition) then exit sub\r
+  If IsEmpty(WhereClause) Then\r
+    WhereClause="(" & NewCondition & ")"\r
+  Else\r
+    WhereClause=WhereClause & " AND (" & NewCondition & ")"\r
+  End If\r
+End Sub\r
+\r
+\r
+end class\r
+\r
+%>\r
diff --git a/plugins/asp/excel.asp b/plugins/asp/excel.asp
new file mode 100644 (file)
index 0000000..6e93e87
--- /dev/null
@@ -0,0 +1,61 @@
+<%@ LANGUAGE="VBSCRIPT" %>\r
+<%\r
+\r
+dim xmlfile,xslfile,outfile\r
+xmlfile=Request.QueryString("xml")\r
+xslfile=Request.QueryString("xsl")\r
+outfile=trim(Request.QueryString("name"))\r
+if outfile="" then outfile="export"\r
+if xmlfile="" then\r
+  response.write "ERROR: expected url for xml source document"\r
+elseif xslfile="" then\r
+  response.write "ERROR: expected url for xsl transformation"\r
+else\r
+  doTransform replace(xmlfile,":",""), xslfile & "2xl.xsl"\r
+end if\r
+\r
+\r
+sub doTransform(ByVal xmlfilename, ByVal xslfilename)\r
+  dim xml,xsl\r
+  \r
+  if not loadXmlDoc(xml,xmlfilename) then exit sub\r
+  if not loadXmlDoc(xsl,xslfilename) then exit sub\r
+  Response.AddHeader "Content-Disposition","attachment; filename=" & outfile & ".xls"\r
+  Response.ContentType = "application/ms-excel"\r
+  'Response.ContentType="application/vnd.ms-excel"\r
+  'Response.ContentType = "application/xml"   ' for debugging\r
+  xml.transformNodeToObject xsl, Response\r
+  set xml = nothing\r
+  set xsl = nothing\r
+end sub\r
+\r
+  \r
+function loadXmlDoc(xmldoc, ByVal filename)\r
+  on error resume next\r
+  set xmldoc = Server.CreateObject("Msxml2.DomDocument")\r
+  xmldoc.async = false\r
+  'xmldoc.setProperty "ServerHTTPRequest", true\r
+  'xmldoc.load(filename)\r
+  xmldoc.load(Server.MapPath(filename))\r
+  'Check for a successful load\r
+  if Err.Number <> 0 then\r
+    Response.Write "<p>"\r
+    Response.Write "<strong>Error # " & hex(Err.Number) & " was generated by " & Err.Source & "</strong><hr>"\r
+    Response.Write "File: " & Server.HTMLencode(filename) & "<br>"\r
+    Response.Write Err.Description\r
+    Response.Write "</p>"\r
+  elseif xmldoc.parseerror.errorcode <> 0 then \r
+    Response.Write "<p>"\r
+    Response.Write "<strong>Error loading XML document</strong><hr>"\r
+    Response.Write "File: " & Server.HTMLencode(filename) & "<br>"\r
+    Response.Write "Error Code: " & xmldoc.parseerror.errorcode & "<br>"\r
+    Response.Write "Reason: " & xmldoc.parseerror.reason\r
+    Response.Write "</p>"\r
+    Response.End\r
+    loadXmlDoc=false\r
+  else\r
+    loadXmlDoc=true\r
+  End If\r
+end function\r
+  \r
+%>\r
diff --git a/plugins/asp/ricoLiveGridForms.vbs b/plugins/asp/ricoLiveGridForms.vbs
new file mode 100644 (file)
index 0000000..80f782d
--- /dev/null
@@ -0,0 +1,751 @@
+<%\r
+'**********************************\r
+' Rico: GENERIC TABLE/VIEW EDITOR\r
+'  By Matt Brown\r
+'**********************************\r
+\r
+class TableEditTable\r
+  Public TblName,alias,arFields,arData,arColInfo(100)\r
+end class\r
+\r
+\r
+class TableEditClass\r
+\r
+Public action,options,AutoInit,CurrentField,LookupField,sessions\r
+Public SvrOnly,gridID,formVar,gridVar,bufferVar,optionsVar,DefaultSort,formView\r
+\r
+Private Panels(20)\r
+Private objDB,CurrentPanel,oParseMain\r
+Private xhtmlcloser\r
+Private ErrorFlag,ErrorMsg,MainTbl\r
+Private Tables(30),TableCnt\r
+Private Fields(200),FieldCnt\r
+\r
+\r
+'*************************************************************************************\r
+' Class Constructor\r
+'*************************************************************************************\r
+Private Sub Class_Initialize\r
+  dim a,resize,i\r
+  if IsObject(oDB) then set objDB=oDB  ' use oDB global as database connection, if it exists\r
+\r
+  set options = CreateObject("Scripting.Dictionary")\r
+  options("TableSelectNew")="___new___"\r
+  options("TableSelectNone")=""\r
+  options("canAdd")=true\r
+  options("canEdit")=true\r
+  options("canDelete")=true\r
+  options("ConfirmDelete")=true\r
+  options("ConfirmDeleteCol")=-1\r
+  options("DebugFlag")=(trim(Request.QueryString("debug"))<>"")\r
+  options("prefetchBuffer")=true\r
+  options("PanelNamesOnTabHdr")=true\r
+  options("highlightElem")="menuRow"\r
+\r
+  set SvrOnly = CreateObject("Scripting.Dictionary")\r
+  SvrOnly("DropDownSelect")=1\r
+  SvrOnly("SelectSql")=1\r
+  SvrOnly("SelectFilter")=1\r
+  SvrOnly("TableIdx")=1\r
+  SvrOnly("AddQuotes")=1\r
+  SvrOnly("FilterFlag")=1\r
+  SvrOnly("XMLprovider")=1\r
+\r
+  xhtmlcloser=">"\r
+  FieldCnt=-1\r
+  CurrentPanel=-1\r
+  TableCnt=-1\r
+  AutoInit=true\r
+  ErrorFlag=false\r
+  ErrorMsg=""\r
+  formView=true\r
+  sessions=true\r
+  set oParseMain=new sqlParse\r
+  oParseMain.Init(-1)\r
+end Sub\r
+\r
+\r
+'*************************************************************************************\r
+' Class Destructor\r
+'*************************************************************************************\r
+Private Sub Class_Terminate   ' Setup Terminate event.\r
+  for i=0 to FieldCnt\r
+    set Fields(i)=Nothing\r
+  next\r
+  set options = Nothing\r
+  set SvrOnly = Nothing\r
+  set oParseMain = Nothing\r
+end Sub\r
+\r
+\r
+Public Property Let TableFilter(filter)\r
+  oParseMain.AddWhereCondition filter\r
+End Property\r
+\r
+\r
+' returns field number if successful, empty if error\r
+Public Function AddEntryField(ColumnName,Heading,EntryTypeCode,DefaultValue)\r
+  if InStr("/S/N/R/H/D/DT/I/F/B/T/TA/SL/RL/CL/tinyMCE/","/" & EntryTypeCode & "/") < 1 then\r
+    TableEditError "invalid EntryTypeCode in TableEditClass"\r
+    exit Function\r
+  end if\r
+  if not IncrCurrentField then exit Function\r
+  CurrentField("ColName")=ColumnName\r
+  CurrentField("Hdg")=Heading\r
+  CurrentField("EntryType")=EntryTypeCode\r
+  CurrentField("ColData")=DefaultValue\r
+  select case EntryTypeCode\r
+    case "D": CurrentField("type")="date"\r
+    case "DT": CurrentField("type")="datetime"\r
+    case "TA","tinyMCE" : CurrentField("TxtAreaRows")=4 : CurrentField("TxtAreaCols")=80\r
+    case "R","RL": CurrentField("RadioBreak")="<br" & xhtmlcloser\r
+    case "H": CurrentField("visible")=false\r
+  end select\r
+  dim s\r
+  s=Tables(MainTbl).alias & "." & ColumnName\r
+  If InStr("/B/T/TA/tinyMCE/","/" & EntryTypeCode & "/") > 0 Then s="rtrim(" & s & ")"\r
+  oParseMain.AddColumn s,"rico_col" & FieldCnt\r
+  AddEntryField=FieldCnt\r
+end Function\r
+\r
+\r
+' returns field number if successful, empty if error\r
+Public Function AddEntryFieldW(ColumnName,Heading,EntryTypeCode,DefaultValue,Width)\r
+  dim retval\r
+  retval=AddEntryField(ColumnName,Heading,EntryTypeCode,DefaultValue)\r
+  if not IsEmpty(retval) then CurrentField("width")=Width\r
+  AddEntryFieldW=retval\r
+end Function\r
+\r
+' DescColName is optional - pass empty if not used\r
+Public Function AddLookupField(CodeColName,DescColName,CodeHdg,DisplayHdg,EntryTypeCode,DefaultValue,sql)\r
+  dim alias,s,codeField,descField,oParseLookup\r
+  AddLookupField=AddEntryField(CodeColName,CodeHdg,EntryTypeCode,DefaultValue)\r
+  CurrentField("visible")=false\r
+  CurrentField("SelectSql")=sql\r
+  if not IsEmpty(DescColName) then\r
+    CurrentField("DescriptionField")=ExtFieldId(FieldCnt+1)\r
+  end if\r
+  set LookupField=CurrentField\r
+  set oParseLookup=new sqlParse\r
+  alias="t" & FieldCnt\r
+  oParseLookup.ParseSelect sql\r
+  if ubound(oParseLookup.arSelList)=1 then\r
+    codeField=oParseLookup.arSelList(0)\r
+    descField=oParseLookup.arSelList(1)\r
+    s="left join " & oParseLookup.FromClause & " " & alias & " on t." & CodeColName & "=" & alias & "." & replace(replace(codeField,"%alias%",""),"%aliasmain%","")\r
+    if not IsEmpty(oParseLookup.WhereClause) then s=s & " and " & replace(oParseLookup.WhereClause,"%alias%",alias & ".")\r
+    oParseMain.AddJoin s\r
+    IncrCurrentField\r
+    CurrentField("ColName")="Lookup_" & FieldCnt\r
+    CurrentField("Hdg")=DisplayHdg\r
+    If not IsEmpty(DescColName) then\r
+      descField=Tables(MainTbl).alias & "." & DescColName\r
+      CurrentField("ColName")=DescColName\r
+      CurrentField("FormView")="hidden"\r
+      CurrentField("EntryType")="T"\r
+    ElseIf IsFieldName(descField) Then\r
+      descField=alias & "." & descField\r
+    Else\r
+      descField=replace(replace(descField,"%alias%",alias & "."),"%aliasmain%","t.")\r
+    End If\r
+    oParseMain.AddColumn descField,"rico_col" & FieldCnt\r
+  else\r
+    TableEditError "Invalid lookup query (" & sql & ")"\r
+  end if\r
+  set oParseLookup = Nothing\r
+end Function\r
+\r
+\r
+' returns field number if successful, empty if error\r
+Public Function AddCalculatedField(ByVal ColumnFormula, ByVal Heading)\r
+  if not IncrCurrentField then exit Function\r
+  if left(ColumnFormula,1) <> "(" then ColumnFormula="(" & ColumnFormula & ")"\r
+  CurrentField("ColName")="Calc_" & FieldCnt\r
+  CurrentField("Hdg")=Heading\r
+  oParseMain.AddColumn ColumnFormula,"rico_col" & FieldCnt\r
+  AddCalculatedField=FieldCnt\r
+end Function\r
+\r
+\r
+Public Sub AddPanel(ByVal PanelHeading)\r
+  if CurrentPanel >= ubound(Panels) then\r
+    TableEditError "exceeded max # of panels in TableEditClass"\r
+    exit sub\r
+  end if\r
+  CurrentPanel=CurrentPanel+1\r
+  Panels(CurrentPanel)=PanelHeading\r
+end Sub\r
+\r
+\r
+Public Function DefineAltTable(ByVal AltTabName, arFieldList, arFieldData)\r
+  if TableCnt >= ubound(Tables) then\r
+    TableEditError "exceeded max # of alternate tables in TableEditClass"\r
+    exit Function\r
+  end if\r
+  TableCnt=TableCnt+1\r
+  set Tables(TableCnt)=new TableEditTable\r
+  with Tables(TableCnt)\r
+    .TblName=AltTabName\r
+    .alias="a" & TableCnt\r
+    .arFields=arFieldList\r
+    .arData=arFieldData\r
+    if ubound(.arFields) <> ubound(.arData) then\r
+      TableEditError "# of fields does not match # of data entries supplied for table " & AltTabName\r
+      exit Function\r
+    end if\r
+  end with\r
+  DefineAltTable=TableCnt\r
+end Function\r
+\r
+\r
+' returns true if FieldCnt successfully incremented\r
+Private Function IncrCurrentField\r
+  if FieldCnt >= ubound(Fields) then\r
+    TableEditError "exceeded max # of columns in TableEditClass"\r
+    IncrCurrentField=false\r
+    exit Function\r
+  end if\r
+  FieldCnt=FieldCnt+1\r
+  set CurrentField = CreateObject("Scripting.Dictionary")\r
+  set Fields(FieldCnt)=CurrentField\r
+  if CurrentPanel>=0 then CurrentField("panelIdx")=CurrentPanel else CurrentField("panelIdx")=0\r
+  CurrentField("AddQuotes")=true\r
+  CurrentField("ReadOnly")=false\r
+  CurrentField("TableIdx")=MainTbl\r
+  IncrCurrentField=true\r
+end Function\r
+\r
+\r
+Public Sub SetTableName(ByVal s)\r
+  dim actionparm\r
+  TableCnt=TableCnt+1\r
+  MainTbl=TableCnt\r
+  set Tables(TableCnt)=new TableEditTable\r
+  with Tables(TableCnt)\r
+    .TblName=s\r
+    .alias="t"\r
+  end with\r
+  oParseMain.FromClause=s & " t"\r
+  gridID=LCase(replace(replace(s,".","_")," ","_"))\r
+  formVar=gridID & "['edit']"\r
+  gridVar=gridID & "['grid']"\r
+  bufferVar=gridID & "['buffer']"\r
+  optionsVar=gridID & "['options']"\r
+  actionparm="_action_" & gridID\r
+  action=trim(Request.QueryString(actionparm))\r
+  if action="" then action=trim(Request.Form(actionparm))\r
+  if action="" then action="table" else action=lcase(action)\r
+end Sub\r
+\r
+\r
+Private Sub AddSort(field,direction)\r
+  if not IsEmpty(DefaultSort) then DefaultSort=DefaultSort & ","\r
+  DefaultSort=DefaultSort & field & " " & direction\r
+end Sub\r
+\r
+\r
+Public Sub SortCurrent(direction)\r
+  AddSort oParseMain.LastColumn,direction\r
+  options("sortCol")=FieldCnt\r
+  options("sortDir")=direction\r
+end Sub\r
+\r
+\r
+Public Sub SortAsc()\r
+  SortCurrent "ASC"\r
+end Sub\r
+\r
+\r
+Public Sub SortDesc()\r
+  SortCurrent "DESC"\r
+end Sub\r
+\r
+\r
+Public Sub ConfirmDeleteColumn()\r
+  options("ConfirmDeleteCol")=FieldCnt\r
+end Sub\r
+\r
+\r
+Public Sub genXHTML()\r
+  xhtmlcloser=" />"\r
+end Sub
+\r
+\r
+Public Sub SetDbConn(ByRef dbcls)\r
+  set objDB=dbcls\r
+end Sub\r
+\r
+\r
+'*************************************************************************************\r
+' Take appropriate action\r
+'*************************************************************************************\r
+Public Sub DisplayPage()\r
+  if FieldCnt < 0 then exit sub\r
+  if not ErrorFlag then GetColumnInfo\r
+  if not ErrorFlag then\r
+    select case action\r
+      case "del"  if options("canDelete") then TableDeleteRecord\r
+      case "ins"  if options("canAdd") then TableInsertRecord\r
+      case "upd"  if options("canEdit") then TableUpdateRecord\r
+      case else\r
+        if sessions then session.contents(gridID)=SqlSelectData\r
+        TableDisplay\r
+    end select\r
+  end if\r
+  if ErrorFlag then\r
+    response.write vbLf & "<p style='color:red;'><span style='text-decoration:underline;'>ERROR ENCOUNTERED</span><br" & xhtmlcloser & ErrorMsg\r
+  end if\r
+end Sub\r
+\r
+' if AltTable has a multi-column key, then add those additional constraints\r
+Private function AltTableKeyWhereClause(AltTabIdx)\r
+  dim w,i\r
+  for i=0 to ubound(Tables(AltTabIdx).arFields)\r
+    if Tables(AltTabIdx).arColInfo(i).IsPKey then\r
+      w=w & " and " & Tables(AltTabIdx).arFields(i) & "=" & Tables(AltTabIdx).arData(i)\r
+    end if\r
+  next\r
+  AltTableKeyWhereClause=w\r
+end function\r
+\r
+Private function AltTableJoinClause(alias)\r
+  dim i,w\r
+  for i=0 to FieldCnt\r
+    if Fields(i)("TableIdx")=MainTbl and not IsCalculatedField(i) then\r
+      if Fields(i)("ColInfo").IsPKey then objDB.AddCondition w,Fields(i)("ColName") & "=" & alias & "." & Fields(i)("ColName")\r
+    end if\r
+  next\r
+  AltTableJoinClause=w\r
+end function\r
+\r
+' form where clause based on table's primary key\r
+Private function TableKeyWhereClause()\r
+  dim i,w\r
+  for i=0 to FieldCnt\r
+    if Fields(i)("TableIdx")=MainTbl and not IsCalculatedField(i) then\r
+      if Fields(i)("ColInfo").IsPKey then objDB.AddCondition w,Fields(i)("ColName") & "=" & FormatValue(trim(Request.Form("_k" & i)),i)\r
+    end if\r
+  next\r
+  if IsEmpty(w) then\r
+    TableEditError "no key value"\r
+  else\r
+    TableKeyWhereClause=" WHERE " & w\r
+  end if\r
+end function\r
+\r
+' name used external to this script\r
+Private function ExtFieldId(i)\r
+  ExtFieldId=gridID & "_" & i\r
+end function\r
+\r
+\r
+Private function IsCalculatedField(i)\r
+  IsCalculatedField=not Fields(i).exists("EntryType")\r
+end function\r
+\r
+\r
+'*************************************************************************************\r
+' Retrieves column info from database for main table and any alternate tables\r
+'*************************************************************************************\r
+Private sub GetColumnInfo()\r
+  dim c,i,j,FieldNum,cnt,colname,Columns(250),dicColIdx\r
+  set dicColIdx = CreateObject("Scripting.Dictionary")\r
+  dicColIdx.CompareMode=1\r
+  for FieldNum=0 to FieldCnt\r
+    dicColIdx.Add Fields(FieldNum)("TableIdx") & "." & Fields(FieldNum)("ColName"),FieldNum\r
+    if options("canEdit")=false and options("canAdd")=false then Fields(FieldNum)("ReadOnly")=true\r
+  next\r
+  for i=0 to TableCnt\r
+    cnt=objDB.GetColumnInfo(Tables(i).TblName,Columns)\r
+    if cnt<1 then\r
+      TableEditError "unable to retrieve column info for " & Tables(i).TblName & "<br>" & objDB.LastErrorMsg\r
+      exit sub\r
+    end if\r
+    for c=0 to cnt-1\r
+      colname=trim(Columns(c).ColName)\r
+      if dicColIdx.exists(i & "." & colname) then\r
+        FieldNum=dicColIdx(i & "." & colname)\r
+        set Fields(FieldNum)("ColInfo")=Columns(c)\r
+      elseif i<>MainTbl then\r
+        for j=0 to ubound(Tables(i).arFields)\r
+          if colname=Tables(i).arFields(j) then set Tables(i).arColInfo(j)=Columns(c)\r
+        next\r
+      elseif Columns(c).IsPKey then\r
+        TableEditError "primary key field is not defined (" & Tables(i).TblName & "." & colname & ")"\r
+        set dicColIdx = Nothing\r
+        exit sub\r
+      end if\r
+    next\r
+  next\r
+  set dicColIdx = Nothing\r
+end sub\r
+\r
+Private sub TableUpdateDatabase(ByVal sqltext, ByVal actiontxt)\r
+  dim errmsg,cnt\r
+  if ErrorFlag then exit sub\r
+  cnt=objDB.RunActionQueryReturnMsg(sqltext,errmsg)\r
+  if IsEmpty(errmsg) and cnt=1 then\r
+    response.write "<p class='ricoFormResponse " & actiontxt & "Successfully'></p>"\r
+    if options("DebugFlag") then response.write "<p class='debug'>" & sqltext & "<br" & xhtmlcloser & "Records affected: " & cnt\r
+  else\r
+    TableEditError "unable to update database!<br" & xhtmlcloser & errmsg\r
+  end if\r
+end sub\r
+\r
+\r
+Private function FormatValue(ByVal v, ByVal idx)\r
+  dim fld,addquotes\r
+  set fld=Fields(idx)\r
+  addquotes=fld("AddQuotes")\r
+  if v="" and Fields(idx)("ColInfo").Nullable then\r
+    addquotes=false\r
+    v="NULL"\r
+  elseif fld("EntryType")="I" or fld("EntryType")="F" then\r
+    addquotes=false\r
+    if not IsNumeric(v) then v="NULL"\r
+  elseif fld("EntryType")="N" and v=options("TableSelectNew") then\r
+    v=trim(Request.Form("textnew__" & ExtFieldId(idx)))\r
+  elseif InStr("SNR",left(fld("EntryType"),1)) > 0 and v=options("TableSelectNone") then\r
+    addquotes=false\r
+    v="NULL"\r
+  end if\r
+  if addquotes then v=objDB.addQuotes(v)\r
+  FormatValue=v\r
+end function\r
+\r
+\r
+Private function FormatFormValue(idx)\r
+  dim v\r
+  if not Fields(idx).exists("EntryType") then exit function\r
+  if Fields(idx)("EntryType")="H" or Fields(idx)("FormView")="exclude" then\r
+    v=Fields(idx)("ColData")\r
+  else\r
+    v=trim(Request.Form(ExtFieldId(idx)))\r
+  end if\r
+  FormatFormValue=FormatValue(v,idx)\r
+end function\r
+\r
+\r
+'*************************************************************************************\r
+' Deletes the specified record\r
+'   Assumes any AltTable columns are handled via referential integrity/cascading deletes\r
+'*************************************************************************************\r
+Private sub TableDeleteRecord()\r
+  TableUpdateDatabase "DELETE FROM " & Tables(MainTbl).TblName & TableKeyWhereClause(), "deleted"\r
+end sub\r
+\r
+Private sub UpdateRecord(sqltext)\r
+  dim errmsg\r
+  objDB.RunActionQueryReturnMsg sqltext,errmsg\r
+  if not IsEmpty(errmsg) then\r
+    errmsg="unable to update database!<br" & xhtmlcloser & errmsg\r
+    if options("DebugFlag") then errmsg=errmsg & "<p>SQL: " & sqltext\r
+    TableEditError errmsg\r
+  elseif options("DebugFlag") then\r
+    response.write "<BR class='debug'>" & sqltext\r
+  end if\r
+end sub\r
+\r
+Private sub UpdateAltTableRecords(i)\r
+  dim j,sqltext,colnames,coldata,c\r
+  if ErrorFlag then exit sub\r
+\r
+  ' delete existing record\r
+\r
+  sqltext="delete from " & Tables(i).TblName\r
+  sqltext=sqltext & TableKeyWhereClause()\r
+  sqltext=sqltext & AltTableKeyWhereClause(i)\r
+  UpdateRecord(sqltext)\r
+\r
+  ' insert new record\r
+\r
+  colnames=""\r
+  coldata=""\r
+  for j=0 to FieldCnt\r
+    if Fields(j).exists("ColInfo") then\r
+      if Fields(j)("TableIdx")=i or Fields(j)("ColInfo").IsPKey then\r
+        colnames=colnames & "," & Fields(j)("ColName")\r
+        coldata=coldata & "," & FormatValue(trim(Request.Form(ExtFieldId(j))),j)\r
+      end if\r
+    end if\r
+  next\r
+  for j=0 to ubound(Tables(i).arFields)\r
+    c=Tables(i).arFields(j)\r
+    colnames=colnames & "," & c\r
+    coldata=coldata & "," & Tables(i).arData(j)\r
+  next\r
+  sqltext="insert into " & Tables(i).TblName & " (" & mid(colnames,2) & ") values (" & mid(coldata,2) & ")"\r
+  UpdateRecord(sqltext)\r
+end sub\r
+\r
+\r
+'*************************************************************************************\r
+' Updates an existing record in the db\r
+'*************************************************************************************\r
+Private sub TableUpdateRecord()\r
+  dim i,sqltext\r
+  for i=0 to TableCnt\r
+    if i<>MainTbl then UpdateAltTableRecords i\r
+  next\r
+  for i=0 to FieldCnt\r
+    if not IsCalculatedField(i) then\r
+      if Fields(i)("TableIdx")=MainTbl and Fields(i)("ColInfo").Writeable and not Fields(i).exists("InsertOnly") then\r
+        sqltext=sqltext & "," & Fields(i)("ColName") & "=" & FormatFormValue(i)\r
+      end if\r
+    end if\r
+  next\r
+  sqltext="UPDATE " & Tables(MainTbl).TblName & " SET " & mid(sqltext,2)\r
+  sqltext=sqltext & TableKeyWhereClause()\r
+  TableUpdateDatabase sqltext, "updated"\r
+end sub\r
+\r
+'*************************************************************************************\r
+' Inserts a new record into the db\r
+'*************************************************************************************\r
+Private sub TableInsertRecord()\r
+  dim i,sqltext,sqlcol,sqlval,keyCnt,keyIdx\r
+  keyCnt=0\r
+  sqlcol=""\r
+  sqlval=""\r
+  for i=0 to FieldCnt\r
+    if not IsCalculatedField(i) and Fields(i)("TableIdx")=MainTbl and not Fields(i).exists("UpdateOnly") then\r
+      if Fields(i)("ColInfo").IsPKey then\r
+        keyCnt=keyCnt+1\r
+        keyIdx=i\r
+      end if\r
+      if Fields(i)("ColInfo").Writeable then\r
+        sqlcol=sqlcol & "," & Fields(i)("ColName")\r
+        sqlval=sqlval & "," & FormatFormValue(i)\r
+      end if\r
+    end if\r
+  next\r
+  sqltext="insert into " & Tables(MainTbl).TblName & " (" & mid(sqlcol,2) & ") values (" & mid(sqlval,2) & ")"\r
+  TableUpdateDatabase sqltext, "added"\r
+end sub\r
+\r
+\r
+Private Sub TableEditError(msg)\r
+  ErrorFlag=true\r
+  ErrorMsg=msg\r
+End Sub\r
+\r
+\r
+Private Function IsFieldName(s)\r
+  dim i,c\r
+  i=1\r
+  IsFieldName=false\r
+  while i <= len(s)\r
+    c=mid(s,i,1)\r
+    if (c >= "0" and c <= "9" and i > 1) or (c >= "A" and c <= "Z") or (c >= "a" and c <= "z") or (c = "_") then\r
+      i=i+1\r
+    else\r
+      exit function\r
+    end if\r
+  wend\r
+  IsFieldName=(i > 1)\r
+End Function\r
+\r
+\r
+'***********************************\r
+' do post-processing on sql query\r
+'***********************************\r
+Private sub FinishQuery()\r
+  dim oParseLookup\r
+  dim i,s,codeField,descField,descQuery,alias,tabidx\r
+\r
+  set oParseLookup=new sqlParse\r
+  for i=0 to FieldCnt\r
+    if Fields(i).exists("TableIdx") then tabidx=Fields(i)("TableIdx")\r
+    if Fields(i).exists("FilterFlag") then\r
+      ' add any column filters to where clause\r
+      oParseMain.AddWhereCondition Tables(tabidx).alias & "." & Fields(i)("ColName") & "='" & Fields(i)("ColData") & "'"\r
+    end if\r
+    if Fields(i).exists("EntryType") then\r
+      if InStr("CSNR",left(Fields(i)("EntryType"),1)) > 0 then\r
+        if Fields(i).exists("SelectSql") then\r
+          s=Fields(i)("SelectSql")\r
+          if Fields(i).exists("SelectFilter") then\r
+            oParseLookup.ParseSelect s\r
+            oParseLookup.AddWhereCondition Fields(i)("SelectFilter")\r
+            s=oParseLookup.UnparseSelect\r
+          end if\r
+          Fields(i)("DropDownSelect")=replace(replace(s,"%alias%",""),"%aliasmain%","")\r
+        else\r
+          s=Fields(i)("ColName")\r
+          If Fields(i).exists("ColInfo") Then\r
+            If Fields(i)("ColInfo").ColType="CHAR" and Fields(i)("ColInfo").FixedLength Then s="rtrim(" & s & ")"\r
+          End If\r
+          Fields(i)("DropDownSelect")="select distinct " & s & " from " & Tables(tabidx).TblName & " where " & Fields(i)("ColName") & " is not null"\r
+        end if\r
+      end if\r
+    end if\r
+\r
+    if tabidx<>MainTbl then\r
+\r
+      ' column from alt table - no avoiding subqueries here\r
+\r
+      s="(select " & Fields(i)("ColName") & " from " & Tables(tabidx).TblName & " a" & i & _\r
+        " where " & AltTableJoinClause("t") & AltTableKeyWhereClause(tabidx) & ")"\r
+      if mid(Fields(i)("EntryType"),2)="L" and Fields(i).exists("SelectSql") then\r
+        oParseLookup.ParseSelect Fields(i)("SelectSql")\r
+        if ubound(oParseLookup.arSelList)=1 then\r
+          codeField=oParseLookup.arSelList(0)\r
+          descField=oParseLookup.arSelList(1)\r
+          descQuery="select " & descField & " from " & oParseLookup.FromClause & " where " & codeField & "=" & s\r
+          if not IsEmpty(oParseLookup.WhereClause) then descQuery=descQuery & " and " & oParseLookup.WhereClause\r
+          oParseMain.arSelList(i)="(" & objDB.concat(Array("(" & descQuery & ")","'<span class=""ricoLookup"">'",objDB.Convert2Char(s),"'</span>'"), false) & ")"\r
+        else\r
+          TableEditError "Invalid lookup query (" & Fields(i)("SelectSql") & ")"\r
+          exit sub\r
+        end if\r
+      else\r
+        oParseMain.arSelList(i)=s\r
+      end if\r
+\r
+    end if\r
+  next\r
+\r
+  if IsEmpty(DefaultSort) then DefaultSort=objDB.PrimaryKey(Tables(MainTbl).TblName)\r
+  oParseMain.AddSort DefaultSort\r
+End Sub\r
+\r
+\r
+'***********************************\r
+' returns details of sql query as an array\r
+'***********************************\r
+Public Function SqlSelectData()\r
+  dim arr,i,SelectIdx,HdgIdx,a,b\r
+  FinishQuery\r
+  arr=oParseMain.ToArray()\r
+  ReDim Preserve arr(ubound(arr)+2)\r
+  HdgIdx=ubound(arr)\r
+  SelectIdx=HdgIdx-1\r
+  ReDim a(FieldCnt)\r
+  arr(SelectIdx)=a\r
+  ReDim b(FieldCnt)\r
+  arr(HdgIdx)=b\r
+  for i=0 to FieldCnt\r
+    if Fields(i).exists("DropDownSelect") then arr(SelectIdx)(i)=Fields(i)("DropDownSelect")\r
+    if Fields(i).exists("Hdg") then arr(HdgIdx)(i)=Fields(i)("Hdg")\r
+  next\r
+  SqlSelectData=arr\r
+end Function\r
+\r
+\r
+'***********************************\r
+' Displays a table\r
+'***********************************\r
+Private sub TableDisplay()\r
+  dim i,o\r
+\r
+  response.write vbLf & "<p class='ricoBookmark'>"\r
+  response.write "<span id='" & gridID & "_timer' class='ricoSessionTimer'></span>"\r
+  response.write "<span id='" & gridID & "_bookmark' class='ricoBookmark'>&nbsp;</span>"\r
+  response.write "<span id='" & gridID & "_savemsg' class='ricoSaveMsg'></span>"\r
+  response.write "</p>"\r
+  response.write vbLf & "<div id='" & gridID & "'></div>"\r
+\r
+  response.write vbLf & "<script type='text/javascript'>"\r
+  response.write vbLf & "Rico.acceptLanguage('" & Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") & "');"\r
+  response.write vbLf & "var " & gridID & " = {};"\r
+  response.write vbLf & optionsVar & " = {"\r
+  for each o in options\r
+    if not IsObject(options(o)) and not SvrOnly.exists(o) then response.write vbLf & "  " & o & ": " & FormatOption(options(o)) & ","\r
+  next\r
+  if CurrentPanel>=0 then\r
+    response.write vbLf & "  panels: ["\r
+    for i=0 to CurrentPanel\r
+      if i>0 then response.write ","\r
+      response.write "'" & Panels(i) & "'"\r
+    next\r
+    response.write "],"\r
+  end if\r
+  response.write vbLf & "  columnSpecs : ["\r
+  for i=0 to FieldCnt\r
+    if Fields(i).exists("TableIdx") then\r
+      if Fields(i)("TableIdx")<>MainTbl then Fields(i)("UpdateOnly")=true\r
+    end if\r
+    if i>0 then response.write ","\r
+    response.write vbLf & "    {"\r
+    response.write " FieldName:'" & ExtFieldId(i) & "'"\r
+    for each o in Fields(i)\r
+      if not IsObject(Fields(i)(o)) and not SvrOnly.exists(o) then response.write "," & vbLf & "      " & o & ": " & FormatOption(Fields(i)(o)) '& "  /* " & vartype(Fields(i)(o)) & " */"\r
+    next\r
+    if Fields(i).exists("ColInfo") then\r
+      response.write "," & vbLf & "      isNullable:" & FormatOption(Fields(i)("ColInfo").Nullable)\r
+      response.write "," & vbLf & "      Writeable:" & FormatOption(Fields(i)("ColInfo").Writeable)\r
+      response.write "," & vbLf & "      isKey:" & FormatOption(Fields(i)("ColInfo").IsPKey)\r
+      if Fields(i)("ColInfo").ColLength then response.write "," & vbLf & "      Length:" & FormatOption(Fields(i)("ColInfo").ColLength)\r
+    end if\r
+    response.write " }"\r
+  next\r
+  response.write vbLf & "  ]"\r
+  response.write vbLf & "};"\r
+  if AutoInit then\r
+    response.write vbLf & "Rico.onLoad(function() {"\r
+    'response.write vbLf & "  try {"\r
+    response.write vbLf & "  if(typeof Rico.LiveGrid=='undefined') throw('LiveGridForms requires the Rico.LiveGrid Library');"\r
+    response.write vbLf & "  if(typeof Rico.GridMenu=='undefined') throw('LiveGridForms requires the Rico.GridMenu Library');"\r
+    response.write vbLf & "  if(typeof Rico.Buffer=='undefined') throw('LiveGridForms requires the Rico.Buffer Library');"\r
+    response.write vbLf & "  if(typeof Rico.Buffer.AjaxSQL=='undefined') throw('LiveGridForms requires the Rico.Buffer.AjaxSQL Library');"\r
+    response.write InitScript\r
+    'response.write vbLf & "  } catch(e) { alert(e.message); };"\r
+    response.write vbLf & "});"\r
+  end if\r
+  response.write vbLf & "</script>"\r
+end sub\r
+\r
+\r
+'********************************************************************************************************\r
+' Pad a number to the specified length with leading zeroes\r
+'********************************************************************************************************\r
+Private Function PadNumber(number, length)\r
+  dim strNumber\r
+\r
+  if IsNull(number) or IsEmpty(number) then strNumber=String(length,"-") else strNumber = Cstr(number)\r
+  do while len(strNumber) < length\r
+    strNumber = "0" & strNumber\r
+  loop\r
+\r
+  PadNumber=strNumber\r
+End Function\r
+\r
+Private Function FormatOption(s)\r
+  if IsArray(s) then\r
+    FormatOption="{" & join(s,",") & "}"\r
+  else\r
+    select case vartype(s)\r
+      case 8,129,130,200,202\r
+        ' string\r
+        FormatOption="""" & replace(s,"""","\""") & """"\r
+      case 11\r
+        ' boolean\r
+        if s then FormatOption="true" else FormatOption="false"\r
+      case 7,133,134,135:\r
+        ' date/time, format as ISO8601\r
+        FormatOption="'" & year(s) & "-" & PadNumber(month(s),2) & "-" & PadNumber(day(s),2) & "T" & PadNumber(hour(s),2) & ":" & PadNumber(minute(s),2) & ":" & PadNumber(second(s),2) & "'"\r
+      case 4,5,14 \r
+        'single, double, decimal variants. Changing ',' to '.' \r
+        FormatOption=replace(CStr(s),",",".") \r
+      case else\r
+        FormatOption=s\r
+    end select\r
+  end if\r
+End Function\r
+\r
+\r
+Public function InitScript()\r
+  InitScript = vbLf & bufferVar & "=new Rico.Buffer.AjaxSQL('" & options("XMLprovider") & "', {TimeOut:" & Session.Timeout & "});" & _\r
+               vbLf & "if(typeof " & gridID & "_GridInit=='function') " & gridID & "_GridInit();" & _\r
+               vbLf & gridVar & "=new Rico.LiveGrid ('" & gridID & "'," & bufferVar & "," & optionsVar & ");" & _\r
+               vbLf & gridVar & ".menu=new Rico.GridMenu();"\r
+  if formView then\r
+    InitScript = InitScript & vbLf & "if(typeof " & gridID & "_FormInit=='function') " & gridID & "_FormInit();" & _\r
+                 vbLf & formVar & "=new Rico.TableEdit(" & gridVar & ");"\r
+  end if\r
+  InitScript = InitScript & vbLf & "if(typeof " & gridID & "_InitComplete=='function') " & gridID & "_InitComplete();"\r
+end function\r
+\r
+end class\r
+%>
\ No newline at end of file
diff --git a/plugins/asp/ricoResponse.vbs b/plugins/asp/ricoResponse.vbs
new file mode 100644 (file)
index 0000000..1888612
--- /dev/null
@@ -0,0 +1,638 @@
+<%\r
+\r
+class ricoXmlResponse\r
+\r
+Public orderByRef      ' use column numbers in order by clause? (true/false)\r
+Public sendDebugMsgs   ' send details of sql parsing/execution in ajax response? (true/false)\r
+Public AllRowsMax      ' max # of rows to send if numrows=-1\r
+Public fmt             ' xml, json, html, xl\r
+Private objDB,eof,oParse,sqltext,arParams,RowsStart,RowsEnd,SendHdg,Headings,HiddenCols,arDebugMsgs\r
+\r
+\r
+Private Sub Class_Initialize\r
+  orderByRef=false\r
+  if IsObject(oDB) then\r
+    set objDB=oDB  ' use oDB global as database connection, if it exists\r
+    if objDB.Dialect="Access" or objDB.Dialect="MySQL" then orderByRef=true\r
+  end if\r
+  sendDebugMsgs=false\r
+  SendHdg=false\r
+  AllRowsMax=1999\r
+  HiddenCols=Array()\r
+  redim arParams(-1)\r
+  redim arDebugMsgs(-1)\r
+end sub\r
+\r
+\r
+Public Sub ProcessQuery(id,sqlselect,filters)\r
+  dim offset,size,total,distinctCol,editCol,closetags,hidden,i,j,u,skip,SkipIdx\r
+\r
+  fmt=trim(Request.QueryString("_fmt"))\r
+  offset=trim(Request.QueryString("offset"))\r
+  size=trim(Request.QueryString("page_size"))\r
+  total=lcase(Request.QueryString("get_total"))\r
+  distinctCol=trim(Request.QueryString("distinct"))\r
+  hidden=trim(Request.QueryString("hidden"))\r
+  editCol=trim(Request.QueryString("edit"))\r
+  if offset="" then offset="0"\r
+  if total="" then total="false"\r
+  if hidden<>"" then HiddenCols=split(hidden,",")\r
+\r
+  Response.clear\r
+  if fmt<>"xl" then\r
+    Response.CacheControl = "no-cache"\r
+    Response.AddHeader "Pragma", "no-cache"\r
+    Response.Expires = -1\r
+  end if\r
+  select case fmt\r
+    case "html":\r
+      Response.ContentType="text/html"\r
+      Response.write "<html><head></head><body>" & vbLf\r
+      closetags="</body></html>"\r
+      RowsStart=vbLf & "<table border='1'>"\r
+      RowsEnd=vbLf & "</table>"\r
+      total="false"\r
+      sendDebugMsgs=false\r
+      SendHdg=true\r
+    case "xl":\r
+      Response.ContentType="application/vnd.ms-excel"\r
+      Response.write "<html><head></head><body>" & vbLf\r
+      closetags="</body></html>"\r
+      RowsStart=vbLf & "<table>"\r
+      RowsEnd=vbLf & "</table>"\r
+      total="false"\r
+      sendDebugMsgs=false\r
+      SendHdg=true\r
+    case "json":\r
+      Response.ContentType="application/json"\r
+      Response.write "{" & vbLf & """id"":""" & id & """"\r
+      RowsStart="," & vbLf & """update_ui"":true," & vbLf & """offset"":" & offset & "," & vbLf & """rows"":["\r
+      RowsEnd=vbLf & "]"\r
+      closetags="}"\r
+    case else:\r
+      ' default to xml\r
+      fmt="xml"\r
+      Response.ContentType="text/xml"\r
+      Response.write "<?xml version='1.0' encoding='iso-8859-1'?>"\r
+      response.write vbLf & "<ajax-response><response type='object' id='" & id & "'>"\r
+      closetags="</response></ajax-response>"\r
+      RowsStart=vbLf & "<rows update_ui='true' offset='" & offset & "'>"\r
+      RowsEnd=vbLf & "</rows>"\r
+  end select\r
+\r
+  if id="" then\r
+    ErrorResponse "No ID provided!"\r
+  elseif distinctCol="" and not IsNumeric(offset) then\r
+    ErrorResponse "Invalid offset!"\r
+  elseif distinctCol="" and not IsNumeric(size) then\r
+    ErrorResponse "Invalid size!"\r
+  elseif distinctCol<>"" and not IsNumeric(distinctCol) then\r
+    ErrorResponse "Invalid distinct parameter!"\r
+  else\r
+    if SendHdg and isArray(sqlselect) then\r
+      ' populate Headings from sqlselect(9) taking into account hidden columns\r
+      u=ubound(sqlselect(9))\r
+      redim Headings(u)\r
+      SkipIdx=0\r
+      j=0\r
+      for i=0 to u\r
+        skip=false\r
+        if SkipIdx <= ubound(HiddenCols) then\r
+          skip=CBool(HiddenCols(SkipIdx)=CStr(i))\r
+          if skip then SkipIdx=SkipIdx+1\r
+        end if\r
+        if not skip then\r
+          Headings(j)=sqlselect(9)(i)\r
+          j=j+1\r
+        end if\r
+      next\r
+    end if\r
+    objDB.DisplayErrors=false\r
+    objDB.ErrMsgFmt="MULTILINE"\r
+    if distinctCol<>"" and isNumeric(distinctCol) then\r
+      Query2xmlDistinct sqlselect, CLng(distinctCol), 999, filters\r
+    elseif editCol<>"" and isNumeric(editCol) and isArray(sqlselect) then\r
+      Query2xml sqlselect(8)(CLng(editCol)),CLng(offset),CLng(size),(total<>"false"),filters\r
+    else\r
+      Query2xml sqlselect,CLng(offset),CLng(size),(total<>"false"),filters\r
+    end if\r
+    if not IsEmpty(objDB.LastErrorMsg) then\r
+      ErrorResponse objDB.LastErrorMsg\r
+    end if\r
+  end if\r
+  if sendDebugMsgs then AppendArrayResponse "debug", arDebugMsgs\r
+  response.write vbLf & closetags\r
+end sub\r
+\r
+\r
+Private sub AddDebugMsg(ByVal msg)\r
+  ReDim Preserve arDebugMsgs(ubound(arDebugMsgs)+1)\r
+  arDebugMsgs(ubound(arDebugMsgs))=msg\r
+end sub\r
+\r
+\r
+Public Sub ErrorResponse(msg)\r
+  AppendResponse "error",msg\r
+end sub\r
+\r
+\r
+Public Sub AppendResponse(tag,content)\r
+  select case fmt\r
+    case "html", "xl":\r
+      response.write vbLf & "<p>" & tag & "<br>" & server.htmlencode(content) & "</p>"\r
+    case "json":\r
+      response.write "," & vbLf & """" & tag & """:""" & escapeJSON(content) & """"\r
+    case "xml":\r
+      'response.write vbLf & "<" & tag & ">" & content & "</" & tag & ">"\r
+      response.write vbLf & "<" & tag & ">" & server.htmlencode(content) & "</" & tag & ">"\r
+  end select\r
+end sub\r
+\r
+\r
+Public Sub AppendArrayResponse(tag, arContent)\r
+  dim item,i\r
+  select case fmt\r
+    case "html", "xl":\r
+      response.write vbLf & "<p>" & tag\r
+      for each item in arContent\r
+        response.write "<br>" & server.htmlencode(item)\r
+      next\r
+      response.write "</p>"\r
+    case "json":\r
+      response.write "," & vbLf & """" & tag & """:["\r
+      for i=0 to ubound(arContent)\r
+        if i > 0 then response.write ","\r
+        response.write vbLf & """" & escapeJSON(arContent(i)) & """"\r
+      next\r
+      response.write "]"\r
+    case "xml":\r
+      for each item in arContent\r
+        response.write vbLf & "<" & tag & ">" & server.htmlencode(item) & "</" & tag & ">"\r
+      next\r
+  end select\r
+end sub\r
+\r
+\r
+' All Oracle and SQL Server 2005 queries *must* have an ORDER BY clause\r
+' "as" clauses are now ok\r
+' If numrows < 0, then retrieve all rows\r
+Public function Query2xml(sqlselect,offset,numrows,gettotal,filters)\r
+  dim totcnt,version,Dialect\r
+  set oParse=new sqlParse\r
+  if IsArray(sqlselect) then\r
+    oParse.LoadArray(sqlselect)\r
+  else\r
+    oParse.ParseSelect sqlselect\r
+  end if\r
+  ApplyQStringParms filters\r
+  response.write RowsStart\r
+  if numrows >= 0 then Dialect=objDB.Dialect else numrows=AllRowsMax\r
+  select case Dialect\r
+    case "TSQL":\r
+      objDB.SingleRecordQuery "select @@VERSION",version\r
+      if InStr(version,"SQL Server 2005") > 0 or InStr(version,"SQL Server 2008") > 0 then\r
+        sqltext=UnparseWithRowNumber(offset,numrows+1,true)\r
+        totcnt=Query2xmlRaw_Limit(sqltext,offset,numrows,1)\r
+      else\r
+        sqltext=oParse.UnparseSelectSkip(HiddenCols)\r
+        totcnt=Query2xmlRaw_NoLimit(sqltext,offset,numrows,gettotal)\r
+      end if\r
+    case "Oracle": \r
+      sqltext=UnparseWithRowNumber(offset,numrows+1,false)\r
+      totcnt=Query2xmlRaw_Limit(sqltext,offset,numrows,1)\r
+    case "MySQL":\r
+      sqltext=oParse.UnparseSelectSkip(HiddenCols) & " LIMIT " & offset & "," & CStr(numrows+1)\r
+      totcnt=Query2xmlRaw_Limit(sqltext,offset,numrows,0)\r
+    case else:\r
+      sqltext=oParse.UnparseSelectSkip(HiddenCols)\r
+      totcnt=Query2xmlRaw_NoLimit(sqltext,offset,numrows,gettotal)\r
+  end select  \r
+  response.write RowsEnd\r
+  if not eof and gettotal then totcnt=getTotalRowCount\r
+  if fmt="xml" or fmt="json" then\r
+    if eof then AppendResponse "rowcount",totcnt\r
+  end if\r
+  if sendDebugMsgs then AddDebugMsg sqltext\r
+  Query2xml=totcnt\r
+  set oParse=Nothing\r
+end function\r
+\r
+\r
+Public sub Query2xmlDistinct(ByVal sqlselect,colnum,maxrows,filters)\r
+  set oParse=new sqlParse\r
+  if IsArray(sqlselect) then\r
+    oParse.LoadArray(sqlselect)\r
+  else\r
+    oParse.ParseSelect sqlselect\r
+  end if\r
+  if colnum<0 or colnum>ubound(oParse.arSelList) then\r
+    objDB.LastErrorMsg="Invalid column number for distinct query"\r
+    exit sub\r
+  end if\r
+  ApplyQStringParms filters\r
+  sqltext=oParse.UnparseDistinctColumn(colnum)\r
+  response.write RowsStart\r
+  totcnt=Query2xmlRaw_NoLimit(sqltext,0,maxrows,false)\r
+  response.write RowsEnd\r
+  if sendDebugMsgs then AddDebugMsg sqltext\r
+  set oParse=Nothing\r
+end sub\r
+\r
+\r
+' Tested ok with SQL Server 2005, MySQL, and Oracle\r
+Private function getTotalRowCount()\r
+  dim countSql,cnt\r
+  countSql="SELECT " & oParse.UnparseColumnList & " FROM " & oParse.FromClause\r
+  if not IsEmpty(oParse.WhereClause) then countSql=countSql & " WHERE " & oParse.WhereClause\r
+  if IsArray(oParse.arGroupBy) then\r
+    if UBound(oParse.arGroupBy)>=0 then countSql=countSql & " GROUP BY " & join(oParse.arGroupBy,",")\r
+  end if\r
+  if not IsEmpty(oParse.HavingClause) then countSql=countSql & " HAVING " & oParse.HavingClause\r
+  countSql="SELECT COUNT(*) FROM (" & countSql & ")"\r
+  if objDB.Dialect<>"Oracle" then countSql=countSql & " AS rico_Main"\r
+  if sendDebugMsgs then AddDebugMsg countSql\r
+  if ubound(arParams) >= 0 then\r
+    set rsMain = objDB.RunParamQuery(countSql,arParams)\r
+  else\r
+    set rsMain = objDB.RunQuery(countSql)\r
+  end if\r
+  getTotalRowCount=rsMain.Fields(0).Value\r
+  objDB.rsClose rsMain\r
+  eof=true\r
+end Function\r
+\r
+\r
+Private function UnparseWithRowNumber(offset,numrows,includeAS)\r
+  dim unparseText,strOrderBy\r
+  if IsArray(oParse.arOrderBy) then\r
+    if UBound(oParse.arOrderBy)>=0 then strOrderBy=join(oParse.arOrderBy,",")\r
+  end If\r
+  if IsEmpty(strOrderBy) then\r
+    ' order by clause should be included in main sql select statement\r
+    ' However, if it isn't, then use primary key as sort - assuming FromClause is a simple table name\r
+    strOrderBy=objDB.PrimaryKey(oParse.FromClause)\r
+  end if\r
+  unparseText="SELECT ROW_NUMBER() OVER (ORDER BY " & strOrderBy & ") AS rico_rownum,"\r
+  unparseText=unparseText & oParse.UnparseColumnListSkip(HiddenCols) & " FROM " & oParse.FromClause\r
+  if not IsEmpty(oParse.WhereClause) then unparseText=unparseText & " WHERE " & oParse.WhereClause\r
+  if IsArray(oParse.arGroupBy) then\r
+    if UBound(oParse.arGroupBy)>=0 then unparseText=unparseText & " GROUP BY " & join(oParse.arGroupBy,",")\r
+  end if\r
+  if not IsEmpty(oParse.HavingClause) then unparseText=unparseText & " HAVING " & oParse.HavingClause\r
+  unparseText="SELECT * FROM (" & unparseText & ")"\r
+  if includeAS then unparseText=unparseText & " AS rico_Main"\r
+  unparseText=unparseText & " WHERE rico_rownum > " & offset & " AND rico_rownum <= " & CStr(offset+numrows)\r
+  UnparseWithRowNumber=unparseText\r
+end Function\r
+\r
+\r
+Public function Query2xmlRaw(ByVal rawsqltext, ByVal offset, ByVal numrows)\r
+  Query2xmlRaw=Query2xmlRaw_NoLimit(rawsqltext,offset,numrows,true)\r
+end Function\r
+\r
+\r
+Public function Query2xmlRaw_NoLimit(ByVal rawsqltext, ByVal offset, ByVal numrows, ByVal gettotal)\r
+  dim rsMain,totcnt\r
+\r
+  if ubound(arParams) >= 0 then\r
+    set rsMain = objDB.RunParamQuery(rawsqltext,arParams)\r
+  else\r
+    set rsMain = objDB.RunQuery(rawsqltext)\r
+  end if\r
+  totcnt=0\r
+  eof=true\r
+  if rsMain is Nothing then exit function\r
+\r
+  while not rsMain.eof and totcnt<offset\r
+    totcnt=totcnt+1\r
+    rsMain.movenext\r
+  wend\r
+  select case fmt\r
+    case "json":\r
+      totcnt = totcnt + WriteRowsJSON(rsMain, numrows, 0)\r
+    case else:\r
+      totcnt = totcnt + WriteRowsXHTML(rsMain, numrows, 0)\r
+  end select\r
+  if gettotal then\r
+    while not rsMain.eof\r
+      totcnt=totcnt+1\r
+      rsMain.movenext\r
+    wend\r
+  end if\r
+  eof=rsMain.eof\r
+\r
+  objDB.rsClose rsMain\r
+  Query2xmlRaw_NoLimit=totcnt\r
+end function\r
+\r
+\r
+Public function Query2xmlRaw_Limit(ByVal rawsqltext,offset,numrows,firstcol)\r
+  dim rsMain,totcnt\r
+\r
+  if ubound(arParams) >= 0 then\r
+    set rsMain = objDB.RunParamQuery(rawsqltext,arParams)\r
+  else\r
+    set rsMain = objDB.RunQuery(rawsqltext)\r
+  end if\r
+  totcnt=offset\r
+  eof=true\r
+  if rsMain is Nothing then exit function\r
+  select case fmt\r
+    case "json":\r
+      totcnt = totcnt + WriteRowsJSON(rsMain, numrows, firstcol)\r
+    case else:\r
+      totcnt = totcnt + WriteRowsXHTML(rsMain, numrows, firstcol)\r
+  end select\r
+  eof=rsMain.eof\r
+  objDB.rsClose rsMain\r
+  Query2xmlRaw_Limit=totcnt\r
+end function\r
+\r
+\r
+Private Function WriteRowsXHTML(rsMain, ByVal numrows, ByVal firstcol)\r
+  dim colcnt,rowcnt,i,n\r
+  rowcnt=0\r
+  colcnt=rsMain.fields.count\r
+  on error resume next\r
+  if SendHdg then\r
+    response.write vbLf & "<tr>"\r
+    for i=firstcol to colcnt-1\r
+      n=rsMain.fields(i).name\r
+      if isArray(Headings) then\r
+        if not IsEmpty(Headings(i-firstcol)) then n=Headings(i-firstcol)\r
+      end if \r
+      response.write XmlStringCell(n)\r
+    next\r
+    response.write "</tr>"\r
+  end if\r
+  while not rsMain.eof and rowcnt<numrows\r
+    rowcnt=rowcnt+1\r
+    response.write vbLf & "<tr>"\r
+    for i=firstcol to colcnt-1\r
+      response.write XmlStringCell(FormatValue(rsMain.fields(i).value))\r
+    next\r
+    response.write "</tr>"\r
+    rsMain.movenext\r
+  wend\r
+  WriteRowsXHTML=rowcnt\r
+end function\r
+\r
+\r
+Private Function WriteRowsJSON(rsMain, ByVal numrows, ByVal firstcol)\r
+  dim colcnt,rowcnt,i\r
+  rowcnt=0\r
+  colcnt=rsMain.fields.count\r
+  on error resume next\r
+  if SendHdg=true then\r
+    response.write vbLf & "["\r
+    for i=firstcol to colcnt-1\r
+      n=rsMain.fields(i).name\r
+      if isArray(Headings) then\r
+        if not IsEmpty(Headings(i-firstcol)) then n=Headings(i-firstcol)\r
+      end if \r
+      response.write """" & escapeJSON(n) & """"\r
+    next\r
+    response.write "]"\r
+  end if\r
+  while not rsMain.eof and rowcnt<numrows\r
+    if rowcnt>0 or SendHdg then response.write ","\r
+    rowcnt=rowcnt+1\r
+    response.write vbLf & "["\r
+    for i=firstcol to colcnt-1\r
+      if i>firstcol then response.write ","\r
+      response.write """" & escapeJSON(FormatValue(rsMain.fields(i).value)) & """"\r
+    next\r
+    response.write "]"\r
+    rsMain.movenext\r
+  wend\r
+  WriteRowsJSON=rowcnt\r
+end function\r
+\r
+\r
+Private Function PadNumber(number, length)\r
+       dim strNumber\r
+       \r
+       if IsNull(number) or IsEmpty(number) then strNumber=String(length,"-") else strNumber = Cstr(number)\r
+       do while len(strNumber) < length\r
+               strNumber = "0" & strNumber\r
+       loop\r
+\r
+       PadNumber=strNumber\r
+End Function\r
+\r
+\r
+Private Function FormatValue(s)\r
+  select case vartype(s)\r
+    case 11\r
+      FormatValue=lcase(s)      ' boolean\r
+    case 7,133,134,135:\r
+      FormatValue=year(s) & "-" & PadNumber(month(s),2) & "-" & PadNumber(day(s),2) & " " & PadNumber(hour(s),2) & ":" & PadNumber(minute(s),2) & ":" & PadNumber(second(s),2) ' date/time\r
+    case else\r
+      FormatValue=s\r
+  end select\r
+End Function\r
+\r
+\r
+Public Sub SetDbConn(dbcls)\r
+  set objDB=dbcls\r
+end Sub\r
+\r
+\r
+Private sub PushParam(ByVal newvalue)\r
+  ReDim Preserve arParams(ubound(arParams)+1)\r
+  newvalue=cstr(newvalue)\r
+  if newvalue="" then newvalue=" "  ' empty string gets converted to TEXT data type instead of VARCHAR\r
+  arParams(ubound(arParams))=newvalue\r
+  if sendDebugMsgs then AddDebugMsg "Param " & ubound(arParams) & " type=" & typename(newvalue) & " value=" & newvalue\r
+end sub\r
+\r
+\r
+' assumes oParse is already initialized\r
+Private sub ApplyQStringParms(filters)\r
+  dim i,j,newfilter,qs,a,flen,fop,value,blank,param\r
+\r
+  for each qs in Request.QueryString\r
+    select case left(qs,1)\r
+      \r
+      ' user-invoked condition\r
+      case "w","h":\r
+        i=mid(qs,2)\r
+        if IsNumeric(i) and isArray(filters) then\r
+          i=CInt(i)\r
+          if i<0 or i>ubound(filters) then exit for\r
+          value=Request.QueryString(qs)\r
+          newfilter=filters(i)\r
+          j=InStr(1,newfilter," in (?)",1)\r
+          if j>0 then\r
+            a=split(value,",")\r
+            for i=0 to ubound(a)\r
+              PushParam a(i)\r
+              a(i)="?"\r
+            next\r
+            newfilter=left(newfilter,j+4) & join(a,",") & mid(newfilter,j+6)\r
+          elseif InStr(newfilter,"?")>0 then\r
+            PushParam value\r
+          end if\r
+          if left(qs,1)="h" then\r
+            oParse.AddHavingCondition newfilter\r
+          else\r
+            oParse.AddWhereCondition newfilter\r
+          end if\r
+        end if\r
+      \r
+      ' sort\r
+      case "s":\r
+        i=mid(qs,2)\r
+        if not IsNumeric(i) then exit for\r
+        i=CInt(i)\r
+        if i<0 or i>ubound(oParse.arSelList) then exit for\r
+        value=ucase(left(Request.QueryString(qs),4))\r
+        if value<>"ASC" and value<>"DESC" then value="ASC"\r
+        if orderByRef then\r
+          oParse.AddSort CStr(i+1) & " " & value\r
+        else\r
+          oParse.AddSort oParse.arSelList(i) & " " & value\r
+        end if\r
+      \r
+      ' user-supplied filter\r
+      case "f":\r
+        a=split(qs,"[")\r
+        if ubound(a)=2 then\r
+          if a(2)="op]" then\r
+            i=left(a(1),len(a(1))-1)\r
+            if not IsNumeric(i) then exit for\r
+            if len(i)>3 then exit for\r
+            i=CInt(i)\r
+            if i<0 or i>ubound(oParse.arSelList) then exit for\r
+            fop=Request.QueryString(qs)\r
+            newfilter=oParse.arSelList(i)\r
+            select case fop\r
+              case "EQ":\r
+                newfilter = "(" & AddCoalesce(newfilter) & " IN " & GetMultiParmFilter(qs) & ")"\r
+              case "LE":\r
+                newfilter=newfilter & "<=?"\r
+                PushParam Request.QueryString(replace(qs,"[op]","[0]"))\r
+              case "GE":\r
+                newfilter=newfilter & ">=?"\r
+                PushParam Request.QueryString(replace(qs,"[op]","[0]"))\r
+              case "NULL": newfilter=newfilter & " is null"\r
+              case "NOTNULL": newfilter=newfilter & " is not null"\r
+              case "LIKE":\r
+                newfilter=newfilter & " LIKE ?"\r
+                PushParam replace(Request.QueryString(replace(qs,"[op]","[0]")),"*",objDB.Wildcard)\r
+              case "NE"\r
+                newfilter = "(" & AddCoalesce(newfilter) & " NOT IN " & GetMultiParmFilter(qs) & ")"\r
+            end select\r
+            if (InStr(oParse.arSelList(i),"min(")>0 or _\r
+               InStr(oParse.arSelList(i),"max(")>0 or _\r
+               InStr(oParse.arSelList(i),"sum(")>0 or _\r
+               InStr(oParse.arSelList(i),"count(")>0) and _\r
+               InStr(oParse.arSelList(i),"(select ")<1 then\r
+              oParse.AddHavingCondition newfilter\r
+            else\r
+              oParse.AddWhereCondition newfilter\r
+            end if\r
+          end if\r
+        end if\r
+    end select\r
+  next\r
+end sub\r
+\r
+\r
+Private function AddCoalesce(ByVal newfilter)\r
+  if objDB.Dialect="Access" then\r
+    newfilter="iif(IsNull(" & newfilter & "),''," & newfilter & ")"\r
+  else\r
+    newfilter="coalesce(" & newfilter & ",'')"\r
+  end if\r
+  AddCoalesce=newfilter\r
+end function\r
+\r
+\r
+Private function GetMultiParmFilter(ByVal qs)\r
+  dim flen,j,param,filter\r
+  flen = Request.QueryString(replace(qs,"[op]","[len]"))\r
+  if not IsNumeric(flen) then exit function\r
+  flen = CInt(flen)\r
+  for j=0 to flen-1\r
+    if j>0 then filter=filter & ","\r
+    filter=filter & "?"\r
+    param=Request.QueryString(replace(qs,"[op]","[" & j & "]"))\r
+    PushParam param\r
+  next\r
+  GetMultiParmFilter = "(" & filter & ")"\r
+end function\r
+\r
+\r
+Public function XmlStringCell(value)\r
+  dim result\r
+  if IsNull(value) then result="" else result=server.HTMLEncode(value)\r
+  if fmt="html" and result="" then result="&nbsp;"\r
+  XmlStringCell="<td>" & result & "</td>"\r
+end function\r
+\r
+\r
+' for the root node, parentID should "" (empty string)\r
+' containerORleaf: L/zero (leaf), C/non-zero (container)\r
+' selectable:      0->not selectable, 1->selectable\r
+Public sub WriteTreeRow(parentID,ID,description,containerORleaf,selectable)\r
+  response.write vbLf & "<tr>"\r
+  response.write XmlStringCell(parentID)\r
+  response.write XmlStringCell(ID)\r
+  response.write XmlStringCell(description)\r
+  response.write XmlStringCell(containerORleaf)\r
+  response.write XmlStringCell(selectable)\r
+  response.write "</tr>"\r
+end sub\r
+\r
+\r
+'******************************************************************************************\r
+'' @SDESCRIPTION:   takes a given string and makes it JSON valid (http://json.org/)\r
+'' @AUTHOR: Michael Rebec\r
+'' @DESCRIPTION:    all characters which needs to be escaped are beeing replaced by their\r
+''          unicode representation according to the\r
+''          RFC4627#2.5 - http://www.ietf.org/rfc/rfc4627.txt?number=4627\r
+'' @PARAM:      val [string]: value which should be escaped\r
+'' @RETURN:   [string] JSON valid string\r
+'******************************************************************************************\r
+public function escapeJSON(val)\r
+    const cDoubleQuote = &h22\r
+    const cRevSolidus = &h5C\r
+    const cSolidus = &h2F\r
+    dim i,currentDigit\r
+\r
+    for i = 1 to (len(val))\r
+        currentDigit = mid(val, i, 1)\r
+        if asc(currentDigit)> &h00 and asc(currentDigit) <&h1F then\r
+            currentDigit = escapeJSONSquence(currentDigit)\r
+        elseif asc(currentDigit)>= &hC280 and asc(currentDigit) <= &hC2BF then\r
+            currentDigit = "\u00" + right(padLeft(hex(asc(currentDigit) - &hC200), 2, 0), 2)\r
+        elseif asc(currentDigit)>= &hC380 and asc(currentDigit) <= &hC3BF then\r
+            currentDigit = "\u00" + right(padLeft(hex(asc(currentDigit) - &hC2C0), 2, 0), 2)\r
+        else\r
+            select case asc(currentDigit)\r
+                case cDoubleQuote: currentDigit = escapeJSONSquence(currentDigit)\r
+                case cRevSolidus: currentDigit = escapeJSONSquence(currentDigit)\r
+                case cSolidus: currentDigit = escapeJSONSquence(currentDigit)\r
+            end select\r
+        end if\r
+        escapeJSON = escapeJSON & currentDigit\r
+    next\r
+end function\r
\r
+function escapeJSONSquence(digit)\r
+    escapeJSONSquence = "\u00" + right(padLeft(hex(asc(digit)), 2, 0), 2)\r
+end function \r
\r
+function padLeft(value, totalLength, paddingChar)\r
+    padLeft = right(clone(paddingChar, totalLength) & value, totalLength)\r
+end function\r
\r
+public function clone(byVal str, n)\r
+    dim i\r
+    for i = 1 to n : clone = clone & str : next\r
+end function\r
+\r
+end class\r
+\r
+%>\r
diff --git a/plugins/dotnet/AltTable.ascx b/plugins/dotnet/AltTable.ascx
new file mode 100644 (file)
index 0000000..a5cb173
--- /dev/null
@@ -0,0 +1,3 @@
+<%@ Control Language="VB"\r
+    CodeFile="AltTable.ascx.vb" \r
+    Inherits="AltTable" %>\r
diff --git a/plugins/dotnet/AltTable.ascx.vb b/plugins/dotnet/AltTable.ascx.vb
new file mode 100644 (file)
index 0000000..44deb38
--- /dev/null
@@ -0,0 +1,76 @@
+Partial Class AltTable\r
+Inherits System.Web.UI.UserControl\r
+\r
+public TblName as string\r
+public TblAlias as string\r
+public Delim as string = ","\r
+public altFields as New ArrayList()\r
+\r
+Public Property FieldList() As String\r
+  Get\r
+    dim i as Integer\r
+    dim result as String=""\r
+    for i=0 to altFields.Count-1\r
+      if i > 0 then result &= Delim\r
+      result &= altFields(i).ColName\r
+    next\r
+    Return result\r
+  End Get\r
+  Set(ByVal Value As String)\r
+    dim i as Integer\r
+    dim arFields=Value.split(Delim)\r
+    for i=0 to ubound(arFields)\r
+      if i = altFields.Count then altFields.Add(New AltColumnClass())\r
+      altFields(i).ColName=arFields(i)\r
+    next\r
+  End Set\r
+End Property\r
+\r
+Public Property FieldData() As String\r
+  Get\r
+    dim i as Integer\r
+    dim result as String=""\r
+    for i=0 to altFields.Count-1\r
+      if i > 0 then result &= Delim\r
+      result &= altFields(i).Data\r
+    next\r
+    Return result\r
+  End Get\r
+  Set(ByVal Value As String)\r
+    dim i as Integer\r
+    dim arData=Value.split(Delim)\r
+    for i=0 to ubound(arData)\r
+      if IsNothing(altFields(i)) then altFields(i)=New AltColumnClass()\r
+      altFields(i).Data=arData(i)\r
+    next\r
+  End Set\r
+End Property\r
+\r
+\r
+Public Function FieldCondition(FieldIdx as Integer, optional WithAlias as Boolean=true) As String\r
+  dim s as String = altFields(FieldIdx).ColName & "=" & altFields(FieldIdx).Data\r
+  if WithAlias then s = TblAlias & "." & s\r
+  FieldCondition=s\r
+End Function\r
+\r
+\r
+Public Function KeyCondition(optional WithAlias as Boolean=false) As String\r
+  dim i as Integer\r
+  dim k as String = ""\r
+  for i=0 to altFields.Count-1\r
+    if altFields(i).isKey then\r
+      k &= " AND (" & FieldCondition(i,WithAlias) & ")"\r
+    end if\r
+  next\r
+  KeyCondition=k\r
+End Function\r
+\r
+\r
+Public Class AltColumnClass\r
+  public ColName as string\r
+  public Data as string\r
+  public isKey as boolean\r
+End Class\r
+\r
+\r
+End Class\r
diff --git a/plugins/dotnet/GridColumn.ascx b/plugins/dotnet/GridColumn.ascx
new file mode 100644 (file)
index 0000000..4e43909
--- /dev/null
@@ -0,0 +1,3 @@
+<%@ Control Language="VB"\r
+    CodeFile="GridColumn.ascx.vb" \r
+    Inherits="GridColumn" %>\r
diff --git a/plugins/dotnet/GridColumn.ascx.vb b/plugins/dotnet/GridColumn.ascx.vb
new file mode 100644 (file)
index 0000000..5413690
--- /dev/null
@@ -0,0 +1,179 @@
+Partial Class GridColumn\r
+Inherits System.Web.UI.UserControl\r
+\r
+' ----------------------------------------------------\r
+' Properties\r
+' ----------------------------------------------------\r
+\r
+Public DataType as String    ' maps to LiveGrid column 'type'\r
+Public canSort as Boolean = True\r
+Public canDrag as Boolean = False\r
+Public canFilter as Boolean = True\r
+Public control as String     ' javascript code to create control object\r
+Public format as String\r
+Public visible as Boolean = True\r
+Public ClassName as String\r
+Public filterUI as String\r
+Public filterCol as Integer = -1\r
+Public spec as String\r
+\r
+' number formatting\r
+Public multiplier as Double = 1.0\r
+Public decPlaces as Integer = 0\r
+Public decPoint as String\r
+Public thouSep as String\r
+Public negSign as String\r
+Public prefix as String\r
+Public suffix as String\r
+\r
+' date formatting\r
+Public dateFmt as String\r
+\r
+' LiveGrid Forms\r
+Public pattern as String\r
+Public min as String\r
+Public max as String\r
+Public Help as String\r
+Public TxtAreaRows as Integer = 4\r
+Public TxtAreaCols as Integer = 80\r
+Public ColName as String\r
+Public ColData as String\r
+Public SelectSql as String\r
+Public SelectCtl as String\r
+Public SelectFilter as String\r
+Public SelectValues as String\r
+Public SelectRows as Integer = -1\r
+Public Formula as String\r
+Public TableIdx as Integer = 0\r
+Public FilterFlag as Boolean = False\r
+Public FieldName as String\r
+Public isNullable as Boolean = False\r
+Public Writeable as Boolean = True\r
+Public FixedLength as Boolean\r
+Public isKey as Boolean = False\r
+Public Length as Integer = -1\r
+Public TypeName as String  ' .net type\r
+Public panelIdx as Integer = -1\r
+Public ConfirmDeleteColumn as Boolean = False\r
+Public InsertOnly as Boolean = False\r
+Public UpdateOnly as Boolean = False\r
+Public [ReadOnly] as Boolean = False\r
+Public FormView as String\r
+Public AddQuotes as Boolean = True\r
+Public AltTable as String\r
+Public MultiSelect as Boolean = False\r
+Public DescriptionCol as String\r
+Public DescriptionField as String  ' should populate automatically based on DescriptionCol\r
+Public noFormBreak as Boolean = False\r
+\r
+Private _EntryType as String\r
+Private _colHeading As String\r
+Private _width As Integer = -1\r
+\r
+\r
+Public Property Heading() As String\r
+  Get\r
+    Return _colHeading\r
+  End Get\r
+  Set\r
+    _colHeading = value\r
+  End Set\r
+End Property\r
+\r
+Public Property Width() As Integer\r
+  Get\r
+    Return _width\r
+  End Get\r
+  Set\r
+    _width = value\r
+  End Set\r
+End Property\r
+\r
+Public Function isLookupField() as Boolean\r
+  isLookupField=CBool(mid(_EntryType,2,1)="L")\r
+End Function\r
+\r
+Public Property EntryType() As String\r
+  Get\r
+    Return _EntryType\r
+  End Get\r
+  Set\r
+    select case value\r
+      case "TA","tinyMCE","R","RL","S","SL","CL","N","B","T","I","F":\r
+      case "D":   DataType="date"\r
+      case "DT":  DataType="datetime"\r
+      case "H":   visible=false\r
+      case else:  Throw New Exception("Invalid EntryType")\r
+    end select\r
+    _EntryType = value\r
+  End Set\r
+End Property\r
+\r
+\r
+Private function FmtBool(b)\r
+  if b then FmtBool="true" else FmtBool="false"\r
+end function\r
+\r
+Public ReadOnly Property script() As String\r
+  Get\r
+    if not IsNothing(Me.spec) then Return "'" & Me.spec & "'"\r
+    dim a as New ArrayList()\r
+    if not IsNothing(Me.DataType) then a.Add("type: '" & Me.DataType & "'")\r
+    if not IsNothing(Me.control) then a.Add("control: " & Me.control)\r
+    if not IsNothing(Me.pattern) then a.Add("pattern: '" & Me.pattern & "'")\r
+    if not IsNothing(Me.min) then a.Add("min: '" & Me.min & "'")\r
+    if not IsNothing(Me.max) then a.Add("max: '" & Me.max & "'")\r
+    if not IsNothing(Me.Help) then a.Add("Help: '" & Me.Help & "'")\r
+    if not IsNothing(Me.format) then a.Add("format: '" & Me.format & "'")\r
+    if not Me.canSort then a.Add("canSort: false")\r
+    if Me.canDrag then a.Add("canDrag: true")\r
+    if not Me.canFilter then a.Add("canFilter: false")\r
+    if not Me.visible then a.Add("visible: false")\r
+    if Me._width >= 0 then a.Add("width: " & Me._width)\r
+    if not IsNothing(Me.ColName)   then a.Add("ColName: '" & Me.ColName & "'")\r
+    if not IsNothing(Me.FieldName) then a.Add("FieldName: '" & Me.FieldName & "'")\r
+    if not IsNothing(Me.ClassName) then a.Add("ClassName: '" & Me.ClassName & "'")\r
+    if not IsNothing(Me.filterUI)  then a.Add("filterUI: '" & Me.filterUI & "'")\r
+    if Me.filterCol >= 0 then a.Add("filterCol: " & Me.filterCol)\r
+\r
+    if Me.multiplier <> 1.0 then a.Add("multiplier: " & Me.multiplier)\r
+    if Me.decPlaces > 0 then a.Add("decPlaces: " & Me.decPlaces)\r
+    if not IsNothing(Me.decPoint) then a.Add("decPoint: '" & Me.decPoint & "'")\r
+    if not IsNothing(Me.thouSep) then a.Add("thouSep: '" & Me.thouSep & "'")\r
+    if not IsNothing(Me.negSign) then a.Add("negSign: '" & Me.negSign & "'")\r
+    if not IsNothing(Me.prefix) then a.Add("prefix: '" & Me.prefix & "'")\r
+    if not IsNothing(Me.suffix) then a.Add("suffix: '" & Me.suffix & "'")\r
+    if not IsNothing(Me.dateFmt) then a.Add("dateFmt: '" & Me.dateFmt & "'")\r
+    if Me.panelIdx >= 0 then a.Add("panelIdx: " & Me.panelIdx)\r
+\r
+    if not IsNothing(Me.EntryType) then\r
+      a.Add("EntryType: '" & Me.EntryType & "'")\r
+      if Me.EntryType="D" and ucase(Me.ColData)="TODAY" then\r
+        a.Add("ColData: '" & DateTime.Today.ToString("s") & "'")\r
+      else\r
+        a.Add("ColData: '" & replace(Me.ColData,"'","\'") & "'")\r
+      end if\r
+      if Me.EntryType="TA" or Me.EntryType="tinyMCE" then\r
+        a.Add("TxtAreaRows: " & Me.TxtAreaRows)\r
+        a.Add("TxtAreaCols: " & Me.TxtAreaCols)\r
+      end if\r
+      if not IsNothing(Me.FormView) then a.Add("FormView: '" & Me.FormView & "'")\r
+      if not IsNothing(Me.SelectCtl) then a.Add("SelectCtl: '" & Me.SelectCtl & "'")\r
+      if not IsNothing(Me.SelectValues) then a.Add("SelectValues: '" & Me.SelectValues & "'")\r
+      if Me.Length >= 0 then a.Add("Length: " & Me.Length)\r
+      if Me.isNullable then a.Add("isNullable: true")\r
+      if Me.isKey then a.Add("isKey: true")\r
+      a.Add("Writeable: " & FmtBool(Me.Writeable))\r
+      if Me.InsertOnly then a.Add("InsertOnly: true")\r
+      if Me.UpdateOnly or not IsNothing(AltTable) then a.Add("UpdateOnly: true")\r
+      if Me.ReadOnly then a.Add("ReadOnly: true")\r
+      if Me.MultiSelect then a.Add("MultiSelect: true")\r
+      if Me.noFormBreak then a.Add("noFormBreak: true")\r
+      if not IsNothing(Me.DescriptionField) then a.Add("DescriptionField: '" & Me.DescriptionField & "'")\r
+      if Me.SelectRows > 0 then a.Add("SelectRows: " & Me.SelectRows)\r
+    end if\r
+    Return " {" & String.Join("," & vbCrLf & "  ", a.ToArray(Type.GetType("System.String"))) & " }"\r
+  End Get\r
+End Property\r
+\r
+End Class\r
diff --git a/plugins/dotnet/GridPanel.ascx b/plugins/dotnet/GridPanel.ascx
new file mode 100644 (file)
index 0000000..fee15e2
--- /dev/null
@@ -0,0 +1,3 @@
+<%@ Control Language="VB"\r
+    CodeFile="GridPanel.ascx.vb" \r
+    Inherits="GridPanel" %>\r
diff --git a/plugins/dotnet/GridPanel.ascx.vb b/plugins/dotnet/GridPanel.ascx.vb
new file mode 100644 (file)
index 0000000..5d6755d
--- /dev/null
@@ -0,0 +1,15 @@
+Partial Class GridPanel\r
+Inherits System.Web.UI.UserControl\r
+\r
+private _heading as string\r
+\r
+public property heading as string\r
+  get\r
+    return _heading\r
+  end get\r
+  set\r
+    _heading=value\r
+  end set\r
+end property\r
+\r
+End Class\r
diff --git a/plugins/dotnet/LiveGrid.ascx b/plugins/dotnet/LiveGrid.ascx
new file mode 100644 (file)
index 0000000..f5b4888
--- /dev/null
@@ -0,0 +1,25 @@
+<%@ Control Language="VB"\r
+    CodeFile="LiveGrid.ascx.vb" \r
+    Inherits="LiveGrid" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column"   Src="GridColumn.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="Panel"    Src="GridPanel.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="AltTable" Src="AltTable.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlParse" Src="sqlParse.ascx" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlCompatibilty" Src="sqlCompatibilty.ascx" %>\r
+\r
+<script type='text/javascript'>\r
+<%=Me.init_Script %>\r
+<%=Me.globalInitScript%>\r
+</script>\r
+\r
+<%=Me.DebugString%>\r
+<%=Me.Bookmark%>\r
+<table id='<%=Me.UniqueId %>' class='ricoLiveGrid' cellpadding='0' cellspacing='0'>\r
+<thead class='ricoLG_top ui-widget-header'>\r
+<asp:placeholder runat='server' id='LiveGridHeadingsTop' />\r
+<tr id='<%=Me.UniqueId %>_hdg_main'>\r
+<asp:placeholder runat='server' id='LiveGridHeadingsMain' />\r
+</tr>\r
+<asp:placeholder runat='server' id='LiveGridHeadingsBottom' />\r
+</thead>\r
+</table>\r
diff --git a/plugins/dotnet/LiveGrid.ascx.vb b/plugins/dotnet/LiveGrid.ascx.vb
new file mode 100644 (file)
index 0000000..55a1fdc
--- /dev/null
@@ -0,0 +1,1055 @@
+Imports System.Data\r
+\r
+Partial Class LiveGrid\r
+Inherits System.Web.UI.UserControl\r
+   \r
+' ----------------------------------------------------\r
+' Constants\r
+' ----------------------------------------------------\r
+\r
+Public Const sizeToWindow=-1\r
+Public Const sizeToData=-2\r
+Public Const sizeToBody=-3\r
+Public Const sizeToParent=-4\r
+\r
+' ----------------------------------------------------\r
+' Private Properties\r
+' ----------------------------------------------------\r
+\r
+Private _rows As Integer = sizeToWindow\r
+Private _sqlFilters as New ArrayList()\r
+Private _gridHeading As ITemplate = Nothing\r
+Private _headingTop As ITemplate = Nothing\r
+Private _headingBottom As ITemplate = Nothing\r
+Protected globalInitScript as String = ""\r
+Protected HdgContainer As New GridContainer()\r
+Protected DebugString As String\r
+Protected oSqlCompat as sqlCompatibilty\r
+Protected oParseMain as New sqlParse()\r
+\r
+\r
+' ----------------------------------------------------\r
+' Public Properties\r
+' ----------------------------------------------------\r
+Public columns as New ArrayList()\r
+Public dataProvider as String = "ricoQuery.aspx"\r
+Public menuEvent as String = "dblclick"\r
+Public frozenColumns as Integer = 0\r
+Public canSortDefault as Boolean = True\r
+Public canHideDefault as Boolean = True\r
+Public canFilterDefault as Boolean = True\r
+Public allowColResize as Boolean = True\r
+Public highlightElem as String = "menuRow"\r
+Public highlightMethod as String\r
+Public prefetchBuffer as Boolean = True\r
+Public DisplayTimer as Boolean = True\r
+Public DisplayBookmark as Boolean = True\r
+Public Caption as String\r
+Public click as String\r
+Public dblclick as String\r
+Public contextmenu as String\r
+Public headingSort as String\r
+Public beforeInit as String\r
+Public afterInit as String\r
+Public TableFilter as String\r
+Public FilterLocation as Integer = -2\r
+Public FilterAllToken as String\r
+Public FilterBoxMaxLen as Integer = -1\r
+Public FilterAnchorLeft as Boolean = false  ' when matching text box values, should they match beginning of string (true) or anywhere in string (false)?
+Public requestParameters as New Hashtable()\r
+Public saveColumnWidth as Boolean = True\r
+Public saveColumnFilter as Boolean = False\r
+Public saveColumnSort as Boolean = False\r
+Public cookieDays as Integer\r
+Public DefaultSort as String\r
+Public BufferType as String = "AjaxSQL"  ' can be overridden to AjaxXML\r
+Public maxPrint as Integer = -1\r
+Public dndMgrIdx as Integer = -1\r
+Public fmt as String = "xml"\r
+Public UsingMinRico as Boolean = False   ' using minified version of Rico?\r
+Public sessions as Boolean = True\r
+Public minPageRows as Integer = -1\r
+Public maxPageRows as Integer = -1\r
+Public defaultWidth as Integer = -1  ' if -1, then use unformatted column width, otherwise this is the default width in pixels\r
+Public debug as Boolean = False\r
+Public LogSqlOnError as Boolean = false   ' include sql statement in results if an error occurs (true/false)\r
+\r
+\r
+\r
+Public Property rows() As Integer\r
+  Get\r
+    Return _rows\r
+  End Get\r
+  Set(ByVal Value As Integer)\r
+    _rows=Value\r
+  End Set\r
+End Property\r
+\r
+<TemplateContainer(GetType(GridContainer))> _\r
+Public Property GridColumns() As ITemplate\r
+  Get\r
+    Return _gridHeading\r
+  End Get\r
+  Set\r
+    _gridHeading = value\r
+  End Set\r
+End Property\r
+\r
+<TemplateContainer(GetType(GridContainer))> _\r
+Public Property HeadingTop() As ITemplate\r
+  Get\r
+    Return _headingTop\r
+  End Get\r
+  Set\r
+    _headingTop = value\r
+  End Set\r
+End Property\r
+\r
+<TemplateContainer(GetType(GridContainer))> _\r
+Public Property HeadingBottom() As ITemplate\r
+  Get\r
+    Return _headingBottom\r
+  End Get\r
+  Set\r
+    _headingBottom = value\r
+  End Set\r
+End Property\r
+\r
+Public WriteOnly Property sqlQuery() As String\r
+  Set(ByVal SqlText As String)\r
+    if oParseMain.ParseSelect(SqlText) then\r
+      ' sync column headings\r
+      dim i as Integer\r
+      for i=0 to oParseMain.SelectList.Count-1\r
+        if i < Me.columns.Count then\r
+          if IsNothing(Me.columns(i).Heading) then\r
+            Me.columns(i).Heading=oParseMain.SelectList(i).name\r
+          else\r
+            oParseMain.SelectList(i).name=Me.columns(i).Heading\r
+          end if\r
+        else\r
+          AddCalculatedField(oParseMain.SelectList(i).name, oParseMain.SelectList(i).sql)\r
+        end if\r
+      next\r
+      if sessions then session.contents(Me.UniqueId)=oParseMain\r
+    else\r
+      Throw New Exception("Invalid SQL statement")\r
+    end if\r
+  End Set\r
+End Property\r
+\r
+Public ReadOnly Property ParseClone() As object\r
+  Get\r
+    return oParseMain.Clone()\r
+  End Get\r
+End Property\r
+\r
+Protected ReadOnly Property TimerSpan() As String\r
+  Get\r
+    if Me.DisplayTimer then\r
+      Return "<span id='" & Me.UniqueId & "_timer' class='ricoSessionTimer'>&nbsp;</span>"\r
+    else\r
+      Return ""\r
+    end if\r
+  End Get\r
+End Property\r
+\r
+Protected ReadOnly Property BookmarkSpan() As String\r
+  Get\r
+    if Me.DisplayBookmark then\r
+      Return "<span id='" & Me.UniqueId & "_bookmark'>&nbsp;</span>"\r
+    else\r
+      Return ""\r
+    end if\r
+  End Get\r
+End Property\r
+\r
+Protected ReadOnly Property SaveMsgSpan() As String\r
+  Get\r
+    if Me.formView then\r
+      Return "<span id='" & Me.UniqueId & "_savemsg' class='ricoSaveMsg'></span>"\r
+    else\r
+      Return ""\r
+    end if\r
+  End Get\r
+End Property\r
+\r
+Protected ReadOnly Property CaptionSpan() As String\r
+  Get\r
+    if IsNothing(Caption) then\r
+      Return ""\r
+    else\r
+      Return "<span id='" & Me.UniqueId & "_caption' class='ricoCaption'>" & Me.Caption & "</span>"\r
+    end if\r
+  End Get\r
+End Property\r
+\r
+Protected ReadOnly Property FilterIcon() As String\r
+  Get\r
+    if FilterLocation >= -1 then\r
+      Return "<a id='ex3_filterLink' href='#' style='margin-right:1em;'></a>"\r
+    else\r
+      Return ""\r
+    end if\r
+  End Get\r
+End Property\r
+\r
+Protected ReadOnly Property Bookmark() As String\r
+  Get\r
+    if Me.DisplayBookmark or Me.DisplayTimer or not IsNothing(Caption) then\r
+      Return "<p class='ricoBookmark'>" & Me.CaptionSpan & Me.TimerSpan & Me.FilterIcon & Me.BookmarkSpan & Me.SaveMsgSpan & "</p>"\r
+    else\r
+      Return ""\r
+    end if\r
+  End Get\r
+End Property\r
+\r
+Private function FmtBool(b)\r
+  if b then FmtBool="true" else FmtBool="false"\r
+end function\r
+\r
+Protected ReadOnly Property init_Script() As String\r
+  Get\r
+    Dim script as New System.Text.StringBuilder(), confirmCol as Integer=0\r
+    script.Append("var " & Me.UniqueId & " = {};" & vbCrLf)\r
+    script.Append("function " & Me.UniqueId & "_init" & "() {" & vbCrLf)\r
+    if not IsNothing(beforeInit) then script.Append(beforeInit & vbCrLf)\r
+\r
+    ' grid options\r
+\r
+    script.Append("  " & optionsVar & " = {" & vbCrLf)\r
+    script.Append("    visibleRows: " & Me.rows & "," & vbCrLf)\r
+    script.Append("    frozenColumns: " & frozenColumns & "," & vbCrLf)\r
+    script.Append("    canSortDefault: " & FmtBool(canSortDefault) & "," & vbCrLf)\r
+    script.Append("    canHideDefault: " & FmtBool(canHideDefault) & "," & vbCrLf)\r
+    script.Append("    canFilterDefault: " & FmtBool(canFilterDefault) & "," & vbCrLf)\r
+    script.Append("    allowColResize: " & FmtBool(allowColResize) & "," & vbCrLf)\r
+    script.Append("    highlightElem: '" & highlightElem & "'," & vbCrLf)\r
+    if not IsNothing(highlightMethod) then script.Append("    highlightMethod: '" & highlightMethod & "'," & vbCrLf)\r
+    script.Append("    prefetchBuffer: " & FmtBool(prefetchBuffer) & "," & vbCrLf)\r
+    script.Append("    menuEvent: '" & menuEvent & "'," & vbCrLf)\r
+    if not IsNothing(RecordName) then script.Append("    RecordName: '" & RecordName & "'," & vbCrLf)\r
+    script.Append("    saveColumnInfo: {width:" & FmtBool(saveColumnWidth) & ", filter:" & FmtBool(saveColumnFilter) & ", sort:" & FmtBool(saveColumnSort) & "}," & vbCrLf)\r
+    if not IsNothing(cookieDays) then script.Append("    cookieDays: " & cookieDays & "," & vbCrLf)\r
+    \r
+    if panels.count > 0 then\r
+      script.Append("    PanelNamesOnTabHdr: " & FmtBool(PanelNamesOnTabHdr) & "," & vbCrLf)\r
+      script.Append("    panels: ['" & join(panels.ToArray(),"','") & "']," & vbCrLf)\r
+    end if\r
+    if not IsNothing(headingSort) then script.Append("    headingSort: '" & headingSort & "'," & vbCrLf)\r
+    if not IsNothing(click)       then script.Append("    click: " & click & "," & vbCrLf)\r
+    if not IsNothing(dblclick)    then script.Append("    dblclick: " & dblclick & "," & vbCrLf)\r
+    if not IsNothing(contextmenu) then script.Append("    contextmenu: " & contextmenu & "," & vbCrLf)\r
+    if FilterLocation >= -1       then script.Append("    FilterLocation: " & FilterLocation & "," & vbCrLf)\r
+    if not IsNothing(FilterAllToken) then script.Append("    FilterAllToken: '" & FilterAllToken & "'," & vbCrLf)\r
+    if FilterBoxMaxLen >= 0       then script.Append("    FilterBoxMaxLen: " & FilterBoxMaxLen & "," & vbCrLf)\r
+    if FilterAnchorLeft           then script.Append("    FilterAnchorLeft: " & FmtBool(FilterAnchorLeft) & "," & vbCrLf)\r
+    if maxPrint >= 0              then script.Append("    maxPrint: " & maxPrint & "," & vbCrLf)\r
+    if dndMgrIdx >= 0             then script.Append("    dndMgrIdx: " & dndMgrIdx & "," & vbCrLf)\r
+    if minPageRows >= 0           then script.Append("    minPageRows: " & minPageRows & "," & vbCrLf)\r
+    if maxPageRows >= 0           then script.Append("    maxPageRows: " & maxPageRows & "," & vbCrLf)\r
+    if defaultWidth > 0           then script.Append("    defaultWidth: " & defaultWidth & "," & vbCrLf)\r
+    \r
+    if formView then\r
+      script.Append("    canAdd: " & FmtBool(canAdd) & "," & vbCrLf)\r
+      script.Append("    canEdit: " & FmtBool(canEdit) & "," & vbCrLf)\r
+      script.Append("    canClone: " & FmtBool(canClone) & "," & vbCrLf)\r
+      script.Append("    canDelete: " & FmtBool(canDelete) & "," & vbCrLf)\r
+      script.Append("    ConfirmDelete: " & FmtBool(ConfirmDelete) & "," & vbCrLf)\r
+      script.Append("    TableSelectNew: '" & TableSelectNew & "'," & vbCrLf)\r
+      script.Append("    TableSelectNone: '" & TableSelectNone & "'," & vbCrLf)\r
+      if panelHeight > 0 then script.Append("    panelHeight: " & panelHeight & "," & vbCrLf)\r
+      if panelWidth > 0 then script.Append("    panelWidth: " & panelWidth & "," & vbCrLf)\r
+      if maxDisplayLen > 0 then script.Append("    maxDisplayLen: " & maxDisplayLen & "," & vbCrLf)\r
+      if not IsNothing(formOpen) then script.Append("    formOpen: " & formOpen & "," & vbCrLf)\r
+      if not IsNothing(formClose) then script.Append("    formClose: " & formClose & "," & vbCrLf)\r
+      if not IsNothing(formSubmit) then script.Append("    formSubmit: " & onSubmitResponse & "," & vbCrLf)\r
+      if not IsNothing(onSubmitResponse) then script.Append("    onSubmitResponse: " & onSubmitResponse & "," & vbCrLf)\r
+      if not IsNothing(showSaveMsg) then script.Append("    showSaveMsg: '" & showSaveMsg & "'," & vbCrLf)\r
+    end if\r
+    script.Append("    columnSpecs   : [" & vbCrLf)\r
+    Dim c as Integer\r
+    for c=0 to columns.count-1\r
+      if c > 0 then script.Append("," & vbCrLf)\r
+      script.Append(CType(columns(c),GridColumn).script)\r
+      if columns(c).ConfirmDeleteColumn then confirmCol=c\r
+    next\r
+    script.Append("]")\r
+    if formView then script.Append("," & vbCrLf & "ConfirmDeleteCol: " & confirmCol)\r
+    script.Append(vbCrLf & "  }" & vbCrLf)\r
+\r
+    ' buffer\r
+\r
+    dim a as New ArrayList()\r
+    script.Append("  " & bufferOptVar & " = {")\r
+    if requestParameters.Count > 0 then\r
+      Dim param As DictionaryEntry\r
+      For Each param In requestParameters\r
+        a.Add(vbCrLf & "      {name:'" & param.Key & "',value:'" & param.Value & "'}")\r
+      Next\r
+      script.Append(vbCrLf & "    requestParameters: [" & String.Join(",", a.ToArray(Type.GetType("System.String"))) & vbCrLf & "    ]")\r
+    end if\r
+    if BufferType="AjaxSQL" then\r
+      if a.Count > 0 then script.Append(",")\r
+      script.Append(vbCrLf & "    TimeOut: " & Session.Timeout & ",")\r
+      script.Append(vbCrLf & "    fmt: '" & fmt & "'")\r
+    end if\r
+    script.Append(vbCrLf & "  }" & vbCrLf)\r
+    script.Append("  " & bufferVar & " = new Rico.Buffer." & BufferType & "('" & dataProvider & "', " & bufferOptVar & ");" & vbCrLf)\r
+\r
+    ' grid\r
+\r
+    script.Append("  " & gridVar & " = new Rico.LiveGrid ('" & Me.UniqueId & "', " & bufferVar & ", " & optionsVar & ");" & vbCrLf)\r
+    if not IsNothing(menuEvent) then\r
+      script.Append("  " & gridVar & ".menu = new Rico.GridMenu();" & vbCrLf)\r
+    end if\r
+\r
+    ' form\r
+\r
+    if formView then\r
+      script.Append("  if(typeof " & Me.UniqueId & "_FormInit=='function') " & Me.UniqueId & "_FormInit();" & vbCrLf)\r
+      script.Append("  " & formVar & "=new Rico.TableEdit(" & gridVar & ");" & vbCrLf)\r
+    end if\r
+\r
+    script.Append("  if(typeof " & Me.UniqueId & "_InitComplete=='function') " & Me.UniqueId & "_InitComplete();" & vbCrLf)\r
+    if not IsNothing(afterInit) then script.Append(afterInit & vbCrLf)\r
+\r
+    script.Append("}" & vbCrLf)\r
+    Return script.ToString\r
+  End Get\r
+End Property\r
+\r
+\r
+' ----------------------------------------------------\r
+' Properties for LiveGridForms\r
+' ----------------------------------------------------\r
+\r
+Public dbConnection as object\r
+Public formView as Boolean = false\r
+Public TableSelectNew as String = "___new___"\r
+Public TableSelectNone as String = ""\r
+Public canAdd as Boolean = true\r
+Public canEdit as Boolean = true\r
+Public canClone as Boolean = false\r
+Public canDelete as Boolean = true\r
+Public ConfirmDelete as Boolean = true\r
+Public RecordName as String\r
+Public PanelNamesOnTabHdr as Boolean = true\r
+Public showSaveMsg as String\r
+Public dbDialect as String\r
+Public panels as New ArrayList()\r
+Public panelHeight as Integer = -1\r
+Public panelWidth as Integer = -1\r
+Public maxDisplayLen as Integer = -1\r
+\r
+' events\r
+Public formOpen as String\r
+Public formClose as String\r
+Public formSubmit as String\r
+Public onSubmitResponse as String\r
+\r
+Public gridVar as String\r
+Public formVar as String\r
+Public bufferVar as String\r
+Public bufferOptVar as String ' name of buffer options js var\r
+Public optionsVar as String   ' name of grid options js var\r
+\r
+Protected Tables as New ArrayList()\r
+Protected _action As String\r
+Protected MainTbl as Integer = -1\r
+\r
+\r
+Public Property TableName() As String\r
+  Get\r
+    if MainTbl >= 0 then\r
+      Return Tables(MainTbl).TblName\r
+    else\r
+      Return Nothing\r
+    end if\r
+  End Get\r
+  Set\r
+    MainTbl=Tables.Count\r
+    dim tab as new AltTable()\r
+    tab.TblName=value\r
+    tab.TblAlias="t"\r
+    AddTable(tab)\r
+  End Set\r
+End Property\r
+\r
+Public Function AddTable(t as AltTable) as Integer\r
+  AddTable=Tables.Count\r
+  if IsNothing(t.TblAlias) then t.TblAlias="a" & Tables.Count\r
+  Tables.Add(t)\r
+End Function\r
+\r
+Public ReadOnly Property action() As String\r
+  Get\r
+    Return _action\r
+  End Get\r
+End Property\r
+\r
+Public ReadOnly Property CurrentField() As GridColumn\r
+  Get\r
+    Return columns(columns.count-1)\r
+  End Get\r
+End Property\r
+\r
+\r
+' ----------------------------------------------------\r
+' Methods\r
+' ----------------------------------------------------\r
+Sub Page_Init()\r
+  formVar=Me.UniqueId & "['edit']"\r
+  gridVar=Me.UniqueId & "['grid']"\r
+  bufferVar=Me.UniqueId & "['buffer']"\r
+  bufferOptVar=Me.UniqueId & "['bufferopt']"\r
+  optionsVar=Me.UniqueId & "['options']"\r
+  dim actionparm as String="_action_" & Me.UniqueId\r
+  _action=trim(Request.QueryString(actionparm))\r
+  if _action="" then _action=trim(Request.Form(actionparm))\r
+  if _action="" then _action="table" else _action=lcase(_action)\r
+\r
+  If Not (_gridHeading Is Nothing) Then\r
+    _gridHeading.InstantiateIn(HdgContainer)\r
+    For Each ctrl As Control In HdgContainer.Controls\r
+      If TypeOf(ctrl) is GridColumn then\r
+        AddColumn(CType(ctrl,GridColumn))\r
+      ElseIf TypeOf(ctrl) is GridPanel then\r
+        panels.Add(CType(ctrl,GridPanel).heading)\r
+      ElseIf TypeOf(ctrl) is AltTable then\r
+        AddTable(ctrl)\r
+      end if\r
+    Next\r
+  End If\r
+\r
+  If Not (_headingTop Is Nothing) Then\r
+    Dim container As New GridContainer()\r
+    _headingTop.InstantiateIn(container)\r
+    LiveGridHeadingsTop.Controls.Add(container)\r
+  End If\r
+  \r
+  If Not (_headingBottom Is Nothing) Then\r
+    Dim container As New GridContainer()\r
+    _headingBottom.InstantiateIn(container)\r
+    LiveGridHeadingsBottom.Controls.Add(container)\r
+  End If\r
+End Sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Adds a new column to grid, returns column index\r
+' -------------------------------------------------------------\r
+Public Function AddColumn(ColumnObj as GridColumn) as integer\r
+  if ColumnObj.isLookupField() then\r
+    \r
+    ' this items get applied to the lookup field instead of the code field\r
+    dim Hdg as string = ColumnObj.Heading\r
+    dim width as integer = ColumnObj.Width\r
+    dim filterUI as string = ColumnObj.filterUI\r
+    dim ConfirmDelete as boolean = ColumnObj.ConfirmDeleteColumn\r
+    dim DescriptionCol as String = ColumnObj.DescriptionCol\r
+\r
+    ColumnObj.Heading=Hdg & " Code"\r
+    ColumnObj.panelIdx=panels.count-1\r
+    ColumnObj.FieldName=ExtFieldId(columns.count)\r
+    ColumnObj.filterUI=Nothing\r
+    ColumnObj.Width=-1\r
+    ColumnObj.visible=false\r
+    ColumnObj.ConfirmDeleteColumn=false\r
+    if not IsNothing(DescriptionCol) then\r
+      ColumnObj.DescriptionField=ExtFieldId(columns.count+1)\r
+    end if\r
+    columns.Add(ColumnObj)\r
+    \r
+    ColumnObj=new GridColumn()\r
+    ColumnObj.filterUI=filterUI\r
+    ColumnObj.Width=width\r
+    ColumnObj.Heading=Hdg\r
+    ColumnObj.ConfirmDeleteColumn=ConfirmDelete\r
+    if IsNothing(DescriptionCol) then\r
+      ColumnObj.Formula=""  ' to be filled in by FormSqlQuery()\r
+    else\r
+      ColumnObj.ColName=DescriptionCol\r
+      ColumnObj.FormView="hidden"\r
+      ColumnObj.EntryType="T"\r
+    end if\r
+  end if\r
+  ColumnObj.panelIdx=panels.count-1\r
+  ColumnObj.FieldName=ExtFieldId(columns.count)\r
+  AddColumn=columns.count\r
+  columns.Add(ColumnObj)\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Adds a new column to grid, returns column index\r
+' -------------------------------------------------------------\r
+Public Function AddCalculatedField(Heading as string, ColumnFormula as string, optional width as integer = -1, optional ClassName as string = "") as GridColumn\r
+  Dim ColumnObj as New GridColumn()\r
+  if left(ColumnFormula,1) <> "(" then ColumnFormula="(" & ColumnFormula & ")"\r
+  ColumnObj.ColName="Calc_" & columns.count\r
+  ColumnObj.Formula=ColumnFormula\r
+  ColumnObj.Heading=Heading\r
+  if width >= 0 then ColumnObj.Width=width\r
+  if ClassName <> "" then ColumnObj.ClassName=ClassName\r
+  AddColumn(ColumnObj)\r
+  AddCalculatedField=ColumnObj\r
+End Function\r
+\r
+\r
+Private Function IsFieldName(s) as boolean\r
+  dim i as integer, c as string\r
+  i=1\r
+  IsFieldName=false\r
+  while i <= len(s)\r
+    c=mid(s,i,1)\r
+    if (c >= "0" and c <= "9" and i > 1) or (c >= "A" and c <= "Z") or (c >= "a" and c <= "z") or (c = "_") then\r
+      i=i+1\r
+    else\r
+      exit function\r
+    end if\r
+  end while\r
+  IsFieldName=(i > 1)\r
+End Function\r
+\r
+\r
+' name used external to this script\r
+Private function ExtFieldId(i) as string\r
+  ExtFieldId=Me.UniqueId & "_" & i\r
+end function\r
+\r
+\r
+Private function FormatValue(v as String, ByVal ColIdx as Integer) as String\r
+  dim addquotes as Boolean = columns(ColIdx).AddQuotes\r
+  select case left(columns(ColIdx).EntryType,1)\r
+    case "I","F":\r
+      addquotes=false\r
+      if not IsNumeric(v) then v=""\r
+    case "N":\r
+      if v=TableSelectNew then\r
+        v=trim(Request.Form("textnew__" & ExtFieldId(ColIdx)))\r
+      elseif v=TableSelectNone then\r
+        v=""\r
+      end if\r
+    case "S","R":\r
+      if v=TableSelectNone then v=""\r
+  end select\r
+  if v="" and columns(ColIdx).isNullable then\r
+    FormatValue="NULL"\r
+  elseif addquotes then\r
+    FormatValue=oSqlCompat.addQuotes(v)\r
+  else\r
+    FormatValue=v\r
+  end if\r
+end function\r
+\r
+\r
+Private function FormatFormValue(idx as Integer) as String\r
+  dim v as String\r
+  if IsNothing(columns(idx).EntryType) then exit function\r
+  if columns(idx).EntryType="H" or columns(idx).FormView="exclude" then\r
+    v=columns(idx).ColData\r
+  else\r
+    v=trim(Request.Form(ExtFieldId(idx)))\r
+  end if\r
+  FormatFormValue=FormatValue(v,idx)\r
+end function\r
+\r
+\r
+Private Function AltTableJoinClause(AltTabIdx as Integer) as String\r
+  dim i as Integer, Condition as String\r
+  for i=0 to columns.Count-1\r
+    if columns(i).TableIdx=MainTbl and columns(i).isKey then\r
+      AddCondition(Condition, Tables(MainTbl).TblAlias & "." & columns(i).ColName & "=" & Tables(AltTabIdx).TblAlias & "." & columns(i).ColName)\r
+    end if\r
+  next\r
+  for i=0 to Tables(AltTabIdx).altFields.Count-1\r
+    if Tables(AltTabIdx).altFields(i).isKey then\r
+      AddCondition(Condition, Tables(AltTabIdx).FieldCondition(i))\r
+    end if\r
+  next\r
+  AltTableJoinClause=Condition\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Add a condition to a where or having clause\r
+' -------------------------------------------------------------\r
+Public Sub AddCondition(ByRef WhereClause as String, ByVal NewCondition as String)\r
+  if IsNothing(NewCondition) then exit sub\r
+  If IsNothing(WhereClause) Then\r
+    WhereClause = "(" & NewCondition & ")"\r
+  Else\r
+    WhereClause &= " AND (" & NewCondition & ")"\r
+  End If\r
+End Sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Return the index of a column based on its column name, or -1 if not found\r
+' -------------------------------------------------------------\r
+Public Function ColIndex(ByVal SearchName as String) as Integer\r
+  dim i as Integer\r
+  ColIndex=-1\r
+  for i=0 to columns.Count-1\r
+    if columns(i).ColName=SearchName then\r
+      ColIndex=i\r
+      Exit Function\r
+    end if\r
+  next\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Return the a column object based on its column name, or Nothing if not found\r
+' -------------------------------------------------------------\r
+Public Function getColumnByName(ByVal SearchName as String) as GridColumn\r
+  dim i as Integer\r
+  for i=0 to columns.Count-1\r
+    if columns(i).ColName=SearchName then\r
+      getColumnByName=columns(i)\r
+      Exit Function\r
+    end if\r
+  next\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Return the index of a table based on its table name\r
+' -------------------------------------------------------------\r
+Public Function TabIndex(ByVal SearchName as String)\r
+  dim i as Integer\r
+  for i=0 to Tables.Count-1\r
+    if Tables(i).TblName=SearchName then\r
+      TabIndex=i\r
+      Exit Function\r
+    end if\r
+  next\r
+End Function\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Return the index of the new filter\r
+' -------------------------------------------------------------\r
+Public Function AddFilter(ByVal newfilter as String)\r
+  AddFilter=_sqlFilters.Count\r
+  _sqlFilters.Add(newfilter)\r
+End Function\r
+\r
+\r
+' form where clause based on table's primary key\r
+Private function TableKeyWhereClause(TabIdx as Integer) as String\r
+  dim i as Integer, w as String\r
+  for i=0 to columns.Count-1\r
+    if (columns(i).TableIdx=MainTbl or columns(i).TableIdx=TabIdx) and IsNothing(columns(i).Formula) and columns(i).isKey then\r
+      AddCondition(w, columns(i).ColName & "=" & FormatValue(trim(Request.Form("_k" & i)),i))\r
+    end if\r
+  next\r
+  if IsNothing(w) then\r
+    'Throw New Exception("no key value")\r
+  else\r
+    TableKeyWhereClause=" WHERE " & w\r
+  end if\r
+end function\r
+\r
+\r
+Protected Sub GetColumnInfo()\r
+  dim t as Integer, r as Integer, c as Integer, colname as String, schemaTable As DataTable\r
+  Dim restrictions(3) As String\r
+  if IsNothing(Me.dbConnection) then exit sub\r
+  for t=0 to Tables.Count-1\r
+    if debug then DebugString &= "<p>Table: " & Tables(t).TblName & " tblidx=" & t & " colcnt=" & columns.Count\r
+\r
+    Dim command = Me.dbConnection.CreateCommand()\r
+    command.CommandText = "select * from " & Tables(t).TblName\r
+    dim rdr = command.ExecuteReader(CommandBehavior.KeyInfo or CommandBehavior.SchemaOnly)\r
+    schemaTable = rdr.GetSchemaTable()\r
+    For Each colinfo As DataRow In schemaTable.Rows\r
+      colname = colinfo("ColumnName").ToString\r
+      for c=0 to columns.Count-1\r
+        if t=columns(c).TableIdx and colname=columns(c).ColName then\r
+          with columns(c)\r
+            .isNullable=CBool(colinfo("AllowDBNull"))\r
+            .TypeName=replace(colinfo("DataType").ToString(),"System.","")\r
+            if .TypeName<>"String" AndAlso not IsDBNull(colinfo("NumericPrecision")) AndAlso colinfo("NumericPrecision")<>0 then\r
+              .Length=colinfo("NumericPrecision")\r
+            elseif not IsDBNull(colinfo("ColumnSize")) then\r
+              .Length=colinfo("ColumnSize")\r
+            end if\r
+            .Writeable=not colinfo("IsReadOnly")\r
+            .isKey=colinfo("IsKey")\r
+            'columns(c).FixedLength=((colinfo("COLUMN_FLAGS") and &H0000010) <> 0)\r
+            if debug then DebugString &= "<br> Column: " & colname & " type=" & .TypeName & " len=" & .Length & " nullable=" & .isNullable & " isKey=" & .isKey\r
+          end with\r
+          exit for\r
+        end if\r
+      next\r
+      \r
+      for c=0 to Tables(t).altFields.Count-1\r
+        if colname=Tables(t).altFields(c).ColName then\r
+          Tables(t).altFields(c).isKey=colinfo("IsKey")\r
+          exit for\r
+        end if\r
+      next\r
+    Next\r
+    rdr.Close()\r
+    \r
+    ' AllowDBNull is not accurate when using Jet driver\r
+    if InStr(Me.dbConnection.ConnectionString,"Microsoft.Jet") > 0 then\r
+      restrictions(2)=Tables(t).TblName\r
+      schemaTable = Me.dbConnection.GetSchema("Columns",restrictions)\r
+      For Each colinfo As DataRow In schemaTable.Rows\r
+        colname = colinfo("column_name").ToString\r
+        for c=0 to columns.Count-1\r
+          if t=columns(c).TableIdx and colname=columns(c).ColName then\r
+            with columns(c)\r
+              .isNullable=CBool(colinfo("is_nullable"))\r
+              if debug then DebugString &= "<br> Column: " & colname & " nullable=" & .isNullable\r
+            end with\r
+            exit for\r
+          end if\r
+        next\r
+      Next\r
+    end if\r
+  Next\r
+End Sub\r
+\r
+\r
+Protected Function UpdateDatabase(sqltext as String, actiontxt as String) as String\r
+  dim cnt as Integer\r
+  if IsNothing(Me.dbConnection) then\r
+    UpdateDatabase="<p>ERROR: no database connection</p>"\r
+  else\r
+    Try\r
+      Dim command = Me.dbConnection.CreateCommand()\r
+      command.CommandText = sqltext\r
+      cnt=command.ExecuteNonQuery()\r
+      UpdateDatabase="<p class='ricoFormResponse " & actiontxt & "Successfully'></p>"\r
+    Catch ex As Exception\r
+      dim msg="<p>ERROR: unable to update database - " & server.HTMLencode(ex.Message.ToString()) & "</p>"\r
+      if LogSqlOnError then msg &= "<br>" & server.HTMLencode(sqltext)\r
+      UpdateDatabase=msg\r
+    End Try\r
+    'if debug then msg &= " - " & sqltext & " - Records affected: " & cnt\r
+  end if\r
+End Function\r
+\r
+\r
+Public Sub DeleteRecord(writer as HTMLTextWriter)\r
+  dim sqltext as String = "DELETE FROM " & Tables(MainTbl).TblName & TableKeyWhereClause(MainTbl)\r
+  writer.WriteLine(UpdateDatabase(sqltext, "deleted"))\r
+End Sub\r
+\r
+\r
+Public Sub InsertRecord(writer as HTMLTextWriter)\r
+  dim i as Integer, keyIdx as Integer\r
+  dim keyCnt as Integer=0\r
+  dim sqlcol as String=""\r
+  dim sqlval as String=""\r
+  for i=0 to columns.Count-1\r
+    if columns(i).TableIdx=MainTbl and not IsNothing(columns(i).EntryType) and columns(i).UpdateOnly=false then\r
+      if columns(i).isKey then\r
+        keyCnt=keyCnt+1\r
+        keyIdx=i\r
+      end if\r
+      if columns(i).Writeable then\r
+        sqlcol &= "," & columns(i).ColName\r
+        sqlval &= "," & FormatFormValue(i)\r
+      end if\r
+    end if\r
+  next\r
+  if IsNothing(sqlcol) then\r
+    writer.WriteLine("<p>Nothing to add</p>")\r
+  else\r
+    dim sqltext as String="insert into " & Tables(MainTbl).TblName & " (" & mid(sqlcol,2) & ") values (" & mid(sqlval,2) & ")"\r
+    dim updateMsg as String = UpdateDatabase(sqltext, "added")\r
+    writer.WriteLine(updateMsg)\r
+  end if\r
+End Sub\r
+\r
+\r
+Public Sub UpdateRecord(writer as HTMLTextWriter)\r
+  dim i as Integer, sqltext as String, errmsg as String=""\r
+  for i=0 to Tables.Count-1\r
+    if i<>MainTbl then errmsg &= UpdateAltTableRecords(i)\r
+  next\r
+  if errmsg<>"" then\r
+    writer.WriteLine("<p>" & errmsg & "</p>")\r
+    exit sub\r
+  end if\r
+  for i=0 to columns.Count-1\r
+    if columns(i).TableIdx=MainTbl and not IsNothing(columns(i).EntryType) and columns(i).Writeable and columns(i).InsertOnly=false then\r
+      sqltext &= "," & columns(i).ColName & "=" & FormatFormValue(i)\r
+    end if\r
+  next\r
+  if not IsNothing(sqltext) then\r
+    sqltext="UPDATE " & Tables(MainTbl).TblName & " SET " & mid(sqltext,2) & TableKeyWhereClause(MainTbl)\r
+    writer.WriteLine(UpdateDatabase(sqltext, "updated"))\r
+  elseif Tables.Count > 1 then\r
+    ' only updated altTable records\r
+    writer.WriteLine("<p class='ricoFormResponse updatedSuccessfully'></p>")\r
+  else\r
+    writer.WriteLine("<p>Nothing to update</p>")\r
+  end if\r
+End Sub\r
+\r
+\r
+Private function UpdateAltTableRecords(tabidx as Integer)\r
+  dim j as Integer, cnt as Integer\r
+  dim sqltext as String, colnames as String, coldata as String\r
+  dim whereClause as String, errmsg as String\r
+\r
+  ' check for existing record\r
+\r
+  whereClause = TableKeyWhereClause(tabidx) & Tables(tabidx).KeyCondition()\r
+  sqltext="select count(*) from " & Tables(tabidx).TblName & " " & Tables(tabidx).TblAlias & whereClause\r
+  Try\r
+    Dim command = Me.dbConnection.CreateCommand()\r
+    command.CommandText = sqltext\r
+    cnt=command.ExecuteScalar()\r
+  Catch ex As Exception\r
+    errmsg = "UpdateAltTableRecords Count<br>ERROR: " & server.HTMLencode(ex.Message.ToString())\r
+    if LogSqlOnError then errmsg &= "<br>" & sqltext\r
+    UpdateAltTableRecords = errmsg\r
+    exit function\r
+  End Try\r
+  \r
+  if cnt = 0 then\r
+\r
+    ' insert new record\r
+  \r
+    colnames=""\r
+    coldata=""\r
+    for j=0 to columns.Count-1\r
+      if (columns(j).TableIdx=tabidx and not IsNothing(columns(j).EntryType)) or columns(j).isKey then\r
+        colnames &= "," & columns(j).ColName\r
+        coldata &= "," & FormatFormValue(j)\r
+      end if\r
+    next\r
+    for j=0 to Tables(tabidx).altFields.Count-1\r
+      colnames &= "," & Tables(tabidx).altFields(j).ColName\r
+      coldata &= "," & Tables(tabidx).altFields(j).Data\r
+    next\r
+    Try\r
+      Dim command = Me.dbConnection.CreateCommand()\r
+      sqltext="insert into " & Tables(tabidx).TblName & " (" & mid(colnames,2) & ") values (" & mid(coldata,2) & ")"\r
+      command.CommandText = sqltext\r
+      cnt=command.ExecuteNonQuery()\r
+    Catch ex As Exception\r
+      errmsg="UpdateAltTableRecords Insert<br>ERROR: " & server.HTMLencode(ex.Message.ToString())\r
+      if LogSqlOnError then errmsg &= "<br>" & sqltext\r
+      UpdateAltTableRecords = errmsg\r
+    End Try\r
+\r
+  else\r
+\r
+    ' update record\r
+  \r
+    sqltext=""\r
+    for j=0 to columns.Count-1\r
+      if columns(j).TableIdx=tabidx and not IsNothing(columns(j).EntryType) then\r
+        sqltext &= "," & columns(j).ColName & "=" & FormatFormValue(j)\r
+      end if\r
+    next\r
+    for j=0 to Tables(tabidx).altFields.Count-1\r
+      sqltext &= "," & Tables(tabidx).altFields(j).ColName & "=" & Tables(tabidx).altFields(j).Data\r
+    next\r
+    if sqltext <> "" then\r
+      Try\r
+        Dim command = Me.dbConnection.CreateCommand()\r
+        sqltext="update " & Tables(tabidx).TblName & " set " & mid(sqltext,2) & whereClause\r
+        command.CommandText = sqltext\r
+        cnt=command.ExecuteNonQuery()\r
+      Catch ex As Exception\r
+        errmsg="UpdateAltTableRecords Update<br>ERROR: " & server.HTMLencode(ex.Message.ToString())\r
+        if LogSqlOnError then errmsg &= "<br>" & sqltext\r
+        UpdateAltTableRecords = errmsg\r
+      End Try\r
+    end if\r
+  end if\r
+end function\r
+\r
+\r
+' -------------------------------------\r
+' form main sql query to populate the grid\r
+' -------------------------------------\r
+Protected Sub FormSqlQuery()\r
+  Dim oParseLookup=new sqlParse\r
+  Dim oParseSubQry=new sqlParse\r
+  Dim i as Integer\r
+  Dim j as Integer\r
+  Dim s as String\r
+  Dim tabidx as Integer\r
+  Dim csvPrimaryKey as String\r
+  if debug then DebugString &= "<p>FormSqlQuery"\r
+  oParseMain.FromClause=Tables(MainTbl).TblName & " t"\r
+  for i=0 to Tables.Count-1\r
+    if i<>MainTbl then\r
+      s="left join " & Tables(i).TblName & " " & Tables(i).TblAlias & " ON " & AltTableJoinClause(i)\r
+      oParseMain.AddJoin(s)\r
+    end if\r
+  next\r
+  oParseMain.AddWhereCondition(TableFilter)\r
+  \r
+  ' build sql for each column\r
+  \r
+  for i=0 to columns.Count-1\r
+    if columns(i).TableIdx>=0 then tabidx=columns(i).TableIdx\r
+    if columns(i).FilterFlag then\r
+      ' add any column filters to where clause\r
+      oParseMain.AddWhereCondition(Tables(tabidx).TblAlias & "." & columns(i).ColName & "='" & columns(i).ColData & "'")\r
+    end if\r
+\r
+    if not IsNothing(columns(i).Formula) then\r
+\r
+      ' computed column\r
+\r
+      oParseMain.AddColumn("(" & columns(i).Formula & ")", columns(i).Heading)\r
+\r
+    elseif tabidx=MainTbl then\r
+\r
+      ' column from main table - avoid subqueries to make it compatible with MS Access & MySQL < v4.1\r
+\r
+      if columns(i).isKey then\r
+        if not IsNothing(csvPrimaryKey) then csvPrimaryKey &= ","\r
+        csvPrimaryKey &= Tables(tabidx).TblAlias & "." & columns(i).ColName\r
+      end if\r
+      if columns(i).isLookupField() and not IsNothing(columns(i).SelectSql) then\r
+        Dim TblAlias as String="t" & CStr(i)\r
+        s=replace(columns(i).SelectSql,"%alias%",TblAlias & ".")\r
+        oParseLookup.ParseSelect(s)\r
+        if oParseLookup.SelectList.count=2 then\r
+          Dim codeField as String=oParseLookup.SelectList(0).sql\r
+          Dim descField as String=oParseLookup.SelectList(1).sql\r
+          If IsFieldName(descField) Then\r
+            descField=TblAlias & "." & descField\r
+          Else\r
+            descField=replace(replace(descField,"%alias%",TblAlias & "."),"%aliasmain%","t.")\r
+          End If\r
+          s="left join " & oParseLookup.FromClause & " " & TblAlias & " on t." & columns(i).ColName & "=" & TblAlias & "." & replace(replace(codeField,"%alias%",""),"%aliasmain%","")\r
+          if not IsNothing(oParseLookup.WhereClause) then s &= " and " & replace(oParseLookup.WhereClause,"%alias%",TblAlias & ".")\r
+          oParseMain.AddJoin(s)\r
+          oParseMain.AddColumn(Tables(tabidx).TblAlias & "." & columns(i).ColName)\r
+          if IsNothing(columns(i).DescriptionCol) then\r
+            columns(i+1).Formula=descField\r
+          end if\r
+            \r
+        else\r
+          Throw New Exception("Invalid lookup query (" & columns(i).SelectSql & ")")\r
+        end if\r
+      else\r
+        oParseMain.AddColumn(Tables(tabidx).TblAlias & "." & columns(i).ColName, columns(i).Heading)\r
+      end if\r
+\r
+    else\r
+\r
+      ' column from alt table - no avoiding subqueries here\r
+\r
+      if columns(i).isLookupField() and not IsNothing(columns(i).SelectSql) then\r
+        oParseLookup.ParseSelect(columns(i).SelectSql)\r
+        if oParseLookup.SelectList.count=2 then\r
+          Dim descQuery as String="select " & oParseLookup.SelectList(1).sql & " from " & oParseLookup.FromClause & " where " & _\r
+            oParseLookup.SelectList(0).sql & "=" & Tables(tabidx).TblAlias & "." & columns(i).ColName\r
+          if not IsNothing(oParseLookup.WhereClause) then descQuery=descQuery & " and " & oParseLookup.WhereClause\r
+          oParseMain.AddColumn(Tables(tabidx).TblAlias & "." & columns(i).ColName)\r
+          columns(i+1).Formula="(" & descQuery & ")"\r
+        else\r
+          Throw New Exception("Invalid lookup query (" & columns(i).SelectSql & ")")\r
+        end if\r
+      else\r
+        oParseMain.AddColumn(Tables(tabidx).TblAlias & "." & columns(i).ColName, columns(i).Heading)\r
+      end if\r
+\r
+    end if\r
+\r
+    if not IsNothing(columns(i).EntryType) then\r
+      Dim SessionColId as String = ExtFieldId(i)\r
+      if InStr("CSNR",left(columns(i).EntryType,1)) > 0 then\r
+        if not IsNothing(columns(i).SelectSql) then\r
+          s=columns(i).SelectSql\r
+          if not IsNothing(columns(i).SelectFilter) then\r
+            oParseLookup.ParseSelect(s)\r
+            oParseLookup.AddWhereCondition(columns(i).SelectFilter)\r
+            s=oParseLookup.UnparseSelect\r
+          end if\r
+          oParseMain.SelectList(i).LookupQuery=replace(replace(s,"%alias%",""),"%aliasmain%","")\r
+        else\r
+          oParseMain.SelectList(i).LookupQuery="select distinct " & columns(i).ColName & " from " & Tables(tabidx).TblName & " where " & columns(i).ColName & " is not null"\r
+        end if\r
+      end if\r
+    end if\r
+  next\r
+  if not IsNothing(DefaultSort) then\r
+    oParseMain.AddSort(DefaultSort)\r
+  elseif not IsNothing(csvPrimaryKey) then\r
+    oParseMain.AddSort(csvPrimaryKey)\r
+  end if\r
+End Sub\r
+\r
+\r
+Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)    \r
+  MyBase.OnPreRender(e)\r
+  if not IsNothing(dbConnection) then\r
+    oSqlCompat=New sqlCompatibilty(dbDialect)\r
+  end if\r
+  \r
+  ' Create headings\r
+  Dim i as Integer\r
+  for i=0 to columns.Count-1\r
+    if not IsNothing(columns(i).AltTable) then\r
+      columns(i).TableIdx=TabIndex(columns(i).AltTable)\r
+    else\r
+      columns(i).TableIdx=MainTbl\r
+    end if\r
+    Dim cell as New TableHeaderCell()\r
+    cell.Text=columns(i).Heading\r
+    if i<frozenColumns then cell.CssClass="ricoFrozen"\r
+    LiveGridHeadingsMain.Controls.Add(cell)\r
+  next\r
+  \r
+  if BufferType="AjaxXML" or not sessions then Me.DisplayTimer=false\r
+  if Tables.count > 0 then\r
+    Me.GetColumnInfo()\r
+    if _action="table" and sessions then\r
+      Me.FormSqlQuery()\r
+      session.contents(Me.UniqueId)=oParseMain\r
+      session.contents(Me.UniqueId & ".filters")=Me._sqlFilters\r
+    elseif _action="query" then\r
+      Me.FormSqlQuery()\r
+    end if\r
+  end if\r
+\r
+  ' populate globalInitScript\r
+  Dim FixedGridScript as String = ""\r
+  Dim VarGridScript as String = ""\r
+  Dim gblFormView as Boolean = false\r
+  If Not Page.IsStartupScriptRegistered("LiveGridInit") Then\r
+    For Each ctrl As Control In Page.Controls\r
+      If TypeOf(ctrl) is LiveGrid then\r
+        if CType(ctrl,LiveGrid).Rows >= 0 then\r
+          FixedGridScript &= "  " & ctrl.UniqueId & "_init" & "();" & vbCrLf\r
+        else\r
+          VarGridScript &= "  " & ctrl.UniqueId & "_init" & "();" & vbCrLf\r
+        end if\r
+        if CType(ctrl,LiveGrid).formView then gblFormView=true\r
+      End If\r
+    Next\r
+    globalInitScript = "Rico.acceptLanguage('" & Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") & "');" & vbCrLf\r
+    if not UsingMinRico then\r
+      globalInitScript &= "Rico.loadModule('LiveGridAjax','LiveGridMenu');" & vbCrLf\r
+      if gblFormView then globalInitScript &= "Rico.loadModule('LiveGridForms');" & vbCrLf\r
+    end if\r
+    globalInitScript &= "Rico.onLoad( function() {" & vbCrLf\r
+    globalInitScript &= FixedGridScript                 ' initialize grids with fixed # of rows first\r
+    globalInitScript &= VarGridScript & "});" & vbCrLf  ' then initialize grids with variable # of rows\r
+    Page.RegisterStartupScript("LiveGridInit", "")\r
+  End If\r
+End Sub\r
+\r
+\r
+Public Class GridContainer\r
+  Inherits Control\r
+  Implements INamingContainer\r
+End Class\r
+\r
+End Class\r
diff --git a/plugins/dotnet/SimpleGrid.ascx b/plugins/dotnet/SimpleGrid.ascx
new file mode 100644 (file)
index 0000000..f913d14
--- /dev/null
@@ -0,0 +1,5 @@
+<%@ Control Language="VB"\r
+    CodeFile="SimpleGrid.ascx.vb" \r
+    Inherits="SimpleGrid" Debug="true" %>\r
+<%@ Register TagPrefix="Rico" TagName="Column" Src="GridColumn.ascx" %>\r
+\r
diff --git a/plugins/dotnet/SimpleGrid.ascx.vb b/plugins/dotnet/SimpleGrid.ascx.vb
new file mode 100644 (file)
index 0000000..c742f03
--- /dev/null
@@ -0,0 +1,347 @@
+Imports System.Data\r
+\r
+Partial Class SimpleGrid\r
+Inherits System.Web.UI.UserControl\r
+\r
+Private _gridHeading As ITemplate = Nothing\r
+Protected HdgContainer As New GridContainer()\r
+\r
+Public columns as New ArrayList()\r
+Public gridVar as String\r
+Public optionsVar as String   ' name of grid options js var\r
+Public FilterLocation as Integer = -2\r
+Public FilterAllToken as String\r
+Public FilterBoxMaxLen as Integer = -1\r
+Public FilterAnchorLeft as Boolean = false  ' when matching text box values, should they match beginning of string (true) or anywhere in string (false)?
+Public UsingMinRico as Boolean = True       ' using minified version of Rico?\r
+Public defaultWidth as Integer = -1         ' if -1, then use unformatted column width, otherwise this is the default width in pixels\r
+Public menuEvent as String\r
+public rows as New ArrayList()\r
+public FrozenCols as Integer\r
+private LastRow,LastHeadingRow,ResizeRowIdx\r
+\r
+\r
+\r
+Sub Page_Init()\r
+  gridVar=Me.UniqueId & "['grid']"\r
+  optionsVar=Me.UniqueId & "['options']"\r
+\r
+  If Not (_gridHeading Is Nothing) Then\r
+    _gridHeading.InstantiateIn(HdgContainer)\r
+    For Each ctrl As Control In HdgContainer.Controls\r
+      If TypeOf(ctrl) is GridColumn then\r
+        columns.Add(ctrl)\r
+      end if\r
+    Next\r
+  End If\r
+End Sub\r
+\r
+\r
+Public Class HeadingCellClass\r
+  Public content As String, span As Integer\r
+\r
+  Public Sub New(Optional contentParm As String = "", Optional spanParm As Integer = 1)\r
+    content=contentParm\r
+    span=spanParm\r
+  End Sub\r
+End Class\r
+\r
+class SimpleGridCell\r
+  public content as String\r
+  private attr As New Hashtable()\r
+\r
+  Public Function HeadingCell() as object\r
+    Dim s as String, span as Integer\r
+    s="<td"\r
+    span=1\r
+    If attr.contains("colspan") Then\r
+      span=CInt(attr("colspan"))\r
+      s &= " colspan='" & span & "'"\r
+    End If\r
+    dim content as String=s & "><div class='ricoLG_col'>" & DataCell("") & "</div></td>"\r
+    dim result() as object = {content,span}\r
+    HeadingCell = result\r
+  End Function\r
+\r
+  Public Function DataCell(rowclass as String) as String\r
+    dim s as String, k as String\r
+    s = "<div"\r
+    attr("class")=trim("ricoLG_cell " & attr("class") & " " & rowclass)\r
+    for each k in attr.keys\r
+      If k<>"colspan" Then s=s & " " & k & "='" & attr(k) & "'"\r
+    next\r
+    s=s & ">" & content & "</div>"\r
+    DataCell=s\r
+  End Function\r
+\r
+  Public Function HtmlCell()\r
+    dim s as String="", k as String\r
+    for each k in attr.keys\r
+      s &= " " & k & "='" & attr(k) & "'"\r
+    next\r
+    HtmlCell="<td" & s & ">" & content & "</td>"\r
+  End Function\r
+\r
+  Public Sub SetAttr(name as String, value as String)\r
+    attr(name)=value\r
+  End Sub\r
+End class\r
+\r
+\r
+class SimpleGridRow\r
+  public cells as New ArrayList()\r
+  private attr As New Hashtable()\r
+  private CurrentCell as SimpleGridCell\r
+\r
+  Public Sub AddCell(ByVal content as String)\r
+    CurrentCell=new SimpleGridCell()\r
+    cells.Add(CurrentCell)\r
+    CurrentCell.content=content\r
+  End Sub\r
+  \r
+  Public Function HeadingRow(ByVal c1 as Integer, ByVal c2 as Integer) as String\r
+    dim s as String, a\r
+    dim cellidx as Integer=0\r
+    dim colidx as Integer=0\r
+    while colidx < c1 and cellidx < cells.count\r
+      a=cells(cellidx).HeadingCell()\r
+      colidx+=CInt(a(1))\r
+      cellidx+=1\r
+    end while\r
+    while (colidx <= c2 or c2=-1) and cellidx < cells.count\r
+      a=cells(cellidx).HeadingCell()\r
+      s &= a(0)\r
+      colidx+=CInt(a(1))\r
+      cellidx+=1\r
+    end while\r
+    HeadingRow = s\r
+  End Function\r
+  \r
+  Public Function HeadingClass()\r
+    HeadingClass=trim("ricoLG_hdg " & attr("class"))\r
+  End Function\r
+  \r
+  Public Function CellCount()\r
+    CellCount=cells.count\r
+  End Function\r
+\r
+  Public Function GetRowAttr(ByVal name)\r
+    GetRowAttr=attr(name)\r
+  End Function\r
+\r
+  Public Sub SetRowAttr(ByVal name, ByVal value)\r
+    attr(name)=value\r
+  End Sub\r
+\r
+  Public Sub SetCellAttr(ByVal name, ByVal value)\r
+    CurrentCell.SetAttr(name,value)\r
+  End Sub\r
+end class\r
+\r
+\r
+Public Function AddHeadingRow(ResizeRowFlag as Boolean)\r
+  LastHeadingRow=AddDataRow()\r
+  if ResizeRowFlag then ResizeRowIdx=LastHeadingRow\r
+  AddHeadingRow=LastHeadingRow\r
+End Function\r
+\r
+Public Function AddDataRow()\r
+  rows.Add(new SimpleGridRow())\r
+  LastRow=rows.count-1\r
+  AddDataRow=LastRow\r
+End Function\r
+\r
+Public Function HeadingRowCount()\r
+  if IsNothing(LastHeadingRow) then\r
+    HeadingRowCount=0\r
+  else\r
+    HeadingRowCount=LastHeadingRow+1\r
+  end if\r
+End Function\r
+\r
+Public Function DataRowCount()\r
+  if IsNothing(LastRow) then\r
+    DataRowCount=0\r
+  else\r
+    DataRowCount=LastRow+1-HeadingRowCount()\r
+  end if\r
+End Function\r
+\r
+' returns # of cells in the current row\r
+Public Function CellCount()\r
+  CellCount=rows(LastRow).CellCount\r
+End Function\r
+\r
+Public Sub AddCell(ByVal content as String)\r
+  rows(LastRow).AddCell(content)\r
+End Sub\r
+\r
+Public Sub AddCellToRow(ByVal RowIdx as Integer, ByVal content as String)\r
+  LastRow=RowIdx\r
+  AddCell(content)\r
+End Sub\r
+\r
+Public Sub SetRowAttr(ByVal name as String, ByVal value as String)\r
+  rows(LastRow).SetRowAttr(name,value)\r
+End Sub\r
+\r
+Public Sub SetCellAttr(ByVal name as String, ByVal value as String)\r
+  rows(LastRow).SetCellAttr(name,value)\r
+End Sub\r
+\r
+Private Function RenderColumns(writer as HTMLTextWriter, c1 as Integer, c2 as Integer)\r
+  dim r as Integer, c as Integer\r
+  for c=c1 to c2\r
+    writer.Write("<td><div class='ricoLG_col'>")\r
+    for r=LastHeadingRow+1 to rows.count-1\r
+      writer.Write(rows(r).cells(c).DataCell(rows(r).GetRowAttr("class")))\r
+    next\r
+    writer.WriteLine("</div></td>")\r
+  next\r
+End Function\r
+\r
+<TemplateContainer(GetType(GridContainer))> _\r
+Public Property GridColumns() As ITemplate\r
+  Get\r
+    Return _gridHeading\r
+  End Get\r
+  Set\r
+    _gridHeading = value\r
+  End Set\r
+End Property\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  dim colcnt as Integer, r as Integer, c as Integer\r
+  if IsNothing(ResizeRowIdx) then exit sub\r
+  colcnt=rows(ResizeRowIdx).CellCount\r
+  \r
+  writer.WriteLine("<script type='text/javascript'>")\r
+  if not UsingMinRico then writer.WriteLine("Rico.loadModule('SimpleGrid');")\r
+  writer.WriteLine("var " & Me.UniqueId & " = {};")\r
+  writer.WriteLine("Rico.onLoad( function() {")\r
+  writer.WriteLine("  " & optionsVar & " = {")\r
+  if FilterLocation >= -1       then writer.WriteLine("    FilterLocation: " & FilterLocation & ",")\r
+  if not IsNothing(FilterAllToken) then writer.WriteLine("    FilterAllToken: '" & FilterAllToken & "',")\r
+  if FilterBoxMaxLen >= 0       then writer.WriteLine("    FilterBoxMaxLen: " & FilterBoxMaxLen & ",")\r
+  if FilterAnchorLeft           then writer.WriteLine("    FilterAnchorLeft: " & lcase(FilterAnchorLeft) & ",")\r
+  if defaultWidth > 0           then writer.WriteLine("    defaultWidth: " & defaultWidth & ",")\r
+  if not IsNothing(menuEvent)   then writer.WriteLine("    menuEvent: '" & menuEvent & "',")\r
+  writer.WriteLine("    columnSpecs: [")\r
+  for c=0 to columns.count-1\r
+    if c > 0 then writer.WriteLine(",")\r
+    writer.Write(CType(columns(c),GridColumn).script)\r
+  next\r
+  writer.WriteLine(vbCrLf & "    ]")\r
+  writer.WriteLine("  };")\r
+  writer.WriteLine("  " & gridVar & "=new Rico.SimpleGrid('" & Me.UniqueId & "', " & optionsVar & ");")\r
+  writer.WriteLine("  if(typeof " & Me.UniqueId & "_InitComplete=='function') " & Me.UniqueId & "_InitComplete();" & vbCrLf)\r
+  writer.WriteLine("});")\r
+  writer.WriteLine("</script>")\r
+  \r
+  writer.Write("<div id='" & Me.UniqueId & "_outerDiv'>")\r
+\r
+  '-------------------\r
+  ' frozen columns\r
+  '-------------------\r
+  writer.WriteLine("<div id='" & Me.UniqueId & "_frozenTabsDiv'>")\r
+\r
+  ' upper left\r
+  writer.WriteLine("<table id='" & Me.UniqueId & "_tab0h' class='ricoLG_table ricoLG_top ricoLG_left' cellspacing='0' cellpadding='0'><thead>")\r
+  for r=0 to LastHeadingRow\r
+    writer.Write("<tr class='" & rows(r).HeadingClass() & "'")\r
+    if r=ResizeRowIdx then writer.Write(" id='" & Me.UniqueId & "_tab0h_main'")\r
+    writer.WriteLine(">")\r
+    writer.Write(rows(r).HeadingRow(0,FrozenCols-1))\r
+    writer.Write("</tr>")\r
+  next\r
+  writer.WriteLine("</thead></table>")\r
+\r
+  ' lower left\r
+  writer.Write("<table id='" & Me.UniqueId & "_tab0' class='ricoLG_table ricoLG_bottom ricoLG_left' cellspacing='0' cellpadding='0'>")\r
+  writer.WriteLine("<tr>")\r
+  RenderColumns(writer,0,FrozenCols-1)\r
+  writer.Write("</tr>")\r
+  writer.WriteLine("</table>")\r
+\r
+  writer.WriteLine("</div>")\r
+\r
+\r
+  '-------------------\r
+  ' scrolling columns\r
+  '-------------------\r
+\r
+  ' upper right\r
+  writer.Write("<div id='" & Me.UniqueId & "_innerDiv'>")\r
+  writer.Write("<div id='" & Me.UniqueId & "_scrollTabsDiv'>")\r
+  writer.WriteLine("<table id='" & Me.UniqueId & "_tab1h' class='ricoLG_table ricoLG_top ricoLG_right' cellspacing='0' cellpadding='0'><thead>")\r
+  for r=0 to LastHeadingRow\r
+    writer.Write("<tr class='" & rows(r).HeadingClass & "'")\r
+    if r=ResizeRowIdx then writer.Write(" id='" & Me.UniqueId & "_tab1h_main'")\r
+    writer.Write(">")\r
+    writer.Write(rows(r).HeadingRow(FrozenCols,-1))\r
+    writer.Write("</tr>")\r
+  next\r
+  writer.Write("</thead></table>")\r
+  writer.Write("</div>")\r
+  writer.WriteLine("</div>")\r
+\r
+  ' lower right\r
+  writer.Write("<div id='" & Me.UniqueId & "_scrollDiv'>")\r
+  writer.Write("<table id='" & Me.UniqueId & "_tab1' class='ricoLG_table ricoLG_bottom ricoLG_right' cellspacing='0' cellpadding='0'>")\r
+  writer.WriteLine("<tr>")\r
+  RenderColumns(writer,FrozenCols,colcnt-1)\r
+  writer.Write("</tr>")\r
+  writer.Write("</table>")\r
+  writer.Write("</div>")\r
+\r
+  writer.WriteLine("</div>")\r
+End Sub\r
+\r
+' Response.Buffer must be true\r
+Public Sub RenderExcel(fileName)\r
+  Dim r as Integer, c as Integer\r
+  Dim sw As New System.IO.StringWriter\r
+\r
+  HttpContext.Current.Response.Clear()\r
+  if fileName<>"" then HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" & fileName)\r
+  HttpContext.Current.Response.ContentType = "application/ms-excel"\r
+\r
+  sw.WriteLine("<table>")\r
+  for r=0 to rows.count-1\r
+    sw.WriteLine("<tr>")\r
+    for c=0 to rows(r).CellCount()-1\r
+      sw.Write(rows(r).cells(c).HtmlCell())\r
+    next\r
+    sw.WriteLine("</tr>")\r
+  next\r
+  sw.WriteLine("</table>")\r
+  HttpContext.Current.Response.Write(sw.ToString)\r
+  HttpContext.Current.Response.End()\r
+End Sub\r
+\r
+' Response.Buffer must be true\r
+Public Sub RenderDelimited(fileName,delim,SubstituteChar)\r
+  Dim r as Integer, c as Integer\r
+  Dim sw As New System.IO.StringWriter\r
+\r
+  HttpContext.Current.Response.Clear()\r
+  if fileName<>"" then HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" & fileName)\r
+  HttpContext.Current.Response.ContentType = "text/csv"\r
+\r
+  for r=0 to rows.count-1\r
+    for c=0 to rows(r).CellCount()-1\r
+      if c > 0 then sw.Write(delim)\r
+      sw.Write(replace(rows(r).cells(c).content,delim,SubstituteChar))\r
+    next\r
+    sw.WriteLine("")\r
+  next\r
+  HttpContext.Current.Response.Write(sw.ToString)\r
+  HttpContext.Current.Response.End()\r
+End Sub\r
+\r
+Public Class GridContainer\r
+  Inherits Control\r
+  Implements INamingContainer\r
+End Class\r
+\r
+End Class\r
diff --git a/plugins/dotnet/ricoResponse.ascx b/plugins/dotnet/ricoResponse.ascx
new file mode 100644 (file)
index 0000000..615de3b
--- /dev/null
@@ -0,0 +1,557 @@
+<%@ Control Language="vb" debug="true" ClassName="ricoResponse" %>\r
+<%@ Register TagPrefix="Rico" TagName="sqlParse" Src="sqlParse.ascx" %>\r
+<%@ Import Namespace="System.Data" %>\r
+<script runat="server">\r
+\r
+Public dbConnection as object\r
+Public dbDialect as String\r
+Protected dbVersion as String\r
+Protected dbClassName as String\r
+Public RequestId as string     \r
+Public offset as integer = 0\r
+Public numrows as integer = 1999\r
+Public AllRowsMax as integer = 1999  ' max # of rows to send if numrows=-1\r
+Public gettotal as Boolean = true\r
+Public distinctCol as integer = -1\r
+Public editCol as integer = -1\r
+Public Headings(-1) as string\r
+Public HiddenCols(-1) as string\r
+Public filters as ArrayList\r
+Public orderByRef = false     ' use column numbers in order by clause? (true/false)\r
+Public Wildcard as String="%"\r
+Public oParse as object       ' parsed sql select statement to execute\r
+Public sqlText as String      ' sql query to execute (either oParse or sqlText must be set prior to rendering)\r
+Public ErrorMsg as String     ' may contain the text of an error message that occurred outside this control prior to rendering\r
+Public HeaderRows as new ArrayList()  ' data that will be inserted before the query results\r
+Public FooterRows as new ArrayList()  ' data that will be appended after the query results\r
+Public fmt as string\r
+Public SendHdg as Boolean = false\r
+Public RenderFlag as Boolean = true\r
+Protected command as object\r
+\r
+' DEBUGGING CONTROL\r
+Public sendDebugMsgs as Boolean = false   ' send details of sql parsing/execution in ajax response? (true/false)\r
+Public LogSqlOnError as Boolean = false   ' include sql statement in results if an error occurs (true/false)\r
+Protected DebugMsgs as new ArrayList()\r
+\r
+\r
+Protected Sub Page_Init(Sender As object, e As EventArgs)\r
+  RequestId = trim(Request.QueryString("id"))\r
+  fmt = trim(Request.QueryString("_fmt"))\r
+  dim sRequestOffset as string = trim(Request.QueryString("offset"))\r
+  dim sRequestSize as string   = trim(Request.QueryString("page_size"))\r
+  dim sRequestTotal as string  = lcase(Request.QueryString("get_total"))\r
+  dim sDistinct as string      = trim(Request.QueryString("distinct"))\r
+  dim sEdit as string          = trim(Request.QueryString("edit"))\r
+  dim sHidden as string        = trim(Request.QueryString("hidden"))\r
+  if not IsNumeric(sRequestOffset) then sRequestOffset="0"\r
+\r
+  if sRequestOffset<>"" then offset=CLng(sRequestOffset)\r
+  if sRequestSize<>"" then numrows=CLng(sRequestSize)\r
+  if sDistinct<>"" then distinctCol=CLng(sDistinct)\r
+  if sEdit<>"" then editCol=CLng(sEdit)\r
+  if sHidden<>"" then HiddenCols=split(sHidden,",")\r
+  gettotal=(sRequestTotal="true")\r
+End Sub\r
+\r
+\r
+Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+  Me.RunQuery(writer)\r
+End Sub\r
+\r
+\r
+'Protected Overrides Sub Render(writer as HTMLTextWriter)\r
+Public Sub RunQuery(writer as HTMLTextWriter)\r
+  Dim SqlRows as integer=0\r
+  dim closetags as string, RowsStart as string, RowsEnd as string\r
+\r
+  if not RenderFlag then exit sub\r
+  Response.clear\r
+  if fmt<>"xl" then\r
+    Response.CacheControl = "no-cache"\r
+    Response.AddHeader("Pragma", "no-cache")\r
+    Response.Expires = -1\r
+  end if\r
+  select case fmt\r
+    case "html":\r
+      Response.ContentType="text/html"\r
+      writer.WriteLine("<html><head></head><body>")\r
+      closetags="</body></html>"\r
+      RowsStart=vbLf & "<table border='1'>"\r
+      RowsEnd=vbLf & "</table>"\r
+      gettotal=false\r
+      sendDebugMsgs=false\r
+      SendHdg=true\r
+    case "xl":\r
+      Response.ContentType="application/vnd.ms-excel"\r
+      writer.WriteLine("<html><head></head><body>")\r
+      closetags="</body></html>"\r
+      RowsStart=vbLf & "<table>"\r
+      RowsEnd=vbLf & "</table>"\r
+      gettotal=false\r
+      sendDebugMsgs=false\r
+      SendHdg=true\r
+    case "json":\r
+      Response.ContentType="application/json"\r
+      writer.Write("{" & vbLf & """id"":""" & RequestId & """")\r
+      RowsStart="," & vbLf & """update_ui"":true," & vbLf & """offset"":" & offset & "," & vbLf & """rows"":["\r
+      RowsEnd=vbLf & "]"\r
+      closetags="}"\r
+    case else:\r
+      ' default to xml\r
+      fmt="xml"\r
+      Response.ContentType="text/xml"\r
+      writer.WriteLine("<?xml version='1.0' encoding='iso-8859-1'?>")\r
+      writer.WriteLine("<ajax-response><response type='object' id='" & RequestId & "'>")\r
+      closetags="</response></ajax-response>"\r
+      RowsStart=vbLf & "<rows update_ui='true' offset='" & offset & "'>"\r
+      RowsEnd=vbLf & "</rows>"\r
+  end select\r
+\r
+  if RequestId="" then\r
+    ErrorMsg="No ID provided!"\r
+  elseif IsNothing(dbConnection) and (not IsNothing(oParse) or not IsNothing(sqlText)) then\r
+    ErrorMsg="No database connection"\r
+  end if\r
+\r
+  if not IsNothing(ErrorMsg) then\r
+    ErrorResponse(writer, ErrorMsg)\r
+  else\r
+\r
+    writer.WriteLine(RowsStart)\r
+    try\r
+      writer.WriteLine(join(HeaderRows.ToArray(),vbLf))\r
+      if not IsNothing(dbConnection) then\r
+        SqlRows=RenderQueryRows(writer)\r
+      end if\r
+      writer.WriteLine(join(FooterRows.ToArray(),vbLf))\r
+      writer.WriteLine(RowsEnd)\r
+      if SqlRows >= 0 and (fmt="xml" or fmt="json") then\r
+        AppendResponse(writer, "rowcount", CStr(SqlRows+HeaderRows.count+FooterRows.count))\r
+      end if\r
+      if sendDebugMsgs then\r
+        AppendArrayResponse(writer, "debug", DebugMsgs.ToArray())\r
+      end if\r
+    Catch ex As Exception\r
+      writer.WriteLine(RowsEnd)\r
+      dim msg as string = ex.Message\r
+      if LogSqlOnError AndAlso not IsNothing(sqlText) then msg &= " - " & sqlText\r
+      ErrorResponse(writer, msg)\r
+    end try\r
+  end if\r
+  writer.WriteLine(closetags)\r
+End Sub\r
+\r
+\r
+Public Sub ErrorResponse(writer as HTMLTextWriter, msg as string)\r
+  AppendResponse(writer,"error",msg)\r
+end sub\r
+\r
+\r
+Public Sub AppendResponse(writer as HTMLTextWriter, tag as string, content as string)\r
+  select case fmt\r
+    case "html", "xl":\r
+      writer.write(vbLf & "<p>" & tag & "<br>" & server.htmlencode(content) & "</p>")\r
+    case "json":\r
+      writer.write("," & vbLf & """" & tag & """:""" & escapeJSON(content) & """")\r
+    case "xml":\r
+      writer.write(vbLf & "<" & tag & ">" & server.htmlencode(content) & "</" & tag & ">")\r
+  end select\r
+end sub\r
+\r
+\r
+Public Sub AppendArrayResponse(writer as HTMLTextWriter, tag as string, arContent as object())\r
+  dim item as string, i as integer\r
+  select case fmt\r
+    case "html", "xl":\r
+      writer.write(vbLf & "<p>" & tag)\r
+      for each item in arContent\r
+        writer.write("<br>" & server.htmlencode(item))\r
+      next\r
+      writer.write("</p>")\r
+    case "json":\r
+      writer.write("," & vbLf & """" & tag & """:[")\r
+      for i=0 to arContent.Length-1\r
+        arContent(i)="""" & escapeJSON(arContent(i)) & """"\r
+      next\r
+      writer.write(join(arContent,",") & "]")\r
+    case "xml":\r
+      for each item in arContent\r
+        writer.write(vbLf & "<" & tag & ">" & server.htmlencode(item) & "</" & tag & ">")\r
+      next\r
+  end select\r
+end sub\r
+\r
+\r
+' returns the total number of rows produced by the query (or -1 if unknown)\r
+Protected Function RenderQueryRows(writer as HTMLTextWriter) As Integer\r
+  dim rowcnt as integer, fldNum as integer, dbDate as DateTime, strFieldItem as String\r
+  dim firstCol as Integer=0, limitQuery as Boolean=false, eof as Boolean=false, n as String\r
+  dim rdr as object\r
+  dim totcnt as Integer=0\r
+\r
+  RenderQueryRows=-1\r
+  dbVersion=dbConnection.ServerVersion\r
+  dbClassName=TypeName(dbConnection)\r
+  command = dbConnection.CreateCommand()\r
+  if not IsNothing(oParse) then\r
+    if distinctCol >= 0 then\r
+      ApplyQStringParms()\r
+      sqlText=oParse.UnparseDistinctColumn(distinctCol)\r
+    elseif editCol >= 0 then\r
+      sqlText=oParse.SelectList(editCol).LookupQuery\r
+      oParse=new sqlParse()\r
+      oParse.ParseSelect(sqlText)\r
+      ApplyQStringParms()\r
+      sqlText=oParse.UnparseSelect()\r
+    elseif numrows < 0 then\r
+      ApplyQStringParms()\r
+      sqlText=oParse.UnparseSelectSkip(HiddenCols)\r
+    else\r
+      ApplyQStringParms()\r
+      select case dbDialect\r
+        case "TSQL":\r
+          if left(dbVersion,2) >= "09" then\r
+            sqlText=oParse.UnparseWithRowNumber(offset,numrows+1,true,HiddenCols)\r
+            firstCol=1\r
+            limitQuery=true\r
+          else\r
+            sqlText=oParse.UnparseSelectSkip(HiddenCols)\r
+          end if\r
+        case "Oracle": \r
+          sqlText=oParse.UnparseWithRowNumber(offset,numrows+1,false,HiddenCols)\r
+          firstCol=1\r
+          limitQuery=true\r
+        case "MySQL":\r
+          sqlText=oParse.UnparseSelectSkip(HiddenCols) & " LIMIT " & offset & "," & CStr(numrows+1)\r
+          limitQuery=true\r
+        case else:\r
+          sqlText=oParse.UnparseSelectSkip(HiddenCols)\r
+      end select  \r
+    end if\r
+  end if\r
+  if IsNothing(sqlText) then Exit Function\r
+  DebugMsgs.add(sqlText)\r
+  DebugMsgs.add(dbClassName)\r
+  DebugMsgs.add("DB version=" & dbVersion)\r
+  command.CommandText = sqlText\r
+  rdr = command.ExecuteReader()\r
+\r
+  if limitQuery then\r
+    totcnt=offset\r
+  else\r
+    while (totcnt < offset) and (not eof)\r
+      if rdr.Read() then\r
+        totcnt += 1\r
+      else\r
+        eof=true\r
+      end if\r
+    end while\r
+  end if\r
+\r
+  rowcnt=0\r
+  if numrows < 0 then numrows=AllRowsMax\r
+  if fmt="json" then\r
+    if SendHdg then\r
+      writer.Write(vbLf & "[")\r
+      for fldNum=firstCol to rdr.FieldCount -1\r
+        if IsNothing(oParse) then\r
+          n=Nothing\r
+        else\r
+          n=oParse.Headings(fldNum-firstCol)\r
+        end if\r
+        if IsNothing(n) then n=rdr.GetName(fldNum)\r
+        writer.Write("""" & escapeJSON(n) & """")\r
+      next\r
+      writer.Write("]")\r
+    end if\r
+    while (rowcnt < numrows) and (not eof)\r
+      if rdr.Read() then\r
+        if rowcnt > 0 or SendHdg then writer.Write(",")\r
+        writer.Write(vbLf & "[")\r
+        for fldNum = firstCol to rdr.FieldCount -1\r
+          strFieldItem = ""\r
+          if not rdr.IsDBNull(fldNum) then\r
+            select case rdr.GetFieldType(fldNum).Name\r
+              case "DateTime":\r
+                dbDate=rdr.GetDateTime(fldNum)\r
+                strFieldItem = replace(dbDate.ToString("s"),"T"," ")  ' convert to ISO-8601 format\r
+              case else:\r
+                strFieldItem = escapeJSON(rdr.GetValue(fldNum))\r
+            end select\r
+          end if\r
+          if fldNum > firstCol then writer.Write(",")\r
+          writer.Write("""" & strFieldItem & """")\r
+        next\r
+        writer.Write("]")\r
+        rowcnt += 1\r
+      else\r
+        eof=true\r
+      end if\r
+    end while\r
+  else\r
+    if SendHdg then\r
+      writer.Write(vbLf & "<tr>")\r
+      for fldNum=firstCol to rdr.FieldCount -1\r
+        if IsNothing(oParse) then\r
+          n=Nothing\r
+        else\r
+          n=oParse.Headings(fldNum-firstCol)\r
+        end if\r
+        if IsNothing(n) then n=rdr.GetName(fldNum)\r
+        writer.Write("<td>" & server.HTMLEncode(n) & "</td>")\r
+      next\r
+      writer.Write("</tr>")\r
+    end if\r
+    while (rowcnt < numrows) and (not eof)\r
+      if rdr.Read() then\r
+        rowcnt += 1\r
+        writer.Write("<tr>")\r
+        for fldNum = firstCol to rdr.FieldCount -1\r
+          strFieldItem = ""\r
+          if not rdr.IsDBNull(fldNum) then\r
+            select case rdr.GetFieldType(fldNum).Name\r
+              case "DateTime":\r
+                dbDate=rdr.GetDateTime(fldNum)\r
+                strFieldItem = replace(dbDate.ToString("s"),"T"," ")  ' convert to ISO-8601 format\r
+              case else:\r
+                strFieldItem = server.HTMLEncode(rdr.GetValue(fldNum))\r
+            end select\r
+          end if\r
+          writer.Write("<td>" & strFieldItem & "</td>")\r
+        next\r
+        writer.Write("</tr>")\r
+      else\r
+        eof=true\r
+      end if\r
+    end while\r
+  end if\r
+  totcnt += rowcnt\r
+\r
+  if not eof and gettotal then\r
+    if limitQuery then\r
+      rdr.Close()\r
+      dim countSql,cnt\r
+      countSql="SELECT " & oParse.UnparseColumnList() & " FROM " & oParse.FromClause\r
+      if not IsNothing(oParse.WhereClause) then countSql &= " WHERE " & oParse.WhereClause\r
+      if oParse.GroupBy.count > 0 then countSql &= " GROUP BY " & join(oParse.GroupBy.ToArray(),",")\r
+      if not IsNothing(oParse.HavingClause) then countSql &= " HAVING " & oParse.HavingClause\r
+      countSql="SELECT COUNT(*) FROM (" & countSql & ")"\r
+      if dbDialect<>"Oracle" then countSql &= " AS rico_Main"\r
+      DebugMsgs.add(countSql)\r
+      command.CommandText = countSql\r
+      totcnt = command.ExecuteScalar()\r
+      eof=true\r
+    else\r
+      while rdr.Read()\r
+        totcnt += 1\r
+      end while\r
+      eof=true\r
+    end if\r
+  end if\r
+  if eof then RenderQueryRows=totcnt\r
+  rdr.Close()\r
+End Function\r
+\r
+\r
+' returns the parameter symbol to insert into the sql string\r
+Private Function PushParam(ByVal newvalue) as String\r
+  dim ParamName as String\r
+  newvalue=cstr(newvalue)\r
+  if newvalue="" then newvalue=" "  ' empty string gets converted to TEXT data type instead of VARCHAR\r
+  select case dbClassName\r
+    case "SqlConnection":\r
+      ParamName="@P" & CStr(command.parameters.count)\r
+      PushParam=ParamName\r
+    case else:\r
+      ParamName=""\r
+      PushParam="?"\r
+  end select\r
+  command.parameters.add(ParamName,newvalue)\r
+  DebugMsgs.add("Param " & ParamName & " value=" & newvalue)\r
+End Function\r
+\r
+\r
+' assumes oParse is already initialized\r
+Private sub ApplyQStringParms()\r
+  dim i, a, flen\r
+  dim j as Integer, fop as String, ParamSymbol as String\r
+  dim newfilter as string, qs as string, value as string\r
+\r
+  for each qs in Request.QueryString\r
+    select case left(qs,1)\r
+      \r
+      ' user-invoked condition\r
+      case "w","h":\r
+        i=mid(qs,2)\r
+        if IsNumeric(i) then\r
+          i=CInt(i)\r
+          if i<0 or i>=filters.Count then exit for\r
+          value=Request.QueryString(qs)\r
+          newfilter=filters(i)\r
+          j=InStr(1,newfilter," in (?)",1)\r
+          if j>0 then\r
+            a=split(value,",")\r
+            for i=0 to ubound(a)\r
+              ParamSymbol=PushParam(a(i))\r
+              a(i)=ParamSymbol\r
+            next\r
+            newfilter=left(newfilter,j+4) & join(a,",") & mid(newfilter,j+6)\r
+          elseif InStr(newfilter,"?")>0 then\r
+            ParamSymbol=PushParam(value)\r
+            if ParamSymbol<>"?" then newfilter=replace(newfilter,"?",ParamSymbol)\r
+          end if\r
+          if left(qs,1)="h" then\r
+            oParse.AddHavingCondition(newfilter)\r
+          else\r
+            oParse.AddWhereCondition(newfilter)\r
+          end if\r
+        end if\r
+      \r
+      ' sort\r
+      case "s":\r
+        i=mid(qs,2)\r
+        if not IsNumeric(i) then exit for\r
+        i=CInt(i)\r
+        if i<0 or i>=oParse.SelectList.count then exit for\r
+        value=ucase(left(Request.QueryString(qs),4))\r
+        if value<>"ASC" and value<>"DESC" then value="ASC"\r
+        if orderByRef then\r
+          oParse.AddSort(CStr(i+1) & " " & value)\r
+        else\r
+          oParse.AddSort(oParse.SelectList(i).sql & " " & value)\r
+        end if\r
+      \r
+      ' user-supplied filter\r
+      case "f":\r
+        a=split(qs,"[")\r
+        if ubound(a)=2 then\r
+          if a(2)="op]" then\r
+            i=left(a(1),len(a(1))-1)\r
+            if not IsNumeric(i) then exit for\r
+            if len(i)>3 then exit for\r
+            i=CInt(i)\r
+            if i<0 or i>oParse.SelectList.count then exit for\r
+            fop=Request.QueryString(qs)\r
+            newfilter=oParse.SelectList(i).sql\r
+            select case fop\r
+              case "EQ":\r
+                newfilter = "(" & AddCoalesce(newfilter) & " IN " & GetMultiParmFilter(qs) & ")"\r
+              case "LE":\r
+                newfilter &= "<=" & PushParam(Request.QueryString(replace(qs,"[op]","[0]")))\r
+              case "GE":\r
+                newfilter &= ">=" & PushParam(Request.QueryString(replace(qs,"[op]","[0]")))\r
+              case "NULL": newfilter &= " is null"\r
+              case "NOTNULL": newfilter &= " is not null"\r
+              case "LIKE":\r
+                newfilter &= " LIKE " & PushParam(replace(Request.QueryString(replace(qs,"[op]","[0]")),"*",Wildcard))\r
+              case "NE"\r
+                newfilter = "(" & AddCoalesce(newfilter) & " NOT IN " & GetMultiParmFilter(qs) & ")"\r
+            end select\r
+            dim sql=oParse.SelectList(i).sql\r
+            if (InStr(sql,"min(")>0 or _\r
+               InStr(sql,"max(")>0 or _\r
+               InStr(sql,"sum(")>0 or _\r
+               InStr(sql,"count(")>0) and _\r
+               InStr(sql,"(select ")<1 then\r
+              oParse.AddHavingCondition(newfilter)\r
+            else\r
+              oParse.AddWhereCondition(newfilter)\r
+            end if\r
+          end if\r
+        end if\r
+    end select\r
+  next\r
+end sub\r
+\r
+\r
+Private function AddCoalesce(newfilter as String) as String\r
+  if dbDialect="Access" then\r
+    newfilter="iif(IsNull(" & newfilter & "),''," & newfilter & ")"\r
+  else\r
+    newfilter="coalesce(" & newfilter & ",'')"\r
+  end if\r
+  AddCoalesce=newfilter\r
+end function\r
+\r
+\r
+Private function GetMultiParmFilter(qs as String) as String\r
+  dim flenStr as String = Request.QueryString(replace(qs,"[op]","[len]"))\r
+  if not IsNumeric(flenStr) then exit function\r
+  dim flen as Integer = CInt(flenStr)\r
+  dim j as Integer, param as String, filter as String = ""\r
+  for j=0 to flen-1\r
+    if j>0 then filter &= ","\r
+    param=Request.QueryString(replace(qs,"[op]","[" & j & "]"))\r
+    filter &= PushParam(param)\r
+  next\r
+  GetMultiParmFilter = "(" & filter & ")"\r
+end function\r
+\r
+\r
+Public function XmlStringCell(value as object) as String\r
+  dim result\r
+  if IsDBNull(value) then result="" else result=server.HTMLEncode(value)\r
+  XmlStringCell="<td>" & result & "</td>"\r
+end function\r
+\r
+\r
+' for the root node, parentID should "" (empty string)\r
+' containerORleaf: L/zero (leaf), C/non-zero (container)\r
+' selectable:      0->not selectable, 1->selectable\r
+Public function WriteTreeRow(parentID,ID,description,containerORleaf,selectable)\r
+  HeaderRows.Add(TreeRow(parentID,ID,description,containerORleaf,selectable))\r
+end function\r
+\r
+Public function TreeRow(parentID,ID,description,containerORleaf,selectable)\r
+  TreeRow="<tr>" & XmlStringCell(parentID) & XmlStringCell(ID) & XmlStringCell(description) & XmlStringCell(containerORleaf) & XmlStringCell(selectable) & "</tr>"\r
+end function\r
+\r
+'******************************************************************************************\r
+'' @SDESCRIPTION:   takes a given string and makes it JSON valid (http://json.org/)\r
+'' @AUTHOR: Michael Rebec\r
+'' @DESCRIPTION:    all characters which needs to be escaped are beeing replaced by their\r
+''          unicode representation according to the\r
+''          RFC4627#2.5 - http://www.ietf.org/rfc/rfc4627.txt?number=4627\r
+'' @PARAM:      val [string]: value which should be escaped\r
+'' @RETURN:   [string] JSON valid string\r
+'******************************************************************************************\r
+public function escapeJSON(val)\r
+    const cDoubleQuote = &h22\r
+    const cRevSolidus = &h5C\r
+    const cSolidus = &h2F\r
+    dim i as integer, currentDigit as string\r
+\r
+    for i = 1 to (len(val))\r
+        currentDigit = mid(val, i, 1)\r
+        if asc(currentDigit)> &h00 and asc(currentDigit) <&h1F then\r
+            currentDigit = escapeJSONSquence(currentDigit)\r
+        elseif asc(currentDigit)>= &hC280 and asc(currentDigit) <= &hC2BF then\r
+            currentDigit = "\u00" + right(padLeft(hex(asc(currentDigit) - &hC200), 2, 0), 2)\r
+        elseif asc(currentDigit)>= &hC380 and asc(currentDigit) <= &hC3BF then\r
+            currentDigit = "\u00" + right(padLeft(hex(asc(currentDigit) - &hC2C0), 2, 0), 2)\r
+        else\r
+            select case asc(currentDigit)\r
+                case cDoubleQuote: currentDigit = escapeJSONSquence(currentDigit)\r
+                case cRevSolidus: currentDigit = escapeJSONSquence(currentDigit)\r
+                case cSolidus: currentDigit = escapeJSONSquence(currentDigit)\r
+            end select\r
+        end if\r
+        escapeJSON = escapeJSON & currentDigit\r
+    next\r
+end function\r
\r
+function escapeJSONSquence(digit)\r
+    escapeJSONSquence = "\u00" + right(padLeft(hex(asc(digit)), 2, 0), 2)\r
+end function \r
\r
+function padLeft(value, totalLength, paddingChar)\r
+    padLeft = right(clone(paddingChar, totalLength) & value, totalLength)\r
+end function\r
\r
+public function clone(byVal str, n)\r
+    dim i as integer\r
+    for i = 1 to n : clone = clone & str : next\r
+end function\r
+\r
+</script>\r
diff --git a/plugins/dotnet/sqlCompatibilty.ascx b/plugins/dotnet/sqlCompatibilty.ascx
new file mode 100644 (file)
index 0000000..8e34e52
--- /dev/null
@@ -0,0 +1,3 @@
+<%@ Control Language="VB"\r
+    CodeFile="sqlCompatibilty.ascx.vb" \r
+    Inherits="sqlCompatibilty" %>\r
diff --git a/plugins/dotnet/sqlCompatibilty.ascx.vb b/plugins/dotnet/sqlCompatibilty.ascx.vb
new file mode 100644 (file)
index 0000000..5d8ba46
--- /dev/null
@@ -0,0 +1,104 @@
+Partial Class sqlCompatibilty\r
+Inherits System.Web.UI.UserControl\r
+\r
+' ---------------------------------------------------------------------------\r
+' Functions to allow cross-db compatibility within Rico\r
+'\r
+' SQL dialect possible values: Access, Oracle, TSQL (MS SQL Server)\r
+' ---------------------------------------------------------------------------\r
+\r
+Protected Dialect as String\r
+\r
+Sub New(dbDialect as String)\r
+  Dialect=dbDialect\r
+End Sub\r
+\r
+Sub New()\r
+End Sub\r
+\r
+Sub SetDialectFromProvider(Provider as String)\r
+  Provider=ucase(Provider)\r
+  if Provider="SQLOLEDB" then\r
+    Dialect="TSQL"\r
+  elseif InStr(Provider,"ORACLE")>0 then\r
+    Dialect="Oracle"\r
+  elseif InStr(Provider,"JET")>0 then\r
+    Dialect="Access"\r
+  else\r
+    Throw New Exception("Unknown ADO provider")\r
+  end if\r
+End Sub\r
+\r
+Public function CurrentTime() as String\r
+  select case Dialect\r
+    case "TSQL","DB2": CurrentTime="CURRENT_TIMESTAMP"\r
+    case "Access": CurrentTime="Now()"\r
+    case else: CurrentTime="LOCALTIMESTAMP"\r
+  end select\r
+end function\r
+\r
+Public function Convert2Char(s as String) as String\r
+  select case Dialect\r
+    case "TSQL"  : Convert2Char="cast(" & s & " as varchar)"\r
+    case "Access": Convert2Char="CStr(" & s & ")"\r
+    case "DB2"   : Convert2Char="CHAR(" & s & ")"\r
+    case "Oracle": Convert2Char="cast(" & s & " as varchar2(20))"\r
+    case else: Convert2Char=s   ' implicit conversion (MySQL)\r
+  end select\r
+end function\r
+\r
+Public function Wildcard() as String\r
+  Wildcard="%"\r
+end function\r
+\r
+Public function SqlDay(s as String) as String\r
+  select case Dialect\r
+    case "Oracle": SqlDay="to_char(" & s & ",'DD')"\r
+    case "MySQL":  SqlDay="dayofmonth(" & s & ")"\r
+    case else: SqlDay="day(" & s & ")"\r
+  end select\r
+end function\r
+\r
+Public function SqlMonth(s as String) as String\r
+  select case Dialect\r
+    case "Oracle": SqlMonth="to_char(" & s & ",'MM')"\r
+    case else: SqlMonth="month(" & s & ")"\r
+  end select\r
+end function\r
+\r
+Public function SqlYear(s as String) as String\r
+  select case Dialect\r
+    case "Oracle": SqlYear="to_char(" & s & ",'YYYY')"\r
+    case else: SqlYear="year(" & s & ")"\r
+  end select\r
+end function\r
+\r
+Public function addQuotes(s as String) as String\r
+  select case Dialect\r
+    case "Access":\r
+      if IsDate(s) then\r
+        addQuotes="#" & s & "#"\r
+      else\r
+        addQuotes="""" & replace(s,"""","""""") & """"\r
+      end if\r
+    case "MySQL":  addQuotes="'" & replace(replace(s,"\","\\"),"'","\'") & "'"\r
+    case else:     addQuotes="'" & replace(s,"'","''") & "'"\r
+  end select\r
+end function\r
+\r
+Public function Concat(arStrings() as String, addQuotes as Boolean) as String\r
+  dim i as Integer\r
+  if addQuotes then\r
+    For Each i in arStrings\r
+      'arStrings(i)=addQuotes(arStrings(i))\r
+    next\r
+  end if\r
+  select case Dialect\r
+    case "TSQL": Concat=join(arStrings,"+")\r
+    case "Access": Concat=join(arStrings," & ")\r
+    case "MySQL": Concat="concat(" & join(arStrings,",") & ")"\r
+    case else: Concat=join(arStrings," || ")\r
+  end select\r
+end function\r
+\r
+End Class\r
diff --git a/plugins/dotnet/sqlParse.ascx b/plugins/dotnet/sqlParse.ascx
new file mode 100644 (file)
index 0000000..20e6a77
--- /dev/null
@@ -0,0 +1,5 @@
+<%@ Control Language="VB"\r
+    CodeFile="sqlParse.ascx.vb" \r
+    Inherits="sqlParse" %>\r
+<%@ Import Namespace="System.Data" %>\r
+<%@ Import Namespace="System.Data.OleDb" %>\r
diff --git a/plugins/dotnet/sqlParse.ascx.vb b/plugins/dotnet/sqlParse.ascx.vb
new file mode 100644 (file)
index 0000000..e525624
--- /dev/null
@@ -0,0 +1,382 @@
+Partial Class sqlParse\r
+Inherits System.Web.UI.UserControl\r
+Implements ICloneable\r
+\r
+Public Class sqlColumn\r
+  Public sql As String, name As String\r
+  Public LookupQuery As String ' query to populate column\r
+\r
+  Public Sub New(Optional sqlParm As String = "", Optional nameParm As String = "")\r
+    if sqlParm<>"" then sql=sqlParm\r
+    if nameParm<>"" then name=nameParm\r
+  End Sub\r
+\r
+  Public function Unparse()\r
+    dim s As String=sql\r
+    if not IsNothing(name) then\r
+      s &= " AS " & name\r
+    end if\r
+    Unparse=s\r
+  end Function\r
+End Class\r
+\r
+\r
+\r
+'********************************************************************************************************\r
+' Parse SQL a statement\r
+'********************************************************************************************************\r
+\r
+Public IsDistinct As Boolean\r
+Public SelectList As New ArrayList()\r
+Public GroupBy As New ArrayList()\r
+Public OrderBy As New ArrayList()\r
+Public FromClause As String, WhereClause As String, HavingClause As String\r
+Public Headings As New ArrayList()  ' set after an any unparse* call\r
+\r
+Public Function Clone As Object Implements ICloneable.Clone\r
+  Dim NewObj as object = Me.MemberwiseClone, item as String\r
+  ' shallow copy of OrderBy is insufficient because it may be modified by ricoResponse.ascx\r
+  NewObj.OrderBy = New ArrayList()\r
+  for each item in Me.OrderBy\r
+    NewObj.OrderBy.Add(item)\r
+  next\r
+  Return NewObj\r
+End Function\r
+\r
+' -------------------------------------------------------------\r
+' Rebuilds a SQL select statement that was parsed by ParseSelect\r
+' -------------------------------------------------------------\r
+Private Function Unparse(arSkipCols) As String\r
+  dim sqltext As String = "SELECT "\r
+  if IsDistinct then sqltext &= "DISTINCT "\r
+  sqltext &= UnparseColumnListSkip(arSkipCols) & " FROM " & FromClause\r
+  if not IsNothing(WhereClause) then sqltext &= " WHERE " & WhereClause\r
+  if GroupBy.count > 0 then sqltext &= " GROUP BY " & join(GroupBy.ToArray(),",")\r
+  if not IsNothing(HavingClause) then sqltext &= " HAVING " & HavingClause\r
+  if OrderBy.count > 0 then sqltext &= " ORDER BY " & join(OrderBy.ToArray(),",")\r
+  Unparse=sqltext\r
+end Function\r
+\r
+\r
+Public Function UnparseSelect() As String\r
+  dim arSkipCols(-1) as string\r
+  UnparseSelect=Unparse(arSkipCols)\r
+end Function\r
+\r
+\r
+Public function UnparseSelectSkip(arSkipCols)\r
+  UnparseSelectSkip=Unparse(arSkipCols)\r
+end Function\r
+\r
+\r
+Public Function UnparseSelectDistinct() As String\r
+  dim arSkipCols(-1) as string\r
+  IsDistinct=true\r
+  UnparseSelectDistinct=Unparse(arSkipCols)\r
+end Function\r
+\r
+\r
+Public Function UnparseDistinctColumn(colnum as integer) As String\r
+  dim sqltext As String\r
+  sqltext="SELECT DISTINCT " & SelectList(colnum).sql & " FROM " & FromClause\r
+  if not IsNothing(WhereClause) then sqltext &= " WHERE " & WhereClause\r
+  Headings.Clear()\r
+  Headings.Add(SelectList(colnum).name)\r
+  UnparseDistinctColumn=sqltext\r
+end Function\r
+\r
+\r
+Public function UnparseColumnList() As String\r
+  dim strSelectList As New ArrayList(), i as integer, sql as String\r
+  Headings.Clear()\r
+  for i=0 to SelectList.count-1\r
+    strSelectList.Add(SelectList(i).sql & " AS rico_col" & i)\r
+    Headings.Add(SelectList(i).name)\r
+  next\r
+  UnparseColumnList=join(strSelectList.ToArray(),",")\r
+end Function\r
+\r
+\r
+Public function UnparseColumnListSkip(arSkipCols() as String) As String\r
+  dim strSelectList As New ArrayList(), i as integer\r
+  dim SkipIdx as integer=0, skip as boolean\r
+  Headings.Clear()\r
+  for i=0 to SelectList.count-1\r
+    skip=false\r
+    if SkipIdx < arSkipCols.Length then\r
+      skip=CBool(arSkipCols(SkipIdx)=CStr(i))\r
+      if skip then SkipIdx+=1\r
+    end if\r
+    if not skip then\r
+      strSelectList.Add(SelectList(i).sql & " AS rico_col" & i)\r
+      Headings.Add(SelectList(i).name)\r
+    end if\r
+  next\r
+  UnparseColumnListSkip=join(strSelectList.ToArray(),",")\r
+end Function\r
+\r
+\r
+' returns a "windowed" select query\r
+' includeAS should be true for SQL Server 2005+ and false for Oracle\r
+Public function UnparseWithRowNumber(offset as Integer, numrows as Integer, includeAS as Boolean, arSkipCols() as String) as String\r
+  dim unparseText as String\r
+  if OrderBy.count = 0 then Throw New Exception("an OrderBy clause is required")\r
+  unparseText="SELECT ROW_NUMBER() OVER (ORDER BY " & join(OrderBy.ToArray(),",") & ") AS rico_rownum," & UnparseColumnListSkip(arSkipCols) & " FROM " & FromClause\r
+  if not IsNothing(WhereClause) then unparseText &= " WHERE " & WhereClause\r
+  if GroupBy.count > 0 then unparseText &= " GROUP BY " & join(GroupBy.ToArray(),",")\r
+  if not IsNothing(HavingClause) then unparseText &= " HAVING " & HavingClause\r
+  unparseText="SELECT * FROM (" & unparseText & ")"\r
+  if includeAS then unparseText &= " AS rico_Main"\r
+  unparseText &= " WHERE rico_rownum > " & offset & " AND rico_rownum <= " & CStr(offset+numrows)\r
+  UnparseWithRowNumber=unparseText\r
+end Function\r
+\r
+\r
+Public sub Init()\r
+  SelectList.Clear()\r
+  GroupBy.Clear()\r
+  OrderBy.Clear()\r
+  FromClause=Nothing\r
+  WhereClause=Nothing\r
+  HavingClause=Nothing\r
+  IsDistinct=false\r
+end sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Parse a SQL select statement into its major components\r
+' Does not handle:\r
+' 1) union queries\r
+' 2) select into\r
+' 3) more than one space between "group" and "by", or "order" and "by"\r
+' 4) stored procedures\r
+' -------------------------------------------------------------\r
+Public function ParseSelect(ByVal sqltext as String) As Boolean\r
+  dim i As Integer, j As Integer, l As Integer, idx As Integer, parencnt As Integer\r
+  dim clause As String, ch As String, curfield As String, nexttoken As String, inquote As Boolean, endquote As String\r
+  Init()\r
+  ParseSelect=false\r
+  sqltext=replace(sqltext,vbLf," ")\r
+  sqltext=" " & replace(sqltext,vbCr," ") & " SELECT "   ' SELECT suffix forces last curfield to be saved\r
+  'response.write "<p>ParseSelect: " & sqltext & "</p>"\r
+  l=len(sqltext)\r
+  parencnt=0\r
+  inquote=false\r
+  i=1\r
+  curfield=""\r
+  while i<l\r
+    ch=mid(sqltext,i,1)\r
+    if inquote then\r
+      if ch=endquote then\r
+        if endquote="'" and mid(sqltext,i,2)="''" then\r
+          curfield &= "'"\r
+          i=i+1\r
+        else\r
+          inquote=false\r
+        end if\r
+      end if\r
+      curfield &= ch\r
+    elseif ch="'" or ch="""" or ch="`" then\r
+      inquote=true\r
+      endquote=ch\r
+      curfield &= ch\r
+    elseif ch="[" then\r
+      inquote=true\r
+      endquote="]"\r
+      curfield &= ch\r
+    elseif ch="(" then\r
+      parencnt=parencnt+1\r
+      curfield &= ch\r
+    elseif ch=")" then\r
+      if parencnt=0 then exit function  ' sql statement has a syntax error\r
+      parencnt=parencnt-1\r
+      curfield &= ch\r
+    elseif parencnt > 0 then\r
+      curfield &= ch\r
+    elseif ch="," then\r
+      'response.write "<p>" & clause & ": " & server.htmlencode(curfield) & "</p>"\r
+      select case clause\r
+        case "SELECT":\r
+          AddColumn(curfield)\r
+          curfield=""\r
+        case "AS":\r
+          SelectList(SelectList.count-1).name=curfield\r
+          curfield=""\r
+          clause="SELECT"\r
+        case "GROUP BY": ArrayPush(GroupBy,curfield)\r
+        case "ORDER BY": ArrayPush(OrderBy,curfield)\r
+        case else: curfield &= ch\r
+      end select\r
+    elseif ch=" " then\r
+      j=InStr(i+1,sqltext," ")\r
+      if j<1 then\r
+        curfield &= ch\r
+      else\r
+        if ucase(mid(sqltext,j+1,3))="BY " then j=j+3\r
+        nexttoken=ucase(mid(sqltext,i+1,j-i-1))\r
+        'wscript.echo "'" & nexttoken & "'"\r
+        'response.write "<p>" & clause & " : " & nexttoken & " : " & server.htmlencode(curfield) & "</p>"\r
+        select case nexttoken\r
+          case "SELECT","INTO","FROM","WHERE","GROUP BY","HAVING","ORDER BY":\r
+            select case clause\r
+              case "SELECT":\r
+                AddColumn(curfield)\r
+                curfield=""\r
+              case "AS":\r
+                SelectList(SelectList.count-1).name=curfield\r
+                curfield=""\r
+              case "FROM":     SetParseField(FromClause,curfield)\r
+              case "WHERE":    SetParseField(WhereClause,curfield)\r
+              case "GROUP BY": ArrayPush(GroupBy,curfield)\r
+              case "HAVING":   SetParseField(HavingClause,curfield)\r
+              case "ORDER BY": ArrayPush(OrderBy,curfield)\r
+            end select\r
+            clause=nexttoken\r
+            i=j-1\r
+\r
+          case "AS":\r
+            if clause="SELECT" then\r
+              AddColumn(curfield)\r
+              curfield=""\r
+              clause=nexttoken\r
+              i=j\r
+            elseif curfield<>"" then\r
+              curfield &= ch\r
+            end if\r
+\r
+          case "DISTINCT":\r
+            if clause="SELECT" then\r
+              IsDistinct=true\r
+              curfield=""\r
+              i=j\r
+            elseif curfield<>"" then\r
+              curfield &= ch\r
+            end if\r
+\r
+          case else: if curfield<>"" then curfield &= ch\r
+        end select\r
+      end if\r
+    else\r
+      curfield &= ch\r
+    end if\r
+    i=i+1\r
+  end while\r
+  ParseSelect=true\r
+end function\r
+\r
+\r
+Private Sub ArrayPush(s as ArrayList, ByRef newvalue as string)\r
+  s.add(newvalue)\r
+  newvalue=""\r
+end sub\r
+\r
+Private Sub SetParseField(ByRef f as string, ByRef newvalue as string)\r
+  f=newvalue\r
+  newvalue=""\r
+end sub\r
+\r
+\r
+Public Sub AddColumn(sqlParm as String, Optional nameParm As String = "")\r
+  SelectList.add(new sqlColumn(sqlParm,nameParm))\r
+End Sub\r
+\r
+\r
+' -------------------------------------------------------------\r
+' Add a join to the from clause\r
+' -------------------------------------------------------------\r
+Public Sub AddJoin(ByVal JoinClause As String)\r
+  if InStr(FromClause," join ")>0 then FromClause="(" & FromClause & ")"  ' required by Access\r
+  FromClause=FromClause & " " & JoinClause\r
+end sub\r
+\r
+Private Sub SplitSortSpec(ByVal sortspec As String, ByRef sortcol As String, ByRef sortdir As String)\r
+  sortspec=ucase(sortspec)\r
+  if right(sortspec,3)="ASC" then\r
+    sortcol=trim(left(sortspec,len(sortspec)-3))\r
+    sortdir="ASC"\r
+  elseif right(sortspec,4)="DESC" then\r
+    sortcol=trim(left(sortspec,len(sortspec)-4))\r
+    sortdir="DESC"\r
+  else\r
+    sortcol=trim(sortspec)\r
+    sortdir=""\r
+  end if\r
+End Sub\r
+\r
+Private Function FindSortColumn(ByVal sortspec As String) As Integer\r
+  dim i As Integer, findcol As String, finddir As String, sortcol As String, sortdir As String\r
+  FindSortColumn=-1\r
+  SplitSortSpec(sortspec, findcol, finddir)\r
+  for i=0 to OrderBy.count-1\r
+    SplitSortSpec(OrderBy(i), sortcol, sortdir)\r
+    if sortcol=findcol then\r
+      FindSortColumn=i\r
+      exit for\r
+    end if\r
+  next\r
+End Function\r
+\r
+' -------------------------------------------------------------\r
+' Add sort criteria to the beginning of the order by clause\r
+' -------------------------------------------------------------\r
+Public Sub AddSort(ByVal NewSort As String)\r
+  dim i As Integer, colidx As Integer\r
+  colidx=FindSortColumn(NewSort)\r
+  if colidx>=0 then\r
+    for i=colidx to 1 step -1\r
+      OrderBy(i)=OrderBy(i-1)\r
+    next\r
+    OrderBy(0)=NewSort\r
+  else\r
+    OrderBy.insert(0,NewSort)\r
+  end if\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Append sort criteria to the order by clause\r
+' -------------------------------------------------------------\r
+Public Sub AppendSort(ByVal NewSort As String)\r
+  OrderBy.add(NewSort)\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Add a condition to the where clause\r
+' -------------------------------------------------------------\r
+Public Sub AddWhereCondition(ByVal NewCondition)\r
+  AddCondition(WhereClause,NewCondition)\r
+end sub\r
+\r
+' -------------------------------------------------------------\r
+' Add a condition to the having clause\r
+' -------------------------------------------------------------\r
+Public Sub AddHavingCondition(ByVal NewCondition)\r
+  AddCondition(HavingClause,NewCondition)\r
+end sub\r
+\r
+Private Sub AddCondition(ByRef Clause, ByVal NewCondition)\r
+  if IsNothing(NewCondition) then exit sub\r
+  If IsNothing(Clause) Then\r
+    Clause="(" & NewCondition & ")"\r
+  Else\r
+    Clause &= " AND (" & NewCondition & ")"\r
+  End If\r
+End Sub\r
+\r
+Public Sub DebugPrint(writer as object)\r
+  dim i as integer\r
+  writer.write("<p>Parse Result:")\r
+  writer.write("<table border='1'>")\r
+  if IsDistinct then writer.write("<tr valign='top'><td>DISTINCT<td>&nbsp;")\r
+  writer.write("<tr valign='top'><td>COLUMNS:<td><ol>")\r
+  for i=0 to SelectList.count-1\r
+    writer.write("<li>" & SelectList(i).Unparse)\r
+  next\r
+  writer.write("</ol><tr valign='top'><td>FROM:<td>" & FromClause)\r
+  if not IsNothing(WhereClause) then writer.write("<tr valign='top'><td>WHERE:<td>" & WhereClause)\r
+  if GroupBy.count > 0 then writer.write("<tr valign='top'><td>GROUP BY:<td>" & join(GroupBy.ToArray(),"<br>"))\r
+  if not IsNothing(HavingClause) then writer.write("<tr valign='top'><td>HAVING:<td>" & HavingClause)\r
+  if OrderBy.count > 0 then writer.write("<tr valign='top'><td>ORDER BY:<td>" & join(OrderBy.ToArray(),"<br>"))\r
+  writer.write("</table>")\r
+End Sub\r
+\r
+End Class\r
diff --git a/plugins/php/SimpleGrid.php b/plugins/php/SimpleGrid.php
new file mode 100644 (file)
index 0000000..ecc3d14
--- /dev/null
@@ -0,0 +1,283 @@
+<?php\r
+\r
+class SimpleGridCell {\r
+  var $content;\r
+  var $attr;\r
+\r
+  function SimpleGridCell() {\r
+    $this->attr=array();\r
+  }\r
+\r
+  function Class_Terminate() {\r
+    unset($this->attr); // WARNING: class_terminate will not be automatically called\r
+  }\r
+\r
+  function HeadingCell() {\r
+    $s="<td";\r
+    $span=1;\r
+    if (array_key_exists("colspan",$this->attr)) {\r
+      $span=$this->attr["colspan"];\r
+      $s.=" colspan='".$span."'";\r
+    }\r
+    return array($s."><div class='ricoLG_col'>".$this->DataCell("")."</div></td>", $span);\r
+  }\r
+\r
+  function DataCell($rowclass) {\r
+    $s="<div";\r
+    $this->attr["class"]=trim("ricoLG_cell ".$this->GetAttr("class")." ".$rowclass);\r
+    foreach ($this->attr as $k => $v) {\r
+      if ($k != "colspan") {\r
+        $s.=" ".$k."='".$v."'";\r
+      }\r
+    }\r
+    $s.=">".$this->content."</div>";\r
+    return $s;\r
+  }\r
+\r
+  function HtmlCell() {\r
+    $s="<td";\r
+    foreach ($this->attr as $k => $v) {\r
+      $s.=" ".$k."='".$v."'";\r
+    }\r
+    $s.=">".$this->content."</td>";\r
+    return $s;\r
+  }\r
+\r
+  function GetAttr($name) {\r
+    return (array_key_exists($name,$this->attr)) ? $this->attr[$name] : "";\r
+  }\r
+\r
+  function SetAttr($name, $value) {\r
+    $this->attr[$name]=$value;\r
+  }\r
+}\r
+\r
+class SimpleGridRow {\r
+  var $cells;\r
+  var $attr;\r
+  var $CurrentCell;\r
+\r
+  function SimpleGridRow() {\r
+    $this->cells=array();\r
+    $this->attr=array();\r
+  }\r
+\r
+  function Class_Terminate() {\r
+    $this->attr=NULL; // WARNING: class_terminate will not be automatically called\r
+  }\r
+\r
+  function AddCell($content) {\r
+    array_push($this->cells, new SimpleGridCell());\r
+    $this->CurrentCell=&$this->cells[count($this->cells)-1];\r
+    $this->CurrentCell->content=$content;\r
+  }\r
+\r
+  function HeadingRow($c1, $c2) {\r
+    $cellidx=0;\r
+    $colidx=0;\r
+    $s="";\r
+    while ($colidx < $c1 && $cellidx < count($this->cells)) {\r
+      $a=$this->cells[$cellidx]->HeadingCell();\r
+      $colidx+=intval($a[1]);\r
+      $cellidx++;\r
+    }\r
+    while (($colidx <= $c2) && $cellidx <= count($this->cells)-1) {\r
+      $a=$this->cells[$cellidx]->HeadingCell();\r
+      $s.=$a[0];\r
+      $colidx+=intval($a[1]);\r
+      $cellidx++;\r
+    }\r
+    return $s;\r
+  }\r
+\r
+  function HeadingClass() {\r
+    $s="ricoLG_hdg";\r
+    if (array_key_exists("class",$this->attr)) $s.=" ".$this->attr["class"];\r
+    return $s;\r
+  }\r
+\r
+  function CellCount() {\r
+    return count($this->cells);\r
+  }\r
+\r
+  function GetRowAttr($name) {\r
+    return (array_key_exists($name,$this->attr)) ? $this->attr[$name] : "";\r
+  }\r
+\r
+  function SetRowAttr($name, $value) {\r
+    $this->attr[$name]=$value;\r
+  }\r
+\r
+  function SetCellAttr($name, $value) {\r
+    $this->CurrentCell->SetAttr($name, $value);\r
+  }\r
+}\r
+\r
+class SimpleGrid {\r
+  var $rows;\r
+  var $LastRow;\r
+  var $LastHeadingRow;\r
+  var $ResizeRowIdx=-1;\r
+\r
+  function SimpleGrid() {\r
+    $this->rows=array();\r
+  }\r
+\r
+  function AddHeadingRow($ResizeRowFlag) {\r
+    $this->LastHeadingRow=$this->AddDataRow();\r
+    if ($ResizeRowFlag) {\r
+      $this->ResizeRowIdx=$this->LastHeadingRow;\r
+    }\r
+    return $this->LastHeadingRow;\r
+  }\r
+\r
+  function AddDataRow() {\r
+    array_push($this->rows, new SimpleGridRow());\r
+    $this->LastRow=count($this->rows)-1;\r
+    return $this->LastRow;\r
+  }\r
+\r
+  function HeadingRowCount() {\r
+    return empty($this->LastHeadingRow) ? 0 : $this->LastHeadingRow+1;\r
+  }\r
+  \r
+  function DataRowCount() {\r
+    return empty($this->LastRow) ? 0 : $this->LastRow+1-$this->HeadingRowCount();\r
+  }\r
+  \r
+  // returns # of cells in the current row\r
+  function CellCount() {\r
+    return $this->rows[$this->LastRow]->CellCount();\r
+  }\r
+\r
+  function AddCell($content) {\r
+    $this->rows[$this->LastRow]->AddCell($content);\r
+  }\r
+\r
+  function AddCellToRow($RowIdx, $content) {\r
+    $this->LastRow=$RowIdx;\r
+    $this->AddCell($content);\r
+  }\r
+\r
+  function SetRowAttr($name, $value) {\r
+    $this->rows[$this->LastRow]->SetRowAttr($name, $value);\r
+  }\r
+\r
+  function SetCellAttr($name, $value) {\r
+    $this->rows[$this->LastRow]->SetCellAttr($name, $value);\r
+  }\r
+\r
+  function RenderColumns($c1, $c2) {\r
+    for ($c=$c1; $c<=$c2; $c++) {\r
+      echo "\n<td><div class='ricoLG_col'>";\r
+      for ($r=$this->LastHeadingRow + 1; $r<count($this->rows); $r++) {\r
+        echo $this->rows[$r]->cells[$c]->DataCell($this->rows[$r]->GetRowAttr("class"));\r
+      }\r
+      echo "</div></td>";\r
+    }\r
+  }\r
+\r
+  // output buffering must be enabled\r
+  function RenderExcel($fileName) {\r
+    ob_clean();\r
+    if ($fileName != "") {\r
+      header("content-disposition: attachment; filename=" . $fileName);\r
+    }\r
+    header("Content-type: application/ms-excel");\r
+\r
+    echo "\n<table>";\r
+    for ($r=0; $r<count($this->rows); $r++) {\r
+      echo "\n<tr>";\r
+      $colcnt=count($this->rows[$r]->cells);\r
+      for ($c=0; $c<$colcnt; $c++) {\r
+        echo $this->rows[$r]->cells[$c]->HtmlCell();\r
+      }\r
+      echo "\n</tr>";\r
+    }\r
+    echo "\n</table>";\r
+    ob_end_flush();\r
+    exit();\r
+  }\r
+\r
+  // output buffering must be enabled\r
+  function RenderDelimited($fileName, $delim, $SubstituteChar) {\r
+    ob_clean();\r
+    if ($fileName != "") {\r
+      header("content-disposition: attachment; filename=" . $fileName);\r
+    }\r
+    header("Content-type: text/csv");\r
+\r
+    for ($r=0; $r<count($this->rows); $r++) {\r
+      $colcnt=count($this->rows[$r]->cells);\r
+      for ($c=0; $c<$colcnt; $c++) {\r
+        if ($c > 0) {\r
+          echo $delim;\r
+        }\r
+        echo str_replace($delim, $SubstituteChar, $this->rows[$r]->cells[$c]->content);\r
+      }\r
+      echo "\n";\r
+    }\r
+    ob_end_flush();\r
+    exit();\r
+  }\r
+\r
+  function Render($id, $FrozenCols) {\r
+    if ($this->ResizeRowIdx < 0) {\r
+      return;\r
+    }\r
+    $colcnt=$this->rows[$this->ResizeRowIdx]->CellCount();\r
+    echo "\n<div id='".$id."_outerDiv'>";\r
+    //-------------------\r
+    // frozen columns\r
+    //-------------------\r
+    echo "\n<div id='".$id."_frozenTabsDiv'>";\r
+    // upper left\r
+    echo "\n<table id='".$id."_tab0h' class='ricoLG_table ricoLG_top ricoLG_left' cellspacing='0' cellpadding='0'><thead>";\r
+    for ($r=0; $r<=$this->LastHeadingRow; $r++) {\r
+      echo "\n<tr class='".$this->rows[$r]->HeadingClass()."'";\r
+      if ($r == $this->ResizeRowIdx) {\r
+        echo " id='".$id."_tab0h_main'";\r
+      }\r
+      echo ">";\r
+      echo $this->rows[$r]->HeadingRow(0, $FrozenCols-1);\r
+      echo "</tr>";\r
+    }\r
+    echo "\n</thead></table>";\r
+    // lower left\r
+    echo "\n<table id='".$id."_tab0' class='ricoLG_table ricoLG_bottom ricoLG_left' cellspacing='0' cellpadding='0'>";\r
+    echo "\n<tr>";\r
+    $this->RenderColumns(0, $FrozenCols-1);\r
+    echo "</tr>";\r
+    echo "\n</table>";\r
+    echo "</div>";\r
+    //-------------------\r
+    // scrolling columns\r
+    //-------------------\r
+    // upper right\r
+    echo "\n<div id='".$id."_innerDiv'>";\r
+    echo "\n<div id='".$id."_scrollTabsDiv'>";\r
+    echo "\n<table id='".$id."_tab1h' class='ricoLG_table ricoLG_top ricoLG_right' cellspacing='0' cellpadding='0'><thead>";\r
+    for ($r=0; $r<=$this->LastHeadingRow; $r++) {\r
+      echo "\n<tr class='".$this->rows[$r]->HeadingClass()."'";\r
+      if ($r == $this->ResizeRowIdx) {\r
+        echo " id='".$id."_tab1h_main'";\r
+      }\r
+      echo ">";\r
+      echo $this->rows[$r]->HeadingRow($FrozenCols, $colcnt-1);\r
+      echo "\n</tr>";\r
+    }\r
+    echo "\n</thead></table>";\r
+    echo "\n</div>";\r
+    echo "\n</div>";\r
+    // lower right\r
+    echo "\n<div id='".$id."_scrollDiv'>";\r
+    echo "\n<table id='".$id."_tab1' class='ricoLG_table ricoLG_bottom ricoLG_right' cellspacing='0' cellpadding='0'>";\r
+    echo "\n<tr>";\r
+    $this->RenderColumns($FrozenCols, $colcnt-1);\r
+    echo "\n</tr>";\r
+    echo "\n</table>";\r
+    echo "\n</div>";\r
+    echo "\n</div>";\r
+  }\r
+}\r
+?>\r
diff --git a/plugins/php/class.xml.parser.php b/plugins/php/class.xml.parser.php
new file mode 100644 (file)
index 0000000..aed9c34
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+//============================================================================
+//============================================================================
+// Script:     PHP Class "xmlParser"
+//============================================================================
+// From:       http://ch2.php.net/xml
+// Autor:      monte at NOT-SP-AM dot ohrt dot com
+// Date:       14-Sep-2005 06:48 
+// License/
+// Usage:      Open Source / for free  
+//============================================================================
+// DESCRIPTION:
+// This is a class for XML parsing with an URL input. It does:
+// -  Get File from URL (XML/RSS-File)
+// -  Parsing the file into array
+// -  Return Array
+//============================================================================
+//============================================================================
+
+
+class xmlParser{
+
+// *** ----------------------------------------------------------------
+// DECLARATION
+var $xml_obj = null;
+var $output = array();
+
+
+// *** ----------------------------------------------------------------
+// CONSTRUCTOR
+function xmlParser(){
+
+$this->xml_obj = xml_parser_create();
+xml_set_object($this->xml_obj,$this);
+xml_set_character_data_handler($this->xml_obj, 'dataHandler'); 
+xml_set_element_handler($this->xml_obj, "startHandler", "endHandler");
+
+} 
+
+
+// *** ----------------------------------------------------------------
+function parse($path){
+
+if (!($fp = fopen($path, "r"))) {
+die("Cannot open XML data file: $path");
+return false;
+}
+
+while ($data = fread($fp, 4096)) {
+if (!xml_parse($this->xml_obj, $data, feof($fp))) {
+die(sprintf("XML error: %s at line %d",
+xml_error_string(xml_get_error_code($this->xml_obj)),
+xml_get_current_line_number($this->xml_obj)));
+xml_parser_free($this->xml_obj);
+}
+}
+
+return true;
+}
+
+
+// *** ----------------------------------------------------------------
+function startHandler($parser, $name, $attribs){
+$_content = array('name' => $name);
+if(!empty($attribs))
+$_content['attrs'] = $attribs;
+array_push($this->output, $_content);
+}
+
+// *** ----------------------------------------------------------------
+function dataHandler($parser, $data){
+if(!empty($data)) {
+$_output_idx = count($this->output) - 1;
+$this->output[$_output_idx]['content'] = $data;
+}
+}
+
+// *** ----------------------------------------------------------------
+function endHandler($parser, $name){
+if(count($this->output) > 1) {
+$_data = array_pop($this->output);
+$_output_idx = count($this->output) - 1;
+$this->output[$_output_idx]['child'][] = $_data;
+} 
+}
+
+// *** ----------------------------------------------------------------
+function GetNodeByPath($path,$tree = false) {
+if ($tree) {
+$tree_to_search = $tree;
+}
+else {
+$tree_to_search = $this->output;
+}
+
+if ($path == "") {
+return null; 
+}
+
+$arrPath = explode('/',$path);
+
+foreach($tree_to_search as $key => $val) {
+if (gettype($val) == "array") {
+$nodename = $val[name];
+
+if ($nodename == $arrPath[0]) { 
+
+if (count($arrPath) == 1) { 
+return $val;
+} 
+
+array_shift($arrPath);
+
+$new_path = implode($arrPath,"/");
+
+return $this->GetNodeByPath($new_path,$val[child]);
+}
+}
+}
+}
+} // class : end
+?> 
diff --git a/plugins/php/dbClass3.php b/plugins/php/dbClass3.php
new file mode 100644 (file)
index 0000000..14ccc3f
--- /dev/null
@@ -0,0 +1,1219 @@
+<?php\r
+/*****************************************************************\r
+ Page        : dbClass2.php\r
+ Description : Routines to access MySQL, SQL Server, Oracle, & ODBC databases\r
+ Date        : 25 May 2006\r
+ Author      : Matt Brown (dowdybrown@yahoo.com)\r
+ Copyright (C) 2006-2008 Matt Brown\r
+\r
+ Rico is 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
+******************************************************************/\r
+\r
+\r
+//********************************************************************************************************\r
+// Parse a SQL statement\r
+//********************************************************************************************************\r
+\r
+class sqlParse {\r
+  var $IsDistinct;\r
+  var $arSelList;\r
+  var $arSelListAs;\r
+  var $FromClause;\r
+  var $WhereClause;\r
+  var $arGroupBy;\r
+  var $HavingClause;\r
+  var $arOrderBy;\r
+\r
+  function ToArray() {\r
+    return array($this->arSelList,$this->arSelListAs,$this->FromClause,$this->WhereClause,$this->arGroupBy,$this->HavingClause,$this->arOrderBy,$this->IsDistinct);\r
+  }\r
+\r
+  function LoadArray($a) {\r
+    $this->arSelList=$a[0];\r
+    $this->arSelListAs=$a[1];\r
+    $this->FromClause=$a[2];\r
+    $this->WhereClause=$a[3];\r
+    $this->arGroupBy=$a[4];\r
+    $this->HavingClause=$a[5];\r
+    $this->arOrderBy=$a[6];\r
+    $this->IsDistinct=$a[7];\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Rebuilds a SQL select statement that was parsed by ParseSelect\r
+  // -------------------------------------------------------------\r
+  function Unparse($arSkipCols) {\r
+    $sqltext="SELECT ";\r
+    if ($this->IsDistinct) $sqltext.="DISTINCT ";\r
+    $sqltext.=$this->UnparseColumnListSkip($arSkipCols)." FROM ".$this->FromClause;\r
+    if (!empty($this->WhereClause)) {\r
+      $sqltext.=" WHERE ".$this->WhereClause;\r
+    }\r
+    if (is_array($this->arGroupBy)) {\r
+      if (count($this->arGroupBy) >  0) {\r
+        $sqltext.=" GROUP BY ".implode(",",$this->arGroupBy);\r
+      }\r
+    }\r
+    if (!empty($this->HavingClause)) {\r
+      $sqltext.=" HAVING ".$this->HavingClause;\r
+    }\r
+    if (is_array($this->arOrderBy)) {\r
+      if (count($this->arOrderBy) >  0) {\r
+        $sqltext.=" ORDER BY ".implode(",",$this->arOrderBy);\r
+      }\r
+    }\r
+    return $sqltext;\r
+  }\r
+\r
+  function UnparseSelect() {\r
+    return $this->Unparse(array());\r
+  }\r
+\r
+  function UnparseSelectSkip($arSkipCols) {\r
+    return $this->Unparse($arSkipCols);\r
+  }\r
+\r
+  function UnparseSelectDistinct() {\r
+    $this->IsDistinct=true;\r
+    return $this->Unparse(array());\r
+  }\r
+\r
+  function UnparseDistinctColumn($colnum) {\r
+    $sqltext="SELECT DISTINCT ".$this->UnparseColumn($colnum)." FROM ".$this->FromClause;\r
+    if (!empty($this->WhereClause)) {\r
+      $sqltext.=" WHERE ".$this->WhereClause;\r
+    }\r
+    $sqltext.=" ORDER BY ".$this->arSelList[$colnum];\r
+    return $sqltext;\r
+  }\r
+\r
+  function UnparseColumn($i) {\r
+    $s=$this->arSelList[$i];\r
+    if (!empty($this->arSelListAs[$i])) {\r
+      $s.=" AS ".$this->arSelListAs[$i];\r
+    }\r
+    return $s;\r
+  }\r
+\r
+  function UnparseColumnList() {\r
+    if (empty($this->arSelList)) return "";\r
+    $sqltext=$this->UnparseColumn(0);\r
+    for ($i=1; $i<count($this->arSelList); $i++) {\r
+      $sqltext.=",".$this->UnparseColumn($i);\r
+    }\r
+    return $sqltext;\r
+  }\r
+\r
+  function UnparseColumnListSkip($arSkipCols) {\r
+    for ($i=0,$SkipIdx=0; $i<count($this->arSelList); $i++) {\r
+      $skip=false;\r
+      if ($SkipIdx < count($arSkipCols)) {\r
+        $skip=($arSkipCols[$SkipIdx]==$i);\r
+        if ($skip) $SkipIdx++;\r
+      }\r
+      if (!$skip) {\r
+        if (empty($sqltext)) {\r
+          $sqltext=$this->UnparseColumn($i);\r
+        } else {\r
+          $sqltext.=",".$this->UnparseColumn($i);\r
+        }\r
+      }\r
+    }\r
+    return $sqltext;\r
+  }\r
+\r
+  function DebugPrint() {\r
+    echo "<p>Parse Result:";\r
+    echo "<table border='1'>";\r
+    if ($this->IsDistinct) echo "<tr valign='top'><td>DISTINCT<td>&nbsp;";\r
+    echo "<tr valign='top'><td>COLUMNS:<td><ol>";\r
+    if (!empty($this->arSelList)) {\r
+      for ($i=0; $i<count($this->arSelList); $i++) {\r
+        echo "<li>".$this->UnparseColumn($i);\r
+      }\r
+    }\r
+    echo "</ol><tr valign='top'><td>FROM:<td>" . $this->FromClause;\r
+    if (!empty($this->WhereClause)) {\r
+      echo "<tr valign='top'><td>WHERE:<td>".$this->WhereClause;\r
+    }\r
+    if (is_array($this->arGroupBy)) {\r
+      if (count($this->arGroupBy) >  0) {\r
+        echo "<tr valign='top'><td>GROUP BY:<td>".implode("<br>",$this->arGroupBy);\r
+      }\r
+    }\r
+    if (!empty($this->HavingClause)) {\r
+      echo "<tr valign='top'><td>HAVING:<td>".$this->HavingClause;\r
+    }\r
+    if (is_array($this->arOrderBy)) {\r
+      if (count($this->arOrderBy) >  0) {\r
+        echo "<tr valign='top'><td>ORDER BY:<td>".implode("<br>",$this->arOrderBy);\r
+      }\r
+    }\r
+    echo "</table>";\r
+  }\r
+\r
+  function Init() {\r
+    $this->arSelList=array();\r
+    $this->arSelListAs=array();\r
+    $this->arGroupBy=array();\r
+    $this->arOrderBy=array();\r
+    $this->FromClause=NULL;\r
+    $this->WhereClause=NULL;\r
+    $this->HavingClause=NULL;\r
+    $this->IsDistinct=false;\r
+  }\r
+  // -------------------------------------------------------------\r
+  // Parse a SQL select statement into its major components\r
+  // Does not handle:\r
+  // 1) union queries\r
+  // 2) select into\r
+  // 3) more than one space between "group" and "by", or "order" and "by"\r
+  // If distinct is specified, it will be part of the first item in arSelList\r
+  // -------------------------------------------------------------\r
+\r
+  function ParseSelect($sqltext) {\r
+    $this->Init();\r
+    $clause='';\r
+    $_retval=false;\r
+    $sqltext=str_replace("\n"," ",$sqltext);\r
+    $sqltext=" ".str_replace("\r"," ",$sqltext)." SELECT ";\r
+    // SELECT suffix forces last curfield to be saved\r
+    $l=strlen($sqltext);\r
+    $parencnt=0;\r
+    $inquote=false;\r
+    $curfield="";\r
+    for ($i=0; $i<$l; $i++) {\r
+      $ch=substr($sqltext,$i,1);\r
+      if ($inquote) {\r
+        if ($ch == $endquote) {\r
+          if ($endquote=="'" && substr($sqltext,$i,2) == "''") {\r
+            $curfield.="'";\r
+            $i++;\r
+          }\r
+          else {\r
+            $inquote=false;\r
+          }\r
+        }\r
+        $curfield.=$ch;\r
+      }\r
+      elseif ($ch == "'" || $ch == "\"" || $ch == "`") {\r
+        $inquote=true;\r
+        $endquote=$ch;\r
+        $curfield.=$ch;\r
+      }\r
+      elseif ($ch == "[") {\r
+        $inquote=true;\r
+        $endquote="]";\r
+        $curfield.=$ch;\r
+      }\r
+      elseif ($ch == "(") {\r
+        $parencnt++;\r
+        $curfield.=$ch;\r
+      }\r
+      elseif ($ch == ")") {\r
+        if ($parencnt == 0) {\r
+          return $_retval;\r
+          // sql statement has a syntax error\r
+        }\r
+        $parencnt--;\r
+        $curfield.=$ch;\r
+      }\r
+      elseif ($parencnt > 0) {\r
+        $curfield.=$ch;\r
+      }\r
+      elseif ($ch == ",") {\r
+        switch ($clause) {\r
+          case "SELECT":\r
+            array_push($this->arSelList, $curfield);\r
+            array_push($this->arSelListAs, NULL);\r
+            $curfield='';\r
+            break;\r
+          case "AS":\r
+            $this->arSelListAs[count($this->arSelList)-1]=$curfield;\r
+            $curfield='';\r
+            $clause="SELECT";\r
+            break;\r
+          case "GROUP BY":\r
+            array_push($this->arGroupBy, $curfield);\r
+            $curfield='';\r
+            break;\r
+          case "ORDER BY":\r
+            array_push($this->arOrderBy, $curfield);\r
+            $curfield='';\r
+            break;\r
+          default:\r
+            $curfield.=$ch;\r
+            break;\r
+        }\r
+      }\r
+      elseif ($ch == " ") {\r
+        $j=strpos($sqltext," ",$i+1);\r
+        if ($j===false)\r
+        {\r
+          $curfield.=$ch;\r
+        }\r
+          else\r
+        {\r
+          if (strtoupper(substr($sqltext,$j+1,3))=="BY ") $j+=3;\r
+          $nexttoken=strtoupper(substr($sqltext,$i+1,$j-$i-1));\r
+          //echo '<br>'.$nexttoken;\r
+          switch ($nexttoken) {\r
+\r
+            case "SELECT":\r
+            case "INTO":\r
+            case "FROM":\r
+            case "WHERE":\r
+            case "GROUP BY":\r
+            case "HAVING":\r
+            case "ORDER BY":\r
+              switch ($clause) {\r
+                case "SELECT":\r
+                  $this->AddColumn($curfield, NULL);\r
+                  $curfield='';\r
+                  break;\r
+                case "AS":\r
+                  $this->arSelListAs[count($this->arSelList)-1]=$curfield;\r
+                  $curfield='';\r
+                  break;\r
+                case "FROM":     $this->FromClause=$curfield;             $curfield=''; break;\r
+                case "WHERE":    $this->WhereClause=$curfield;            $curfield=''; break;\r
+                case "GROUP BY": array_push($this->arGroupBy, $curfield); $curfield=''; break;\r
+                case "HAVING":   $this->HavingClause=$curfield;           $curfield=''; break;\r
+                case "ORDER BY": array_push($this->arOrderBy, $curfield); $curfield=''; break;\r
+              }\r
+              $clause=$nexttoken;\r
+              $i=$j-1;\r
+              break;\r
+\r
+            case "AS":\r
+              if ($clause=="SELECT") {\r
+                $this->AddColumn($curfield, NULL);\r
+                $curfield='';\r
+                $clause=$nexttoken;\r
+                $i=$j;\r
+              } else if ($curfield != "") {\r
+                $curfield.=$ch;\r
+              }\r
+              break;\r
+\r
+            case "DISTINCT":\r
+              if ($clause=="SELECT") {\r
+                $this->IsDistinct=true;\r
+                $curfield='';\r
+                $i=$j;\r
+              } else if ($curfield != "") {\r
+                $curfield.=$ch;\r
+              }\r
+              break;\r
+\r
+            default:\r
+              if ($curfield != "") {\r
+                $curfield.=$ch;\r
+              }\r
+              break;\r
+          }\r
+        }\r
+      }\r
+      else {\r
+        $curfield.=$ch;\r
+      }\r
+    }\r
+    return true;\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Add column to select list\r
+  // -------------------------------------------------------------\r
+  function AddColumn($ColumnSql, $ColumnName) {\r
+    array_push($this->arSelList, $ColumnSql);\r
+    array_push($this->arSelListAs, $ColumnName);\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Add a join to the from clause\r
+  // -------------------------------------------------------------\r
+  function AddJoin($JoinClause) {\r
+    if (preg_match("/ join /i",$this->FromClause)) {\r
+      $this->FromClause="(".$this->FromClause.")";\r
+      // required by Access\r
+    }\r
+    $this->FromClause.=" ".$JoinClause;\r
+  }\r
+\r
+  function SplitSortSpec($sortspec, &$sortcol, &$sortdir) {\r
+    $sortspec=strtoupper($sortspec);\r
+    if (substr($sortspec,-3) == "ASC") {\r
+      $sortcol=trim(substr($sortspec,0,-3));\r
+      $sortdir="ASC";\r
+    }\r
+    elseif (substr($sortspec,-4) == "DESC") {\r
+      $sortcol=trim(substr($sortspec,0,-4));\r
+      $sortdir="DESC";\r
+    }\r
+    else {\r
+      $sortcol=trim($sortspec);\r
+      $sortdir="";\r
+    }\r
+  }\r
+\r
+  function FindSortColumn($sortspec) {\r
+    $this->SplitSortSpec($sortspec, $findcol, $finddir);\r
+    for ($i=0; $i<=count($this->arOrderBy)-1; $i++) {\r
+      $this->SplitSortSpec($this->arOrderBy[$i], $sortcol, $sortdir);\r
+      if ($sortcol == $findcol) {\r
+        return $i;\r
+      }\r
+    }\r
+    return -1;\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Add sort criteria to the beginning of the order by clause\r
+  // -------------------------------------------------------------\r
+  function AddSort($NewSort) {\r
+    $colidx=$this->FindSortColumn($NewSort);\r
+    if ($colidx >= 0) {\r
+      for ($i=$colidx; $i>0; $i--) {\r
+        $this->arOrderBy[$i]=$this->arOrderBy[$i-1];\r
+      }\r
+      $this->arOrderBy[0]=$NewSort;\r
+    }\r
+    else {\r
+      array_unshift($this->arOrderBy, $NewSort);\r
+    }\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Append sort criteria to the order by clause\r
+  // -------------------------------------------------------------\r
+  function AppendSort($NewSort) {\r
+    array_push($this->arOrderBy, $NewSort);\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Add a condition to the where clause\r
+  // -------------------------------------------------------------\r
+  function AddWhereCondition($NewCondition) {\r
+    $this->AddCondition($this->WhereClause, $NewCondition);\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Add a condition to the having clause\r
+  // -------------------------------------------------------------\r
+  function AddHavingCondition($NewCondition) {\r
+    $this->AddCondition($this->HavingClause, $NewCondition);\r
+  }\r
+\r
+  function AddCondition(&$Clause, $NewCondition) {\r
+    if (empty($NewCondition)) {\r
+      return;\r
+    }\r
+    if (empty($Clause)) {\r
+      $Clause="(".$NewCondition.")";\r
+    }\r
+    else {\r
+      $Clause.=" AND (".$NewCondition.")";\r
+    }\r
+  }\r
+}\r
+\r
+\r
+// -------------------------------------------------------------\r
+// created by dbClass.GetColumnInfo()\r
+// -------------------------------------------------------------\r
+class dbColumn\r
+{\r
+  var $ColName,$Nullable,$ColType,$ColLength,$Writeable,$IsPKey;\r
+}\r
+\r
+// tested ok with MySQL 4 & 5\r
+class dbClass_mysql\r
+{\r
+  var $lastQuery;\r
+  function dbClass_mysql($conn) { $this->conn=$conn; }\r
+  function HasError() { return mysql_errno()!=0; }\r
+  function ErrorMsg() { return mysql_error(); }\r
+  function Close() { return mysql_close($this->conn); }\r
+  function FreeResult($rsLookUp) { return mysql_free_result($rsLookUp); }\r
+  function RunQuery($sqltext) { $this->lastQuery=$sqltext; return mysql_query($sqltext,$this->conn); }\r
+  function NumFields($rsMain) { return mysql_num_fields($rsMain); }\r
+  function NumRows($rsMain) { return mysql_num_rows($rsMain); }\r
+  function FieldType($rsMain,$i) { return mysql_field_type($rsMain,$i); }\r
+  function FieldName($rsMain,$i) { return mysql_field_name($rsMain,$i); }\r
+  function FetchRow($rsMain,&$result) { $result=mysql_fetch_row($rsMain); return ($result==false) ? false : true; }\r
+  function FetchAssoc($rsMain,&$result) { $result=mysql_fetch_assoc($rsMain); return ($result==false) ? false : true; }\r
+  function FetchArray($rsMain,&$result) { $result=mysql_fetch_array($rsMain,MYSQL_NUM); return ($result==false) ? false : true; }\r
+  function AffectedRows($rsMain) { return mysql_affected_rows($this->conn); }\r
+  function Seek($rsMain,$offset) { return mysql_data_seek($rsMain,$offset); }\r
+  function RunParamQuery($query, $phs = array()) {\r
+    foreach ($phs as $ph) {   // from php.net\r
+      if ( isset($ph) ) {\r
+        $ph = "'" . mysql_real_escape_string($ph) . "'";\r
+      } else {\r
+        $ph = "NULL" ;\r
+      }\r
+      $query = substr_replace($query, $ph, strpos($query, '?'), 1);\r
+    }\r
+    $this->lastQuery=$query;\r
+    return mysql_query($query,$this->conn);\r
+  }\r
+  function GetColumnInfo($TableName) {\r
+    $rsMain=$this->RunQuery("SHOW COLUMNS FROM ".$TableName);\r
+    if (!$rsMain) return null;\r
+    $arColumns=array();\r
+    while($this->FetchAssoc($rsMain,$row)) {\r
+      $colinfo=new dbColumn;\r
+      $colinfo->IsPKey=($row["Key"]=="PRI");\r
+      $colinfo->ColName=$row["Field"];\r
+      $colinfo->ColType=$row["Type"];\r
+      $colinfo->Nullable=($row["Null"]=="YES");\r
+      if (preg_match("/\((\d+)\)/", $row["Type"], $matches))\r
+        $colinfo->ColLength=$matches[1];\r
+      else\r
+        $colinfo->ColLength=0;\r
+      $colinfo->Writeable=($row["Extra"] != 'auto_increment');\r
+      array_push($arColumns, $colinfo);\r
+    }\r
+    $this->FreeResult($rsMain);\r
+    return $arColumns;\r
+  }\r
+  function GetTableList($TableType) {\r
+    if ($TableType!='VIEW') $TableType='BASE TABLE';\r
+    $rsMain=$this->RunQuery("SHOW FULL TABLES WHERE Table_type='".$TableType."'");\r
+    if (!$rsMain) return null;\r
+    $arTables=array();\r
+    while($this->FetchRow($rsMain,$row)) {\r
+      array_push($arTables, $row[0]);\r
+    }\r
+    $this->FreeResult($rsMain);\r
+    return $arTables;\r
+  }\r
+  function Concat($arStrings) {\r
+    return "concat(".implode(",",$arStrings).")";\r
+  }\r
+  function Convert2Char($s) {\r
+    return $s; // implicit conversion\r
+  }\r
+  function SqlDay($s) {\r
+    return "dayofmonth(".$s.")";\r
+  }\r
+  function SqlMonth($s) {\r
+    return "month(".$s.")";\r
+  }\r
+  function SqlYear($s) {\r
+    return "year(".$s.")";\r
+  }\r
+  function CurrentTime() {\r
+    return "LOCALTIMESTAMP";\r
+  }\r
+}\r
+\r
+\r
+// tested ok with Oracle XE\r
+class dbClass_oci\r
+{\r
+  var $lastQuery;\r
+  function dbClass_oci($conn) { $this->conn=$conn; }\r
+  function HasError() { return is_array(ocierror()); }\r
+  function ErrorMsg() { $e=ocierror(); return is_array($e) ? $e['message'] : ''; }\r
+  function Close() { return ocilogoff($this->conn); }\r
+  function FreeResult($rsLookUp) { return ocifreestatement($rsLookUp); }\r
+  function RunQuery($sqltext) { $this->lastQuery=$sqltext; $stmt=ociparse($this->conn, $sqltext); ociexecute($stmt); return $stmt; }\r
+  function NumFields($rsMain) { return ocinumcols($rsMain); }\r
+  function NumRows($rsMain) { return -1; }\r
+  function FieldType($rsMain,$i) { return ocicolumntype($rsMain,$i+1); }\r
+  function FieldName($rsMain,$i) { return oci_field_name($rsMain,$i); }\r
+  function FetchRow($rsMain,&$result) { return ocifetchinto($rsMain,$result,OCI_NUM); }\r
+  function FetchAssoc($rsMain,&$result) { return ocifetchinto($rsMain,$result,OCI_ASSOC); }\r
+  function FetchArray($rsMain,&$result) { return ocifetchinto($rsMain,$result,OCI_NUM); }\r
+  function AffectedRows($rsMain) { return (is_resource($rsMain) ? ocirowcount($rsMain) : false); }\r
+  function Seek($rsMain,$offset) {\r
+    for($i=0; $i<$offset; $i++) ocifetchrow($rsMain);\r
+  }\r
+  function RunParamQuery($query, $phs = array()) {\r
+    foreach ($phs as $ph) {   // from php.net\r
+      $ph = isset($ph) ? "'" . str_replace("'","''",$ph) . "'" : "NULL";\r
+      $query = substr_replace($query, $ph, strpos($query, '?'), 1);\r
+    }\r
+    $this->lastQuery=$query;\r
+    return $this->RunQuery($query);\r
+  }\r
+  function GetColumnInfo($TableName) {\r
+    $TableName=strtoupper($TableName);\r
+    $rsMain=$this->RunQuery("select * from col WHERE tname='$TableName' order by colno");\r
+    if (!$rsMain) return null;\r
+    $arColumns=array();\r
+    while($this->FetchAssoc($rsMain,$row)) {\r
+      $colinfo=new dbColumn;\r
+      $colinfo->IsPKey=false;\r
+      $colinfo->ColName=$row["CNAME"];\r
+      $colinfo->ColType=$row["COLTYPE"];\r
+      $colinfo->Nullable=($row["NULLS"]=="NULL");\r
+      $colinfo->ColLength=$row["WIDTH"];\r
+      $colinfo->Writeable=true;   // need to figure out where to find this\r
+      array_push($arColumns, $colinfo);\r
+      //echo "<p>GetColumnInfo: ".$row["CNAME"].' - '.$row["COLTYPE"]."</p>";\r
+    }\r
+    $this->FreeResult($rsMain);\r
+    $sql = "SELECT b.column_name FROM USER_CONSTRAINTS a, USER_CONS_COLUMNS b WHERE (b.table_name='$TableName') AND (a.table_name='$TableName') AND (a.constraint_type = 'P') AND (a.constraint_name = b.constraint_name)";
+    $rsMain = $this->RunQuery($sql);
+    if ($rsMain) {\r
+      while($this->FetchRow($rsMain,$row)) {\r
+        $colname=$row[0];\r
+        //echo "<p>GetColumnInfo pk: ".$colname."</p>";\r
+        for($i=0; $i<count($arColumns); $i++) {\r
+          if ($arColumns[$i]->ColName==$colname) {\r
+            $arColumns[$i]->IsPKey=true;\r
+            break;\r
+          }\r
+        }\r
+      }\r
+      $this->FreeResult($rsMain);\r
+    }\r
+    return $arColumns;\r
+  }\r
+  function Concat($arStrings) {\r
+    return implode(" || ",$arStrings);\r
+  }\r
+  function Convert2Char($s) {\r
+    return "cast(".$s." as varchar2(20))";\r
+  }\r
+  function SqlDay($s) {\r
+    return "to_char(".$s.",'DD')";\r
+  }\r
+  function SqlMonth($s) {\r
+    return "to_char(".$s.",'MM')";\r
+  }\r
+  function SqlYear($s) {\r
+    return "to_char(".$s.",'YYYY')";\r
+  }\r
+  function CurrentTime() {\r
+    return "LOCALTIMESTAMP";\r
+  }\r
+  function GetTableList($TableType) {\r
+    if ($TableType!='VIEW'){\r
+      $TableType='TABLE';\r
+      $tableFiltre="and exists (select 'X' from USER_TABLES where TABLE_NAME = OBJECT_NAME) ";\r
+    }\r
+    $rsMain=$this->RunQuery("SELECT OBJECT_NAME FROM ALL_OBJECTS WHERE OBJECT_TYPE = '".$TableType."' and OWNER = UPPER('".$GLOBALS['appName']."') ".$tableFiltre."order by 1");\r
+    if (!$rsMain) return null;\r
+    $arTables=array();\r
+    while($this->FetchRow($rsMain,$row)) {\r
+      array_push($arTables, $row[0]);\r
+    }\r
+    $this->FreeResult($rsMain);\r
+    return $arTables;\r
+  }\r
+}\r
+\r
+\r
+// tested ok with MS SQL Server & MS Access\r
+// Oracle works ok except for GetColumnInfo\r
+class dbClass_odbc\r
+{\r
+  var $lastQuery,$dbc;\r
+  function dbClass_odbc(&$dbc) { $this->dbc=$dbc; }\r
+  function HasError() { return odbc_error()!=''; }\r
+  function ErrorMsg() { return @odbc_error() . ' ' . @odbc_errormsg(); }\r
+  function Close() { return odbc_close(); }\r
+  function FreeResult($rsLookUp) { return odbc_free_result($rsLookUp); }\r
+  function RunQuery($sqltext) { $this->lastQuery=$sqltext; return odbc_exec($this->dbc->dbMain,$sqltext); }\r
+  function NumFields($rsMain) { return odbc_num_fields($rsMain); }\r
+  function NumRows($rsMain) { return odbc_num_rows($rsMain); }\r
+  function FieldType($rsMain,$i) { return odbc_field_type($rsMain,$i+1); }\r
+  function FieldName($rsMain,$i) { return odbc_field_name($rsMain,$i); }\r
+  function FetchRow($rsMain,&$result) { $rc=odbc_fetch_into($rsMain,$result); return ($rc==false) ? false : true; }\r
+  function FetchAssoc($rsMain,&$result) { $result=odbc_fetch_array($rsMain); return ($result==false) ? false : true; }\r
+  function FetchArray($rsMain,&$result) { $rc=odbc_fetch_into($rsMain,$result); return ($rc==false) ? false : true; }\r
+  function AffectedRows($rsMain) { return odbc_num_rows($rsMain); }\r
+  function Seek($rsMain,$offset) {\r
+    for($i=0; $i<$offset; $i++) odbc_fetch_row($rsMain);\r
+  }\r
+  function RunParamQuery($query, $phs = array()) {\r
+    // odbc_prepare/odbc_execute chokes on this: SELECT * FROM (SELECT * FROM orders WHERE ShipCountry=?) AS rico_Main\r
+    // so that approach cannot be used\r
+    foreach ($phs as $ph) {\r
+      if ( isset($ph) ) {\r
+        if (preg_match("/^\d\d\d\d-?\d\d-?\d\d(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|(?:([-+])(\d\d)(?::?(\d\d))?)?)?)?$/",$ph)) {\r
+          $ph = "{ts '".$ph."'}";\r
+        } else {\r
+          $ph = "'" . str_replace("'","''",$ph) . "'";\r
+        }\r
+      } else {\r
+        $ph = "NULL" ;\r
+      }\r
+      $query = substr_replace($query, $ph, strpos($query, '?'), 1);\r
+    }\r
+    $this->lastQuery=$query;\r
+    return odbc_exec($this->dbc->dbMain,$query);\r
+  }\r
+  function GetColumnInfo($TableName) {\r
+    switch ($this->dbc->Dialect) {\r
+      case "TSQL":\r
+        $qualifier=$this->dbc->dbDefault;\r
+        $schema="%";\r
+        break;\r
+      case "Access":\r
+        $qualifier=$this->dbc->dsn;\r
+        $schema="";\r
+        break;\r
+      default:\r
+        return null;\r
+    }\r
+    //echo "<p>GetColumnInfo: ".$qualifier.".".$schema.".".$TableName."</p>";\r
+    $rsMain=odbc_columns($this->dbc->dbMain, $qualifier, $schema, $TableName);\r
+    //odbc_result_all($rsMain);\r
+    if (!$rsMain) return null;\r
+    $arColumns=array();\r
+    while($this->FetchAssoc($rsMain,$row)) {\r
+      if ($row["TABLE_NAME"]!=$TableName) continue;\r
+      $colinfo=new dbColumn;\r
+      //echo "<p>GetColumnInfo: ".$row["COLUMN_NAME"].':'.$row["TYPE_NAME"]."</p>";\r
+      $colinfo->ColName=$row["COLUMN_NAME"];\r
+      $colinfo->ColType=$row["TYPE_NAME"];\r
+      if (array_key_exists("PRECISION",$row)) {\r
+        $colinfo->ColLength=$row["PRECISION"];\r
+      } else if (array_key_exists("COLUMN_SIZE",$row)) {\r
+        $colinfo->ColLength=$row["COLUMN_SIZE"];\r
+      }\r
+      $colinfo->Nullable=($row["NULLABLE"]=="YES");\r
+      $colinfo->IsPKey=false;\r
+      $colinfo->Writeable=($row["TYPE_NAME"] != 'int identity');\r
+      array_push($arColumns, $colinfo);\r
+    }\r
+    $this->FreeResult($rsMain);\r
+    //$rsMain=odbc_columnprivileges($this->dbc->dbMain, $qualifier, $schema, $TableName,"%");\r
+    //odbc_result_all($rsMain);\r
+    //$this->FreeResult($rsMain);\r
+    $rsMain=odbc_primarykeys($this->dbc->dbMain, $qualifier, $schema, $TableName);\r
+    if ($rsMain) {\r
+      while($this->FetchAssoc($rsMain,$row)) {\r
+        $colname=$row["COLUMN_NAME"];\r
+        //echo "<p>GetColumnInfo pk: ".$colname."</p>";\r
+        for($i=0; $i<count($arColumns); $i++) {\r
+          if ($arColumns[$i]->ColName==$colname) {\r
+            $arColumns[$i]->IsPKey=true;\r
+            break;\r
+          }\r
+        }\r
+      }\r
+      $this->FreeResult($rsMain);\r
+    }\r
+    return $arColumns;\r
+  }\r
+  function Concat($arStrings) {\r
+    $cnt=count($arStrings);\r
+    switch ($cnt) {\r
+      case 0: return '';\r
+      case 1: return $arStrings[0];\r
+      default:\r
+        $result="{fn concat(".$arStrings[0].",".$arStrings[1].")}";\r
+        for ($i=2; $i<$cnt; $i++) {\r
+          $result="{fn concat(".$result.",".$arStrings[$i].")}";\r
+        }\r
+    }\r
+    return $result;\r
+  }\r
+  function Convert2Char($s) {\r
+    return "{fn CONVERT(" . $s . ",SQL_VARCHAR)}";\r
+  }\r
+  function SqlDay($s) {\r
+    return "{fn DAYOFMONTH(" . $s . ")}";\r
+  }\r
+  function SqlMonth($s) {\r
+    return "{fn MONTH(" . $s . ")}";\r
+  }\r
+  function SqlYear($s) {\r
+    return "{fn YEAR(" . $s . ")}";\r
+  }\r
+  function CurrentTime() {\r
+    return "{fn CURDATE()}";\r
+  }\r
+}\r
+\r
+// For MS SQL Server\r
+class dbClass_mssql\r
+{\r
+  var $lastQuery,$dbc;\r
+  function dbClass_mssql($conn) { $this->conn=$conn; }\r
+  function HasError() { return mssql_get_last_message()!=0; }\r
+  function ErrorMsg() { return mssql_get_last_message(); }\r
+  function Close() { return mssql_close($this->conn); }\r
+  function FreeResult($rsLookUp) { return mssql_free_result($rsLookUp); }\r
+  function RunQuery($sqltext) { $this->lastQuery=$sqltext; return mssql_query($sqltext,$this->conn); }\r
+  function NumFields($rsMain) { return mssql_num_fields($rsMain); }\r
+  function NumRows($rsMain) { return mssql_num_rows($rsMain); }\r
+  function FieldType($rsMain,$i) { return mssql_field_type($rsMain,$i); }\r
+  function FieldName($rsMain,$i) { return mssql_field_name($rsMain,$i); }\r
+  function FetchRow($rsMain,&$result) { $result=mssql_fetch_row($rsMain); return ($result==false) ? false : true; }\r
+  function FetchAssoc($rsMain,&$result) { $result=mssql_fetch_assoc($rsMain); return ($result==false) ? false : true; }\r
+  function FetchArray($rsMain,&$result) { $result=mssql_fetch_array($rsMain,MSSQL_NUM); return ($result==false) ? false : true; }\r
+  function AffectedRows($rsMain) { return mssql_rows_affected($rsMain); }\r
+  function Seek($rsMain,$offset) { return mssql_data_seek($rsMain,$offset); }\r
+  function RunParamQuery($query, $phs = array()) {\r
+    foreach ($phs as $ph) {\r
+      if ( isset($ph) ) {\r
+        $ph = "'" . str_replace("'","''",$ph) . "'";\r
+      } else {\r
+        $ph = "NULL" ;\r
+      }\r
+      $query = substr_replace($query, $ph, strpos($query, '?'), 1);\r
+    }\r
+    $this->lastQuery=$query;\r
+    return mssql_query($query,$this->conn);\r
+  }\r
+\r
+  function GetColumnInfo($TableName) {\r
+    $TableName=strtoupper($TableName);\r
+    $rsMain=$this->RunQuery("exec sp_columns '$TableName'");\r
+    if (!$rsMain) return null;\r
+    $arColumns=array();\r
+\r
+    while($this->FetchAssoc($rsMain,$row)) {\r
+      if (strtoupper($row["TABLE_NAME"]) != $TableName) continue;  // sp_columns treats "Order_Details" and "Order Details" as the same\r
+      $colinfo=new dbColumn;\r
+      $colinfo->ColName=$row["COLUMN_NAME"];\r
+      $colinfo->ColType=$row["TYPE_NAME"];\r
+      if (array_key_exists("PRECISION",$row)) {\r
+        $colinfo->ColLength=$row["PRECISION"];\r
+      } else if (array_key_exists("LENGTH",$row)) {\r
+        $colinfo->ColLength=$row["LENGTH"];\r
+      }\r
+      $colinfo->Nullable=($row["NULLABLE"]==1);\r
+      $colinfo->IsPKey=false;\r
+      $colinfo->Writeable=(strtoupper($row["TYPE_NAME"]) != "INT IDENTITY");\r
+      array_push($arColumns, $colinfo);\r
+    }\r
+    $this->FreeResult($rsMain);\r
+    // Get Primary Keys\r
+    $rsMain=$this->RunQuery("exec sp_pkeys '$TableName'");\r
+    if ($rsMain) {\r
+      while($this->FetchAssoc($rsMain,$row)) {\r
+        $colname=$row["COLUMN_NAME"];\r
+        for($i=0; $i<count($arColumns); $i++) {\r
+          if ($arColumns[$i]->ColName==$colname) {\r
+            $arColumns[$i]->IsPKey=true;\r
+            break;\r
+          }\r
+        }\r
+      }\r
+      $this->FreeResult($rsMain);\r
+    }\r
+    return $arColumns;\r
+  }\r
+\r
+  function GetTableList($TableType) { \r
+    $typecode=$TableType!='VIEW' ? 'U' : 'V';\r
+    $rsMain=$this->RunQuery("select name from sysobjects where type='".$typecode."' order by name"); \r
+    if (!$rsMain) return null; \r
+    $arTables=array(); \r
+    while($this->FetchRow($rsMain,$row)) { \r
+      array_push($arTables, $row[0]); \r
+    }  \r
+    $this->FreeResult($rsMain); \r
+    return $arTables; \r
+  } \r
+  \r
+  function Concat($arStrings) {\r
+    return implode("+",$arStrings);\r
+  }\r
+  function Convert2Char($s) {\r
+    return "CAST(" . $s . " AS VARCHAR)";\r
+  }\r
+  function SqlDay($s) {\r
+    return "DAY(" . $s . ")";\r
+  }\r
+  function SqlMonth($s) {\r
+    return "MONTH(" . $s . ")";\r
+  }\r
+  function SqlYear($s) {\r
+    return "YEAR(" . $s . ")";\r
+  }\r
+  function CurrentTime() {\r
+    return "CURRENT_TIMESTAMP";\r
+  }\r
+}\r
+\r
+\r
+\r
+class dbClass\r
+{\r
+\r
+  var $debug,$ConnTimeout,$CmdTimeout,$LockTimeout,$Provider;\r
+  var $ErrMsgFmt;\r
+  var $DisplayErrors;\r
+  var $LastErrorMsg;\r
+  var $Dialect;\r
+  var $Wildcard;\r
+  // these are private:\r
+  var $dbMain,$DisplayFunc,$dbDefault;\r
+\r
+// -------------------------------------------------------------\r
+// Class Constructor\r
+// -------------------------------------------------------------\r
+  function dbClass()\r
+  {\r
+    $this->Provider="localhost";\r
+    $this->debug=false;\r
+    $this->ConnTimeout=30; // seconds\r
+    $this->LockTimeout=5000; // milliseconds\r
+    $this->DisplayErrors=true;\r
+    $this->CmdTimeout=120; // 2 minutes\r
+    $this->ErrMsgFmt="HTML";\r
+    $this->DisplayFunc="echo";\r
+    $this->Dialect="MySQL";\r
+    $this->Wildcard="%";\r
+  }\r
+\r
+// -------------------------------------------------------------\r
+// Class Destructor (only called if php5)\r
+// -------------------------------------------------------------\r
+  function __destruct()\r
+  {\r
+    $this->dbClose();\r
+  }\r
+\r
+  function DefaultDB()\r
+  {\r
+    return $this->dbDefault;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// If the database is down, then an explanation can be placed here\r
+//********************************************************************************************************\r
+  function MaintenanceMsg()\r
+  {\r
+    return "";\r
+  }\r
+\r
+  function DisplayMsg($msg)\r
+  {\r
+    if (!empty($this->DisplayFunc))\r
+    {\r
+      if ($this->ErrMsgFmt=="HTML" && substr($msg,0,1)!="<")\r
+      {\r
+        $msg="<p>".htmlspecialchars(str_replace("\n","<br>",$msg))."</p>";\r
+      }\r
+        else\r
+      {\r
+        $msg=str_replace("\n"," ",$msg);\r
+      }\r
+      eval($this->DisplayFunc."(\"".$msg."\");");\r
+    }\r
+  }\r
+\r
+  function HandleError($msg)\r
+  {\r
+    if ($this->DisplayErrors)\r
+    {\r
+      $this->DisplayMsg($this->LastErrorMsg);\r
+    }\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Checks if an error has occurred, and if so, displays a message & returns true\r
+//********************************************************************************************************\r
+  function CheckForError($msg)\r
+  {\r
+    if (!$this->db->HasError()) return false;\r
+    $this->LastErrorMsg=$msg;\r
+    if (empty($this->ErrMsgFmt)) return true;\r
+    $this->HandleError($this->FormatErrorMsg($msg));\r
+    return true;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Attempts to connect to the Database. Returns true on success.\r
+//********************************************************************************************************\r
+  function MySqlLogon($DefDB,$userid,$pw)\r
+  {\r
+    $this->Dialect="MySQL";\r
+    $this->dbDefault = $DefDB;\r
+    $this->dbMain = mysql_connect($this->Provider,$userid,$pw);\r
+    mysql_select_db($DefDB,$this->dbMain);\r
+    $this->db =& new dbClass_mysql($this->dbMain);\r
+    if ($this->CheckForError("opening connection")) return false;\r
+    return true;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Attempts to connect to the Database. Returns true on success.\r
+//********************************************************************************************************\r
+  function OracleLogon($sim,$user,$pw)\r
+  {\r
+    $this->Dialect="Oracle";\r
+    $this->dbDefault = $user;\r
+    $this->dbMain = ocilogon($user,$pw,$sim);\r
+    $this->db =& new dbClass_oci($this->dbMain);\r
+    if ($this->CheckForError("opening connection")) return false;\r
+    $this->RunActionQuery("alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'");\r
+    return true;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Attempts to connect to the Database. Returns true on success.\r
+//********************************************************************************************************\r
+  function MSSqlLogon($servername,$DefDB,$user,$pw)\r
+  {\r
+    $this->Dialect="TSQL";\r
+    $this->dbDefault = $DefDB;\r
+    ini_set("mssql.datetimeconvert","Off");\r
+    $this->dbMain = mssql_connect($servername,$user,$pw);\r
+    if (!is_resource($this->dbMain)) {\r
+      $this->LastErrorMsg="Error while connecting to ".$servername;\r
+      return false;\r
+    }\r
+    $this->db =& new dbClass_mssql($this->dbMain);\r
+    mssql_select_db($DefDB,$this->dbMain);\r
+    return true;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Attempts to connect to the Database. Returns true on success.\r
+//********************************************************************************************************\r
+  function OdbcLogon($dsn,$DefDB,$userid,$pw)\r
+  {\r
+    $this->dsn = $dsn;\r
+    $this->dbDefault = $DefDB;\r
+    $this->dbMain = odbc_connect($dsn,$userid,$pw,SQL_CUR_USE_ODBC);\r
+    if (!is_resource($this->dbMain)) {\r
+      $this->LastErrorMsg="Error while opening ODBC connection: " . odbc_error();\r
+      return false;\r
+    } else {\r
+      $this->db = new dbClass_odbc($this);\r
+      return true;\r
+    }\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Close database connection\r
+//********************************************************************************************************\r
+  function dbClose() {\r
+    if (is_resource($this->dbMain)) $this->db->Close();\r
+    $this->dbMain = NULL;\r
+    return true;\r
+  }\r
+\r
+  function CurrentTime() {\r
+    return $this->db->CurrentTime();\r
+  }\r
+\r
+  function Convert2Char($s) {\r
+    return $this->db->Convert2Char($s);\r
+  }\r
+\r
+  // returns SQL that converts a datetime value to a date in YYYY-MM-DD format\r
+  function SqlDate($s) {\r
+    return $this->Concat(array($this->SqlYear($s),"'-'",$this->SqlMonth($s),"'-'",$this->SqlDay($s)),false);\r
+  }\r
+\r
+  // returns SQL that converts a datetime value to the day-of-month\r
+  function SqlDay($s) {\r
+    return $this->db->SqlDay($s);\r
+  }\r
+\r
+  // returns SQL that converts a datetime value to the month number\r
+  function SqlMonth($s) {\r
+    return $this->db->SqlMonth($s);\r
+  }\r
+\r
+  // returns SQL that converts a datetime value to the year\r
+  function SqlYear($s) {\r
+    return $this->db->SqlYear($s);\r
+  }\r
+\r
+  // requires an active db connection when using MySQL\r
+  function addQuotes($s) {\r
+    if (get_magic_quotes_gpc())\r
+      $s = stripslashes($s);\r
+\r
+    switch ($this->Dialect) {\r
+      case "MySQL": return "'" . mysql_real_escape_string($s) . "'";\r
+      default:      return "'".str_replace("'","''",$s)."'";\r
+    }\r
+  }\r
+\r
+  // returns SQL that concatenates an array of strings\r
+  function Concat($arStrings, $addQuotes) {\r
+    if ($addQuotes) {\r
+      for ($i=0; $i<count($arStrings); $i++)\r
+        $arStrings[$i]=$this->addQuotes($arStrings[$i]);\r
+    }\r
+    return $this->db->Concat($arStrings);\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Return a string containing an error message\r
+// String format is based on ErrMsgFmt\r
+//********************************************************************************************************\r
+  function FormatErrorMsg($ContextMsg)\r
+  {\r
+    switch ($this->ErrMsgFmt)\r
+    {\r
+      case "HTML":\r
+        $function_ret="<p class=dberror id=dbError>Error! " . $this->db->ErrorMsg() ."</p>".\r
+          "<p class=dberror id=dbErrorDetail><u>Operation that caused the error:</u><br>".$ContextMsg."</p>";\r
+        break;\r
+      case "MULTILINE":\r
+        $function_ret="Error! " . $this->db->ErrorMsg() ."\n\nOperation that caused the error:\n".$ContextMsg;\r
+        break;\r
+      case "1LINE":\r
+        $function_ret="Error! " . $this->db->ErrorMsg() ."  (".$ContextMsg.")";\r
+        break;\r
+    }\r
+    return $function_ret;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Runs a query and moves to the first record.\r
+// Use only for queries that return records (no updates or deletes).\r
+// If the query generated an error then Nothing is returned, otherwise it returns a new recordset object.\r
+//********************************************************************************************************\r
+  function RunQuery($sqltext) {\r
+    $rsLookUp=$this->db->RunQuery($sqltext);\r
+    if ($this->CheckForError($sqltext)) return null;\r
+    if ($this->debug) $this->DisplayMsg($sqltext);\r
+    return $rsLookUp;\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Runs a parameterized query (put ? in $sqltext to indicate where parameters should be inserted)\r
+// Use only for queries that return records (no updates or deletes).\r
+// If the query generated an error then null is returned, otherwise it returns a new recordset object.\r
+//********************************************************************************************************\r
+  function RunParamQuery($sqltext, $arParams) {\r
+    $rsLookUp=$this->db->RunParamQuery($sqltext, $arParams);\r
+    if ($this->CheckForError($sqltext)) return null;\r
+    if ($this->debug) $this->DisplayMsg($sqltext);\r
+    return $rsLookUp;\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Safely close a recordset\r
+//********************************************************************************************************\r
+  function rsClose($rsLookUp) {\r
+    if (is_resource($rsLookUp)) $this->db->FreeResult($rsLookUp);\r
+    $rsLookUp = NULL;\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Runs a query and returns results from the first record in arData.\r
+// Returns true if arData is modified (ie. a record exists).\r
+// If the query generates an error then arData is left unchanged\r
+// returns arData as an array, fields indexed numerically\r
+//********************************************************************************************************\r
+  function SingleRecordQuery($sqltext,&$arData)\r
+  {\r
+    $rsMain=$this->RunQuery($sqltext);\r
+    if (!$rsMain) return false;\r
+    $success=$this->db->FetchArray($rsMain,$arData);\r
+    $this->rsClose($rsMain);\r
+    return $success;\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Runs a query where no result set is expected (updates, deletes, etc)\r
+//   - returns the number of records affected by the action query\r
+//********************************************************************************************************\r
+  function RunActionQuery($sqltext)\r
+  {\r
+    $rsMain=$this->db->RunQuery($sqltext);\r
+    if ($this->CheckForError($sqltext)) {\r
+      return 0;\r
+    }\r
+    else if ($this->debug) {\r
+      $this->DisplayMsg($sqltext);\r
+    }\r
+    return $this->db->AffectedRows($rsMain);\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Runs a query where no result set is expected (updates, deletes, etc)\r
+//   - if an error occurs, then the message is returned in errmsg\r
+//********************************************************************************************************\r
+  function RunActionQueryReturnMsg($sqltext,&$errmsg)\r
+  {\r
+    $tmpDisplayErrors=$this->DisplayErrors;\r
+    $this->DisplayErrors=false;\r
+    $this->LastErrorMsg="";\r
+    $function_ret=$this->RunActionQuery($sqltext);\r
+    if (!empty($this->LastErrorMsg))\r
+    {\r
+      $errmsg=$this->LastErrorMsg;\r
+    }\r
+    $this->DisplayErrors=$tmpDisplayErrors;\r
+    return $function_ret;\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Takes a sql create (table or view) statement and performs:\r
+//   1) a conditional drop (if it already exists)\r
+//   2) the create\r
+//   3) grants select access to public (if not a temp table)\r
+//\r
+// for views, all actions must occur on the default database for the connection\r
+//********************************************************************************************************\r
+  function DropCreate($sqlcreate)\r
+  {\r
+    $parsed=explode(" ",$sqlcreate);\r
+    if (count($parsed) < 3) return;  // error\r
+    $sqltext="DROP ".$parsed[1]." ".$parsed[2];\r
+    $this->RunActionQueryReturnMsg($sqltext,$dropmsg);\r
+    $this->RunActionQuery($sqlcreate);\r
+  }\r
+\r
+//********************************************************************************************************\r
+// Returns a comma-separated list of column names that make up the primary key\r
+// Returns empty string if no primary key has been defined\r
+//********************************************************************************************************\r
+  function PrimaryKey($TableName) {\r
+    $keys='';\r
+    $arColumns=$this->GetColumnInfo($TableName);\r
+    if (!is_array($arColumns)) return '';\r
+    foreach ($arColumns as $colinfo) {\r
+      if ($colinfo->IsPKey) {\r
+        if ($keys!='') $keys.=',';\r
+        $keys.=$colinfo->ColName;\r
+      }\r
+    }\r
+    return $keys;\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Returns array of column info - one entry for each column in $TableName\r
+//********************************************************************************************************\r
+  function GetColumnInfo($TableName) {\r
+    return $this->db->GetColumnInfo($TableName);\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Returns array of table/view names\r
+// $ObjectType is one of 'VIEW' or 'TABLE'\r
+//********************************************************************************************************\r
+  function GetTableList($ObjectType) {\r
+    return $this->db->GetTableList($ObjectType);\r
+  }\r
+\r
+\r
+//********************************************************************************************************\r
+// Add a condition to a where or having clause\r
+//********************************************************************************************************\r
+  function AddCondition(&$WhereClause,$NewCondition)\r
+  {\r
+    if (empty($WhereClause))\r
+      $WhereClause="(".$NewCondition.")";\r
+    else\r
+      $WhereClause.=" AND (".$NewCondition.")";\r
+  }\r
+\r
+}\r
+?>\r
diff --git a/plugins/php/excel.php b/plugins/php/excel.php
new file mode 100644 (file)
index 0000000..0f1a637
--- /dev/null
@@ -0,0 +1,37 @@
+<?php\r
+// Coded for PHP4 - requires PHP's XSLT extension to be enabled\r
+\r
+$outfile=isset($_GET["name"]) ? $_GET["name"] : "export";\r
+if (!isset($_GET["xml"])) {\r
+  echo "ERROR: expected url for xml source document";\r
+}\r
+elseif (!isset($_GET["xsl"])) {\r
+  echo "ERROR: expected url for xsl transformation";\r
+}\r
+else {\r
+  doTransform($_GET["xml"], $_GET["xsl"]."2xl.xsl");\r
+}\r
+\r
+\r
+\r
+function doTransform($xmlfilename, $xslfilename) {\r
+  $xh = xslt_create();\r
+  if (!$xh) {\r
+    echo "<p>ERROR: unable to invoke php's xslt processor";\r
+    return;\r
+  }\r
+  $root='file://'.$_SERVER['DOCUMENT_ROOT'];\r
+  $result = xslt_process($xh, $root.$xmlfilename, $root.$xslfilename);\r
+  if ($result) {\r
+    header("Content-type: application/ms-excel");\r
+    //header("Content-type: application/vnd.ms-excel");\r
+    header('Content-Disposition: attachment; filename="'.$GLOBALS['outfile'].'.xls";');\r
+    echo $result;\r
+  } else {\r
+    echo "<p>ERROR: unable to transform ".$xmlfilename;\r
+    echo "<br>" . xslt_error($xh); \r
+  }\r
+  xslt_free($xh);\r
+}\r
+\r
+?> \r
diff --git a/plugins/php/ricoLiveGridForms.php b/plugins/php/ricoLiveGridForms.php
new file mode 100644 (file)
index 0000000..b081e3d
--- /dev/null
@@ -0,0 +1,737 @@
+<?php\r
+//**********************************\r
+// Rico: GENERIC TABLE/VIEW EDITOR\r
+//  By Matt Brown\r
+//**********************************\r
+\r
+class TableEditTable {\r
+  var $TblName;\r
+  var $alias;\r
+  var $arFields;\r
+  var $arData;\r
+  var $arColInfo;\r
+}\r
+\r
+class TableEditClass {\r
+\r
+  // public properties\r
+  var $action;\r
+  var $TableFilter;\r
+  var $options;\r
+  var $AutoInit;\r
+  var $CurrentField;\r
+  var $LookupField;\r
+  var $SvrOnly;\r
+  var $gridID;\r
+  var $formVar;\r
+  var $gridVar;\r
+  var $bufferVar;\r
+  var $optionsVar;\r
+  var $DefaultSort;\r
+  var $convertCharSet; // set to true if database is ISO-8859-1 encoded, false if UTF-8\r
+  var $sessions;\r
+\r
+  // private properties\r
+  var $Panels=array();\r
+  var $objDB;\r
+  var $CurrentPanel;\r
+  var $xhtmlcloser;\r
+  var $ErrorFlag;\r
+  var $ErrorMsg;\r
+  var $MainTbl;\r
+  var $Tables=array();\r
+  var $TableCnt;\r
+  var $Fields=array();\r
+  var $FieldCnt;\r
+  var $oParseMain;\r
+\r
+  //*************************************************************************************\r
+  // Class Constructor\r
+  //*************************************************************************************\r
+  function TableEditClass() {\r
+    if (is_object($GLOBALS['oDB'])) {\r
+      $this->objDB=&$GLOBALS['oDB'];    // use oDB global as database connection, if it exists\r
+    }\r
+    $this->options=array();\r
+    $this->options["TableSelectNew"]="___new___";\r
+    $this->options["TableSelectNone"]="";\r
+    $this->options["canAdd"]=true;\r
+    $this->options["canEdit"]=true;\r
+    $this->options["canDelete"]=true;\r
+    $this->options["ConfirmDelete"]=true;\r
+    $this->options["ConfirmDeleteCol"]=-1;\r
+    $this->options["DebugFlag"]=isset($_GET["debug"]);\r
+    $this->options["prefetchBuffer"]=true;\r
+    $this->options["PanelNamesOnTabHdr"]=true;\r
+    $this->options["highlightElem"]="menuRow";\r
+\r
+    $this->SvrOnly=array();\r
+    $this->SvrOnly["DropDownSelect"]=1;\r
+    $this->SvrOnly["SelectSql"]=1;\r
+    $this->SvrOnly["SelectFilter"]=1;\r
+    $this->SvrOnly["Formula"]=1;\r
+    $this->SvrOnly["TableIdx"]=1;\r
+    $this->SvrOnly["AddQuotes"]=1;\r
+    $this->SvrOnly["FilterFlag"]=1;\r
+    $this->SvrOnly["XMLprovider"]=1;\r
+\r
+    $this->xhtmlcloser=">";\r
+    $this->FieldCnt=-1;\r
+    $this->CurrentPanel=-1;\r
+    $this->TableCnt=-1;\r
+    $this->AutoInit=true;\r
+    $this->formView=true;\r
+    $this->sessions=isset($_SESSION);\r
+    $this->ErrorFlag=false;\r
+    $this->ErrorMsg="";\r
+    $this->convertCharSet=false;\r
+    $this->oParseMain= new sqlParse();\r
+    $this->oParseMain->Init();\r
+  }\r
+\r
+  // -------------------------------------------------------------\r
+  // Class Destructor (only called if php5)\r
+  // -------------------------------------------------------------\r
+  function __destruct() {\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+      $this->Fields[$i]=NULL;\r
+    }\r
+    $this->options=NULL;\r
+    $this->SvrOnly=NULL;\r
+  }\r
+\r
+  // returns field number if successful, false if error\r
+  function AddEntryField($ColumnName, $Heading, $EntryTypeCode, $DefaultValue) {\r
+    if (!in_array($EntryTypeCode, array("S", "N", "R", "H", "D", "DT", "I", "F", "B", "T", "TA", "SL", "RL", "CL", "tinyMCE"))) {\r
+      $this->TableEditError("invalid EntryTypeCode in TableEditClass");\r
+      return false;\r
+    }\r
+    $this->IncrCurrentField();\r
+    $this->CurrentField["ColName"]=$ColumnName;\r
+    $this->CurrentField["Hdg"]=$Heading;\r
+    $this->CurrentField["EntryType"]=$EntryTypeCode;\r
+    $this->CurrentField["ColData"]=$DefaultValue;\r
+    switch ($EntryTypeCode) {\r
+\r
+      case "D":\r
+        $this->CurrentField["type"]="date";\r
+        break;\r
+\r
+      case "DT":\r
+        $this->CurrentField["type"]="datetime";\r
+        break;\r
+\r
+      case "TA":\r
+      case "tinyMCE":\r
+        $this->CurrentField["TxtAreaRows"]=4;\r
+        $this->CurrentField["TxtAreaCols"]=80;\r
+        break;\r
+\r
+      case "R":\r
+      case "RL":\r
+        $this->CurrentField["RadioBreak"]="<br".$this->xhtmlcloser;\r
+        break;\r
+\r
+      case "H":\r
+        $this->CurrentField["visible"]=false;\r
+        break;\r
+    }\r
+    $s=$this->Tables[$this->MainTbl]->alias.".".$ColumnName;\r
+    if (in_array($EntryTypeCode, array("B", "T", "TA", "tinyMCE"))) $s="rtrim(" . $s . ")";\r
+    $this->oParseMain->AddColumn($s, "rico_col".$this->FieldCnt);\r
+    return $this->FieldCnt;\r
+  }\r
+\r
+  // returns field number if successful, false if error\r
+  function AddEntryFieldW($ColumnName, $Heading, $EntryTypeCode, $DefaultValue, $Width) {\r
+    $retval=$this->AddEntryField($ColumnName, $Heading, $EntryTypeCode, $DefaultValue);\r
+    if ($retval!==false) $this->CurrentField["width"]=$Width;\r
+    return $retval;\r
+  }\r
+  \r
+  // $DescColName is optional - pass empty if not used\r
+  function AddLookupField($CodeColName,$DescColName,$CodeHdg,$DisplayHdg,$EntryTypeCode,$DefaultValue,$sql) {\r
+    $retval=$this->AddEntryField($CodeColName,$CodeHdg,$EntryTypeCode,$DefaultValue);\r
+    $this->CurrentField["visible"]=false;\r
+    $this->CurrentField["SelectSql"]=$sql;\r
+    if (!empty($DescColName)) $this->CurrentField["DescriptionField"]=$this->ExtFieldId($this->FieldCnt+1);\r
+    $this->LookupField=&$this->Fields[$this->FieldCnt];\r
+    $oParseLookup= new sqlParse();\r
+    $alias="t" . $this->FieldCnt;\r
+    $oParseLookup->ParseSelect($sql);\r
+    if (count($oParseLookup->arSelList) == 2) {\r
+      $codeField=$oParseLookup->arSelList[0];\r
+      $descField=$oParseLookup->arSelList[1];\r
+      $s="left join ".$oParseLookup->FromClause." ".$alias." on t.".$CodeColName."=".$alias.".".str_replace("%alias%","",str_replace("%aliasmain%","",$codeField));\r
+      if (!empty($oParseLookup->WhereClause)) $s.=" and " . str_replace("%alias%",$alias.".",$oParseLookup->WhereClause);\r
+      $this->oParseMain->AddJoin($s);\r
+      $this->IncrCurrentField();\r
+      $this->CurrentField["ColName"]="Lookup_".$this->FieldCnt;\r
+      $this->CurrentField["Hdg"]=$DisplayHdg;\r
+      if (!empty($DescColName)) {\r
+        $descField=$this->Tables[$this->MainTbl]->alias & "." & $DescColName;\r
+        $this->CurrentField["ColName"]=$DescColName;\r
+        $this->CurrentField["FormView"]="hidden";\r
+        $this->CurrentField["EntryType"]="T";\r
+      } else if (preg_match("/^\\w+$/",$descField)) {\r
+        $descField=$alias.".".$descField;\r
+      } else {\r
+        $descField=str_replace("%alias%",$alias . ".",str_replace("%aliasmain%","t.",$descField));\r
+      }\r
+      $this->oParseMain->AddColumn($descField, "rico_col".$this->FieldCnt);\r
+    }\r
+    else {\r
+      $this->TableEditError("Invalid lookup query (".$sql.")");\r
+    }\r
+  }\r
+\r
+  // returns field number if successful, false if error\r
+  function AddCalculatedField($ColumnFormula, $Heading) {\r
+    $this->IncrCurrentField();\r
+    if (substr($ColumnFormula,0,1) != "(") {\r
+      $ColumnFormula="(".$ColumnFormula.")";\r
+    }\r
+    $this->CurrentField["ColName"]="Calc_".$this->FieldCnt;\r
+    $this->CurrentField["Hdg"]=$Heading;\r
+    $this->oParseMain->AddColumn($ColumnFormula, "rico_col".$this->FieldCnt);\r
+    return $this->FieldCnt;\r
+  }\r
+\r
+  function AddPanel($PanelHeading) {\r
+    $this->CurrentPanel++;\r
+    $this->Panels[$this->CurrentPanel]=$PanelHeading;\r
+  }\r
+\r
+  function DefineAltTable($AltTabName, $arFieldList, $arFieldData) {\r
+    $this->TableCnt++;\r
+    $this->Tables[$this->TableCnt]= new TableEditTable();\r
+    $_withval=$this->Tables[$this->TableCnt];\r
+    $_withval->TblName=$AltTabName;\r
+    $_withval->alias="a" . $this->TableCnt;\r
+    $_withval->arFields=$arFieldList;\r
+    $_withval->arData=$arFieldData;\r
+    if (count($_withval->arFields) != count($_withval->arData)) {\r
+      $this->TableEditError("# of fields does not match # of data entries supplied for table ".$AltTabName);\r
+      return false;\r
+    }\r
+    return $this->TableCnt;\r
+  }\r
+\r
+  function IncrCurrentField() {\r
+    $this->FieldCnt++;\r
+    $this->Fields[$this->FieldCnt]= array();\r
+    $this->CurrentField= &$this->Fields[$this->FieldCnt];\r
+    $this->CurrentField["panelIdx"]=($this->CurrentPanel >= 0) ? $this->CurrentPanel : 0;\r
+    $this->CurrentField["AddQuotes"]=true;\r
+    $this->CurrentField["ReadOnly"]=false;\r
+    $this->CurrentField["TableIdx"]=$this->MainTbl;\r
+  }\r
+\r
+  function SetTableName($s) {\r
+    $this->TableCnt++;\r
+    $this->MainTbl=$this->TableCnt;\r
+    $this->Tables[$this->TableCnt]= new TableEditTable();\r
+    $this->Tables[$this->MainTbl]->TblName=$s;\r
+    $this->Tables[$this->MainTbl]->alias="t";\r
+    $this->oParseMain->FromClause=$s." t";\r
+    $this->gridID=strtolower(str_replace(" ","_",str_replace(".","_",$s)));\r
+    $this->formVar=$this->gridID . "['edit']";\r
+    $this->gridVar=$this->gridID . "['grid']";\r
+    $this->bufferVar=$this->gridID . "['buffer']";\r
+    $this->optionsVar=$this->gridID . "['options']";\r
+    $actionparm="_action_".$this->gridID;\r
+    $this->action=isset($_REQUEST[$actionparm]) ? trim($_REQUEST[$actionparm]) : "";\r
+    $this->action=($this->action == "") ? "table" : strtolower($this->action);\r
+  }\r
+\r
+  function AddSort($field,$direction) {\r
+    if (!empty($this->DefaultSort)) $this->DefaultSort.=",";\r
+    $this->DefaultSort.=$field . " " . $direction;\r
+  }\r
+\r
+  function SortCurrent($direction) {\r
+    if (array_key_exists("Formula",$this->CurrentField))\r
+      $this->AddSort($this->CurrentField["Formula"],$direction);\r
+    elseif (array_key_exists("ColName",$this->CurrentField))\r
+      $this->AddSort($this->Tables[$this->CurrentField["TableIdx"]]->alias . "." . $this->CurrentField["ColName"],$direction);\r
+    $this->options["sortCol"]=$this->FieldCnt;\r
+    $this->options["sortDir"]=$direction;\r
+  }\r
+\r
+  function SortAsc() {\r
+    $this->SortCurrent("ASC");\r
+  }\r
+\r
+  function SortDesc() {\r
+    $this->SortCurrent("DESC");\r
+  }\r
+\r
+  function ConfirmDeleteColumn() {\r
+    $this->options["ConfirmDeleteCol"]=$this->FieldCnt;\r
+  }\r
+\r
+  function genXHTML() {\r
+    $this->xhtmlcloser=" />";\r
+  }\r
+\r
+  function SetDbConn(&$dbcls) {\r
+    $this->objDB=&$dbcls;\r
+  }\r
+\r
+  //*************************************************************************************\r
+  // Take appropriate action\r
+  //*************************************************************************************\r
+  function DisplayPage() {\r
+    if (count($this->Fields) == 0) {\r
+      return;\r
+    }\r
+    if (!$this->ErrorFlag) {\r
+      $this->GetColumnInfo();\r
+    }\r
+    if (!$this->ErrorFlag) {\r
+      switch ($this->action) {\r
+\r
+        case "del":\r
+          if ($this->options["canDelete"]) {\r
+            $this->TableDeleteRecord();\r
+          }\r
+          break;\r
+\r
+        case "ins":\r
+          if ($this->options["canAdd"]) {\r
+            $this->TableInsertRecord();\r
+          }\r
+          break;\r
+\r
+        case "upd":\r
+          if ($this->options["canEdit"]) {\r
+            $this->TableUpdateRecord();\r
+          }\r
+          break;\r
+\r
+        default:\r
+          if ($this->sessions) $_SESSION[$this->gridID]=$this->SqlSelectData();\r
+          $this->TableDisplay();\r
+          break;\r
+      }\r
+    }\r
+    if ($this->ErrorFlag) {\r
+      echo "\n<p style='color:red;'><span style='text-decoration:underline;'>ERROR ENCOUNTERED</span><br".$this->xhtmlcloser.$this->ErrorMsg;\r
+    }\r
+  }\r
+\r
+  // if AltTable has a multi-column key, then add those additional constraints\r
+  function AltTableKeyWhereClause($AltTabIdx) {\r
+    for ($i=0; $i<count($this->Tables[$AltTabIdx]->arFields); $i++) {\r
+      if ($this->Tables[$AltTabIdx]->arColInfo[$i]->IsPKey) {\r
+        $w.=" and ".$this->Tables[$AltTabIdx]->arFields[$i]."=".$this->Tables[$AltTabIdx]->arData[$i];\r
+      }\r
+    }\r
+    return $w;\r
+  }\r
+\r
+  function AltTableJoinClause($alias) {\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+      if ($this->Fields[$i]["TableIdx"] == $this->MainTbl && !$this->IsCalculatedField($i)) {\r
+        if ($this->Fields[$i]["ColInfo"]->IsPKey) {\r
+          $this->objDB->AddCondition($w, $this->Fields[$i]["ColName"]."=".$alias.".".$this->Fields[$i]["ColName"]);\r
+        }\r
+      }\r
+    }\r
+    return $w;\r
+  }\r
+\r
+  // form where clause based on table's primary key\r
+  function TableKeyWhereClause() {\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+      if ($this->Fields[$i]["TableIdx"] == $this->MainTbl && !$this->IsCalculatedField($i)) {\r
+        if ($this->Fields[$i]["ColInfo"]->IsPKey) {\r
+          $this->objDB->AddCondition($w, $this->Fields[$i]["ColName"]."=".$this->FormatValue($_POST["_k".$i],$i));\r
+        }\r
+      }\r
+    }\r
+    if (empty($w)) {\r
+      $this->TableEditError("no key value");\r
+    }\r
+    else {\r
+      return " WHERE ".$w;\r
+    }\r
+  }\r
+\r
+  // name used external to this script\r
+  function ExtFieldId($i) {\r
+    return $this->gridID."_".$i;\r
+  }\r
+\r
+  function IsCalculatedField($i) {\r
+    return array_key_exists("Formula",$this->Fields[$i]);\r
+  }\r
+\r
+  //*************************************************************************************\r
+  // Retrieves column info from database for main table and any alternate tables\r
+  //*************************************************************************************\r
+  function GetColumnInfo() {\r
+    $Columns=array();\r
+    $dicColIdx=array();\r
+    for ($FieldNum=0; $FieldNum<count($this->Fields); $FieldNum++) {\r
+      $dicColIdx[$this->Fields[$FieldNum]["TableIdx"].".".strtoupper($this->Fields[$FieldNum]["ColName"])]= $FieldNum;\r
+      if ($this->options["canEdit"] == false && $this->options["canAdd"] == false) {\r
+        $this->Fields[$FieldNum]["ReadOnly"]=true;\r
+      }\r
+    }\r
+    //print_r($dicColIdx);\r
+    for ($i=0; $i<=$this->TableCnt; $i++) {\r
+      $Columns=$this->objDB->GetColumnInfo($this->Tables[$i]->TblName);\r
+      if (!is_array($Columns)) {\r
+        $this->TableEditError("unable to retrieve column info for ".$this->Tables[$i]->TblName."<br>".$this->objDB->LastErrorMsg);\r
+        return;\r
+      }\r
+      //print_r($Columns);\r
+      for ($c=0; $c < count($Columns); $c++) {\r
+        $colname=strtoupper($Columns[$c]->ColName);\r
+        if (array_key_exists($i.".".$colname,$dicColIdx)) {\r
+          $FieldNum=$dicColIdx[$i.".".$colname];\r
+          $this->Fields[$FieldNum]["ColInfo"]=$Columns[$c];\r
+        }\r
+        elseif ($i != $this->MainTbl) {\r
+          for ($j=0; $j < count($this->Tables[$i]->arFields); $j++) {\r
+            if ($colname == $this->Tables[$i]->arFields[$j]) {\r
+              $this->Tables[$i]->arColInfo[$j]=$Columns[$c];\r
+            }\r
+          }\r
+        }\r
+        elseif ($Columns[$c]->IsPKey) {\r
+          $this->TableEditError("primary key field is not defined (".$this->Tables[$i]->TblName.".".$colname.")");\r
+          $dicColIdx=NULL;\r
+          return;\r
+        }\r
+      }\r
+    }\r
+    $dicColIdx=NULL;\r
+  }\r
+\r
+  function TableUpdateDatabase($sqltext, $actiontxt) {\r
+    if ($this->ErrorFlag) {\r
+      return;\r
+    }\r
+    $cnt=$this->objDB->RunActionQueryReturnMsg($sqltext, $errmsg);\r
+    if ($this->options["DebugFlag"])\r
+      echo "<p class='debug'>".$sqltext."<br".$this->xhtmlcloser."Records affected: ".$cnt;\r
+    if (!empty($errmsg))\r
+      $this->TableEditError("unable to update database!<br".$this->xhtmlcloser.$errmsg);\r
+    else if ($cnt == 1)\r
+      echo "<p class='ricoFormResponse ".$actiontxt."Successfully'></p>";\r
+    else\r
+      $this->TableEditError("no data changed - update skipped");\r
+  }\r
+\r
+  function FormatValue($v, $idx) {\r
+    $fld=$this->Fields[$idx];\r
+    $addquotes=$fld["AddQuotes"];\r
+    if (substr($fld["EntryType"],0,1) == "D") {\r
+      if ($v == "") {\r
+        $addquotes=false;\r
+        $v="NULL";\r
+      }\r
+    }\r
+    elseif ($fld["EntryType"] == "I" || $fld["EntryType"] == "F") {\r
+      $addquotes=false;\r
+      if ($v == "" || !is_numeric($v)) {\r
+        $v="NULL";\r
+      }\r
+    }\r
+    elseif ($fld["EntryType"] == "N" && $v == $this->options["TableSelectNew"]) {\r
+      $v=trim($_POST["textnew__".$this->ExtFieldId($idx)]);\r
+    }\r
+    elseif (strpos("SNR",substr($fld["EntryType"],0,1)) !== false && $v == $this->options["TableSelectNone"]) {\r
+      $addquotes=false;\r
+      $v="NULL";\r
+    }\r
+    if ($addquotes) $v=$this->objDB->addQuotes($v);\r
+    return $v;\r
+  }\r
+\r
+  function FormatFormValue($idx) {\r
+    if (!array_key_exists("EntryType",$this->Fields[$idx])) return "";\r
+    $fldname=$this->ExtFieldId($idx);\r
+    if ($this->Fields[$idx]["EntryType"] == "H" || (array_key_exists("FormView",$this->Fields[$idx]) && $this->Fields[$idx]["FormView"] == "exclude"))\r
+      $v=$this->Fields[$idx]["ColData"];\r
+    elseif (isset($_POST[$fldname])) {\r
+      $v=$_POST[$fldname];\r
+      if (get_magic_quotes_gpc()) $v=stripslashes($v);\r
+      $v=($this->convertCharSet) ? utf8_decode($v) : urldecode($v);\r
+      $v=trim($v);\r
+    }\r
+    return $this->FormatValue($v, $idx);\r
+  }\r
+\r
+  //*************************************************************************************\r
+  // Deletes the specified record\r
+  //*************************************************************************************\r
+  function TableDeleteRecord() {\r
+    $this->TableUpdateDatabase("DELETE FROM ".$this->Tables[$this->MainTbl]->TblName.$this->TableKeyWhereClause(), "deleted");\r
+  }\r
+\r
+  function UpdateRecord($sqltext) {\r
+    $this->objDB->RunActionQueryReturnMsg($sqltext, $errmsg);\r
+    if (!empty($errmsg)) {\r
+      $errmsg="unable to update database!<br".$this->xhtmlcloser.$errmsg;\r
+      if ($this->options["DebugFlag"]) {\r
+        $errmsg.="<p>SQL: ".$sqltext;\r
+      }\r
+      $this->TableEditError($errmsg);\r
+    }\r
+    elseif ($this->options["DebugFlag"]) {\r
+      echo "<BR class='debug'>".$sqltext;\r
+    }\r
+  }\r
+\r
+  function UpdateAltTableRecords($i) {\r
+    if ($this->ErrorFlag) {\r
+      return;\r
+    }\r
+    // delete existing record\r
+    $sqltext="delete from ".$this->Tables[$i]->TblName;\r
+    $sqltext.=$this->TableKeyWhereClause();\r
+    $sqltext.=$this->AltTableKeyWhereClause($i);\r
+    $this->UpdateRecord($sqltext);\r
+    // insert new record\r
+    $colnames="";\r
+    $coldata="";\r
+    for ($j=0; $j<count($this->Fields); $j++) {\r
+      if (!array_key_exists("ColInfo",$this->Fields[$j])) continue;\r
+      if ($this->Fields[$j]["TableIdx"] == $i || $this->Fields[$j]["ColInfo"]->IsPKey) {\r
+        $colnames.=",".$this->Fields[$j]["ColName"];\r
+        $coldata.=",".$this->FormatValue(trim($_POST[$this->ExtFieldId($j)]), $j);\r
+      }\r
+    }\r
+    for ($j=0; $j<count($this->Tables[$i]->arFields); $j++) {\r
+      $c=$this->Tables[$i]->arFields[$j];\r
+      $colnames.=",".$c;\r
+      $coldata.=",".$this->Tables[$i]->arData[$j];\r
+    }\r
+    $sqltext="insert into ".$this->Tables[$i]->TblName." (".substr($colnames,1).") values (".substr($coldata,1).")";\r
+    $this->UpdateRecord($sqltext);\r
+  }\r
+\r
+  //*************************************************************************************\r
+  // Updates an existing record in the db\r
+  //*************************************************************************************\r
+  function TableUpdateRecord() {\r
+    for ($i=0; $i<=$this->TableCnt; $i++) {\r
+      if ($i != $this->MainTbl) {\r
+        $this->UpdateAltTableRecords($i);\r
+      }\r
+    }\r
+    for ($i=0,$sqltext=''; $i<count($this->Fields); $i++) {\r
+      if (!$this->IsCalculatedField($i)) {\r
+        if ($this->Fields[$i]["TableIdx"] == $this->MainTbl && $this->Fields[$i]["ColInfo"]->Writeable && !array_key_exists("InsertOnly",$this->Fields[$i])) {\r
+          $sqltext.=",".$this->Fields[$i]["ColName"]."=".$this->FormatFormValue($i);\r
+        }\r
+      }\r
+    }\r
+    $sqltext="UPDATE ".$this->Tables[$this->MainTbl]->TblName." SET ".substr($sqltext,1);\r
+    $sqltext.=$this->TableKeyWhereClause();\r
+    $this->TableUpdateDatabase($sqltext, "updated");\r
+  }\r
+  //*************************************************************************************\r
+  // Inserts a new record into the db\r
+  //*************************************************************************************\r
+\r
+  function TableInsertRecord() {\r
+    $keyCnt=0;\r
+    $sqlcol="";\r
+    $sqlval="";\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+      if (!$this->IsCalculatedField($i) && $this->Fields[$i]["TableIdx"] == $this->MainTbl && !array_key_exists("UpdateOnly",$this->Fields[$i])) {\r
+        if ($this->Fields[$i]["ColInfo"]->IsPKey) {\r
+          $keyCnt++;\r
+          $keyIdx=$i;\r
+        }\r
+        if ($this->Fields[$i]["ColInfo"]->Writeable) {\r
+          $sqlcol.=",".$this->Fields[$i]["ColName"];\r
+          $sqlval.=",".$this->FormatFormValue($i);\r
+        }\r
+      }\r
+    }\r
+    $sqltext="insert into ".$this->Tables[$this->MainTbl]->TblName." (".substr($sqlcol,1).") values (".substr($sqlval,1).")";\r
+    $this->TableUpdateDatabase($sqltext, "added");\r
+  }\r
+\r
+  function TableEditError($msg) {\r
+    $this->ErrorFlag=true;\r
+    $this->ErrorMsg=$msg;\r
+  }\r
+  \r
+  //*************************************************************************************\r
+  // Do post-processing on sql query\r
+  //*************************************************************************************\r
+  function FinishQuery() {\r
+    $oParseLookup= new sqlParse();\r
+    $this->oParseMain->AddWhereCondition($this->TableFilter);\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+\r
+      if (array_key_exists("FilterFlag",$this->Fields[$i])) {\r
+        // add any column filters to where clause\r
+        $this->oParseMain->AddWhereCondition($this->Tables[$this->Fields[$i]["TableIdx"]]->alias.".".$this->Fields[$i]["ColName"]."='".$this->Fields[$i]["ColData"]."'");\r
+      }\r
+\r
+      if (array_key_exists("EntryType",$this->Fields[$i])) {\r
+        if (strpos("CSNR",substr($this->Fields[$i]["EntryType"],0,1)) !== false) {\r
+          if (array_key_exists("SelectSql",$this->Fields[$i])) {\r
+            $s=$this->Fields[$i]["SelectSql"];\r
+            if (array_key_exists("SelectFilter",$this->Fields[$i])) {\r
+              $oParseLookup->ParseSelect($s);\r
+              $oParseLookup->AddWhereCondition($this->Fields[$i]["SelectFilter"]);\r
+              $s=$oParseLookup->UnparseSelect();\r
+            }\r
+            $this->Fields[$i]["DropDownSelect"]=str_replace("%alias%","",str_replace("%aliasmain%","",$s));\r
+          }\r
+          else {\r
+            $this->Fields[$i]["DropDownSelect"]="select distinct ".$this->Fields[$i]["ColName"]." from ".$this->Tables[$this->Fields[$i]["TableIdx"]]->TblName." where ".$this->Fields[$i]["ColName"]." is not null";\r
+          }\r
+        }\r
+      }\r
+\r
+      if ($this->Fields[$i]["TableIdx"] != $this->MainTbl) {\r
+\r
+        // column from alt table - no avoiding subqueries here\r
+\r
+        $s="(select " . $this->Fields[$i]["ColName"] . " from " . $this->Tables[$this->Fields[$i]["TableIdx"]]->TblName . " a" . $i . " where " . $this->AltTableJoinClause("t") . $this->AltTableKeyWhereClause($this->Fields[$i]["TableIdx"]) . ")";\r
+        if (substr($this->Fields[$i]["EntryType"],1) == "L" && array_key_exists("SelectSql",$this->Fields[$i])) {\r
+          $oParseLookup->ParseSelect($this->Fields[$i]["SelectSql"]);\r
+          if (count($oParseLookup->arSelList) == 2) {\r
+            $codeField=$oParseLookup->arSelList[0];\r
+            $descField=$oParseLookup->arSelList[1];\r
+            $descQuery="select " . $descField . " from " . $oParseLookup->FromClause . " where " . $codeField . "=" . $s;\r
+            if (!empty($oParseLookup->WhereClause)) $descQuery.=" and " . $oParseLookup->WhereClause;\r
+            $this->oParseMain->arSelList[$i]="(" . $this->objDB->concat(array("(" . $descQuery . ")", "'<span class=\"ricoLookup\">'", $this->objDB->Convert2Char($s), "'</span>'"), false) . ") as rico_col" . $i;\r
+          } else {\r
+            $this->TableEditError("Invalid lookup query (".$this->Fields[$i]["SelectSql"].")");\r
+            return;\r
+          }\r
+        } else {\r
+          $this->oParseMain->arSelList[$i]=$s . " as rico_col" . $i;\r
+        }\r
+      }\r
+    }\r
+    if (empty($this->DefaultSort)) {\r
+      $this->DefaultSort=$this->objDB->PrimaryKey($this->Tables[$this->MainTbl]->TblName);\r
+    }\r
+    $this->oParseMain->AddSort($this->DefaultSort);\r
+  }\r
+  \r
+  //*************************************************************************************\r
+  // returns details of sql query as an array\r
+  //*************************************************************************************\r
+  function SqlSelectData() {\r
+    $this->FinishQuery();\r
+    $arr=$this->oParseMain->ToArray();\r
+    $SelectIdx=count($arr);\r
+    array_push($arr, array());\r
+    $HdgIdx=count($arr);\r
+    array_push($arr, array());\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+      if (array_key_exists("DropDownSelect",$this->Fields[$i])) {\r
+        $arr[$SelectIdx][$i]=$this->Fields[$i]["DropDownSelect"];\r
+      }\r
+      if (array_key_exists("Hdg",$this->Fields[$i])) {\r
+        $arr[$HdgIdx][$i]=$this->Fields[$i]["Hdg"];\r
+      }\r
+    }\r
+    return $arr;\r
+  }\r
+  \r
+  //*************************************************************************************\r
+  // Displays a table\r
+  //*************************************************************************************\r
+  function TableDisplay() {\r
+    echo "\n<p class='ricoBookmark'>";\r
+    echo "<span id='".$this->gridID."_timer' class='ricoSessionTimer'></span>";\r
+    echo "<span id='".$this->gridID."_bookmark' class='ricoBookmark'>&nbsp;</span>";\r
+    echo "<span id='".$this->gridID."_savemsg' class='ricoSaveMsg'></span>";\r
+    echo "</p>";\r
+    echo "\n<div id='".$this->gridID."'></div>";\r
+    echo "\n<script type='text/javascript'>";\r
+    echo "\nRico.acceptLanguage('" . $_SERVER["HTTP_ACCEPT_LANGUAGE"] . "');";\r
+    echo "\nvar ".$this->gridID." = {};";\r
+    echo "\n".$this->optionsVar." = {";\r
+    foreach ($this->options as $o => $value) {\r
+      if (!is_object($value) && !array_key_exists($o,$this->SvrOnly)) {\r
+        echo "\n  ".$o.": ".$this->FormatOption($value).",";\r
+      }\r
+    }\r
+    if ($this->CurrentPanel >= 0) {\r
+      echo "\n  panels: [";\r
+      for ($i=0; $i<=$this->CurrentPanel; $i++) {\r
+        if ($i > 0) {\r
+          echo ",";\r
+        }\r
+        echo "'".$this->Panels[$i]."'";\r
+      }\r
+      echo "],";\r
+    }\r
+    echo "\n  columnSpecs : [";\r
+    for ($i=0; $i<count($this->Fields); $i++) {\r
+      if ($this->Fields[$i]["TableIdx"] != $this->MainTbl) $this->Fields[$i]["UpdateOnly"]=true;\r
+      if ($i > 0) {\r
+        echo ",";\r
+      }\r
+      echo "\n    {";\r
+      echo " FieldName:'".$this->ExtFieldId($i)."'";\r
+      foreach ($this->Fields[$i] as $o => $value) {\r
+        if (!is_object($value) && !array_key_exists($o,$this->SvrOnly)) {\r
+          echo ",\n      ".$o.": ".$this->FormatOption($value);\r
+        }\r
+      }\r
+      if (array_key_exists("ColInfo",$this->Fields[$i])) {\r
+        echo ",\n      isNullable:".$this->FormatOption($this->Fields[$i]["ColInfo"]->Nullable);\r
+        echo ",\n      Writeable:".$this->FormatOption($this->Fields[$i]["ColInfo"]->Writeable);\r
+        echo ",\n      isKey:".$this->FormatOption($this->Fields[$i]["ColInfo"]->IsPKey);\r
+        if ($this->Fields[$i]["ColInfo"]->ColLength) {\r
+          echo ",\n      Length:".$this->Fields[$i]["ColInfo"]->ColLength;\r
+        }\r
+      }\r
+      echo " }";\r
+    }\r
+    echo "\n  ]";\r
+    echo "\n};";\r
+    if ($this->AutoInit) {\r
+      echo "\nRico.onLoad(function() {";\r
+      //echo "\n  try {";\r
+      echo "\n  if(typeof Rico.LiveGrid=='undefined') throw('LiveGridForms requires the Rico.LiveGrid Library');";\r
+      echo "\n  if(typeof Rico.GridMenu=='undefined') throw('LiveGridForms requires the Rico.GridMenu Library');";\r
+      echo "\n  if(typeof Rico.Buffer=='undefined') throw('LiveGridForms requires the Rico.Buffer Library');";\r
+      echo "\n  if(typeof Rico.Buffer.AjaxSQL=='undefined') throw('LiveGridForms requires the Rico.Buffer.AjaxSQL Library');";\r
+      echo $this->InitScript();\r
+      //echo "\n  } catch(e) { alert(e.message); };";\r
+      echo "\n});";\r
+    }\r
+    echo "\n</script>";\r
+  }\r
+\r
+  function FormatOption($s) {\r
+    if (is_array($s)) return "{" . implode(",",$s) . "}";\r
+    switch (gettype($s)) {\r
+      case 'string':  return "\"".addslashes($s)."\"";\r
+      case 'boolean': return $s ? 'true' : 'false';\r
+      case 'double':  return str_replace(",",".",strval($s));  // make sure period is used as a decimal point\r
+      default:        return $s;\r
+    }\r
+  }\r
+\r
+  function InitScript() {\r
+    $s="\n".$this->bufferVar."=new Rico.Buffer.AjaxSQL('" . $this->options["XMLprovider"] . "', {TimeOut:" . (array_shift(session_get_cookie_params())/60) . "});";\r
+    $s.="\nif(typeof ".$this->gridID."_GridInit=='function') ".$this->gridID."_GridInit();";\r
+    $s.="\n".$this->gridVar."=new Rico.LiveGrid('".$this->gridID."',".$this->bufferVar.",".$this->optionsVar.");";\r
+    $s.="\n".$this->gridVar.".menu=new Rico.GridMenu();";\r
+    if ($this->formView) {\r
+      $s.="\nif(typeof ".$this->gridID."_FormInit=='function') ".$this->gridID."_FormInit();";\r
+      $s.="\n".$this->formVar."=new Rico.TableEdit(".$this->gridVar.");";\r
+    }\r
+    $s.="\nif(typeof ".$this->gridID."_InitComplete=='function') ".$this->gridID."_InitComplete();";\r
+    return $s;\r
+  }\r
+}\r
+\r
+?>\r
diff --git a/plugins/php/ricoResponse.php b/plugins/php/ricoResponse.php
new file mode 100644 (file)
index 0000000..4e98b6d
--- /dev/null
@@ -0,0 +1,622 @@
+<?php\r
+\r
+// for PHP4\r
+// copied from http://www.php.net/json_encode\r
+if (!function_exists('json_encode'))\r
+{\r
+  function json_encode($a=false)\r
+  {\r
+    if (is_null($a)) return 'null';\r
+    if ($a === false) return 'false';\r
+    if ($a === true) return 'true';\r
+    if (is_scalar($a))\r
+    {\r
+      if (is_float($a))\r
+      {\r
+        // Always use "." for floats.\r
+        return floatval(str_replace(",", ".", strval($a)));\r
+      }\r
+\r
+      if (is_string($a))\r
+      {\r
+        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));\r
+        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';\r
+      }\r
+      else\r
+        return $a;\r
+    }\r
+    $isList = true;\r
+    for ($i = 0, reset($a); $i < count($a); $i++, next($a))\r
+    {\r
+      if (key($a) !== $i)\r
+      {\r
+        $isList = false;\r
+        break;\r
+      }\r
+    }\r
+    $result = array();\r
+    if ($isList)\r
+    {\r
+      foreach ($a as $v) $result[] = json_encode($v);\r
+      return '[' . join(',', $result) . ']';\r
+    }\r
+    else\r
+    {\r
+      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);\r
+      return '{' . join(',', $result) . '}';\r
+    }\r
+  }\r
+}\r
+\r
+class ricoXmlResponse {\r
+\r
+  // public properties\r
+  var $orderByRef;\r
+  var $sendDebugMsgs;\r
+  var $readAllRows;    // always return the total number of rows? (if true, the user will always see the total number of rows, but there is a small performance hit)\r
+  var $convertCharSet; // set to true if database is ISO-8859-1 encoded, false if UTF-8\r
+  var $AllRowsMax;     // max # of rows to send if numrows=-1\r
+  var $fmt;            // xml, json, html, xl\r
\r
+  // private properties\r
+  var $objDB;\r
+  var $eof;\r
+  var $oParse;\r
+  var $sqltext;\r
+  var $arParams;\r
+  var $allParams;\r
+  var $condType;\r
+  var $RowsStart;\r
+  var $RowsEnd;\r
+  var $SendHdg;\r
+  var $Headings;\r
+  var $HiddenCols;\r
+\r
+  function ricoXmlResponse() {\r
+    if (isset($GLOBALS['oDB']) && is_object($GLOBALS['oDB'])) {\r
+      $this->objDB=$GLOBALS['oDB'];   // use oDB global as database connection, if it exists\r
+    }\r
+    $this->orderByRef=false;\r
+    $this->sendDebugMsgs=false;\r
+    $this->readAllRows=true;    // has no effect on SQL Server 2005, Oracle, and MySQL because they use Query2xmlRaw_Limit()\r
+    $this->convertCharSet=false;\r
+    $this->SendHdg=false;\r
+    $this->AllRowsMax=1999;\r
+    $this->Headings=array();\r
+    $this->HiddenCols=array();\r
+  }\r
+\r
+  function ProcessQuery($id, $sqlselect, $filters=array(), $errmsg='') {\r
+    $this->fmt=isset($_GET["_fmt"]) ? $_GET["_fmt"] : "xml";\r
+    $offset=isset($_GET["offset"]) ? $_GET["offset"] : "0";\r
+    $size=isset($_GET["page_size"]) ? $_GET["page_size"] : "";\r
+    $total=isset($_GET["get_total"]) ? strtolower($_GET["get_total"]) : "false";\r
+    $distinct=isset($_GET["distinct"]) ? $_GET["distinct"] : "";\r
+    $edit=isset($_GET["edit"]) ? $_GET["edit"] : "";\r
+    if (isset($_GET["hidden"]) && $_GET["hidden"]!="") $this->HiddenCols=explode(",", $_GET["hidden"]);\r
+\r
+    ob_clean();\r
+    if ($this->fmt != "xl") {\r
+      header("Cache-Control: no-cache");\r
+      header("Pragma: no-cache");\r
+      header("Expires: ".gmdate("D, d M Y H:i:s",time()+(-1*60))." GMT");\r
+    }\r
+\r
+    switch ($this->fmt) {\r
+      case "html":\r
+        header("Content-type: text/html");\r
+        echo "<html><head></head><body>\n";\r
+        $closetags="</body></html>";\r
+        $this->RowsStart="\n<table border='1'>";\r
+        $this->RowsEnd="\n</table>";\r
+        $total="false";\r
+        $this->sendDebugMsgs=false;\r
+        $this->SendHdg=true;\r
+        break;\r
+      case "xl":\r
+        $this->convertCharSet=false;\r
+        header("Content-type: application/vnd.ms-excel");\r
+        echo "<html><head></head><body>\n";\r
+        $closetags="</body></html>";\r
+        $this->RowsStart="\n<table>";\r
+        $this->RowsEnd="\n</table>";\r
+        $total="false";\r
+        $this->sendDebugMsgs=false;\r
+        $this->SendHdg=true;\r
+        break;\r
+      case "json":\r
+        header("Content-type: application/json");\r
+        echo "{\n\"id\":\"" . $id . "\"";\r
+        $this->RowsStart=",\n\"update_ui\":true,\n\"offset\":" . $offset . ",\n\"rows\":[";\r
+        $this->RowsEnd="\n]";\r
+        $closetags="}";\r
+        $this->sendDebugMsgs=false;\r
+        break;\r
+      default:\r
+        // default to xml\r
+        $this->fmt="xml";\r
+        header("Content-type: text/xml");\r
+        echo "<?xml version='1.0' encoding='UTF-8'?".">\n";\r
+        echo "\n<ajax-response><response type='object' id='" . $id . "'>";\r
+        $closetags="</response></ajax-response>";\r
+        $this->RowsStart="\n<rows update_ui='true' offset='" . $offset . "'>";\r
+        $this->RowsEnd="\n</rows>";\r
+        break;\r
+    }\r
+    if (!empty($errmsg)) {\r
+      $this->ErrorResponse($errmsg);\r
+    } elseif (empty($id)) {\r
+      $this->ErrorResponse("No ID provided!");\r
+    } elseif ($distinct=="" && !is_numeric($offset)) {\r
+      $this->ErrorResponse("Invalid offset!");\r
+    } elseif ($distinct=="" && !is_numeric($size)) {\r
+      $this->ErrorResponse("Invalid size!");\r
+    } elseif ($distinct!="" && !is_numeric($distinct)) {\r
+      $this->ErrorResponse("Invalid distinct parameter!");\r
+    } else {\r
+      if ($this->SendHdg && is_array($sqlselect)) {\r
+        // populate $Headings from $sqlselect[9] taking into account hidden columns\r
+        for ($i=0,$j=0,$SkipIdx=0; $i<count($sqlselect[9]); $i++) {\r
+          $skip=false;\r
+          if ($SkipIdx < count($this->HiddenCols)) {\r
+            $skip=($this->HiddenCols[$SkipIdx] == $i);\r
+            if ($skip) $SkipIdx++;\r
+          }\r
+          if (!$skip) {\r
+            $this->Headings[$j++]=$sqlselect[9][$i];\r
+          }\r
+        }\r
+      }\r
+      $this->objDB->DisplayErrors=false;\r
+      $this->objDB->ErrMsgFmt="MULTILINE";\r
+      if ($distinct!="" && is_numeric($distinct)) {\r
+        $this->Query2xmlDistinct($sqlselect, intval($distinct), -1, $filters);\r
+      } elseif ($edit!="" && is_numeric($edit) && is_array($sqlselect)) {\r
+        $this->Query2xml($sqlselect[8][intval($edit)], intval($offset), intval($size), $total!="false", $filters);\r
+      } else {\r
+        $this->Query2xml($sqlselect, intval($offset), intval($size), $total!="false", $filters);\r
+      }\r
+      if (!empty($this->objDB->LastErrorMsg)) {\r
+        $this->ErrorResponse($this->objDB->LastErrorMsg);\r
+      }\r
+    }\r
+    echo "\n".$closetags;\r
+  }\r
+\r
+  function ErrorResponse($msg) {\r
+    $this->AppendResponse("error",$msg);\r
+  }\r
+\r
+  function AppendResponse($tag, $content) {\r
+    switch ($this->fmt) {\r
+      case "html":\r
+        echo "\n<p>".$tag."<br>".htmlspecialchars($content)."</p>";\r
+        break;\r
+      case "xl":\r
+        echo "\n<p>".$tag."<br>".htmlspecialchars($content)."</p>";\r
+        break;\r
+      case "json":\r
+        echo ",\n\"".$tag."\":".json_encode($content);\r
+        break;\r
+      case "xml":\r
+        echo "\n<".$tag.">".htmlspecialchars($content)."</".$tag.">";\r
+        break;\r
+    }\r
+  }\r
+\r
+  // All Oracle and SQL Server 2005 queries *must* have an ORDER BY clause\r
+  // "as" clauses are now ok\r
+  // If numrows < 0, then retrieve all rows\r
+  function Query2xml($sqlselect, $offset, $numrows, $gettotal, $filters=array()) {\r
+    if ($numrows >= 0) {\r
+      $Dialect=$this->objDB->Dialect;\r
+    } else {\r
+      $numrows=$this->AllRowsMax;\r
+      $Dialect="";  // don't use limit query\r
+    }\r
+    switch ($this->objDB->Dialect) {\r
+      case "MySQL": $this->orderByRef=true; break;\r
+    }\r
+    $this->arParams=array('H'=>array(), 'W'=>array());\r
+    $this->oParse= new sqlParse();\r
+    if (is_array($sqlselect)) {\r
+      $this->oParse->LoadArray($sqlselect);\r
+    } else {\r
+      $this->oParse->ParseSelect($sqlselect);\r
+    }\r
+    $this->ApplyQStringParms($filters);\r
+    $this->allParams=array_merge($this->arParams['W'],$this->arParams['H']);\r
+    echo $this->RowsStart;\r
+    switch ($Dialect) {\r
+\r
+      case "TSQL":\r
+        $this->objDB->SingleRecordQuery("select @@VERSION", $version);\r
+        if (is_string($sqlselect) && strtoupper(substr($sqlselect,0,7))!="SELECT ") {\r
+          $this->allParams=array();\r
+          $totcnt=$this->Query2xmlRaw($sqlselect, $offset, $numrows);\r
+        }\r
+        else if (preg_match("/SQL Server 200(5|8)/i",$version[0])) {\r
+          $this->sqltext=$this->UnparseWithRowNumber($offset, $numrows + 1, true);\r
+          $totcnt=$this->Query2xmlRaw_Limit($this->sqltext, $offset, $numrows, 1);\r
+        }\r
+        else {\r
+          $this->sqltext=$this->oParse->UnparseSelectSkip($this->HiddenCols);\r
+          $totcnt=$this->Query2xmlRaw($this->sqltext, $offset, $numrows);\r
+        }\r
+        break;\r
+\r
+      case "Oracle":\r
+        $this->sqltext=$this->UnparseWithRowNumber($offset, $numrows + 1, false);\r
+        $totcnt=$this->Query2xmlRaw_Limit($this->sqltext, $offset, $numrows, 1);\r
+        break;\r
+\r
+      case "MySQL":\r
+        $this->sqltext=$this->oParse->UnparseSelectSkip($this->HiddenCols)." LIMIT ".$offset.",".($numrows + 1);\r
+        $totcnt=$this->Query2xmlRaw_Limit($this->sqltext, $offset, $numrows, 0);\r
+        break;\r
+\r
+      default:\r
+        $this->sqltext=$this->oParse->UnparseSelectSkip($this->HiddenCols);\r
+        $totcnt=$this->Query2xmlRaw($this->sqltext, $offset, $numrows);\r
+        break;\r
+    }\r
+    echo $this->RowsEnd;\r
+    if ($this->sendDebugMsgs) {\r
+      $this->AppendResponse("debug",$this->objDB->db->lastQuery);\r
+    }\r
+    if (!$this->eof && $gettotal) {\r
+      $totcnt=$this->getTotalRowCount();\r
+    }\r
+    if ($this->fmt=="xml" || $this->fmt=="json") {\r
+      if ($this->eof) $this->AppendResponse("rowcount",$totcnt);\r
+    }\r
+    $this->oParse=NULL;\r
+    return $totcnt;\r
+  }\r
+\r
+\r
+  function Query2xmlDistinct($sqlselect, $colnum, $numrows, $filters=array()) {\r
+    if ($numrows < 0) $numrows=$this->AllRowsMax;\r
+    $this->arParams=array('H'=>array(), 'W'=>array());\r
+    $this->oParse= new sqlParse();\r
+    if (is_array($sqlselect)) {\r
+      $this->oParse->LoadArray($sqlselect);\r
+    } else {\r
+      $this->oParse->ParseSelect($sqlselect);\r
+    }\r
+    $this->ApplyQStringParms($filters);\r
+    $this->allParams=array_merge($this->arParams['W'],$this->arParams['H']);\r
+    echo $this->RowsStart;\r
+    $this->sqltext=$this->oParse->UnparseDistinctColumn($colnum);\r
+    $totcnt=$this->Query2xmlRaw($this->sqltext, 0, $numrows);\r
+    echo $this->RowsEnd;\r
+    if ($this->sendDebugMsgs) {\r
+      $this->AppendResponse("debug",$this->objDB->db->lastQuery);\r
+    }\r
+    $this->oParse=NULL;\r
+  }\r
+\r
+\r
+  // Tested ok with SQL Server 2005, MySQL, and Oracle\r
+  function getTotalRowCount() {\r
+    $countSql="SELECT ".$this->oParse->UnparseColumnList()." FROM ".$this->oParse->FromClause;\r
+    if (!empty($this->oParse->WhereClause)) {\r
+      $countSql.=" WHERE ".$this->oParse->WhereClause;\r
+    }\r
+    if (is_array($this->oParse->arGroupBy)) {\r
+      if (count($this->oParse->arGroupBy) >  0) {\r
+        $countSql.=" GROUP BY ".implode(",",$this->oParse->arGroupBy);\r
+      }\r
+    }\r
+    if (!empty($this->oParse->HavingClause)) {\r
+      $countSql.=" HAVING ".$this->oParse->HavingClause;\r
+    }\r
+    $countSql="SELECT COUNT(*) FROM (".$countSql.")";\r
+    if ($this->objDB->Dialect != "Oracle") {\r
+      $countSql.=" AS rico_Main";\r
+    }\r
+    if (count($this->allParams)>0) {\r
+      $rsMain=$this->objDB->RunParamQuery($countSql,$this->allParams);\r
+    } else {\r
+      $rsMain=$this->objDB->RunQuery($countSql);\r
+    }\r
+    if (!$rsMain) {\r
+      echo "\n<debug>getTotalRowCount: rsMain is null</debug>";\r
+      return;\r
+    }\r
+    if (!$this->objDB->db->FetchArray($rsMain,$a)) return;\r
+    $this->objDB->rsClose($rsMain);\r
+    $this->eof=true;\r
+    return $a[0];\r
+  }\r
+\r
+\r
+  function UnparseWithRowNumber($offset, $numrows, $includeAS) {\r
+    if (is_array($this->oParse->arOrderBy)) {\r
+      if (count($this->oParse->arOrderBy) >  0) {\r
+        $strOrderBy=implode(",",$this->oParse->arOrderBy);\r
+      }\r
+    }\r
+    if (empty($strOrderBy) && !preg_match("/\bjoin\b/",$this->oParse->FromClause)) {\r
+      // order by clause should be included in main sql select statement\r
+      // However, if it isn't, then use primary key as sort - assuming FromClause is a simple table name\r
+      $strOrderBy=$this->objDB->PrimaryKey($this->oParse->FromClause);\r
+    }\r
+    $unparseText="SELECT ROW_NUMBER() OVER (ORDER BY ".$strOrderBy.") AS rico_rownum,";\r
+    $unparseText.=$this->oParse->UnparseColumnListSkip($this->HiddenCols)." FROM ".$this->oParse->FromClause;\r
+    if (!empty($this->oParse->WhereClause)) {\r
+      $unparseText.=" WHERE ".$this->oParse->WhereClause;\r
+    }\r
+    if (is_array($this->oParse->arGroupBy)) {\r
+      if (count($this->oParse->arGroupBy) >  0) {\r
+        $unparseText.=" GROUP BY ".implode(",",$this->oParse->arGroupBy);\r
+      }\r
+    }\r
+    if (!empty($this->oParse->HavingClause)) {\r
+      $unparseText.=" HAVING ".$this->oParse->HavingClause;\r
+    }\r
+    $unparseText="SELECT * FROM (".$unparseText.")";\r
+    if ($includeAS) {\r
+      $unparseText.=" AS rico_Main";\r
+    }\r
+    $unparseText.=" WHERE rico_rownum > ".$offset." AND rico_rownum <= ".($offset + $numrows);\r
+    return $unparseText;\r
+  }\r
+\r
+  function Query2xmlRaw($rawsqltext, $offset, $numrows) {\r
+    if (count($this->allParams)>0) {\r
+      $rsMain=$this->objDB->RunParamQuery($rawsqltext,$this->allParams);\r
+    } else {\r
+      $rsMain=$this->objDB->RunQuery($rawsqltext);\r
+    }\r
+    if (!$rsMain) return;\r
+  \r
+    $colcnt = $this->objDB->db->NumFields($rsMain);\r
+    $totcnt = $this->objDB->db->NumRows($rsMain);\r
+    //echo "<debug>Query2xmlRaw: NumRows=$totcnt</debug>";\r
+    if ($offset < $totcnt || $totcnt==-1) {\r
+      $this->objDB->db->Seek($rsMain,$offset);\r
+      switch ($this->fmt) {\r
+        case "json": $rowcnt=$this->WriteRowsJSON($rsMain, $numrows, 0); break;\r
+        default:     $rowcnt=$this->WriteRowsXHTML($rsMain, $numrows, 0); break;\r
+      }\r
+      if ($totcnt < 0) {\r
+        $totcnt=$offset+$rowcnt;\r
+        while($this->objDB->db->FetchRow($rsMain,$row))\r
+          $totcnt++;\r
+      }\r
+    } else {\r
+      $totcnt=$offset;\r
+    }\r
+    $this->objDB->rsClose($rsMain);\r
+    $this->eof=true;\r
+    return $totcnt;\r
+  }\r
+\r
+  function Query2xmlRaw_Limit($rawsqltext, $offset, $numrows, $firstcol) {\r
+    if (count($this->allParams)>0) {\r
+      $rsMain=$this->objDB->RunParamQuery($rawsqltext,$this->allParams);\r
+    } else {\r
+      $rsMain=$this->objDB->RunQuery($rawsqltext);\r
+    }\r
+    //if ($this->objDB->db->HasError()) echo "<error>" . $this->objDB->db->ErrorMsg() . "</error>";\r
+    $totcnt=$offset;\r
+    $this->eof=true;\r
+    if (!$rsMain) return;\r
+    switch ($this->fmt) {\r
+      case "json": $totcnt+=$this->WriteRowsJSON($rsMain, $numrows, $firstcol); break;\r
+      default:     $totcnt+=$this->WriteRowsXHTML($rsMain, $numrows, $firstcol); break;\r
+    }\r
+    $this->objDB->rsClose($rsMain);\r
+    return $totcnt;\r
+  }\r
+\r
+  function WriteRowsXHTML($rsMain, $numrows, $firstcol) {\r
+    $colcnt = $this->objDB->db->NumFields($rsMain);\r
+    $rowcnt=0;\r
+    if ($this->SendHdg) {\r
+      echo "\n<tr>";\r
+      for ($i=$firstcol; $i < $colcnt; $i++) {\r
+        $n=empty($this->Headings[$i-$firstcol]) ? $this->objDB->db->FieldName($rsMain,$i) : $this->Headings[$i-$firstcol];\r
+        print $this->XmlStringCell($n);\r
+      }\r
+      echo "</tr>";\r
+    }\r
+    while(($this->objDB->db->FetchRow($rsMain,$row)) && $rowcnt < $numrows) {\r
+      $rowcnt++;\r
+      print "\n<tr>";\r
+      for ($i=$firstcol; $i < $colcnt; $i++)\r
+        print $this->XmlStringCell($row[$i]);\r
+      print "</tr>";\r
+    }\r
+    $this->eof=($rowcnt < $numrows);\r
+    return $rowcnt;\r
+  }\r
+  \r
+  function WriteRowsJSON($rsMain, $numrows, $firstcol) {\r
+    $colcnt = $this->objDB->db->NumFields($rsMain);\r
+    $rowcnt=0;\r
+    if ($this->SendHdg) {\r
+      echo "\n[";\r
+      for ($i=$firstcol; $i < $colcnt; $i++) {\r
+        //$n=empty($this->Headings($i-$firstcol)) ? $this->objDB->db->FieldName($rsMain,$i) : $this->Headings($i-$firstcol);\r
+        print json_encode($n);\r
+      }\r
+      echo "]";\r
+    }\r
+    while(($this->objDB->db->FetchRow($rsMain,$row)) && $rowcnt < $numrows) {\r
+      if ($rowcnt>0 || $this->SendHdg) echo ",";\r
+      $rowcnt++;\r
+      print "\n[";\r
+      for ($i=$firstcol; $i < $colcnt; $i++) {\r
+        if ($i>$firstcol) echo ",";\r
+        $value=$row[$i];\r
+        if ($this->convertCharSet) $value=utf8_encode($value);\r
+        print json_encode($value);\r
+      }\r
+      print "]";\r
+    }\r
+    $this->eof=($rowcnt < $numrows);\r
+    return $rowcnt;\r
+  }\r
+  \r
+  function SetDbConn(&$dbcls) {\r
+    $this->objDB=&$dbcls;\r
+  }\r
+\r
+  function PushParam($newvalue) {\r
+    $parm=$this->convertCharSet ? utf8_decode($newvalue) : $newvalue;\r
+    if (get_magic_quotes_gpc()) $parm=stripslashes($parm);\r
+    array_push($this->arParams[$this->condType], $parm);\r
+    if ($this->sendDebugMsgs) {\r
+      echo "\n<debug>".$this->condType." param=".htmlspecialchars($parm)."</debug>";\r
+    }\r
+  }\r
+  \r
+  function setCondType($selectItem) {\r
+    $this->condType=(preg_match("/\bmin\(|\bmax\(|\bsum\(|\bcount\(/i",$selectItem) && !preg_match("/\bselect\b/i",$selectItem)) ? 'H' : 'W';\r
+  }\r
+  \r
+  function addCondition($newfilter) {\r
+    switch ($this->condType) {\r
+      case 'H': $this->oParse->AddHavingCondition($newfilter); break;\r
+      case 'W': $this->oParse->AddWhereCondition($newfilter); break;\r
+    }\r
+  }\r
+\r
+  function ApplyQStringParms($filters) {\r
+    foreach($_GET as $qs => $value) {\r
+      $prefix=substr($qs,0,1);\r
+      switch ($prefix) {\r
+\r
+        // user-invoked condition\r
+        case "w":\r
+        case "h":\r
+          $i=substr($qs,1);\r
+          if (!is_numeric($i)) break;\r
+          $i=intval($i);\r
+          if ($i<0 || $i>=count($filters)) break;\r
+          $newfilter=$filters[$i];\r
+          $this->condType=strtoupper($prefix);\r
+\r
+          $j=strpos($newfilter," in (?)");\r
+          if ($j !== false) {\r
+            $a=explode(",", $value);\r
+            for ($i=0; $i < count($a); $i++) {\r
+              $this->PushParam($a[$i]);\r
+              $a[$i]="?";\r
+            }\r
+            $newfilter=substr($newfilter,0,$j+4) . implode(",",$a) . substr($newfilter,$j+5);\r
+          } elseif (strpos($newfilter,"?") !== false) {\r
+            $this->PushParam($value);\r
+          }\r
+\r
+          $this->addCondition($newfilter);\r
+          break;\r
+\r
+        // sort\r
+        case "s":\r
+          $i=substr($qs,1);\r
+          if (!is_numeric($i)) break;\r
+          $i=intval($i);\r
+          if ($i<0 || $i>=count($this->oParse->arSelList)) break;\r
+          $value=strtoupper(substr($value,0,4));\r
+          if (!in_array($value,array('ASC','DESC'))) $value="ASC";\r
+          if ($this->orderByRef)\r
+            $this->oParse->AddSort(($i + 1)." ".$value);\r
+          else\r
+            $this->oParse->AddSort($this->oParse->arSelList[$i]." ".$value);\r
+          break;\r
+\r
+        // user-supplied filter\r
+        case "f":\r
+          //print_r($value);\r
+          foreach($value as $i => $filter) {\r
+            if ($i<0 || $i>=count($this->oParse->arSelList)) break;\r
+            $newfilter=$this->oParse->arSelList[$i];\r
+            $this->setCondType($newfilter);\r
+            switch ($filter['op']) {\r
+              case "EQ":\r
+                $newfilter='('.$this->AddCoalesce($newfilter).' IN '.$this->GetMultiParmFilter($filter).')';\r
+                break;\r
+              case "LE":\r
+                $newfilter.="<=?";\r
+                $this->PushParam($filter[0]);\r
+                break;\r
+              case "GE":\r
+                $newfilter.=">=?";\r
+                $this->PushParam($filter[0]);\r
+                break;\r
+              case "NULL": $newfilter.=" is null"; break;\r
+              case "NOTNULL": $newfilter.=" is not null"; break;\r
+              case "LIKE":\r
+                $newfilter.=" LIKE ?";\r
+                $this->PushParam(str_replace("*",$this->objDB->Wildcard,$filter[0]));\r
+                break;\r
+              case "NE":\r
+                $newfilter='('.$this->AddCoalesce($newfilter).' NOT IN '.$this->GetMultiParmFilter($filter).')';\r
+                break;\r
+            }\r
+            $this->addCondition($newfilter);\r
+          }\r
+          break;\r
+      }\r
+    }\r
+  }\r
+\r
+  function AddCoalesce($newfilter) {\r
+    if ($this->objDB->Dialect=="Access") {\r
+      return "iif(IsNull(" . $newfilter . "),''," . $newfilter . ")";\r
+    } else {\r
+      return "coalesce(" . $newfilter . ",'')";\r
+    }\r
+  }\r
+\r
+\r
+  function GetMultiParmFilter($filter) {\r
+    $flen=$filter['len'];\r
+    if (!is_numeric($flen)) return "";\r
+    $flen=intval($flen);\r
+    $newfilter='(';\r
+    for ($j=0; $j<$flen; $j++) {\r
+      if ($j > 0) $newfilter.=",";\r
+      $newfilter.='?';\r
+      $this->PushParam($filter[$j]);\r
+    }\r
+    $newfilter.=')';\r
+    return $newfilter;\r
+  }\r
+\r
+  function XmlStringCell($value) {\r
+    if (!isset($value)) {\r
+      $result="";\r
+    }\r
+    else {\r
+      if ($this->convertCharSet) {\r
+        $value=utf8_encode($value);\r
+        $result=htmlspecialchars($value, ENT_COMPAT, 'UTF-8');\r
+      } else {\r
+        $result=htmlspecialchars($value);\r
+      }\r
+    }\r
+    if ($this->fmt=="html" && $result=="") $result="&nbsp;";\r
+    return "<td>".$result."</td>";\r
+  }\r
+\r
+  // for the root node, parentID should "" (empty string)\r
+  // containerORleaf: L/zero (leaf), C/non-zero (container)\r
+  // selectable:      0->not selectable, 1->selectable\r
+  function WriteTreeRow($parentID, $ID, $description, $containerORleaf, $selectable) {\r
+    echo "\n<tr>";\r
+    echo $this->XmlStringCell($parentID);\r
+    echo $this->XmlStringCell($ID);\r
+    echo $this->XmlStringCell($description);\r
+    echo $this->XmlStringCell($containerORleaf);\r
+    echo $this->XmlStringCell($selectable);\r
+    echo "</tr>";\r
+  }\r
+\r
+}\r
+\r
+?>\r
+\r
diff --git a/readme.txt b/readme.txt
new file mode 100644 (file)
index 0000000..6662e28
--- /dev/null
@@ -0,0 +1,6 @@
+Rico 3.0
+
+Forums are at: http://sourceforge.net/projects/openrico/
+
+Instructions for installing and using Rico are located in the documentation directory.
+
diff --git a/ricoClient/css/coffee-with-milk.css b/ricoClient/css/coffee-with-milk.css
new file mode 100644 (file)
index 0000000..f14d371
--- /dev/null
@@ -0,0 +1,176 @@
+/*\r
+Based on "Coffee with milk" table design by Roger Johansson, 456 Berea Street\r
+www.456bereastreet.com\r
+================================================*/\r
+\r
+.ricoLG_table, tr.ricoLG_hdg .ricoLG_cell, .ricoTitle, a.RicoButton, .Rico_tabTitle , .Rico_accTitle, div.ricoCalContainer *, .ricoTree *, .ricoBookmark {\r
+  font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;\r
+}\r
+\r
+.ricoLG_table {\r
+  border-top:1px solid #523A0B !important;\r
+  border-right:none;\r
+  color:#000;\r
+}\r
+tr.ricoLG_hdg .ricoLG_cell, tr.ricoLG_hdg th, tr.ricoLG_hdg td {  /* td/th required for IE */\r
+  background:#EBE5D9 !important;\r
+  line-height:normal;\r
+  text-align:left;\r
+}\r
+\r
+tr.ricoLG_hdg th, tr.ricoLG_hdg td {\r
+  border-bottom:1px solid #523A0B;\r
+  background:#EBE5D9;\r
+}\r
+\r
+tr.ricoLG_hdg th, tr.ricoLG_hdg td {\r
+  border-left: 1px solid #E0D8CD !important;\r
+}\r
+\r
+.ricoLG_bottom th, .ricoLG_bottom td {\r
+  border-left: 1px solid #FFF;\r
+}\r
+\r
+tr.ricoLG_hdg div.ricoLG_cell {\r
+  background:#EBE5D9;\r
+  font-weight:bold;\r
+  padding:0.5em 0 0.5em 0.5em;\r
+}\r
+div.ricoLG_outerDiv table a {\r
+  color:#523A0B;\r
+  text-decoration:none;\r
+  border-bottom:1px dotted;\r
+}\r
+div.ricoLG_outerDiv tbody a:visited {\r
+  color:#444;\r
+  font-weight:normal;\r
+}\r
+div.ricoLG_outerDiv table a:hover {\r
+  border-bottom-style:solid;\r
+}\r
+\r
+div.ricoLG_selection {\r
+  background-color:#ffffee !important;\r
+  border-color:#523A0B !important;\r
+}\r
+.ricoLG_table {\r
+  border-style:none;\r
+}\r
+\r
+div.ricoLG_messageDiv {\r
+  border:2px solid #523A0B;\r
+  background-color:#ffffee;\r
+  color:#444;\r
+}\r
+\r
+a.RicoButton {\r
+  border:1px solid #523A0B;\r
+  background-color: #EBE5D9;\r
+  color: #000;\r
+}\r
+a.RicoButton.hover {\r
+  background-color: #f5f0e1;\r
+}\r
+\r
+.ricoWindow {\r
+  border: 1px solid #523A0B;\r
+  background-color: #ffffee;\r
+}\r
+.ricoTitle  {\r
+  background-color: #EBE5D9;\r
+  border-bottom: 1px solid #523A0B;\r
+  color: #000;\r
+  font-weight: normal;\r
+  font-size:11pt;\r
+}\r
+\r
+\r
+.Rico_tabNavContainer .selected {\r
+  background: #EBE5D9;\r
+  cursor: auto;\r
+}\r
+.Rico_tabContent {\r
+  background-color: #ffffee;\r
+}\r
+.Rico_tabContentContainer {\r
+  border : 1px solid #4f4f4f;\r
+}\r
+.Rico_tabTitle {\r
+  height: 1.5em;\r
+  background: #EBE5D9;\r
+  margin-left: 2px;\r
+  margin-right: 2px;\r
+  text-align: center;\r
+  white-space:nowrap;\r
+  padding: 3px 5px 0px 5px;\r
+  border-color: #523A0B;\r
+  border-width: 1px 1px 0px 1px;\r
+  border-style: solid;\r
+}\r
+\r
+\r
+.Rico_accTitle {\r
+  background-color: #EBE5D9;\r
+  font-weight: normal;\r
+  font-size:11pt;\r
+  height: 1.6em;\r
+  border-bottom:1px solid #523A0B;\r
+  border-top:1px solid #523A0B;\r
+  font-weight : normal;\r
+  padding-left: 1em;\r
+  padding-top:0.1em;\r
+}\r
+\r
+.Rico_accTitle a , .Rico_tabTitle a {\r
+  color : #AAA;\r
+  text-decoration: none;\r
+}\r
+.Rico_accordion .hover a, .Rico_tabNavContainer .hover a {\r
+  color: #000;\r
+}\r
+.Rico_accordion .selected a, .Rico_tabNavContainer .selected a {\r
+  color: #000;\r
+  font-weight : normal;\r
+}\r
+.Rico_accordion  {\r
+  border : 1px solid #523A0B;\r
+}\r
+.Rico_accContent {\r
+  background-color: #ffffee;\r
+}\r
+\r
+div.ricoCalContainer table.ricoCalTab {\r
+  border : 1px solid #523A0B;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th span a {\r
+  font-size: 10pt !important;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th {\r
+  background-color: #EBE5D9;\r
+  color:#000;\r
+  font-weight: normal;\r
+}\r
+div.ricoCalContainer tfoot td {\r
+  border-top : 1px solid #523A0B;\r
+  background-color:#EBE5D9;\r
+  color:#000;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th {\r
+  border-bottom : 1px solid #523A0B;\r
+}\r
+div.ricoCalContainer table.ricoCalTab, div.ricoCalContainer td.ricoCalEmpty, div.ricoCalContainer tr.ricoCalDayNames td {\r
+  background-color:#F7F4EE;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th a.hover {\r
+  background-color: #F7F4EE !important;\r
+}\r
+div.ricoCalContainer tbody td.hover {\r
+  background-color: #ffffcc;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead a:link, div.ricoCalContainer table.ricoCalTab thead a:visited {\r
+  color:#000;\r
+}\r
+.ricoTree a.hover {\r
+  text-decoration: underline;\r
+  cursor:pointer;\r
+}\r
diff --git a/ricoClient/css/grayedout.css b/ricoClient/css/grayedout.css
new file mode 100644 (file)
index 0000000..5d67fa9
--- /dev/null
@@ -0,0 +1,174 @@
+/* -------------------------------------------------------\r
+Based on Grayed Out table design\r
+Author: Terence Ordona\r
+URL: http://www.imaputz.com/\r
+ ------------------------------------------------------- */\r
+div.ricoLG_outerDiv *, div.ricoLG_outerDiv div.ricoLG_cell, div.ricoLG_editDiv *, .ricoTitle, .Rico_tabTitle, .Rico_accTitle, .ricoTree *, .ricoBookmark  {\r
+  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\r
+}\r
+\r
+div.ricoLG_outerDiv div.ricoLG_cell, div.ricoLG_outerDiv div.ricoLG_cell *, div.ricoLG_keywordDiv *, table.ricoLiveGrid td, table.ricoLiveGrid th  {\r
+  font-size: 11px;\r
+}\r
+\r
+.ricoLG_table {\r
+       border-top: 1px solid #CCC;\r
+       border-right: 1px solid #CCC;\r
+}\r
+\r
+tr.ricoLG_hdg th, tr.ricoLG_hdg td, table.ricoLiveGrid thead td, table.ricoLiveGrid thead th {\r
+       background-color: #FFF !important;\r
+  background: url(../images/grayedout.gif) #FFF repeat-x scroll center left;\r
+  border-bottom: 1px solid #CCC;\r
+}\r
+\r
+.ricoLG_table th, .ricoLG_table td {\r
+       border-left: 1px solid #CCC;\r
+}\r
+\r
+.ricoLG_bottom th, .ricoLG_bottom td {\r
+       border-bottom: 1px solid #CCC;\r
+}\r
+\r
+div.ricoLG_outerDiv .ricoLG_bottom div.ricoLG_cell {\r
+  border-bottom: none;\r
+  padding: 5px;\r
+}\r
+\r
+tr.ricoLG_hdg .ricoLG_cell {\r
+  font-weight: normal;\r
+}\r
+\r
+div.ricoLG_outerDiv a:visited, div.ricoLG_outerDiv a:link {\r
+       color: #009;\r
+       text-decoration: none;\r
+}\r
+\r
+div.ricoLG_outerDiv a:hover {\r
+       color: #009;\r
+       text-decoration: underline;\r
+}\r
+\r
+div.ricoLG_selection {\r
+       background-color: #999;\r
+       color: #FFF;\r
+}\r
+\r
+div.ricoLG_messageDiv {\r
+  border:2px solid #999;\r
+  background-color:#ffffff;\r
+  color:#009;\r
+}\r
+\r
+div.ricoLG_highlightDiv {\r
+       border-color: #999;\r
+}\r
+       \r
+a.RicoButton {\r
+  background-color: #999;\r
+  color: #FFF;\r
+}\r
+a.RicoButton.hover {\r
+  background-color: #AAA;\r
+}\r
+\r
+caption {\r
+       text-align: left;\r
+       font-size: 100%;\r
+       padding: .75em;\r
+       color: #000;\r
+}\r
+\r
+.ricoWindow {\r
+  border: 1px solid #CCC;\r
+  font-size: 11px;\r
+       background-color: #F8F8F8;\r
+}\r
+.ricoTitle  {\r
+  background: url(../images/grayedout.gif) #FFF repeat-x scroll center left;\r
+  border-bottom: 1px solid #CCC;\r
+       color: #000;\r
+  font-weight: bold;\r
+  font-size: 11px;\r
+}\r
+\r
+.Rico_tabNavContainer .selected {\r
+  background: #999;\r
+  cursor: auto;\r
+}\r
+.Rico_tabContent {\r
+  background: #FFF;\r
+}\r
+\r
+.Rico_tabContentContainer {\r
+  border : 1px solid #999;\r
+}\r
+.Rico_tabTitle {\r
+  height: 1.5em;\r
+  background: #DDD;\r
+  margin-left: 2px;\r
+  margin-right: 2px;\r
+  text-align: center;\r
+  white-space:nowrap;\r
+  overflow:hidden;\r
+  padding: 3px 5px 0px 5px;\r
+}\r
+\r
+.Rico_accTitle {\r
+  background: url(../images/grayedout.gif) #FFF repeat-x scroll center left;\r
+  font-size: 11px;\r
+  height: 1.7em;\r
+  font-weight : normal;\r
+  border-bottom:1px solid #CCC;\r
+  border-top:1px solid #CCC;\r
+  font-weight : normal;\r
+  padding-left: 1em;\r
+  padding-top:0.3em;\r
+}\r
+\r
+.Rico_accTitle a , .Rico_tabTitle a {\r
+  color : #559;\r
+  text-decoration: none;\r
+}\r
+.Rico_accordion .hover a, .Rico_tabNavContainer .hover a {\r
+  color : #000;\r
+}\r
+.Rico_accordion .selected a {\r
+  color : #000;\r
+  font-weight : bold;\r
+}\r
+.Rico_tabNavContainer .selected a {\r
+  color : #FFF;\r
+  font-weight : bold;\r
+}\r
+.Rico_accordion  {\r
+  border : 1px solid #CCC;\r
+}\r
+\r
+div.ricoCalContainer table.ricoCalTab thead th {\r
+  background-color: #999;\r
+  color:#FFFFFF;\r
+}\r
+div.ricoCalContainer tfoot td {\r
+  background-color:#999;\r
+  color:#FFFFFF;\r
+}\r
+span.Rico_leftArrow {\r
+  background: url(../images/left_w.gif) no-repeat bottom left;\r
+}\r
+span.Rico_rightArrow {\r
+  background: url(../images/right_w.gif) no-repeat bottom left;\r
+}\r
+div.ricoCalContainer span.RicoClose {\r
+  background: url(../images/close_w.gif) no-repeat top right;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th a.hover {\r
+  background-color: #AAA !important;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead a:link, div.ricoCalContainer table.ricoCalTab thead a:visited {\r
+  color:#FFFFFF;\r
+}\r
+.ricoTree a.hover {\r
+  text-decoration: underline;\r
+  cursor:pointer;\r
+}\r
diff --git a/ricoClient/css/greenHdg.css b/ricoClient/css/greenHdg.css
new file mode 100644 (file)
index 0000000..3856b8e
--- /dev/null
@@ -0,0 +1,109 @@
+/* display grid headings with a green background */\r
+\r
+div.ricoLG_outerDiv *, div.ricoLG_outerDiv div.ricoLG_cell, div.ricoLG_editDiv *, .ricoTitle, .Rico_tabTitle, .Rico_accTitle, .ricoTree *, .ricoBookmark  {\r
+  font-family: Arial, Helvetica, sans-serif;\r
+}\r
+\r
+tr.ricoLG_hdg .ricoLG_cell, tr.ricoLG_hdg th, tr.ricoLG_hdg td {  /* td/th required for IE */\r
+  background-color : #cedebd;\r
+  color            : #000000;\r
+  font-weight      : bold;\r
+  text-align       : center;\r
+}\r
+div.ricoLG_selection {\r
+  background-color: #cedebd;\r
+}\r
+tr.ricoLG_hdg div.hover, table.ricoLiveGrid thead td, table.ricoLiveGrid thead th {\r
+  background-color: #dee8cd !important;\r
+}\r
+\r
+div.ricoLG_messageDiv {\r
+  border:2px solid green;\r
+  background-color:white;\r
+  color:navy;\r
+}\r
+\r
+a.RicoButton {\r
+  background-color: #D8E0F2;\r
+  color: #444;\r
+  border: 1px solid #444;\r
+}\r
+a.RicoButton.hover {\r
+  background-color: #cedebd;\r
+}\r
+\r
+.ricoWindow {\r
+  border: 1px solid black;\r
+  background-color: white;\r
+}\r
+.ricoTitle  {\r
+  background-color: #cedebd;\r
+  color: black;\r
+  font-weight: bold;\r
+  font-size:9pt;\r
+  border: 1px solid #aebe9d;\r
+}\r
+\r
+.Rico_tabNavContainer .selected {\r
+  background: #cedebd;\r
+  cursor: auto;\r
+}\r
+.Rico_tabContent {\r
+    background: #f8f8f8;\r
+}\r
+\r
+.Rico_tabContentContainer {\r
+  border : 1px solid #4f4f4f;\r
+}\r
+.Rico_tabTitle {\r
+  height: 1.5em;\r
+  background-color: #D8E0F2;\r
+  font-weight : bold;\r
+  margin-left: 2px;\r
+  margin-right: 2px;\r
+  text-align: center;\r
+  white-space:nowrap;\r
+  overflow:hidden;\r
+  padding: 3px 5px 0px 5px;\r
+}\r
+\r
+\r
+.Rico_accTitle {\r
+  background-color : #cedebd;\r
+  height: 1.7em;\r
+  font-weight : normal;\r
+  border-bottom:1px solid #becead;\r
+  border-top:1px solid #f0f0f0;\r
+  font-weight : normal;\r
+  padding-left: 1em;\r
+  padding-top:0.3em;\r
+}\r
+\r
+.Rico_accTitle a , .Rico_tabTitle a {\r
+  color : #AAA;\r
+  text-decoration: none;\r
+}\r
+.Rico_accordion .hover a, .Rico_tabNavContainer .hover a {\r
+  color : #666;\r
+}\r
+.Rico_accordion .selected a, .Rico_tabNavContainer .selected a {\r
+  color : #444;\r
+  font-weight : bold;\r
+  \r
+}\r
+.Rico_accordion  {\r
+  border : 1px solid #1f669b;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th {\r
+  background-color: #cedebd;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th a.hover {\r
+  background-color: #deeecd !important;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead a:link, div.ricoCalContainer table.ricoCalTab thead a:visited {\r
+  color:blue;\r
+}\r
+.ricoTree a.hover {\r
+  text-decoration: underline;\r
+  cursor:pointer;\r
+}\r
diff --git a/ricoClient/css/jquery-base/images/ui-bg_flat_0_aaaaaa_40x100.png b/ricoClient/css/jquery-base/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644 (file)
index 0000000..5b5dab2
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_flat_75_ffffff_40x100.png b/ricoClient/css/jquery-base/images/ui-bg_flat_75_ffffff_40x100.png
new file mode 100644 (file)
index 0000000..ac8b229
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_glass_55_fbf9ee_1x400.png b/ricoClient/css/jquery-base/images/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100644 (file)
index 0000000..ad3d634
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_glass_55_fbf9ee_1x400.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_glass_65_ffffff_1x400.png b/ricoClient/css/jquery-base/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644 (file)
index 0000000..42ccba2
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_glass_75_dadada_1x400.png b/ricoClient/css/jquery-base/images/ui-bg_glass_75_dadada_1x400.png
new file mode 100644 (file)
index 0000000..5a46b47
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_glass_75_dadada_1x400.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_glass_75_e6e6e6_1x400.png b/ricoClient/css/jquery-base/images/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100644 (file)
index 0000000..86c2baa
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_glass_75_e6e6e6_1x400.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_glass_95_fef1ec_1x400.png b/ricoClient/css/jquery-base/images/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100644 (file)
index 0000000..4443fdc
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_glass_95_fef1ec_1x400.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/ricoClient/css/jquery-base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100644 (file)
index 0000000..7c9fa6c
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-icons_222222_256x240.png b/ricoClient/css/jquery-base/images/ui-icons_222222_256x240.png
new file mode 100644 (file)
index 0000000..ee039dc
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-icons_222222_256x240.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-icons_2e83ff_256x240.png b/ricoClient/css/jquery-base/images/ui-icons_2e83ff_256x240.png
new file mode 100644 (file)
index 0000000..45e8928
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-icons_2e83ff_256x240.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-icons_454545_256x240.png b/ricoClient/css/jquery-base/images/ui-icons_454545_256x240.png
new file mode 100644 (file)
index 0000000..7ec70d1
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-icons_454545_256x240.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-icons_888888_256x240.png b/ricoClient/css/jquery-base/images/ui-icons_888888_256x240.png
new file mode 100644 (file)
index 0000000..5ba708c
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-icons_888888_256x240.png differ
diff --git a/ricoClient/css/jquery-base/images/ui-icons_cd0a0a_256x240.png b/ricoClient/css/jquery-base/images/ui-icons_cd0a0a_256x240.png
new file mode 100644 (file)
index 0000000..7930a55
Binary files /dev/null and b/ricoClient/css/jquery-base/images/ui-icons_cd0a0a_256x240.png differ
diff --git a/ricoClient/css/jquery-base/ui.accordion.css b/ricoClient/css/jquery-base/ui.accordion.css
new file mode 100644 (file)
index 0000000..ee1b1b6
--- /dev/null
@@ -0,0 +1,9 @@
+/* Accordion
+----------------------------------*/
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
+.ui-accordion .ui-accordion-content-active { display: block; }
\ No newline at end of file
diff --git a/ricoClient/css/jquery-base/ui.base.css b/ricoClient/css/jquery-base/ui.base.css
new file mode 100644 (file)
index 0000000..58f5587
--- /dev/null
@@ -0,0 +1,5 @@
+@import url("ui.core.css");
+@import url("ui.accordion.css");
+@import url("ui.dialog.css");
+@import url("ui.tabs.css");
+@import url("ui.datepicker.css");
\ No newline at end of file
diff --git a/ricoClient/css/jquery-base/ui.core.css b/ricoClient/css/jquery-base/ui.core.css
new file mode 100644 (file)
index 0000000..c2f18f2
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* jQuery UI CSS Framework
+* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
+*/
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
\ No newline at end of file
diff --git a/ricoClient/css/jquery-base/ui.datepicker.css b/ricoClient/css/jquery-base/ui.datepicker.css
new file mode 100644 (file)
index 0000000..567f8c9
--- /dev/null
@@ -0,0 +1,62 @@
+/* Datepicker
+----------------------------------*/
+.ui-datepicker { width: 17em; padding: .2em .2em 0; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month, 
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+    display: none; /*sorry for IE5*/
+    display/**/: block; /*sorry for IE5*/
+    position: absolute; /*must have*/
+    z-index: -1; /*must have*/
+    filter: mask(); /*must have*/
+    top: -4px; /*must have*/
+    left: -4px; /*must have*/
+    width: 200px; /*must have*/
+    height: 200px; /*must have*/
+}
\ No newline at end of file
diff --git a/ricoClient/css/jquery-base/ui.dialog.css b/ricoClient/css/jquery-base/ui.dialog.css
new file mode 100644 (file)
index 0000000..2997595
--- /dev/null
@@ -0,0 +1,13 @@
+/* Dialog
+----------------------------------*/
+.ui-dialog { position: relative; padding: .2em; width: 300px; }
+.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative;  }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } 
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
diff --git a/ricoClient/css/jquery-base/ui.tabs.css b/ricoClient/css/jquery-base/ui.tabs.css
new file mode 100644 (file)
index 0000000..3ca6b9a
--- /dev/null
@@ -0,0 +1,11 @@
+/* Tabs
+----------------------------------*/
+.ui-tabs { padding: .2em; zoom: 1; }
+.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
+.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
diff --git a/ricoClient/css/rico.css b/ricoClient/css/rico.css
new file mode 100644 (file)
index 0000000..66c93a7
--- /dev/null
@@ -0,0 +1,832 @@
+/* \r
+ *Rico stylesheet\r
+ */\r
+\r
+/* LiveGrid & SimpleGrid */\r
\r
+div.ricoLG_outerDiv {\r
+  position:relative;\r
+}\r
+\r
+div.ricoLG_innerDiv, div.ricoLG_frozenTabsDiv {\r
+  overflow:hidden;\r
+  margin:0px;\r
+  padding:0px;\r
+  position:absolute;\r
+  top:0px;\r
+}\r
+\r
+div.ricoLG_scrollDiv {\r
+  overflow:scroll;\r
+  position:relative;\r
+}\r
+\r
+div.ricoLG_scrollTabsDiv {\r
+  position:absolute;\r
+  top:0px;\r
+}\r
+\r
+div.ricoLG_resizeDiv {\r
+  position:absolute;\r
+  top:0px;\r
+  width:1px;\r
+  z-index:2;\r
+  background-color:blue;\r
+}\r
+\r
+div.ricoLG_highlightDiv {\r
+  position:absolute;\r
+  border: 2px solid black;\r
+}\r
+\r
+.ricoLG_table, table.ricoLiveGrid {\r
+  margin: 0px;\r
+  padding: 0px;\r
+  border-right: 1px solid silver;\r
+  border-top: 1px solid silver;\r
+  border-left-width: 0px;  /* for dojo */\r
+}\r
+\r
+.ricoLG_FilterRow  div.ricoLG_cell {\r
+  height:1.6em;\r
+  line-height: 1.6em;\r
+}\r
+\r
+.ricoLG_FilterRow  div.ricoLG_cell {\r
+  vertical-align: middle;\r
+}\r
+\r
+.ricoLG_FilterRow select {\r
+  width:100%; \r
+}\r
+\r
+div.ricoLG_mFilter {\r
+  position:absolute;\r
+  z-index:200;\r
+  border: 1px solid #888;\r
+}\r
+div.ricoLG_mFilter * {\r
+  font-size: 8pt;\r
+}\r
+div.ricoLG_mFilter_content {\r
+  height: 150px;\r
+  width: 100%;\r
+  overflow: auto;\r
+  background-color: white;\r
+}\r
+div.ricoLG_mFilter_button {\r
+  padding: 3px;\r
+  background-color: #DDD;\r
+}\r
+tr.ricoLG_mFilter_oddrow {\r
+  background-color: #EEE;\r
+}\r
+\r
+table.ricoLG_bottom, table.ricoLiveGrid td, table.ricoLiveGrid th {\r
+  border-top-style: none;\r
+}\r
+\r
+.ricoLG_selection { background-color: #cedebd; }\r
+\r
+div.ricoLG_col {\r
+  overflow:hidden;\r
+  width:100px;\r
+}\r
+\r
+.ricoLG_top div.ricoLG_col {\r
+  position:relative;\r
+}\r
+\r
+.ricoLG_top div.ricoLG_Resize {\r
+  position:absolute;\r
+  width:5px;\r
+  height:100%;\r
+  top:0px;\r
+  cursor:e-resize;\r
+}\r
+\r
+.ricoLG_HdrIcon {\r
+  padding-left:2px;\r
+  padding-right:2px;\r
+}\r
+\r
+.ricoLG_sortAsc {\r
+  background: url(../images/sort_asc.gif) no-repeat center center;\r
+  width: 11px;\r
+  height: 11px;\r
+}\r
+\r
+.ricoLG_sortDesc {\r
+  background: url(../images/sort_desc.gif) no-repeat center center;\r
+  width: 11px;\r
+  height: 11px;\r
+}\r
+\r
+.ricoClearNative {\r
+  background: url(../images/delete.gif) no-repeat center center;\r
+  width: 17px;\r
+  height: 17px;\r
+  margin-top: -8px;\r
+}\r
+\r
+.ricoClear {\r
+  display:-moz-inline-box;\r
+  display:inline-block;\r
+  cursor: pointer;\r
+}\r
+\r
+.ricoLG_bottom div.ricoLG_cell {\r
+  border-style: solid;\r
+  border-color: silver;\r
+  border-width: 0px 0px 1px 0px;\r
+}\r
+\r
+.ricoLG_top th, .ricoLG_top td, table.ricoLiveGrid td, table.ricoLiveGrid th {\r
+  border-style: solid;\r
+  border-color: silver;\r
+  border-width: 0px 0px 1px 1px;\r
+}\r
+\r
+.ricoLG_bottom th, .ricoLG_bottom td {\r
+  border-style: solid;\r
+  border-color: silver;\r
+  border-width: 0px 0px 0px 1px;\r
+}\r
+\r
+div.ricoLG_cell, table.ricoLiveGrid td, table.ricoLiveGrid th {\r
+  overflow:hidden;\r
+  height:1.2em;\r
+  padding-left: 3px;\r
+  margin: 0px;\r
+  font-size: 10pt;\r
+       padding-top:3px;\r
+       padding-bottom:3px;\r
+}\r
+\r
+div.ricoLG_messageDiv {\r
+  font-weight:bold;\r
+  font-size:larger;\r
+  text-align:center;\r
+  padding:1em;\r
+  opacity:0.8;\r
+}\r
+\r
+p.ricoBookmark {\r
+  margin-bottom: 3px;\r
+  font-size: 10pt;\r
+  white-space: nowrap;\r
+}\r
+\r
+p.ricoBookmark span {\r
+  margin-right: 1em;\r
+  font-size: 10pt;\r
+}\r
+\r
+span.ricoCaption {\r
+  font-weight: bold;\r
+}\r
+\r
+div.alignleft {\r
+  text-align: left;\r
+}\r
+\r
+div.aligncenter {\r
+  text-align: center;\r
+}\r
+\r
+div.alignright {\r
+  text-align: right;\r
+}\r
+\r
+span.ricoSessionTimer {\r
+  background-color:black;\r
+  color:white;\r
+}\r
+\r
+.ricoLG_top input {\r
+  font-weight: normal;\r
+  font-size: 8pt !important;\r
+}\r
+\r
+.ricoLG_top option, .ricoLG_top select {\r
+  font-weight: normal;\r
+  font-size: 9pt !important;\r
+}\r
+\r
+/* grid column chooser */\r
+\r
+div.ricoLG_chooserDiv {\r
+  z-index:200;\r
+}\r
+div.ricoLG_chooserDiv  .ricoContent {\r
+  height: 150px;\r
+  width: 200px;\r
+}\r
+.ricoContent {\r
+  padding: 3px;\r
+  overflow: auto;\r
+}\r
+div.ricoLG_chooserDiv .ricoContent div {\r
+  border-bottom: 1px solid #CCC;\r
+}\r
+div.ricoLG_chooserDiv .ricoContent input {\r
+  margin-right: 0.5em;\r
+}\r
+\r
+/* grid keyword entry */\r
+\r
+div.ricoLG_chooserDiv  *, div.ricoLG_keywordDiv * {\r
+  font-size: 8pt;\r
+}\r
+div.ricoLG_keywordDiv {\r
+  position:absolute;\r
+  z-index:200;\r
+  width: 250px;\r
+}\r
+\r
+div.ricoLG_keywordDiv input {\r
+  position: relative;\r
+  font-size: 9pt;\r
+  float: left;\r
+}\r
+\r
+\r
+/* LiveGrid Forms */\r
+\r
+span.ricoSaveMsg {\r
+  background-color:yellow;\r
+}\r
+\r
+span.ricoSessionTimer {\r
+  background-color:black;\r
+  color:white;\r
+}\r
+\r
+div.ricoLG_editResponseDiv {\r
+  color:#000; background:#E8ECF3;\r
+  overflow:auto;\r
+  padding:8px;\r
+  border: 1px solid navy;\r
+  position:absolute;\r
+  z-index:300;\r
+  top:0px;\r
+  left:0px;\r
+}\r
+\r
+.ricoLG_editDiv *, div.ricoLG_editResponseDiv {\r
+  font-size: 10pt;\r
+}\r
+\r
+form .ricoEditLabel sup {\r
+  font-size: smaller;\r
+}\r
+\r
+form .ricoEditLabel {\r
+  font-weight: bold;\r
+  text-align: left;\r
+  padding-right: 1em;\r
+}\r
+\r
+.ricoLG_editDiv a.RicoButton {\r
+  text-decoration: none;\r
+  padding: 0.3em 1em;\r
+  margin-right: 6px;\r
+}\r
+\r
+.ricoLG_editDiv div.ButtonBar {\r
+  padding: 0.3em 0px;\r
+  margin: 3px;\r
+}\r
+\r
+.ricoLG_editDiv form {\r
+  margin:0px;\r
+}\r
+\r
+.ricoLG_editDiv .tabContent, div.ricoLG_editDiv .noTabContent {\r
+  overflow: hidden;\r
+  padding: 4px;\r
+  white-space:nowrap;\r
+}\r
+\r
+\r
+\r
+/* ricoMenu */\r
+\r
+div.ricoMenu, div.ricoMenuSafari {\r
+border:1px solid #666;\r
+padding:2px;\r
+cursor:default;\r
+}\r
+\r
+div.ricoMenu, div.ricoMenu div.ricoMenuHeading, div.ricoMenu a {\r
+background-color:menu;\r
+color: menutext;\r
+text-decoration: none;\r
+font-family:tahoma,arial,helvetica,sans-serif;\r
+font-size: 8pt;\r
+display:block;\r
+}\r
+\r
+div.ricoMenuSafari, div.ricoMenuSafari div.ricoMenuHeading, div.ricoMenuSafari a {\r
+background-color:#EDEDED;\r
+text-decoration: none;\r
+font-family:tahoma,arial,helvetica,sans-serif;\r
+font-size: 8pt;\r
+display:block;\r
+}\r
+\r
+div.ricoMenu div.ricoMenuHeading{\r
+padding: 1px 0px;\r
+font-weight:bold;\r
+}\r
+\r
+div.ricoMenuSafari div.ricoMenuHeading{\r
+padding: 1px 0px;\r
+color: black;\r
+display: block;\r
+font-weight:bold;\r
+}\r
+\r
+div.ricoMenu .enabled {\r
+position: relative;\r
+}\r
+\r
+div.ricoMenuSafari .enabled {\r
+color: black;\r
+}\r
+\r
+div.ricoMenu .enabled, div.ricoMenu .enabled-hover, div.ricoMenuSafari .enabled, div.ricoMenuSafari .enabled-hover, div.ricoMenu .disabled, div.ricoMenuSafari .disabled {\r
+padding-left: 1em;\r
+padding-top:0.1em;\r
+padding-bottom:0.1em;\r
+z-index: 101;\r
+}\r
+\r
+div.ricoMenu .disabled, div.ricoMenuSafari .disabled {\r
+color: #999;\r
+}\r
+\r
+div.ricoMenu hr{\r
+height:1px;\r
+margin:1px;\r
+border:0;\r
+color: menu;\r
+background-color: menu;\r
+}\r
+\r
+div.ricoMenu .enabled-hover, div.ricoMenu .ricoSubMenuOpen {\r
+   background-color: Highlight;\r
+   color:            HighlightText;\r
+}\r
+\r
+div.ricoMenuSafari .enabled-hover, div.ricoMenuSafari .ricoSubMenuOpen {\r
+   background-color: #1657B8;\r
+   color:            white;\r
+}\r
+\r
+div.ricoMenu .ricoSubMenu, div.ricoMenu .ricoSubMenuOpen, div.ricoMenuSafari .ricoSubMenu, div.ricoMenuSafari .ricoSubMenuOpen {\r
+padding: 1px 0px;\r
+display: block;\r
+font-weight:bold;\r
+z-index: 101;\r
+position: relative;\r
+}\r
+\r
+div.ricoMenu div.ricoMenuBreak, div.ricoMenuSafari div.ricoMenuBreak {\r
+height:1px;\r
+margin:3px 0 3px 0;\r
+padding:0;\r
+background-color: #AAA;\r
+width:100%;\r
+line-height:5px;\r
+overflow:hidden;\r
+}\r
+\r
+a.RicoButton {\r
+  -moz-border-radius: 6px;\r
+  -webkit-border-radius: 6px;\r
+}\r
+\r
+\r
+/* Rico.Window */\r
+\r
+\r
+.ricoTitle {\r
+  padding: 3px;\r
+  cursor: move;\r
+}\r
+\r
+.ricoTitleSpan {\r
+  margin-right: 25px;\r
+  white-space: nowrap;\r
+}\r
+\r
+.ui-dialog, .ui-datepicker {\r
+  width: auto !important;\r
+}\r
+\r
+.RicoCloseAnchor {\r
+  cursor: pointer;\r
+  position: absolute;\r
+  top: 1px;\r
+  right: 2px;\r
+}\r
+\r
+span.RicoCloseW {\r
+  display: block;\r
+  height: 15px;\r
+  width: 16px;\r
+  background: url(../images/close_w.gif) no-repeat top right;\r
+}\r
+\r
+span.RicoCloseB, span.RicoClose {\r
+  display: block;\r
+  height: 15px;\r
+  width: 16px;\r
+  background: url(../images/close_b.gif) no-repeat top right;\r
+}\r
+\r
+a.RicoButtonAnchor {\r
+  padding: 1px 0;\r
+  margin: 1px;\r
+  position: relative;\r
+  cursor: pointer;\r
+  float: left;\r
+}\r
+\r
+a.RicoButtonAnchorNative {\r
+  border:1px solid #888;\r
+  background-color: #DDD;\r
+}\r
+\r
+a.RicoButtonAnchor span {\r
+  margin: 0 1px;\r
+  float: left;\r
+}\r
+\r
+a.RicoButtonAnchorNative:hover {\r
+  border:1px solid #666;\r
+  background-color: #CCC;\r
+}\r
+\r
+span.RicoCheckmark {\r
+  display: block;\r
+  height: 17px;\r
+  width: 17px;\r
+  background: url(../images/checkmark.gif) no-repeat top right;\r
+}\r
+\r
+span.RicoCancel {\r
+  display: block;\r
+  height: 17px;\r
+  width: 17px;\r
+  background: url(../images/delete.gif) no-repeat top right;\r
+}\r
+\r
+* html .ui-dialog-titlebar .ui-dialog-titlebar-close {\r
+  top: 16px;   /* required by IE6 */\r
+}\r
+\r
+.ricoLG_cell .ui-icon {\r
+  text-indent: 0px !important;\r
+}\r
+\r
+\r
+\r
+/* ricoKeywordSearch */\r
+.ricoKeywordSearch * {\r
+  font-size: 8pt;\r
+}\r
+\r
+\r
+/* ricoTree */\r
+\r
+.ricoTreeContainer {\r
+  background-color:#cedebd;\r
+  border:1px solid black;\r
+  padding:4px;\r
+}\r
+\r
+.ricoTree td {\r
+  padding: 0px;\r
+}\r
+\r
+.ricoTree {\r
+  border:thin inset;\r
+  overflow:auto;\r
+  background-color:#FFF;\r
+}\r
+\r
+.ricoTree p, .ricoTree a {\r
+  margin:0px;\r
+  padding-left:0.3em;\r
+  white-space:nowrap;\r
+}\r
+\r
+.ricoTree a {\r
+  cursor:pointer;\r
+  text-decoration:none;\r
+}\r
+\r
+.ricoTree img {\r
+  margin:0px;\r
+  padding:0px;\r
+  display:block;\r
+}\r
+\r
+.ricoTreeContainer *, .ricoTree * {\r
+  font-size:8pt;\r
+  white-space:nowrap;\r
+}\r
+\r
+.ricoTreeButtons span:hover {\r
+  background-color:#deeecd;\r
+}\r
+\r
+\r
+/* ricoCalendar */\r
+\r
+table.ricoCalTab, table.ricoCalTab *, .ricoCalYearPrompt *, div.ricoTreeContainer * {\r
+  font-size:8pt !important;\r
+}\r
+\r
+table.ricoCalTab {\r
+  width: auto !important;\r
+}\r
+\r
+div.ricoCalContainer table.ricoCalTab, div.ricoCalContainer td.ricoCalEmpty, div.ricoCalContainer tr.ricoCalDayNames td  {\r
+  background-color:#eee;\r
+}\r
+\r
+div.ricoCalContainer  .ricoCalToday {\r
+  font-weight:bold;\r
+  background-color: #33FFFF !important;\r
+}\r
+\r
+div.ricoCalContainer .ricoSelectedDay {\r
+  font-weight:bold;\r
+  background-color: #FFFF66 !important;\r
+}\r
+\r
+div.ricoCalContainer tbody td.hover {\r
+  background-color: #FDD;\r
+}\r
+\r
+table.ricoCalTab thead a {\r
+  text-decoration: none;\r
+}\r
+\r
+span.RicoCalMonthHeading {\r
+  position:relative;\r
+  margin: 0px 1.6em;\r
+  display: block;\r
+  padding: 0px;\r
+  width: 6em;\r
+  text-align: center;\r
+  float: left;\r
+}\r
+\r
+span.RicoCalYearHeading {\r
+  position:relative;\r
+  display: block;\r
+  width: 7em;\r
+  text-align: center;\r
+  float: left;\r
+}\r
+\r
+span.Rico_leftArrow {\r
+  background: url(../images/left_b.gif) no-repeat bottom right;\r
+  position: absolute;\r
+  top: 4px;\r
+  left: 0px;\r
+  width: 11px;\r
+  height: 11px;\r
+}\r
+\r
+a.Rico_leftArrow {\r
+  position: absolute;\r
+  top: -3px !important;\r
+  left: 0px !important;\r
+  width: 12px;\r
+  height: 1.6em;\r
+}\r
+\r
+span.Rico_rightArrow {\r
+  background: url(../images/right_b.gif) no-repeat bottom left;\r
+  position: absolute;\r
+  top: 4px;\r
+  right: 0px;\r
+  width: 11px;\r
+  height: 11px;\r
+}\r
+\r
+a.Rico_rightArrow {\r
+  position: absolute;\r
+  top: -3px !important;\r
+  right: 0px !important;\r
+  width: 12px;\r
+  height: 1.6em;\r
+}\r
+\r
+table.ricoCalTab thead img {\r
+  border:none;\r
+/*  padding-left: 0.3em;\r
+  padding-right: 0.3em;*/\r
+}\r
+\r
+table.ricoCalTab thead a.hover {\r
+  cursor:pointer;\r
+}\r
+\r
+.ricoCalYearPrompt td {\r
+  white-space: nowrap;\r
+}\r
+\r
+div.ricoCalYearPrompt {\r
+  margin: 0px;\r
+  padding: 3px;\r
+}\r
+\r
+div.ricoCalContainer  div.ricoCalYearPrompt {\r
+  border:1px solid #666666;\r
+  background-color: #FEE;\r
+}\r
+\r
+div.ricoCalContainer  .ricoCalYearPrompt img {\r
+  border: 1px solid black;\r
+  margin-left: 3px;\r
+  vertical-align: middle;\r
+}\r
+\r
+div.ricoCalContainer table.ricoCalTab thead th {\r
+  background-color: #D4D0C8;\r
+  font-weight: bold;\r
+  text-align:center;\r
+  padding: 2px;\r
+}\r
+\r
+.RicoCalHeading {\r
+  position: relative;\r
+  padding: 1px 0px;\r
+  height: 1%;\r
+}\r
+\r
+table.ricoCalTab tfoot td {\r
+  text-align:center;\r
+  padding: 2px;\r
+  cursor:pointer;\r
+}\r
+\r
+div.ricoCalContainer  tfoot td {\r
+  color:#FFF;\r
+  background-color: #666666;\r
+}\r
+\r
+table.ricoCalTab tfoot span {\r
+  text-decoration: underline;\r
+  cursor:pointer;\r
+}\r
+\r
+div.ricoCalContainer table.ricoCalTab tbody {\r
+  background-color: white;\r
+}\r
+\r
+tr.ricoCalDayNames td {\r
+  font-weight: bold;\r
+/*  padding: 0px 2px 0px 2px;*/\r
+  padding: 0px !important;\r
+  text-align:right;\r
+}\r
+\r
+table.ricoCalTab td, table.ricoCalTab th {\r
+  width:2.7em;\r
+}\r
+\r
+td.ricoCal0, td.ricoCal1, td.ricoCal2, td.ricoCal3, td.ricoCal4, td.ricoCal5, td.ricoCal6, td.ricoCalToday, td.ricoCalEmpty {\r
+  text-align:right;\r
+  text-decoration:none;\r
+}\r
+\r
+td.ricoCal0, td.ricoCal1, td.ricoCal2, td.ricoCal3, td.ricoCal4, td.ricoCal5, td.ricoCal6 {\r
+  cursor:pointer;\r
+/*  padding-right: 2px !important;*/\r
+  padding: 0px;\r
+}\r
+\r
+/* Monday-Friday */\r
+div.ricoCalContainer td.ricoCal1, div.ricoCalContainer td.ricoCal2, div.ricoCalContainer td.ricoCal3, div.ricoCalContainer td.ricoCal4, div.ricoCalContainer td.ricoCal5 {\r
+  color:black;\r
+  background-color:#fff;\r
+}\r
+\r
+/* Sunday, Saturday */\r
+div.ricoCalContainer td.ricoCal0, div.ricoCalContainer td.ricoCal6 {\r
+  color:#999;\r
+  background-color:#fff;\r
+}\r
+\r
+td.ricoCalToday {\r
+  cursor:pointer;\r
+  color:red;\r
+  font-weight:bold;\r
+}\r
+\r
+td.ricoCalWeekNum {\r
+  background-color: #D4D0C8;\r
+  color:black;\r
+  text-align:center;\r
+}\r
+\r
+.ricoCalMenu {\r
+  width:12em !important;\r
+}\r
+div.ricoCalContainer .ricoCalMenu {\r
+  background-color: #FEE;\r
+  border-bottom:1px solid #666666;\r
+  border-right:1px solid #666666;\r
+}\r
+\r
+div.ricoCalContainer .ricoCalMenu td {\r
+  border-top:1px solid #666666;\r
+  border-left:1px solid #666666;\r
+}\r
+\r
+.ricoCalMenu a {\r
+  display:block;\r
+  text-decoration:none;\r
+  cursor:pointer;\r
+  font-size:8pt;\r
+  text-align: center !important;\r
+}\r
+\r
+div.ricoCalContainer .ricoCalMenu a {\r
+  color:black;\r
+}\r
+\r
+div.ricoCalContainer .ricoCalMenu a:hover {\r
+  background-color: #FCC;\r
+}\r
+\r
+\r
+/* ricoColorPicker */\r
+\r
+div.ricoColorPicker {\r
+  background-color: white;\r
+}\r
+\r
+div.ricoColorPicker td {\r
+  width: 12px;\r
+  height: 12px;\r
+  font-size: 10px;\r
+}\r
+\r
+/* tabbed panels and accordion */\r
+\r
+.Rico_tabNavContainer {\r
+  display:block;\r
+  margin:0px;\r
+  padding: 0px;\r
+}\r
+\r
+.Rico_tabTitle {\r
+  float: left;\r
+  margin-left: 1px;\r
+  margin-right: 1px;\r
+  margin-bottom: 0px;\r
+  display: inline;\r
+}\r
+.Rico_tabContent, .Rico_accContent {\r
+  padding: 1em;\r
+}\r
+.Rico_accContent {\r
+  overflow: auto;\r
+}\r
+.Rico_tabContentContainer {\r
+  clear:both;\r
+}\r
+.Rico_tabNavContainer .hover, .Rico_accTitle {\r
+  cursor: pointer;\r
+}\r
+\r
+div.ricoCorner {\r
+  position: absolute;\r
+}\r
+div.ricoCorner div {\r
+  line-height: 1px;\r
+  font-size:1px;\r
+  overflow: hidden;\r
+}\r
+\r
+* html .Rico_tabPanel {\r
+  height: 1%;\r
+  position: relative;\r
+}\r
+\r
+* html .ui-tabs {\r
+  position: relative;\r
+}\r
+\r
+* html .Rico_tabNavContainer {\r
+  height: 1%;\r
+  position: relative;\r
+}\r
diff --git a/ricoClient/css/seaglass.css b/ricoClient/css/seaglass.css
new file mode 100644 (file)
index 0000000..9dc1e54
--- /dev/null
@@ -0,0 +1,155 @@
+/* -------------------------------------------------------
+Based on sea glass table design
+Author: Stephanie Leary
+URL: http://www.sillybean.net/
+ ------------------------------------------------------- */
+.ricoLG_table, .ricoTitle, a.RicoButton, .Rico_tabTitle , .Rico_accTitle, .ricoTree *, .ricoBookmark {
+  font: .9em/1.2em Georgia, "Times New Roman", Times, serif;
+}
+caption { font-size: 1.3em; font-weight: bold; text-align: left; padding: 1em 4px; }
+tr.ricoLG_hdg .ricoLG_cell, tr.ricoLG_hdg .ricoLG_cell a, tr.ricoLG_hdg .ricoLG_cell a:visited, tr.ricoLG_hdg th, tr.ricoLG_hdg td, table.ricoLiveGrid thead td, table.ricoLiveGrid thead th {
+  background-color: #2C5755 !important;
+  color: #ffffff !important;
+  text-decoration: none;
+  height: 1.4em;
+  text-align: center;
+  font-weight: normal;
+}
+tr.ricoLG_hdg .ricoLG_cell a:hover {
+       text-decoration: underline;
+}
+.odd th { background: #6E8D88; }
+.ricoLG_bottom .ricoLG_cell { padding: 3px; }
+.ricoLG_bottom  a, .ricoLG_bottom  a:link { color: #325C91; }
+.ricoLG_bottom  a:visited { color: #466C8E; }
+.ricoLG_bottom a:hover, .ricoLG_bottom  a:focus { color: #1E4C94; }
+.ricoLG_table {
+  background: #f1f8ee;
+  color: #033;
+}
+div.ricoLG_messageDiv {
+  border:2px solid black;
+  background-color:#f1f8ee;
+  color:#2C5755;
+}
+
+div.ricoLG_selection {
+  background-color: #839E99;
+  color: #ffffff;
+}
+.ricoLG_top .ricoClearNative {
+  background: url(../images/delete_w.gif) no-repeat center center;
+}
+
+.ricoWindow {
+  border: 1px solid black;
+  background-color: #f1f8ee;
+}
+.ricoTitle  {
+  background-color: #2C5755;
+  color: #FFF;
+  font-size:9pt;
+  padding: 0.4em 1em;
+}
+a.RicoButton {
+  background-color: #4C7775;
+  color: #FFF;
+}
+a.RicoButton.hover {
+  background-color: #6C9795;
+}
+
+.Rico_tabNavContainer .selected {
+  background: #2C5755;
+  cursor: auto;
+}
+.Rico_tabContent {
+  background: #f1f8ee;
+}
+
+.Rico_tabContentContainer {
+  border : 2px solid #2C5755;
+}
+.Rico_tabTitle {
+  height: 1.5em;
+  background: #839E99;
+  margin-left: 2px;
+  margin-right: 2px;
+  text-align: center;
+  white-space:nowrap;
+  overflow:hidden;
+  padding: 5px 7px 0px 7px;
+}
+
+
+.Rico_accTitle {
+  background-color : #2C5755;
+  height: 1.7em;
+  font-weight : normal;
+  border-bottom:1px solid #1C4745;
+  border-top:1px solid #6C9795;
+  font-weight : normal;
+  padding-left: 1em;
+  padding-top:0.3em;
+}
+
+.Rico_accTitle a , .Rico_tabTitle a {
+  color : #CCC;
+  text-decoration: none;
+}
+
+.Rico_accordion .hover a, .Rico_tabNavContainer .hover a {
+  color : #FFF;
+}
+.Rico_accordion .selected a, .Rico_tabNavContainer .selected a {
+  color : #FFF;
+  font-weight : bold;
+}
+.Rico_accordion  {
+  border : 1px solid #1f669b;
+}
+
+div.ricoCalContainer table.ricoCalTab thead th {
+  background-color: #2C5755;
+  color:#FFFFFF;
+}
+div.ricoCalContainer tfoot td {
+  background-color:#1C4745;
+  color:#FFFFFF;
+}
+div.ricoCalContainer table.ricoCalTab, div.ricoCalContainer td.ricoCalEmpty, div.ricoCalContainer tr.ricoCalDayNames td {
+  background-color:#DBE6DD;
+}
+.ricoCal0, .ricoCal1, .ricoCal2, .ricoCal3, .ricoCal4, .ricoCal4, .ricoCal6 {
+  font: .9em/1.2em Georgia, "Times New Roman", Times, serif;
+}
+div.ricoCalContainer div.ricoCalYearPrompt {
+  background-color:#f1f8ee;
+  border:1px solid #2C5755;
+  font: .9em/1.2em Georgia, "Times New Roman", Times, serif;
+}
+div.ricoCalContainer .ricoCalMenu {
+  font: .9em/1.2em Georgia, "Times New Roman", Times, serif;
+  background-color:#f1f8ee;
+  border-bottom:1px solid #2C5755;
+  border-right:1px solid #2C5755;
+}
+span.Rico_leftArrow {
+  background: url(../images/left_w.gif) no-repeat bottom left;
+}
+span.Rico_rightArrow {
+  background: url(../images/right_w.gif) no-repeat bottom left;
+}
+span.RicoClose {
+  background: url(../images/close_w.gif) no-repeat top right;
+}
+div.ricoCalContainer table.ricoCalTab thead th a.hover {
+  background-color: #4C7775 !important;
+}
+div.ricoCalContainer table.ricoCalTab thead a:link, div.ricoCalContainer table.ricoCalTab thead a:visited {
+  color:#FFFFFF;
+}
+.ricoTree a.hover {
+  text-decoration: underline;
+  cursor:pointer;
+}
diff --git a/ricoClient/css/striping/black-tie.css b/ricoClient/css/striping/black-tie.css
new file mode 100644 (file)
index 0000000..a7793bf
--- /dev/null
@@ -0,0 +1 @@
+.ricoLG_oddRow {  background-color: #FFF; }\r
diff --git a/ricoClient/css/striping/blitzer.css b/ricoClient/css/striping/blitzer.css
new file mode 100644 (file)
index 0000000..da846a7
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #F9F9F9; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/coffee-with-milk.css b/ricoClient/css/striping/coffee-with-milk.css
new file mode 100644 (file)
index 0000000..4fd9ac1
--- /dev/null
@@ -0,0 +1,9 @@
+.ricoLG_bottom div.ricoLG_oddRow {\r
+  background-color:#F7F4EE;\r
+  border-top: 1px solid #EBE5D9;\r
+  border-bottom: 1px solid #EBE5D9;\r
+}\r
+.ricoLG_bottom div.ricoLG_evenRow {\r
+  border-top: 1px solid #FFF;\r
+  border-bottom: 1px solid #FFF;\r
+}\r
diff --git a/ricoClient/css/striping/cupertino.css b/ricoClient/css/striping/cupertino.css
new file mode 100644 (file)
index 0000000..c9c9c0f
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #F9FAFB; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/dark-hive.css b/ricoClient/css/striping/dark-hive.css
new file mode 100644 (file)
index 0000000..415bd60
--- /dev/null
@@ -0,0 +1,5 @@
+\r
+.ricoLG_oddRow {  color: #64A7C4; }\r
+/*\r
+.ricoLG_oddRow {  background-color: #474747; }\r
+*/\r
diff --git a/ricoClient/css/striping/dot-luv.css b/ricoClient/css/striping/dot-luv.css
new file mode 100644 (file)
index 0000000..93036c9
--- /dev/null
@@ -0,0 +1 @@
+.ricoLG_oddRow {  background-color: #0A3561; }\r
diff --git a/ricoClient/css/striping/eggplant.css b/ricoClient/css/striping/eggplant.css
new file mode 100644 (file)
index 0000000..bf678e4
--- /dev/null
@@ -0,0 +1,2 @@
+div.ricoLG_evenRow {  background-color: #5C5662; }\r
+div.ricoLG_oddRow {  background-color: #3D3644; }\r
diff --git a/ricoClient/css/striping/excite-bike.css b/ricoClient/css/striping/excite-bike.css
new file mode 100644 (file)
index 0000000..f4e9683
--- /dev/null
@@ -0,0 +1,2 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #eeeeee; }\r
diff --git a/ricoClient/css/striping/flick.css b/ricoClient/css/striping/flick.css
new file mode 100644 (file)
index 0000000..475fb5f
--- /dev/null
@@ -0,0 +1 @@
+.ricoLG_oddRow {  background-color: #F6F6F6; }\r
diff --git a/ricoClient/css/striping/grayedout.css b/ricoClient/css/striping/grayedout.css
new file mode 100644 (file)
index 0000000..99e588b
--- /dev/null
@@ -0,0 +1,3 @@
+.ricoLG_oddRow {\r
+       background-color: #EEE;\r
+}\r
diff --git a/ricoClient/css/striping/greenHdg.css b/ricoClient/css/striping/greenHdg.css
new file mode 100644 (file)
index 0000000..406b9de
--- /dev/null
@@ -0,0 +1,2 @@
+.ricoLG_evenRow   { }\r
+.ricoLG_oddRow    { background-color: #EEE; }\r
diff --git a/ricoClient/css/striping/hot-sneaks.css b/ricoClient/css/striping/hot-sneaks.css
new file mode 100644 (file)
index 0000000..20ce4fa
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #93C3CD; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/humanity.css b/ricoClient/css/striping/humanity.css
new file mode 100644 (file)
index 0000000..7dfc97a
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #f8f4f0; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/le-frog.css b/ricoClient/css/striping/le-frog.css
new file mode 100644 (file)
index 0000000..e2c4b17
--- /dev/null
@@ -0,0 +1 @@
+.ricoLG_oddRow {  background-color: #619A35; }\r
diff --git a/ricoClient/css/striping/mint-choc.css b/ricoClient/css/striping/mint-choc.css
new file mode 100644 (file)
index 0000000..b7a9a19
--- /dev/null
@@ -0,0 +1,2 @@
+div.ricoLG_evenRow {  background-color: #977C68; }\r
+div.ricoLG_oddRow {  background-color: #685648; }\r
diff --git a/ricoClient/css/striping/overcast.css b/ricoClient/css/striping/overcast.css
new file mode 100644 (file)
index 0000000..6ab9b17
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #C9C9C9; }\r
+div.ricoLG_oddRow {  background-color: #D9D9D9; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/pepper-grinder.css b/ricoClient/css/striping/pepper-grinder.css
new file mode 100644 (file)
index 0000000..4870f62
--- /dev/null
@@ -0,0 +1 @@
+.ricoLG_oddRow { background:#F8F7F6 url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/pepper-grinder/images/ui-bg_fine-grain_10_f8f7f6_60x60.png) repeat scroll 50% 50%; }\r
diff --git a/ricoClient/css/striping/redmond.css b/ricoClient/css/striping/redmond.css
new file mode 100644 (file)
index 0000000..a97af07
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #EEF5FB; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/seaglass.css b/ricoClient/css/striping/seaglass.css
new file mode 100644 (file)
index 0000000..857f3be
--- /dev/null
@@ -0,0 +1 @@
+.ricoLG_oddRow  { background: #DBE6DD; }\r
diff --git a/ricoClient/css/striping/smoothness.css b/ricoClient/css/striping/smoothness.css
new file mode 100644 (file)
index 0000000..881cd6f
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #ececec; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/south-street.css b/ricoClient/css/striping/south-street.css
new file mode 100644 (file)
index 0000000..d3ade2f
--- /dev/null
@@ -0,0 +1,2 @@
+div.ricoLG_evenRow {  background-color: #FCFCF9; }\r
+div.ricoLG_oddRow {  background-color: #F5F3E5; }\r
diff --git a/ricoClient/css/striping/start.css b/ricoClient/css/striping/start.css
new file mode 100644 (file)
index 0000000..a384e6a
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #CEE6F0; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/sunny.css b/ricoClient/css/striping/sunny.css
new file mode 100644 (file)
index 0000000..7e5def8
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #FEF8E4; }\r
+div.ricoLG_oddRow {  background-color: #FEEEBD; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/ui-darkness.css b/ricoClient/css/striping/ui-darkness.css
new file mode 100644 (file)
index 0000000..05369a5
--- /dev/null
@@ -0,0 +1,2 @@
+div.ricoLG_evenRow {  background-color: #000000; }\r
+div.ricoLG_oddRow {  background-color: #2c2c2c; }\r
diff --git a/ricoClient/css/striping/ui-lightness.css b/ricoClient/css/striping/ui-lightness.css
new file mode 100644 (file)
index 0000000..c0b5be7
--- /dev/null
@@ -0,0 +1,7 @@
+div.ricoLG_evenRow {  background-color: #ffffff; }\r
+div.ricoLG_oddRow {  background-color: #eeeeee; }\r
+.ricoLG_bottom div.ui-state-hover {\r
+  border-left: none;\r
+  border-top: none;\r
+  border-right: none;\r
+}\r
diff --git a/ricoClient/css/striping/vader.css b/ricoClient/css/striping/vader.css
new file mode 100644 (file)
index 0000000..f0d2f4d
--- /dev/null
@@ -0,0 +1,2 @@
+div.ricoLG_evenRow {  background-color: #000000; }\r
+div.ricoLG_oddRow {  background-color: #4c4c4c; }\r
diff --git a/ricoClient/css/striping/warmfall.css b/ricoClient/css/striping/warmfall.css
new file mode 100644 (file)
index 0000000..72d9bfd
--- /dev/null
@@ -0,0 +1,5 @@
+.ricoLG_oddRow {\r
+       background-color: #fffad0;\r
+       color: #101011;\r
+}\r
+\r
diff --git a/ricoClient/css/warmfall.css b/ricoClient/css/warmfall.css
new file mode 100644 (file)
index 0000000..20d526d
--- /dev/null
@@ -0,0 +1,182 @@
+/* -------------------------------------------------------\r
+Based on warm fall table design\r
+Author: Mya Leigh\r
+Theme: A Warm, Fall Table - Easy to Read\r
+URL: http://www.myaleigh.com \r
+ ------------------------------------------------------- */\r
+div.ricoLG_outerDiv *, div.ricoLG_outerDiv div.ricoLG_cell, div.ricoLG_editDiv *, .ricoTitle, .Rico_tabTitle, .Rico_accTitle, .ricoTree *, .ricoBookmark {\r
+  font-family: Verdana, Arial, Helvetica, sans-serif;\r
+}\r
+\r
+.ricoLG_table {\r
+       border-top: 1px solid #84785e;\r
+       border-right: 1px solid #84785e;\r
+}\r
+\r
+tr.ricoLG_hdg .ricoLG_cell, tr.ricoLG_hdg .ricoLG_cell a, tr.ricoLG_hdg .ricoLG_cell a:visited, tr.ricoLG_hdg th, tr.ricoLG_hdg td, table.ricoLiveGrid thead td, table.ricoLiveGrid thead th {  /* td/th required for IE */\r
+       background-color: #a24116 !important;\r
+  color: #ffffff !important;  \r
+       text-decoration: none;\r
+}\r
+\r
+.ricoLG_table th, .ricoLG_table td {\r
+       border-left: 1px solid #84785e;\r
+}\r
+\r
+.ricoLG_bottom div.ricoLG_cell, .ricoLG_top th, .ricoLG_top td {\r
+  border-bottom: 1px solid #84785e;\r
+}\r
+\r
+tr.ricoLG_hdg .ricoLG_cell {\r
+       background-color: #a24116;\r
+  border: 0px none;\r
+  color: #ffffff;  \r
+       padding: 0.75em;\r
+  font-weight: bold;\r
+}\r
+\r
+div.ricoLG_bottom a:visited, div.ricoLG_bottom a:link, div.ricoLG_bottom a:active {\r
+       color: #101011;\r
+       text-decoration: none;\r
+}\r
+\r
+div.ricoLG_outerDiv a:hover {\r
+       text-decoration: underline;\r
+}\r
+\r
+div.ricoLG_outerDiv tbody a:visited {\r
+       color:#444;\r
+}\r
+\r
+div.ricoLG_messageDiv {\r
+  border:2px solid #a24116;\r
+  background-color:#fffad0;\r
+  color:#a24116;\r
+}\r
+\r
+div.ricoLG_selection {\r
+       background-color: #923106;\r
+       color: #ffffff;\r
+}\r
+\r
+.ricoLG_top .ricoClearNative {\r
+  background: url(../images/delete_w.gif) no-repeat center center;\r
+}\r
+       \r
+a.RicoButton {\r
+  border: 1px solid #923106;\r
+  color: #923106;\r
+}\r
+a.RicoButton.hover {\r
+  background-color: #FFC4AA;\r
+}\r
+\r
+caption {\r
+       text-align: left;\r
+       font-size: 100%;\r
+       padding: .75em;\r
+       color: #000;\r
+}\r
+\r
+.ricoWindow {\r
+  border: 1px solid black;\r
+  background-color: #fffbd8;\r
+}\r
+.ricoTitle  {\r
+  background-color: #a24116;\r
+  color: #FFF;\r
+  font-weight: bold;\r
+  font-size:11pt;\r
+}\r
+\r
+\r
+.Rico_tabNavContainer .selected {\r
+  background: #a24116;\r
+  cursor: auto;\r
+}\r
+.Rico_tabContent {\r
+  background-color: #fffbd8;\r
+}\r
+\r
+.Rico_tabContentContainer {\r
+  border : 1px solid #4f4f4f;\r
+}\r
+.Rico_tabTitle {\r
+  height: 1.5em;\r
+  background: #923106;\r
+  margin-left: 2px;\r
+  margin-right: 2px;\r
+  text-align: center;\r
+  white-space:nowrap;\r
+  overflow:hidden;\r
+  padding: 3px 5px 0px 5px;\r
+}\r
+\r
+\r
+.Rico_accTitle {\r
+  background-color : #a24116;\r
+  height: 1.7em;\r
+  font-weight : normal;\r
+  border-bottom:1px solid #923106;\r
+  border-top:1px solid #c26136;\r
+  font-weight : normal;\r
+  padding-left: 1em;\r
+  padding-top:0.3em;\r
+}\r
+\r
+.Rico_accTitle a , .Rico_tabTitle a {\r
+  color : #AAA;\r
+  text-decoration: none;\r
+}\r
+.Rico_accordion .hover a, .Rico_tabNavContainer .hover a {\r
+  color : #FFF;\r
+}\r
+.Rico_accordion .selected a, .Rico_tabNavContainer .selected a {\r
+  color : #FFF;\r
+  font-weight : bold;\r
+  \r
+}\r
+.Rico_accordion  {\r
+  border : 1px solid #1f669b;\r
+}\r
+\r
+\r
+div.ricoCalContainer table.ricoCalTab thead th {\r
+  background-color: #a24116;\r
+  color:#FFFFFF;\r
+}\r
+div.ricoCalContainer tfoot td {\r
+  background-color:#923106;\r
+  color:#FFFFFF;\r
+}\r
+div.ricoCalContainer table.ricoCalTab, div.ricoCalContainer td.ricoCalEmpty, div.ricoCalContainer tr.ricoCalDayNames td {\r
+  background-color:#f8f3d0;\r
+}\r
+div.ricoCalContainer div.ricoCalYearPrompt {\r
+  background-color:#fffbd8;\r
+  border:1px solid #923106;\r
+}\r
+div.ricoCalContainer .ricoCalMenu {\r
+  background-color:#fffbd8;\r
+  border-bottom:1px solid #923106;\r
+  border-right:1px solid #923106;\r
+}\r
+span.Rico_leftArrow {\r
+  background: url(../images/left_w.gif) no-repeat bottom left;\r
+}\r
+span.Rico_rightArrow {\r
+  background: url(../images/right_w.gif) no-repeat bottom left;\r
+}\r
+span.RicoClose {\r
+  background: url(../images/close_w.gif) no-repeat top right;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead th a.hover {\r
+  background-color: #c26136 !important;\r
+}\r
+div.ricoCalContainer table.ricoCalTab thead a:link, div.ricoCalContainer table.ricoCalTab thead a:visited {\r
+  color:#FFFFFF;\r
+}\r
+.ricoTree a.hover {\r
+  text-decoration: underline;\r
+  cursor:pointer;\r
+}\r
diff --git a/ricoClient/images/aline.gif b/ricoClient/images/aline.gif
new file mode 100644 (file)
index 0000000..7f5cb43
Binary files /dev/null and b/ricoClient/images/aline.gif differ
diff --git a/ricoClient/images/calarrow.png b/ricoClient/images/calarrow.png
new file mode 100644 (file)
index 0000000..acdcfed
Binary files /dev/null and b/ricoClient/images/calarrow.png differ
diff --git a/ricoClient/images/calendaricon.gif b/ricoClient/images/calendaricon.gif
new file mode 100644 (file)
index 0000000..abdf6ac
Binary files /dev/null and b/ricoClient/images/calendaricon.gif differ
diff --git a/ricoClient/images/checkmark.gif b/ricoClient/images/checkmark.gif
new file mode 100644 (file)
index 0000000..88a19a1
Binary files /dev/null and b/ricoClient/images/checkmark.gif differ
diff --git a/ricoClient/images/close_b.gif b/ricoClient/images/close_b.gif
new file mode 100644 (file)
index 0000000..cf32976
Binary files /dev/null and b/ricoClient/images/close_b.gif differ
diff --git a/ricoClient/images/close_w.gif b/ricoClient/images/close_w.gif
new file mode 100644 (file)
index 0000000..3ebc825
Binary files /dev/null and b/ricoClient/images/close_w.gif differ
diff --git a/ricoClient/images/delete.gif b/ricoClient/images/delete.gif
new file mode 100644 (file)
index 0000000..d5c6057
Binary files /dev/null and b/ricoClient/images/delete.gif differ
diff --git a/ricoClient/images/delete_w.gif b/ricoClient/images/delete_w.gif
new file mode 100644 (file)
index 0000000..86acb65
Binary files /dev/null and b/ricoClient/images/delete_w.gif differ
diff --git a/ricoClient/images/divider.gif b/ricoClient/images/divider.gif
new file mode 100644 (file)
index 0000000..d9863d4
Binary files /dev/null and b/ricoClient/images/divider.gif differ
diff --git a/ricoClient/images/doc.gif b/ricoClient/images/doc.gif
new file mode 100644 (file)
index 0000000..2ff706c
Binary files /dev/null and b/ricoClient/images/doc.gif differ
diff --git a/ricoClient/images/dotbutton.gif b/ricoClient/images/dotbutton.gif
new file mode 100644 (file)
index 0000000..20c85cc
Binary files /dev/null and b/ricoClient/images/dotbutton.gif differ
diff --git a/ricoClient/images/drop.gif b/ricoClient/images/drop.gif
new file mode 100644 (file)
index 0000000..afce892
Binary files /dev/null and b/ricoClient/images/drop.gif differ
diff --git a/ricoClient/images/filtercol.gif b/ricoClient/images/filtercol.gif
new file mode 100644 (file)
index 0000000..2e93828
Binary files /dev/null and b/ricoClient/images/filtercol.gif differ
diff --git a/ricoClient/images/folderclosed.gif b/ricoClient/images/folderclosed.gif
new file mode 100644 (file)
index 0000000..73594c3
Binary files /dev/null and b/ricoClient/images/folderclosed.gif differ
diff --git a/ricoClient/images/folderopen.gif b/ricoClient/images/folderopen.gif
new file mode 100644 (file)
index 0000000..f44db49
Binary files /dev/null and b/ricoClient/images/folderopen.gif differ
diff --git a/ricoClient/images/grayedout.gif b/ricoClient/images/grayedout.gif
new file mode 100644 (file)
index 0000000..ead27af
Binary files /dev/null and b/ricoClient/images/grayedout.gif differ
diff --git a/ricoClient/images/info_icon.gif b/ricoClient/images/info_icon.gif
new file mode 100644 (file)
index 0000000..f0d2107
Binary files /dev/null and b/ricoClient/images/info_icon.gif differ
diff --git a/ricoClient/images/left_b.gif b/ricoClient/images/left_b.gif
new file mode 100644 (file)
index 0000000..f652075
Binary files /dev/null and b/ricoClient/images/left_b.gif differ
diff --git a/ricoClient/images/left_w.gif b/ricoClient/images/left_w.gif
new file mode 100644 (file)
index 0000000..ed221f7
Binary files /dev/null and b/ricoClient/images/left_w.gif differ
diff --git a/ricoClient/images/link.gif b/ricoClient/images/link.gif
new file mode 100644 (file)
index 0000000..35b0fe7
Binary files /dev/null and b/ricoClient/images/link.gif differ
diff --git a/ricoClient/images/m.gif b/ricoClient/images/m.gif
new file mode 100644 (file)
index 0000000..4baccbb
Binary files /dev/null and b/ricoClient/images/m.gif differ
diff --git a/ricoClient/images/node.gif b/ricoClient/images/node.gif
new file mode 100644 (file)
index 0000000..f90699e
Binary files /dev/null and b/ricoClient/images/node.gif differ
diff --git a/ricoClient/images/nodeblank.gif b/ricoClient/images/nodeblank.gif
new file mode 100644 (file)
index 0000000..fc9cead
Binary files /dev/null and b/ricoClient/images/nodeblank.gif differ
diff --git a/ricoClient/images/nodelast.gif b/ricoClient/images/nodelast.gif
new file mode 100644 (file)
index 0000000..49f794b
Binary files /dev/null and b/ricoClient/images/nodelast.gif differ
diff --git a/ricoClient/images/nodeline.gif b/ricoClient/images/nodeline.gif
new file mode 100644 (file)
index 0000000..8e62441
Binary files /dev/null and b/ricoClient/images/nodeline.gif differ
diff --git a/ricoClient/images/nodem.gif b/ricoClient/images/nodem.gif
new file mode 100644 (file)
index 0000000..fcc2d37
Binary files /dev/null and b/ricoClient/images/nodem.gif differ
diff --git a/ricoClient/images/nodemlast.gif b/ricoClient/images/nodemlast.gif
new file mode 100644 (file)
index 0000000..11ae43a
Binary files /dev/null and b/ricoClient/images/nodemlast.gif differ
diff --git a/ricoClient/images/nodep.gif b/ricoClient/images/nodep.gif
new file mode 100644 (file)
index 0000000..5b68013
Binary files /dev/null and b/ricoClient/images/nodep.gif differ
diff --git a/ricoClient/images/nodeplast.gif b/ricoClient/images/nodeplast.gif
new file mode 100644 (file)
index 0000000..b87f003
Binary files /dev/null and b/ricoClient/images/nodeplast.gif differ
diff --git a/ricoClient/images/p.gif b/ricoClient/images/p.gif
new file mode 100644 (file)
index 0000000..3b49d67
Binary files /dev/null and b/ricoClient/images/p.gif differ
diff --git a/ricoClient/images/removeFilter.gif b/ricoClient/images/removeFilter.gif
new file mode 100644 (file)
index 0000000..c46c54a
Binary files /dev/null and b/ricoClient/images/removeFilter.gif differ
diff --git a/ricoClient/images/resize.gif b/ricoClient/images/resize.gif
new file mode 100644 (file)
index 0000000..8efd1b5
Binary files /dev/null and b/ricoClient/images/resize.gif differ
diff --git a/ricoClient/images/right_b.gif b/ricoClient/images/right_b.gif
new file mode 100644 (file)
index 0000000..5517f2b
Binary files /dev/null and b/ricoClient/images/right_b.gif differ
diff --git a/ricoClient/images/right_w.gif b/ricoClient/images/right_w.gif
new file mode 100644 (file)
index 0000000..cb7b214
Binary files /dev/null and b/ricoClient/images/right_w.gif differ
diff --git a/ricoClient/images/shadow_l.png b/ricoClient/images/shadow_l.png
new file mode 100644 (file)
index 0000000..e113dfd
Binary files /dev/null and b/ricoClient/images/shadow_l.png differ
diff --git a/ricoClient/images/shadow_ll.png b/ricoClient/images/shadow_ll.png
new file mode 100644 (file)
index 0000000..cc0665b
Binary files /dev/null and b/ricoClient/images/shadow_ll.png differ
diff --git a/ricoClient/images/shadow_lr.png b/ricoClient/images/shadow_lr.png
new file mode 100644 (file)
index 0000000..27e3b4b
Binary files /dev/null and b/ricoClient/images/shadow_lr.png differ
diff --git a/ricoClient/images/shadow_r.png b/ricoClient/images/shadow_r.png
new file mode 100644 (file)
index 0000000..77f877d
Binary files /dev/null and b/ricoClient/images/shadow_r.png differ
diff --git a/ricoClient/images/sort_asc.gif b/ricoClient/images/sort_asc.gif
new file mode 100644 (file)
index 0000000..6330232
Binary files /dev/null and b/ricoClient/images/sort_asc.gif differ
diff --git a/ricoClient/images/sort_desc.gif b/ricoClient/images/sort_desc.gif
new file mode 100644 (file)
index 0000000..b3a681c
Binary files /dev/null and b/ricoClient/images/sort_desc.gif differ
diff --git a/ricoClient/images/tableFilterCollapse.gif b/ricoClient/images/tableFilterCollapse.gif
new file mode 100644 (file)
index 0000000..3209312
Binary files /dev/null and b/ricoClient/images/tableFilterCollapse.gif differ
diff --git a/ricoClient/images/tableFilterExpand.gif b/ricoClient/images/tableFilterExpand.gif
new file mode 100644 (file)
index 0000000..84ae691
Binary files /dev/null and b/ricoClient/images/tableFilterExpand.gif differ
diff --git a/ricoClient/js/baselibs/dojo.debug.js b/ricoClient/js/baselibs/dojo.debug.js
new file mode 100644 (file)
index 0000000..7e0ae91
--- /dev/null
@@ -0,0 +1,11239 @@
+/*
+       Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
+       Available via Academic Free License >= 2.1 OR the modified BSD license.
+       see: http://dojotoolkit.org/license for details
+*/
+
+/*
+       This is a compiled version of Dojo, built for deployment and not for
+       development. To get an editable version, please visit:
+
+               http://dojotoolkit.org
+
+       for documentation and information on getting the source.
+*/
+
+;(function(){
+
+       /*
+       dojo, dijit, and dojox must always be the first three, and in that order.
+       djConfig.scopeMap = [
+               ["dojo", "fojo"],
+               ["dijit", "fijit"],
+               ["dojox", "fojox"]
+       
+       ]
+       */
+
+       /**Build will replace this comment with a scoped djConfig **/
+
+       //The null below can be relaced by a build-time value used instead of djConfig.scopeMap.
+       var sMap = null;
+
+       //See if new scopes need to be defined.
+       if((sMap || (typeof djConfig != "undefined" && djConfig.scopeMap)) && (typeof window != "undefined")){
+               var scopeDef = "", scopePrefix = "", scopeSuffix = "", scopeMap = {}, scopeMapRev = {};
+               sMap = sMap || djConfig.scopeMap;
+               for(var i = 0; i < sMap.length; i++){
+                       //Make local variables, then global variables that use the locals.
+                       var newScope = sMap[i];
+                       scopeDef += "var " + newScope[0] + " = {}; " + newScope[1] + " = " + newScope[0] + ";" + newScope[1] + "._scopeName = '" + newScope[1] + "';";
+                       scopePrefix += (i == 0 ? "" : ",") + newScope[0];
+                       scopeSuffix += (i == 0 ? "" : ",") + newScope[1];
+                       scopeMap[newScope[0]] = newScope[1];
+                       scopeMapRev[newScope[1]] = newScope[0];
+               }
+
+               eval(scopeDef + "dojo._scopeArgs = [" + scopeSuffix + "];");
+
+               dojo._scopePrefixArgs = scopePrefix;
+               dojo._scopePrefix = "(function(" + scopePrefix + "){";
+               dojo._scopeSuffix = "})(" + scopeSuffix + ")";
+               dojo._scopeMap = scopeMap;
+               dojo._scopeMapRev = scopeMapRev;
+       }
+
+/*=====
+// note:
+//             'djConfig' does not exist under 'dojo.*' so that it can be set before the
+//             'dojo' variable exists.
+// note:
+//             Setting any of these variables *after* the library has loaded does
+//             nothing at all.
+
+djConfig = {
+       // summary:
+       //              Application code can set the global 'djConfig' prior to loading
+       //              the library to override certain global settings for how dojo works.
+       //
+       // isDebug: Boolean
+       //              Defaults to `false`. If set to `true`, ensures that Dojo provides
+       //              extended debugging feedback via Firebug. If Firebug is not available
+       //              on your platform, setting `isDebug` to `true` will force Dojo to
+       //              pull in (and display) the version of Firebug Lite which is
+       //              integrated into the Dojo distribution, thereby always providing a
+       //              debugging/logging console when `isDebug` is enabled. Note that
+       //              Firebug's `console.*` methods are ALWAYS defined by Dojo. If
+       //              `isDebug` is false and you are on a platform without Firebug, these
+       //              methods will be defined as no-ops.
+       isDebug: false,
+       // debugAtAllCosts: Boolean
+       //              Defaults to `false`. If set to `true`, this triggers an alternate
+       //              mode of the package system in which dependencies are detected and
+       //              only then are resources evaluated in dependency order via
+       //              `<script>` tag inclusion. This may double-request resources and
+       //              cause problems with scripts which expect `dojo.require()` to
+       //              preform synchronously. `debugAtAllCosts` can be an invaluable
+       //              debugging aid, but when using it, ensure that all code which
+       //              depends on Dojo modules is wrapped in `dojo.addOnLoad()` handlers.
+       //              Due to the somewhat unpredictable side-effects of using
+       //              `debugAtAllCosts`, it is strongly recommended that you enable this
+       //              flag as a last resort. `debugAtAllCosts` has no effect when loading
+       //              resources across domains. For usage information, see the
+       //              [Dojo Book](http://dojotoolkit.org/book/book-dojo/part-4-meta-dojo-making-your-dojo-code-run-faster-and-better/debugging-facilities/deb)
+       debugAtAllCosts: false,
+       // locale: String
+       //              The locale to assume for loading localized resources in this page,
+       //              specified according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
+       //              Must be specified entirely in lowercase, e.g. `en-us` and `zh-cn`.
+       //              See the documentation for `dojo.i18n` and `dojo.requireLocalization`
+       //              for details on loading localized resources. If no locale is specified,
+       //              Dojo assumes the locale of the user agent, according to `navigator.userLanguage`
+       //              or `navigator.language` properties.
+       locale: undefined,
+       // extraLocale: Array
+       //              No default value. Specifies additional locales whose
+       //              resources should also be loaded alongside the default locale when
+       //              calls to `dojo.requireLocalization()` are processed.
+       extraLocale: undefined,
+       // baseUrl: String
+       //              The directory in which `dojo.js` is located. Under normal
+       //              conditions, Dojo auto-detects the correct location from which it
+       //              was loaded. You may need to manually configure `baseUrl` in cases
+       //              where you have renamed `dojo.js` or in which `<base>` tags confuse
+       //              some browsers (e.g. IE 6). The variable `dojo.baseUrl` is assigned
+       //              either the value of `djConfig.baseUrl` if one is provided or the
+       //              auto-detected root if not. Other modules are located relative to
+       //              this path. The path should end in a slash.
+       baseUrl: undefined,
+       // modulePaths: Object
+       //              A map of module names to paths relative to `dojo.baseUrl`. The
+       //              key/value pairs correspond directly to the arguments which
+       //              `dojo.registerModulePath` accepts. Specifiying
+       //              `djConfig.modulePaths = { "foo": "../../bar" }` is the equivalent
+       //              of calling `dojo.registerModulePath("foo", "../../bar");`. Multiple
+       //              modules may be configured via `djConfig.modulePaths`.
+       modulePaths: {},
+       // afterOnLoad: Boolean 
+       //              Indicates Dojo was added to the page after the page load. In this case
+       //              Dojo will not wait for the page DOMContentLoad/load events and fire
+       //              its dojo.addOnLoad callbacks after making sure all outstanding
+       //              dojo.required modules have loaded. Only works with a built dojo.js,
+       //              it does not work the dojo.js directly from source control.
+       afterOnLoad: false,
+       // addOnLoad: Function or Array
+       //              Adds a callback via dojo.addOnLoad. Useful when Dojo is added after
+       //              the page loads and djConfig.afterOnLoad is true. Supports the same
+       //              arguments as dojo.addOnLoad. When using a function reference, use
+       //              `djConfig.addOnLoad = function(){};`. For object with function name use
+       //              `djConfig.addOnLoad = [myObject, "functionName"];` and for object with
+       //              function reference use
+       //              `djConfig.addOnLoad = [myObject, function(){}];`
+       addOnLoad: null,
+       // require: Array
+       //              An array of module names to be loaded immediately after dojo.js has been included
+       //              in a page.
+       require: [],
+       // defaultDuration: Array
+       //              Default duration, in milliseconds, for wipe and fade animations within dijits.
+       //              Assigned to dijit.defaultDuration.
+       defaultDuration: 200,
+       // dojoBlankHtmlUrl: String
+       //              Used by some modules to configure an empty iframe. Used by dojo.io.iframe and
+       //              dojo.back, and dijit popup support in IE where an iframe is needed to make sure native
+       //              controls do not bleed through the popups. Normally this configuration variable 
+       //              does not need to be set, except when using cross-domain/CDN Dojo builds.
+       //              Save dojo/resources/blank.html to your domain and set `djConfig.dojoBlankHtmlUrl`
+       //              to the path on your domain your copy of blank.html.
+       dojoBlankHtmlUrl: undefined,
+       //      ioPublish: Boolean?
+       //              Set this to true to enable publishing of topics for the different phases of
+       //              IO operations. Publishing is done via dojo.publish. See dojo.__IoPublish for a list
+       //              of topics that are published.
+       ioPublish: false,
+       //  useCustomLogger: Anything?
+       //              If set to a value that evaluates to true such as a string or array and
+       //              isDebug is true and Firebug is not available or running, then it bypasses
+       //              the creation of Firebug Lite allowing you to define your own console object.
+       useCustomLogger: undefined,
+       // transparentColor: Array
+       //              Array containing the r, g, b components used as transparent color in dojo.Color;
+       //              if undefined, [255,255,255] (white) will be used.
+       transparentColor: undefined,
+       // skipIeDomLoaded: Boolean
+       //              For IE only, skip the DOMContentLoaded hack used. Sometimes it can cause an Operation
+       //              Aborted error if the rest of the page triggers script defers before the DOM is ready.
+       //              If this is config value is set to true, then dojo.addOnLoad callbacks will not be
+       //              triggered until the page load event, which is after images and iframes load. If you
+       //              want to trigger the callbacks sooner, you can put a script block in the bottom of
+       //              your HTML that calls dojo._loadInit();. If you are using multiversion support, change
+       //              "dojo." to the appropriate scope name for dojo.
+       skipIeDomLoaded: false
+}
+=====*/
+
+(function(){
+       // firebug stubs
+
+       if(typeof this["loadFirebugConsole"] == "function"){
+               // for Firebug 1.2
+               this["loadFirebugConsole"]();
+       }else{
+               this.console = this.console || {};
+
+               //      Be careful to leave 'log' always at the end
+               var cn = [
+                       "assert", "count", "debug", "dir", "dirxml", "error", "group",
+                       "groupEnd", "info", "profile", "profileEnd", "time", "timeEnd",
+                       "trace", "warn", "log"
+               ];
+               var i=0, tn;
+               while((tn=cn[i++])){
+                       if(!console[tn]){
+                               (function(){
+                                       var tcn = tn+"";
+                                       console[tcn] = ('log' in console) ? function(){
+                                               var a = Array.apply({}, arguments);
+                                               a.unshift(tcn+":");
+                                               console["log"](a.join(" "));
+                                       } : function(){}
+                                       console[tcn]._fake = true;
+                               })();
+                       }
+               }
+       }
+
+       //TODOC:  HOW TO DOC THIS?
+       // dojo is the root variable of (almost all) our public symbols -- make sure it is defined.
+       if(typeof dojo == "undefined"){
+               dojo = {
+                       _scopeName: "dojo",
+                       _scopePrefix: "",
+                       _scopePrefixArgs: "",
+                       _scopeSuffix: "",
+                       _scopeMap: {},
+                       _scopeMapRev: {}
+               };
+       }
+
+       var d = dojo;
+
+       //Need placeholders for dijit and dojox for scoping code.
+       if(typeof dijit == "undefined"){
+               dijit = {_scopeName: "dijit"};
+       }
+       if(typeof dojox == "undefined"){
+               dojox = {_scopeName: "dojox"};
+       }
+
+       if(!d._scopeArgs){
+               d._scopeArgs = [dojo, dijit, dojox];
+       }
+
+/*=====
+dojo.global = {
+       //      summary:
+       //              Alias for the global scope
+       //              (e.g. the window object in a browser).
+       //      description:
+       //              Refer to 'dojo.global' rather than referring to window to ensure your
+       //              code runs correctly in contexts other than web browsers (e.g. Rhino on a server).
+}
+=====*/
+       d.global = this;
+
+       d.config =/*===== djConfig = =====*/{
+               isDebug: false,
+               debugAtAllCosts: false
+       };
+
+       if(typeof djConfig != "undefined"){
+               for(var opt in djConfig){
+                       d.config[opt] = djConfig[opt];
+               }
+       }
+
+/*=====
+       // Override locale setting, if specified
+       dojo.locale = {
+               // summary: the locale as defined by Dojo (read-only)
+       };
+=====*/
+       dojo.locale = d.config.locale;
+
+       var rev = "$Rev: 20973 $".match(/\d+/);
+
+/*=====
+       dojo.version = function(){
+               // summary:
+               //              Version number of the Dojo Toolkit
+               // major: Integer
+               //              Major version. If total version is "1.2.0beta1", will be 1
+               // minor: Integer
+               //              Minor version. If total version is "1.2.0beta1", will be 2
+               // patch: Integer
+               //              Patch version. If total version is "1.2.0beta1", will be 0
+               // flag: String
+               //              Descriptor flag. If total version is "1.2.0beta1", will be "beta1"
+               // revision: Number
+               //              The SVN rev from which dojo was pulled
+               this.major = 0;
+               this.minor = 0;
+               this.patch = 0;
+               this.flag = "";
+               this.revision = 0;
+       }
+=====*/
+       dojo.version = {
+               major: 1, minor: 4, patch: 0, flag: "",
+               revision: rev ? +rev[0] : NaN,
+               toString: function(){
+                       with(d.version){
+                               return major + "." + minor + "." + patch + flag + " (" + revision + ")";        // String
+                       }
+               }
+       }
+
+               // Register with the OpenAjax hub
+       if(typeof OpenAjax != "undefined"){
+               OpenAjax.hub.registerLibrary(dojo._scopeName, "http://dojotoolkit.org", d.version.toString());
+       }
+       
+       var extraNames, extraLen, empty = {};
+       for(var i in {toString: 1}){ extraNames = []; break; }
+       dojo._extraNames = extraNames = extraNames || ["hasOwnProperty", "valueOf", "isPrototypeOf",
+               "propertyIsEnumerable", "toLocaleString", "toString", "constructor"];
+       extraLen = extraNames.length;
+
+       dojo._mixin = function(/*Object*/ target, /*Object*/ source){
+               // summary:
+               //              Adds all properties and methods of source to target. This addition
+               //              is "prototype extension safe", so that instances of objects
+               //              will not pass along prototype defaults.
+               var name, s, i;
+               for(name in source){
+                       // the "tobj" condition avoid copying properties in "source"
+                       // inherited from Object.prototype.  For example, if target has a custom
+                       // toString() method, don't overwrite it with the toString() method
+                       // that source inherited from Object.prototype
+                       s = source[name];
+                       if(!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))){
+                               target[name] = s;
+                       }
+               }
+                               // IE doesn't recognize some custom functions in for..in
+               if(extraLen && source){
+                       for(i = 0; i < extraLen; ++i){
+                               name = extraNames[i];
+                               s = source[name];
+                               if(!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))){
+                                       target[name] = s;
+                               }
+                       }
+               }
+                               return target; // Object
+       }
+
+       dojo.mixin = function(/*Object*/obj, /*Object...*/props){
+               // summary:
+               //              Adds all properties and methods of props to obj and returns the
+               //              (now modified) obj.
+               //      description:
+               //              `dojo.mixin` can mix multiple source objects into a
+               //              destination object which is then returned. Unlike regular
+               //              `for...in` iteration, `dojo.mixin` is also smart about avoiding
+               //              extensions which other toolkits may unwisely add to the root
+               //              object prototype
+               //      obj:
+               //              The object to mix properties into. Also the return value.
+               //      props:
+               //              One or more objects whose values are successively copied into
+               //              obj. If more than one of these objects contain the same value,
+               //              the one specified last in the function call will "win".
+               //      example:
+               //              make a shallow copy of an object
+               //      |       var copy = dojo.mixin({}, source);
+               //      example:
+               //              many class constructors often take an object which specifies
+               //              values to be configured on the object. In this case, it is
+               //              often simplest to call `dojo.mixin` on the `this` object:
+               //      |       dojo.declare("acme.Base", null, {
+               //      |               constructor: function(properties){
+               //      |                       // property configuration:
+               //      |                       dojo.mixin(this, properties);
+               //      |       
+               //      |                       console.log(this.quip);
+               //      |                       //  ...
+               //      |               },
+               //      |               quip: "I wasn't born yesterday, you know - I've seen movies.",
+               //      |               // ...
+               //      |       });
+               //      |
+               //      |       // create an instance of the class and configure it
+               //      |       var b = new acme.Base({quip: "That's what it does!" });
+               //      example:
+               //              copy in properties from multiple objects
+               //      |       var flattened = dojo.mixin(
+               //      |               {
+               //      |                       name: "Frylock",
+               //      |                       braces: true
+               //      |               },
+               //      |               {
+               //      |                       name: "Carl Brutanananadilewski"
+               //      |               }
+               //      |       );
+               //      |       
+               //      |       // will print "Carl Brutanananadilewski"
+               //      |       console.log(flattened.name);
+               //      |       // will print "true"
+               //      |       console.log(flattened.braces);
+               if(!obj){ obj = {}; }
+               for(var i=1, l=arguments.length; i<l; i++){
+                       d._mixin(obj, arguments[i]);
+               }
+               return obj; // Object
+       }
+
+       dojo._getProp = function(/*Array*/parts, /*Boolean*/create, /*Object*/context){
+               var obj=context || d.global;
+               for(var i=0, p; obj && (p=parts[i]); i++){
+                       if(i == 0 && d._scopeMap[p]){
+                               p = d._scopeMap[p];
+                       }
+                       obj = (p in obj ? obj[p] : (create ? obj[p]={} : undefined));
+               }
+               return obj; // mixed
+       }
+
+       dojo.setObject = function(/*String*/name, /*Object*/value, /*Object?*/context){
+               // summary:
+               //              Set a property from a dot-separated string, such as "A.B.C"
+               //      description:
+               //              Useful for longer api chains where you have to test each object in
+               //              the chain, or when you have an object reference in string format.
+               //              Objects are created as needed along `path`. Returns the passed
+               //              value if setting is successful or `undefined` if not.
+               //      name:
+               //              Path to a property, in the form "A.B.C".
+               //      context:
+               //              Optional. Object to use as root of path. Defaults to
+               //              `dojo.global`.
+               //      example:
+               //              set the value of `foo.bar.baz`, regardless of whether
+               //              intermediate objects already exist:
+               //      |       dojo.setObject("foo.bar.baz", value);
+               //      example:
+               //              without `dojo.setObject`, we often see code like this:
+               //      |       // ensure that intermediate objects are available
+               //      |       if(!obj["parent"]){ obj.parent = {}; }
+               //      |       if(!obj.parent["child"]){ obj.parent.child= {}; }
+               //      |       // now we can safely set the property
+               //      |       obj.parent.child.prop = "some value";
+               //              wheras with `dojo.setObject`, we can shorten that to:
+               //      |       dojo.setObject("parent.child.prop", "some value", obj);
+               var parts=name.split("."), p=parts.pop(), obj=d._getProp(parts, true, context);
+               return obj && p ? (obj[p]=value) : undefined; // Object
+       }
+
+       dojo.getObject = function(/*String*/name, /*Boolean?*/create, /*Object?*/context){
+               // summary:
+               //              Get a property from a dot-separated string, such as "A.B.C"
+               //      description:
+               //              Useful for longer api chains where you have to test each object in
+               //              the chain, or when you have an object reference in string format.
+               //      name:
+               //              Path to an property, in the form "A.B.C".
+               //      create:
+               //              Optional. Defaults to `false`. If `true`, Objects will be
+               //              created at any point along the 'path' that is undefined.
+               //      context:
+               //              Optional. Object to use as root of path. Defaults to
+               //              'dojo.global'. Null may be passed.
+               return d._getProp(name.split("."), create, context); // Object
+       }
+
+       dojo.exists = function(/*String*/name, /*Object?*/obj){
+               //      summary:
+               //              determine if an object supports a given method
+               //      description:
+               //              useful for longer api chains where you have to test each object in
+               //              the chain. Useful only for object and method detection.
+               //              Not useful for testing generic properties on an object.
+               //              In particular, dojo.exists("foo.bar") when foo.bar = ""
+               //              will return false. Use ("bar" in foo) to test for those cases.
+               //      name:
+               //              Path to an object, in the form "A.B.C".
+               //      obj:
+               //              Object to use as root of path. Defaults to
+               //              'dojo.global'. Null may be passed.
+               //      example:
+               //      |       // define an object
+               //      |       var foo = {
+               //      |               bar: { }
+               //      |       };
+               //      |
+               //      |       // search the global scope
+               //      |       dojo.exists("foo.bar"); // true
+               //      |       dojo.exists("foo.bar.baz"); // false
+               //      |
+               //      |       // search from a particular scope
+               //      |       dojo.exists("bar", foo); // true
+               //      |       dojo.exists("bar.baz", foo); // false
+               return !!d.getObject(name, false, obj); // Boolean
+       }
+
+
+       dojo["eval"] = function(/*String*/ scriptFragment){
+               //      summary:
+               //              Perform an evaluation in the global scope. Use this rather than
+               //              calling 'eval()' directly.
+               //      description:
+               //              Placed in a separate function to minimize size of trapped
+               //              exceptions. Calling eval() directly from some other scope may
+               //              complicate tracebacks on some platforms.
+               //      returns:
+               //              The result of the evaluation. Often `undefined`
+
+
+               // note:
+               //       - JSC eval() takes an optional second argument which can be 'unsafe'.
+               //       - Mozilla/SpiderMonkey eval() takes an optional second argument which is the
+               //       scope object for new symbols.
+
+               // FIXME: investigate Joseph Smarr's technique for IE:
+               //              http://josephsmarr.com/2007/01/31/fixing-eval-to-use-global-scope-in-ie/
+               //      see also:
+               //              http://trac.dojotoolkit.org/ticket/744
+               return d.global.eval ? d.global.eval(scriptFragment) : eval(scriptFragment);    // Object
+       }
+
+       /*=====
+               dojo.deprecated = function(behaviour, extra, removal){
+                       //      summary:
+                       //              Log a debug message to indicate that a behavior has been
+                       //              deprecated.
+                       //      behaviour: String
+                       //              The API or behavior being deprecated. Usually in the form
+                       //              of "myApp.someFunction()".
+                       //      extra: String?
+                       //              Text to append to the message. Often provides advice on a
+                       //              new function or facility to achieve the same goal during
+                       //              the deprecation period.
+                       //      removal: String?
+                       //              Text to indicate when in the future the behavior will be
+                       //              removed. Usually a version number.
+                       //      example:
+                       //      |       dojo.deprecated("myApp.getTemp()", "use myApp.getLocaleTemp() instead", "1.0");
+               }
+
+               dojo.experimental = function(moduleName, extra){
+                       //      summary: Marks code as experimental.
+                       //      description:
+                       //              This can be used to mark a function, file, or module as
+                       //              experimental.  Experimental code is not ready to be used, and the
+                       //              APIs are subject to change without notice.  Experimental code may be
+                       //              completed deleted without going through the normal deprecation
+                       //              process.
+                       //      moduleName: String
+                       //              The name of a module, or the name of a module file or a specific
+                       //              function
+                       //      extra: String?
+                       //              some additional message for the user
+                       //      example:
+                       //      |       dojo.experimental("dojo.data.Result");
+                       //      example:
+                       //      |       dojo.experimental("dojo.weather.toKelvin()", "PENDING approval from NOAA");
+               }
+       =====*/
+
+       //Real functions declared in dojo._firebug.firebug.
+       d.deprecated = d.experimental = function(){};
+
+})();
+// vim:ai:ts=4:noet
+
+/*
+ * loader.js - A bootstrap module.  Runs before the hostenv_*.js file. Contains
+ * all of the package loading methods.
+ */
+
+(function(){
+       var d = dojo;
+
+       d.mixin(d, {
+               _loadedModules: {},
+               _inFlightCount: 0,
+               _hasResource: {},
+
+               _modulePrefixes: {
+                       dojo:   {       name: "dojo", value: "." },
+                       // dojox:       {       name: "dojox", value: "../dojox" },
+                       // dijit:       {       name: "dijit", value: "../dijit" },
+                       doh:    {       name: "doh", value: "../util/doh" },
+                       tests:  {       name: "tests", value: "tests" }
+               },
+
+               _moduleHasPrefix: function(/*String*/module){
+                       // summary: checks to see if module has been established
+                       var mp = d._modulePrefixes;
+                       return !!(mp[module] && mp[module].value); // Boolean
+               },
+
+               _getModulePrefix: function(/*String*/module){
+                       // summary: gets the prefix associated with module
+                       var mp = d._modulePrefixes;
+                       if(d._moduleHasPrefix(module)){
+                               return mp[module].value; // String
+                       }
+                       return module; // String
+               },
+
+               _loadedUrls: [],
+
+               //WARNING: 
+               //              This variable is referenced by packages outside of bootstrap:
+               //              FloatingPane.js and undo/browser.js
+               _postLoad: false,
+               
+               //Egad! Lots of test files push on this directly instead of using dojo.addOnLoad.
+               _loaders: [],
+               _unloaders: [],
+               _loadNotifying: false
+       });
+
+
+               dojo._loadPath = function(/*String*/relpath, /*String?*/module, /*Function?*/cb){
+               //      summary:
+               //              Load a Javascript module given a relative path
+               //
+               //      description:
+               //              Loads and interprets the script located at relpath, which is
+               //              relative to the script root directory.  If the script is found but
+               //              its interpretation causes a runtime exception, that exception is
+               //              not caught by us, so the caller will see it.  We return a true
+               //              value if and only if the script is found.
+               //
+               // relpath: 
+               //              A relative path to a script (no leading '/', and typically ending
+               //              in '.js').
+               // module: 
+               //              A module whose existance to check for after loading a path.  Can be
+               //              used to determine success or failure of the load.
+               // cb: 
+               //              a callback function to pass the result of evaluating the script
+
+               var uri = ((relpath.charAt(0) == '/' || relpath.match(/^\w+:/)) ? "" : d.baseUrl) + relpath;
+               try{
+                       return !module ? d._loadUri(uri, cb) : d._loadUriAndCheck(uri, module, cb); // Boolean
+               }catch(e){
+                       console.error(e);
+                       return false; // Boolean
+               }
+       }
+
+       dojo._loadUri = function(/*String*/uri, /*Function?*/cb){
+               //      summary:
+               //              Loads JavaScript from a URI
+               //      description:
+               //              Reads the contents of the URI, and evaluates the contents.  This is
+               //              used to load modules as well as resource bundles. Returns true if
+               //              it succeeded. Returns false if the URI reading failed.  Throws if
+               //              the evaluation throws.
+               //      uri: a uri which points at the script to be loaded
+               //      cb: 
+               //              a callback function to process the result of evaluating the script
+               //              as an expression, typically used by the resource bundle loader to
+               //              load JSON-style resources
+
+               if(d._loadedUrls[uri]){
+                       return true; // Boolean
+               }
+               d._inFlightCount++; // block addOnLoad calls that arrive while we're busy downloading
+               var contents = d._getText(uri, true);
+               if(contents){ // not 404, et al
+                       d._loadedUrls[uri] = true;
+                       d._loadedUrls.push(uri);
+                       if(cb){
+                               contents = '('+contents+')';
+                       }else{
+                               //Only do the scoping if no callback. If a callback is specified,
+                               //it is most likely the i18n bundle stuff.
+                               contents = d._scopePrefix + contents + d._scopeSuffix;
+                       }
+                       if(!d.isIE){ contents += "\r\n//@ sourceURL=" + uri; } // debugging assist for Firebug
+                       var value = d["eval"](contents);
+                       if(cb){ cb(value); }
+               }
+               // Check to see if we need to call _callLoaded() due to an addOnLoad() that arrived while we were busy downloading
+               if(--d._inFlightCount == 0 && d._postLoad && d._loaders.length){
+                       // We shouldn't be allowed to get here but Firefox allows an event 
+                       // (mouse, keybd, async xhrGet) to interrupt a synchronous xhrGet. 
+                       // If the current script block contains multiple require() statements, then after each
+                       // require() returns, inFlightCount == 0, but we want to hold the _callLoaded() until
+                       // all require()s are done since the out-of-sequence addOnLoad() presumably needs them all.
+                       // setTimeout allows the next require() to start (if needed), and then we check this again.
+                       setTimeout(function(){ 
+                               // If inFlightCount > 0, then multiple require()s are running sequentially and 
+                               // the next require() started after setTimeout() was executed but before we got here.
+                               if(d._inFlightCount == 0){ 
+                                       d._callLoaded();
+                               }
+                       }, 0);
+               }
+               return !!contents; // Boolean: contents? true : false
+       }
+       
+       // FIXME: probably need to add logging to this method
+       dojo._loadUriAndCheck = function(/*String*/uri, /*String*/moduleName, /*Function?*/cb){
+               // summary: calls loadUri then findModule and returns true if both succeed
+               var ok = false;
+               try{
+                       ok = d._loadUri(uri, cb);
+               }catch(e){
+                       console.error("failed loading " + uri + " with error: " + e);
+               }
+               return !!(ok && d._loadedModules[moduleName]); // Boolean
+       }
+
+       dojo.loaded = function(){
+               // summary:
+               //              signal fired when initial environment and package loading is
+               //              complete. You should use dojo.addOnLoad() instead of doing a 
+               //              direct dojo.connect() to this method in order to handle
+               //              initialization tasks that require the environment to be
+               //              initialized. In a browser host, declarative widgets will 
+               //              be constructed when this function finishes runing.
+               d._loadNotifying = true;
+               d._postLoad = true;
+               var mll = d._loaders;
+
+               //Clear listeners so new ones can be added
+               //For other xdomain package loads after the initial load.
+               d._loaders = [];
+
+               for(var x = 0; x < mll.length; x++){
+                       mll[x]();
+               }
+
+               d._loadNotifying = false;
+               
+               //Make sure nothing else got added to the onload queue
+               //after this first run. If something did, and we are not waiting for any
+               //more inflight resources, run again.
+               if(d._postLoad && d._inFlightCount == 0 && mll.length){
+                       d._callLoaded();
+               }
+       }
+
+       dojo.unloaded = function(){
+               // summary:
+               //              signal fired by impending environment destruction. You should use
+               //              dojo.addOnUnload() instead of doing a direct dojo.connect() to this 
+               //              method to perform page/application cleanup methods. See 
+               //              dojo.addOnUnload for more info.
+               var mll = d._unloaders;
+               while(mll.length){
+                       (mll.pop())();
+               }
+       }
+
+       d._onto = function(arr, obj, fn){
+               if(!fn){
+                       arr.push(obj);
+               }else if(fn){
+                       var func = (typeof fn == "string") ? obj[fn] : fn;
+                       arr.push(function(){ func.call(obj); });
+               }
+       }
+
+       dojo.ready = dojo.addOnLoad = function(/*Object*/obj, /*String|Function?*/functionName){
+               // summary:
+               //              Registers a function to be triggered after the DOM and dojo.require() calls 
+               //              have finished loading.
+               //
+               // description:
+               //              Registers a function to be triggered after the DOM has finished
+               //              loading and `dojo.require` modules have loaded. Widgets declared in markup 
+               //              have been instantiated if `djConfig.parseOnLoad` is true when this fires. 
+               //
+               //              Images and CSS files may or may not have finished downloading when
+               //              the specified function is called.  (Note that widgets' CSS and HTML
+               //              code is guaranteed to be downloaded before said widgets are
+               //              instantiated, though including css resouces BEFORE any script elements
+               //              is highly recommended).
+               //
+               // example:
+               //      Register an anonymous function to run when everything is ready
+               //      |       dojo.addOnLoad(function(){ doStuff(); });
+               //
+               // example:
+               //      Register a function to run when everything is ready by pointer:
+               //      |       var init = function(){ doStuff(); }
+               //      |       dojo.addOnLoad(init);
+               //
+               // example:
+               //      Register a function to run scoped to `object`, either by name or anonymously:
+               //      |       dojo.addOnLoad(object, "functionName");
+               //      |       dojo.addOnLoad(object, function(){ doStuff(); });
+
+               d._onto(d._loaders, obj, functionName);
+
+               //Added for xdomain loading. dojo.addOnLoad is used to
+               //indicate callbacks after doing some dojo.require() statements.
+               //In the xdomain case, if all the requires are loaded (after initial
+               //page load), then immediately call any listeners.
+               if(d._postLoad && d._inFlightCount == 0 && !d._loadNotifying){
+                       d._callLoaded();
+               }
+       }
+
+       //Support calling dojo.addOnLoad via djConfig.addOnLoad. Support all the
+       //call permutations of dojo.addOnLoad. Mainly useful when dojo is added
+       //to the page after the page has loaded.
+       var dca = d.config.addOnLoad;
+       if(dca){
+               d.addOnLoad[(dca instanceof Array ? "apply" : "call")](d, dca);
+       }
+
+       dojo._modulesLoaded = function(){
+               if(d._postLoad){ return; }
+               if(d._inFlightCount > 0){ 
+                       console.warn("files still in flight!");
+                       return;
+               }
+               d._callLoaded();
+       }
+
+       dojo._callLoaded = function(){
+
+               // The "object" check is for IE, and the other opera check fixes an
+               // issue in Opera where it could not find the body element in some
+               // widget test cases.  For 0.9, maybe route all browsers through the
+               // setTimeout (need protection still for non-browser environments
+               // though). This might also help the issue with FF 2.0 and freezing
+               // issues where we try to do sync xhr while background css images are
+               // being loaded (trac #2572)? Consider for 0.9.
+               if(typeof setTimeout == "object" || (d.config.useXDomain && d.isOpera)){
+                       setTimeout(
+                               d.isAIR ? function(){ d.loaded(); } : d._scopeName + ".loaded();",
+                               0);
+               }else{
+                       d.loaded();
+               }
+       }
+
+       dojo._getModuleSymbols = function(/*String*/modulename){
+               // summary:
+               //              Converts a module name in dotted JS notation to an array
+               //              representing the path in the source tree
+               var syms = modulename.split(".");
+               for(var i = syms.length; i>0; i--){
+                       var parentModule = syms.slice(0, i).join(".");
+                       if(i == 1 && !d._moduleHasPrefix(parentModule)){                
+                               // Support default module directory (sibling of dojo) for top-level modules 
+                               syms[0] = "../" + syms[0];
+                       }else{
+                               var parentModulePath = d._getModulePrefix(parentModule);
+                               if(parentModulePath != parentModule){
+                                       syms.splice(0, i, parentModulePath);
+                                       break;
+                               }
+                       }
+               }
+               return syms; // Array
+       }
+
+       dojo._global_omit_module_check = false;
+
+       dojo.loadInit = function(/*Function*/init){
+               //      summary:
+               //              Executes a function that needs to be executed for the loader's dojo.requireIf
+               //              resolutions to work. This is needed mostly for the xdomain loader case where
+               //              a function needs to be executed to set up the possible values for a dojo.requireIf
+               //              call.
+               //      init:
+               //              a function reference. Executed immediately.
+               //      description: This function is mainly a marker for the xdomain loader to know parts of
+               //              code that needs be executed outside the function wrappper that is placed around modules.
+               //              The init function could be executed more than once, and it should make no assumptions
+               //              on what is loaded, or what modules are available. Only the functionality in Dojo Base
+               //              is allowed to be used. Avoid using this method. For a valid use case,
+               //              see the source for dojox.gfx.
+               init();
+       }
+
+       dojo._loadModule = dojo.require = function(/*String*/moduleName, /*Boolean?*/omitModuleCheck){
+               //      summary:
+               //              loads a Javascript module from the appropriate URI
+               //      moduleName:
+               //              module name to load, using periods for separators,
+               //               e.g. "dojo.date.locale".  Module paths are de-referenced by dojo's
+               //              internal mapping of locations to names and are disambiguated by
+               //              longest prefix. See `dojo.registerModulePath()` for details on
+               //              registering new modules.
+               //      omitModuleCheck:
+               //              if `true`, omitModuleCheck skips the step of ensuring that the
+               //              loaded file actually defines the symbol it is referenced by.
+               //              For example if it called as `dojo.require("a.b.c")` and the
+               //              file located at `a/b/c.js` does not define an object `a.b.c`,
+               //              and exception will be throws whereas no exception is raised
+               //              when called as `dojo.require("a.b.c", true)`
+               //      description:
+               //              Modules are loaded via dojo.require by using one of two loaders: the normal loader
+               //              and the xdomain loader. The xdomain loader is used when dojo was built with a
+               //              custom build that specified loader=xdomain and the module lives on a modulePath
+               //              that is a whole URL, with protocol and a domain. The versions of Dojo that are on
+               //              the Google and AOL CDNs use the xdomain loader.
+               // 
+               //              If the module is loaded via the xdomain loader, it is an asynchronous load, since
+               //              the module is added via a dynamically created script tag. This
+               //              means that dojo.require() can return before the module has loaded. However, this 
+               //              should only happen in the case where you do dojo.require calls in the top-level
+               //              HTML page, or if you purposely avoid the loader checking for dojo.require
+               //              dependencies in your module by using a syntax like dojo["require"] to load the module.
+               // 
+               //              Sometimes it is useful to not have the loader detect the dojo.require calls in the
+               //              module so that you can dynamically load the modules as a result of an action on the
+               //              page, instead of right at module load time.
+               // 
+               //              Also, for script blocks in an HTML page, the loader does not pre-process them, so
+               //              it does not know to download the modules before the dojo.require calls occur.
+               // 
+               //              So, in those two cases, when you want on-the-fly module loading or for script blocks
+               //              in the HTML page, special care must be taken if the dojo.required code is loaded
+               //              asynchronously. To make sure you can execute code that depends on the dojo.required
+               //              modules, be sure to add the code that depends on the modules in a dojo.addOnLoad()
+               //              callback. dojo.addOnLoad waits for all outstanding modules to finish loading before
+               //              executing. Example:
+               // 
+               //              |       <script type="text/javascript">
+               //              |       dojo.require("foo");
+               //              |       dojo.require("bar");
+               //              |       dojo.addOnLoad(function(){
+               //              |               //you can now safely do something with foo and bar
+               //              |       });
+               //              |       </script>
+               // 
+               //              This type of syntax works with both xdomain and normal loaders, so it is good
+               //              practice to always use this idiom for on-the-fly code loading and in HTML script
+               //              blocks. If at some point you change loaders and where the code is loaded from,
+               //              it will all still work.
+               // 
+               //              More on how dojo.require
+               //              `dojo.require("A.B")` first checks to see if symbol A.B is
+               //              defined. If it is, it is simply returned (nothing to do).
+               //      
+               //              If it is not defined, it will look for `A/B.js` in the script root
+               //              directory.
+               //      
+               //              `dojo.require` throws an excpetion if it cannot find a file
+               //              to load, or if the symbol `A.B` is not defined after loading.
+               //      
+               //              It returns the object `A.B`, but note the caveats above about on-the-fly loading and
+               //              HTML script blocks when the xdomain loader is loading a module.
+               //      
+               //              `dojo.require()` does nothing about importing symbols into
+               //              the current namespace.  It is presumed that the caller will
+               //              take care of that. For example, to import all symbols into a
+               //              local block, you might write:
+               //      
+               //              |       with (dojo.require("A.B")) {
+               //              |               ...
+               //              |       }
+               //      
+               //              And to import just the leaf symbol to a local variable:
+               //      
+               //              |       var B = dojo.require("A.B");
+               //              |       ...
+               //      returns: the required namespace object
+               omitModuleCheck = d._global_omit_module_check || omitModuleCheck;
+
+               //Check if it is already loaded.
+               var module = d._loadedModules[moduleName];
+               if(module){
+                       return module;
+               }
+
+               // convert periods to slashes
+               var relpath = d._getModuleSymbols(moduleName).join("/") + '.js';
+
+               var modArg = !omitModuleCheck ? moduleName : null;
+               var ok = d._loadPath(relpath, modArg);
+
+               if(!ok && !omitModuleCheck){
+                       throw new Error("Could not load '" + moduleName + "'; last tried '" + relpath + "'");
+               }
+
+               // check that the symbol was defined
+               // Don't bother if we're doing xdomain (asynchronous) loading.
+               if(!omitModuleCheck && !d._isXDomain){
+                       // pass in false so we can give better error
+                       module = d._loadedModules[moduleName];
+                       if(!module){
+                               throw new Error("symbol '" + moduleName + "' is not defined after loading '" + relpath + "'"); 
+                       }
+               }
+
+               return module;
+       }
+
+       dojo.provide = function(/*String*/ resourceName){
+               //      summary:
+               //              Register a resource with the package system. Works in conjunction with `dojo.require`
+               //
+               //      description:
+               //              Each javascript source file is called a resource.  When a
+               //              resource is loaded by the browser, `dojo.provide()` registers
+               //              that it has been loaded.
+               //
+               //              Each javascript source file must have at least one
+               //              `dojo.provide()` call at the top of the file, corresponding to
+               //              the file name.  For example, `js/dojo/foo.js` must have
+               //              `dojo.provide("dojo.foo");` before any calls to
+               //              `dojo.require()` are made.
+               //      
+               //              For backwards compatibility reasons, in addition to registering
+               //              the resource, `dojo.provide()` also ensures that the javascript
+               //              object for the module exists.  For example,
+               //              `dojo.provide("dojox.data.FlickrStore")`, in addition to
+               //              registering that `FlickrStore.js` is a resource for the
+               //              `dojox.data` module, will ensure that the `dojox.data`
+               //              javascript object exists, so that calls like 
+               //              `dojo.data.foo = function(){ ... }` don't fail.
+               //
+               //              In the case of a build where multiple javascript source files
+               //              are combined into one bigger file (similar to a .lib or .jar
+               //              file), that file may contain multiple dojo.provide() calls, to
+               //              note that it includes multiple resources.
+               //
+               // resourceName: String
+               //              A dot-sperated string identifying a resource. 
+               //
+               // example:
+               //      Safely create a `my` object, and make dojo.require("my.CustomModule") work
+               //      |       dojo.provide("my.CustomModule"); 
+
+               //Make sure we have a string.
+               resourceName = resourceName + "";
+               return (d._loadedModules[resourceName] = d.getObject(resourceName, true)); // Object
+       }
+
+       //Start of old bootstrap2:
+
+       dojo.platformRequire = function(/*Object*/modMap){
+               //      summary:
+               //              require one or more modules based on which host environment
+               //              Dojo is currently operating in
+               //      description:
+               //              This method takes a "map" of arrays which one can use to
+               //              optionally load dojo modules. The map is indexed by the
+               //              possible dojo.name_ values, with two additional values:
+               //              "default" and "common". The items in the "default" array will
+               //              be loaded if none of the other items have been choosen based on
+               //              dojo.name_, set by your host environment. The items in the
+               //              "common" array will *always* be loaded, regardless of which
+               //              list is chosen.
+               //      example:
+               //              |       dojo.platformRequire({
+               //              |               browser: [
+               //              |                       "foo.sample", // simple module
+               //              |                       "foo.test",
+               //              |                       ["foo.bar.baz", true] // skip object check in _loadModule (dojo.require)
+               //              |               ],
+               //              |               default: [ "foo.sample._base" ],
+               //              |               common: [ "important.module.common" ]
+               //              |       });
+
+               var common = modMap.common || [];
+               var result = common.concat(modMap[d._name] || modMap["default"] || []);
+
+               for(var x=0; x<result.length; x++){
+                       var curr = result[x];
+                       if(curr.constructor == Array){
+                               d._loadModule.apply(d, curr);
+                       }else{
+                               d._loadModule(curr);
+                       }
+               }
+       }
+
+       dojo.requireIf = function(/*Boolean*/ condition, /*String*/ resourceName){
+               // summary:
+               //              If the condition is true then call `dojo.require()` for the specified
+               //              resource
+               //
+               // example:
+               //      |       dojo.requireIf(dojo.isBrowser, "my.special.Module");
+               
+               if(condition === true){
+                       // FIXME: why do we support chained require()'s here? does the build system?
+                       var args = [];
+                       for(var i = 1; i < arguments.length; i++){ 
+                               args.push(arguments[i]);
+                       }
+                       d.require.apply(d, args);
+               }
+       }
+
+       dojo.requireAfterIf = d.requireIf;
+
+       dojo.registerModulePath = function(/*String*/module, /*String*/prefix){
+               //      summary: 
+               //              Maps a module name to a path
+               //      description: 
+               //              An unregistered module is given the default path of ../[module],
+               //              relative to Dojo root. For example, module acme is mapped to
+               //              ../acme.  If you want to use a different module name, use
+               //              dojo.registerModulePath. 
+               //      example:
+               //              If your dojo.js is located at this location in the web root:
+               //      |       /myapp/js/dojo/dojo/dojo.js
+               //              and your modules are located at:
+               //      |       /myapp/js/foo/bar.js
+               //      |       /myapp/js/foo/baz.js
+               //      |       /myapp/js/foo/thud/xyzzy.js
+               //              Your application can tell Dojo to locate the "foo" namespace by calling:
+               //      |       dojo.registerModulePath("foo", "../../foo");
+               //              At which point you can then use dojo.require() to load the
+               //              modules (assuming they provide() the same things which are
+               //              required). The full code might be:
+               //      |       <script type="text/javascript" 
+               //      |               src="/myapp/js/dojo/dojo/dojo.js"></script>
+               //      |       <script type="text/javascript">
+               //      |               dojo.registerModulePath("foo", "../../foo");
+               //      |               dojo.require("foo.bar");
+               //      |               dojo.require("foo.baz");
+               //      |               dojo.require("foo.thud.xyzzy");
+               //      |       </script>
+               d._modulePrefixes[module] = { name: module, value: prefix };
+       }
+
+       dojo.requireLocalization = function(/*String*/moduleName, /*String*/bundleName, /*String?*/locale, /*String?*/availableFlatLocales){
+               // summary:
+               //              Declares translated resources and loads them if necessary, in the
+               //              same style as dojo.require.  Contents of the resource bundle are
+               //              typically strings, but may be any name/value pair, represented in
+               //              JSON format.  See also `dojo.i18n.getLocalization`.
+               //
+               // description:
+               //              Load translated resource bundles provided underneath the "nls"
+               //              directory within a package.  Translated resources may be located in
+               //              different packages throughout the source tree.  
+               //
+               //              Each directory is named for a locale as specified by RFC 3066,
+               //              (http://www.ietf.org/rfc/rfc3066.txt), normalized in lowercase.
+               //              Note that the two bundles in the example do not define all the
+               //              same variants.  For a given locale, bundles will be loaded for
+               //              that locale and all more general locales above it, including a
+               //              fallback at the root directory.  For example, a declaration for
+               //              the "de-at" locale will first load `nls/de-at/bundleone.js`,
+               //              then `nls/de/bundleone.js` and finally `nls/bundleone.js`.  The
+               //              data will be flattened into a single Object so that lookups
+               //              will follow this cascading pattern.  An optional build step can
+               //              preload the bundles to avoid data redundancy and the multiple
+               //              network hits normally required to load these resources.
+               //
+               // moduleName: 
+               //              name of the package containing the "nls" directory in which the
+               //              bundle is found
+               //
+               // bundleName: 
+               //              bundle name, i.e. the filename without the '.js' suffix. Using "nls" as a
+               //              a bundle name is not supported, since "nls" is the name of the folder
+               //              that holds bundles. Using "nls" as the bundle name will cause problems
+               //              with the custom build.
+               //
+               // locale: 
+               //              the locale to load (optional)  By default, the browser's user
+               //              locale as defined by dojo.locale
+               //
+               // availableFlatLocales: 
+               //              A comma-separated list of the available, flattened locales for this
+               //              bundle. This argument should only be set by the build process.
+               //
+               //      example:
+               //              A particular widget may define one or more resource bundles,
+               //              structured in a program as follows, where moduleName is
+               //              mycode.mywidget and bundleNames available include bundleone and
+               //              bundletwo:
+               //      |               ...
+               //      |       mycode/
+               //      |               mywidget/
+               //      |                       nls/
+               //      |                               bundleone.js (the fallback translation, English in this example)
+               //      |                               bundletwo.js (also a fallback translation)
+               //      |                               de/
+               //      |                                       bundleone.js
+               //      |                                       bundletwo.js
+               //      |                               de-at/
+               //      |                                       bundleone.js
+               //      |                               en/
+               //      |                                       (empty; use the fallback translation)
+               //      |                               en-us/
+               //      |                                       bundleone.js
+               //      |                               en-gb/
+               //      |                                       bundleone.js
+               //      |                               es/
+               //      |                                       bundleone.js
+               //      |                                       bundletwo.js
+               //      |                                 ...etc
+               //      |                               ...
+               //
+
+               d.require("dojo.i18n");
+               d.i18n._requireLocalization.apply(d.hostenv, arguments);
+       };
+
+
+       var ore = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),
+               ire = new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");
+
+       dojo._Url = function(/*dojo._Url|String...*/){
+               // summary: 
+               //              Constructor to create an object representing a URL.
+               //              It is marked as private, since we might consider removing
+               //              or simplifying it.
+               // description: 
+               //              Each argument is evaluated in order relative to the next until
+               //              a canonical uri is produced. To get an absolute Uri relative to
+               //              the current document use:
+               //              new dojo._Url(document.baseURI, url)
+
+               var n = null,
+                       _a = arguments,
+                       uri = [_a[0]];
+               // resolve uri components relative to each other
+               for(var i = 1; i<_a.length; i++){
+                       if(!_a[i]){ continue; }
+
+                       // Safari doesn't support this.constructor so we have to be explicit
+                       // FIXME: Tracked (and fixed) in Webkit bug 3537.
+                       //              http://bugs.webkit.org/show_bug.cgi?id=3537
+                       var relobj = new d._Url(_a[i]+""),
+                               uriobj = new d._Url(uri[0]+"");
+
+                       if(
+                               relobj.path == "" &&
+                               !relobj.scheme &&
+                               !relobj.authority &&
+                               !relobj.query
+                       ){
+                               if(relobj.fragment != n){
+                                       uriobj.fragment = relobj.fragment;
+                               }
+                               relobj = uriobj;
+                       }else if(!relobj.scheme){
+                               relobj.scheme = uriobj.scheme;
+
+                               if(!relobj.authority){
+                                       relobj.authority = uriobj.authority;
+
+                                       if(relobj.path.charAt(0) != "/"){
+                                               var path = uriobj.path.substring(0,
+                                                       uriobj.path.lastIndexOf("/") + 1) + relobj.path;
+
+                                               var segs = path.split("/");
+                                               for(var j = 0; j < segs.length; j++){
+                                                       if(segs[j] == "."){
+                                                               // flatten "./" references
+                                                               if(j == segs.length - 1){
+                                                                       segs[j] = "";
+                                                               }else{
+                                                                       segs.splice(j, 1);
+                                                                       j--;
+                                                               }
+                                                       }else if(j > 0 && !(j == 1 && segs[0] == "") &&
+                                                               segs[j] == ".." && segs[j-1] != ".."){
+                                                               // flatten "../" references
+                                                               if(j == (segs.length - 1)){
+                                                                       segs.splice(j, 1);
+                                                                       segs[j - 1] = "";
+                                                               }else{
+                                                                       segs.splice(j - 1, 2);
+                                                                       j -= 2;
+                                                               }
+                                                       }
+                                               }
+                                               relobj.path = segs.join("/");
+                                       }
+                               }
+                       }
+
+                       uri = [];
+                       if(relobj.scheme){ 
+                               uri.push(relobj.scheme, ":");
+                       }
+                       if(relobj.authority){
+                               uri.push("//", relobj.authority);
+                       }
+                       uri.push(relobj.path);
+                       if(relobj.query){
+                               uri.push("?", relobj.query);
+                       }
+                       if(relobj.fragment){
+                               uri.push("#", relobj.fragment);
+                       }
+               }
+
+               this.uri = uri.join("");
+
+               // break the uri into its main components
+               var r = this.uri.match(ore);
+
+               this.scheme = r[2] || (r[1] ? "" : n);
+               this.authority = r[4] || (r[3] ? "" : n);
+               this.path = r[5]; // can never be undefined
+               this.query = r[7] || (r[6] ? "" : n);
+               this.fragment  = r[9] || (r[8] ? "" : n);
+
+               if(this.authority != n){
+                       // server based naming authority
+                       r = this.authority.match(ire);
+
+                       this.user = r[3] || n;
+                       this.password = r[4] || n;
+                       this.host = r[6] || r[7]; // ipv6 || ipv4
+                       this.port = r[9] || n;
+               }
+       }
+
+       dojo._Url.prototype.toString = function(){ return this.uri; };
+
+       dojo.moduleUrl = function(/*String*/module, /*dojo._Url||String*/url){
+               //      summary: 
+               //              Returns a `dojo._Url` object relative to a module.
+               //      example:
+               //      |       var pngPath = dojo.moduleUrl("acme","images/small.png");
+               //      |       console.dir(pngPath); // list the object properties
+               //      |       // create an image and set it's source to pngPath's value:
+               //      |       var img = document.createElement("img");
+               //      |       // NOTE: we assign the string representation of the url object
+               //      |       img.src = pngPath.toString(); 
+               //      |       // add our image to the document
+               //      |       dojo.body().appendChild(img);
+               //      example: 
+               //              you may de-reference as far as you like down the package
+               //              hierarchy.  This is sometimes handy to avoid lenghty relative
+               //              urls or for building portable sub-packages. In this example,
+               //              the `acme.widget` and `acme.util` directories may be located
+               //              under different roots (see `dojo.registerModulePath`) but the
+               //              the modules which reference them can be unaware of their
+               //              relative locations on the filesystem:
+               //      |       // somewhere in a configuration block
+               //      |       dojo.registerModulePath("acme.widget", "../../acme/widget");
+               //      |       dojo.registerModulePath("acme.util", "../../util");
+               //      |       
+               //      |       // ...
+               //      |       
+               //      |       // code in a module using acme resources
+               //      |       var tmpltPath = dojo.moduleUrl("acme.widget","templates/template.html");
+               //      |       var dataPath = dojo.moduleUrl("acme.util","resources/data.json");
+
+               var loc = d._getModuleSymbols(module).join('/');
+               if(!loc){ return null; }
+               if(loc.lastIndexOf("/") != loc.length-1){
+                       loc += "/";
+               }
+               
+               //If the path is an absolute path (starts with a / or is on another
+               //domain/xdomain) then don't add the baseUrl.
+               var colonIndex = loc.indexOf(":");
+               if(loc.charAt(0) != "/" && (colonIndex == -1 || colonIndex > loc.indexOf("/"))){
+                       loc = d.baseUrl + loc;
+               }
+
+               return new d._Url(loc, url); // dojo._Url
+       }
+})();
+
+/*=====
+dojo.isBrowser = {
+       //      example:
+       //      |       if(dojo.isBrowser){ ... }
+};
+
+dojo.isFF = {
+       //      example:
+       //      |       if(dojo.isFF > 1){ ... }
+};
+
+dojo.isIE = {
+       // example:
+       //      |       if(dojo.isIE > 6){
+       //      |               // we are IE7
+       //      |       }
+};
+
+dojo.isSafari = {
+       //      example:
+       //      |       if(dojo.isSafari){ ... }
+       //      example: 
+       //              Detect iPhone:
+       //      |       if(dojo.isSafari && navigator.userAgent.indexOf("iPhone") != -1){ 
+       //      |               // we are iPhone. Note, iPod touch reports "iPod" above and fails this test.
+       //      |       }
+};
+
+dojo = {
+       // isBrowser: Boolean
+       //              True if the client is a web-browser
+       isBrowser: true,
+       //      isFF: Number | undefined
+       //              Version as a Number if client is FireFox. undefined otherwise. Corresponds to
+       //              major detected FireFox version (1.5, 2, 3, etc.)
+       isFF: 2,
+       //      isIE: Number | undefined
+       //              Version as a Number if client is MSIE(PC). undefined otherwise. Corresponds to
+       //              major detected IE version (6, 7, 8, etc.)
+       isIE: 6,
+       //      isKhtml: Number | undefined
+       //              Version as a Number if client is a KHTML browser. undefined otherwise. Corresponds to major
+       //              detected version.
+       isKhtml: 0,
+       //      isWebKit: Number | undefined
+       //              Version as a Number if client is a WebKit-derived browser (Konqueror,
+       //              Safari, Chrome, etc.). undefined otherwise.
+       isWebKit: 0,
+       //      isMozilla: Number | undefined
+       //              Version as a Number if client is a Mozilla-based browser (Firefox,
+       //              SeaMonkey). undefined otherwise. Corresponds to major detected version.
+       isMozilla: 0,
+       //      isOpera: Number | undefined
+       //              Version as a Number if client is Opera. undefined otherwise. Corresponds to
+       //              major detected version.
+       isOpera: 0,
+       //      isSafari: Number | undefined
+       //              Version as a Number if client is Safari or iPhone. undefined otherwise.
+       isSafari: 0,
+       //      isChrome: Number | undefined
+       //              Version as a Number if client is Chrome browser. undefined otherwise.
+       isChrome: 0
+       //      isMac: Boolean
+       //              True if the client runs on Mac
+}
+=====*/
+
+if(typeof window != 'undefined'){
+       dojo.isBrowser = true;
+       dojo._name = "browser";
+
+
+       // attempt to figure out the path to dojo if it isn't set in the config
+       (function(){
+               var d = dojo;
+
+               // this is a scope protection closure. We set browser versions and grab
+               // the URL we were loaded from here.
+
+               // grab the node we were loaded from
+               if(document && document.getElementsByTagName){
+                       var scripts = document.getElementsByTagName("script");
+                       var rePkg = /dojo(\.xd)?\.js(\W|$)/i;
+                       for(var i = 0; i < scripts.length; i++){
+                               var src = scripts[i].getAttribute("src");
+                               if(!src){ continue; }
+                               var m = src.match(rePkg);
+                               if(m){
+                                       // find out where we came from
+                                       if(!d.config.baseUrl){
+                                               d.config.baseUrl = src.substring(0, m.index);
+                                       }
+                                       // and find out if we need to modify our behavior
+                                       var cfg = scripts[i].getAttribute("djConfig");
+                                       if(cfg){
+                                               var cfgo = eval("({ "+cfg+" })");
+                                               for(var x in cfgo){
+                                                       dojo.config[x] = cfgo[x];
+                                               }
+                                       }
+                                       break; // "first Dojo wins"
+                               }
+                       }
+               }
+               d.baseUrl = d.config.baseUrl;
+
+               // fill in the rendering support information in dojo.render.*
+               var n = navigator;
+               var dua = n.userAgent,
+                       dav = n.appVersion,
+                       tv = parseFloat(dav);
+
+               if(dua.indexOf("Opera") >= 0){ d.isOpera = tv; }
+               if(dua.indexOf("AdobeAIR") >= 0){ d.isAIR = 1; }
+               d.isKhtml = (dav.indexOf("Konqueror") >= 0) ? tv : 0;
+               d.isWebKit = parseFloat(dua.split("WebKit/")[1]) || undefined;
+               d.isChrome = parseFloat(dua.split("Chrome/")[1]) || undefined;
+               d.isMac = dav.indexOf("Macintosh") >= 0;
+
+               // safari detection derived from:
+               //              http://developer.apple.com/internet/safari/faq.html#anchor2
+               //              http://developer.apple.com/internet/safari/uamatrix.html
+               var index = Math.max(dav.indexOf("WebKit"), dav.indexOf("Safari"), 0);
+               if(index && !dojo.isChrome){
+                       // try to grab the explicit Safari version first. If we don't get
+                       // one, look for less than 419.3 as the indication that we're on something
+                       // "Safari 2-ish".
+                       d.isSafari = parseFloat(dav.split("Version/")[1]);
+                       if(!d.isSafari || parseFloat(dav.substr(index + 7)) <= 419.3){
+                               d.isSafari = 2;
+                       }
+               }
+
+                               if(dua.indexOf("Gecko") >= 0 && !d.isKhtml && !d.isWebKit){ d.isMozilla = d.isMoz = tv; }
+               if(d.isMoz){
+                       //We really need to get away from this. Consider a sane isGecko approach for the future.
+                       d.isFF = parseFloat(dua.split("Firefox/")[1] || dua.split("Minefield/")[1]) || undefined;
+               }
+               if(document.all && !d.isOpera){
+                       d.isIE = parseFloat(dav.split("MSIE ")[1]) || undefined;
+                       //In cases where the page has an HTTP header or META tag with
+                       //X-UA-Compatible, then it is in emulation mode.
+                       //Make sure isIE reflects the desired version.
+                       //document.documentMode of 5 means quirks mode.
+                       //Only switch the value if documentMode's major version
+                       //is different from isIE's major version.
+                       var mode = document.documentMode;
+                       if(mode && mode != 5 && Math.floor(d.isIE) != mode){
+                               d.isIE = mode;
+                       }
+               }
+
+               //Workaround to get local file loads of dojo to work on IE 7
+               //by forcing to not use native xhr.
+               if(dojo.isIE && window.location.protocol === "file:"){
+                       dojo.config.ieForceActiveXXhr=true;
+               }
+               
+               d.isQuirks = document.compatMode == "BackCompat";
+
+               // TODO: is the HTML LANG attribute relevant?
+               d.locale = dojo.config.locale || (d.isIE ? n.userLanguage : n.language).toLowerCase();
+
+               // These are in order of decreasing likelihood; this will change in time.
+                               d._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
+               
+               d._xhrObj = function(){
+                       // summary: 
+                       //              does the work of portably generating a new XMLHTTPRequest object.
+                       var http, last_e;
+                                               if(!dojo.isIE || !dojo.config.ieForceActiveXXhr){
+                                                       try{ http = new XMLHttpRequest(); }catch(e){}
+                                               }
+                       if(!http){
+                               for(var i=0; i<3; ++i){
+                                       var progid = d._XMLHTTP_PROGIDS[i];
+                                       try{
+                                               http = new ActiveXObject(progid);
+                                       }catch(e){
+                                               last_e = e;
+                                       }
+
+                                       if(http){
+                                               d._XMLHTTP_PROGIDS = [progid];  // so faster next time
+                                               break;
+                                       }
+                               }
+                       }
+                       
+                       if(!http){
+                               throw new Error("XMLHTTP not available: "+last_e);
+                       }
+
+                       return http; // XMLHTTPRequest instance
+               }
+
+               d._isDocumentOk = function(http){
+                       var stat = http.status || 0,
+                               lp = location.protocol;
+                       return (stat >= 200 && stat < 300) ||   // Boolean
+                               stat == 304 ||                                          // allow any 2XX response code
+                               stat == 1223 ||                                                 // get it out of the cache
+                               (!stat && (lp == "file:" || lp == "chrome:" || lp == "app:") ); // Internet Explorer mangled the status code OR we're Titanium requesting a local file
+               }
+
+               //See if base tag is in use.
+               //This is to fix http://trac.dojotoolkit.org/ticket/3973,
+               //but really, we need to find out how to get rid of the dojo._Url reference
+               //below and still have DOH work with the dojo.i18n test following some other
+               //test that uses the test frame to load a document (trac #2757).
+               //Opera still has problems, but perhaps a larger issue of base tag support
+               //with XHR requests (hasBase is true, but the request is still made to document
+               //path, not base path).
+               var owloc = window.location+"";
+               var base = document.getElementsByTagName("base");
+               var hasBase = (base && base.length > 0);
+
+               d._getText = function(/*URI*/ uri, /*Boolean*/ fail_ok){
+                       // summary: Read the contents of the specified uri and return those contents.
+                       // uri:
+                       //              A relative or absolute uri. If absolute, it still must be in
+                       //              the same "domain" as we are.
+                       // fail_ok:
+                       //              Default false. If fail_ok and loading fails, return null
+                       //              instead of throwing.
+                       // returns: The response text. null is returned when there is a
+                       //              failure and failure is okay (an exception otherwise)
+
+                       // NOTE: must be declared before scope switches ie. this._xhrObj()
+                       var http = d._xhrObj();
+
+                       if(!hasBase && dojo._Url){
+                               uri = (new dojo._Url(owloc, uri)).toString();
+                       }
+
+                       if(d.config.cacheBust){
+                               //Make sure we have a string before string methods are used on uri
+                               uri += "";
+                               uri += (uri.indexOf("?") == -1 ? "?" : "&") + String(d.config.cacheBust).replace(/\W+/g,"");
+                       }
+
+                       http.open('GET', uri, false);
+                       try{
+                               http.send(null);
+                               if(!d._isDocumentOk(http)){
+                                       var err = Error("Unable to load "+uri+" status:"+ http.status);
+                                       err.status = http.status;
+                                       err.responseText = http.responseText;
+                                       throw err;
+                               }
+                       }catch(e){
+                               if(fail_ok){ return null; } // null
+                               // rethrow the exception
+                               throw e;
+                       }
+                       return http.responseText; // String
+               }
+               
+
+               var _w = window;
+               var _handleNodeEvent = function(/*String*/evtName, /*Function*/fp){
+                       // summary:
+                       //              non-destructively adds the specified function to the node's
+                       //              evtName handler.
+                       // evtName: should be in the form "onclick" for "onclick" handlers.
+                       // Make sure you pass in the "on" part.
+                       var _a = _w.attachEvent || _w.addEventListener;
+                       evtName = _w.attachEvent ? evtName : evtName.substring(2);
+                       _a(evtName, function(){
+                               fp.apply(_w, arguments);
+                       }, false);
+               };
+
+
+               d._windowUnloaders = [];
+               
+               d.windowUnloaded = function(){
+                       // summary:
+                       //              signal fired by impending window destruction. You may use
+                       //              dojo.addOnWindowUnload() to register a listener for this
+                       //              event. NOTE: if you wish to dojo.connect() to this method
+                       //              to perform page/application cleanup, be aware that this
+                       //              event WILL NOT fire if no handler has been registered with
+                       //              dojo.addOnWindowUnload. This behavior started in Dojo 1.3.
+                       //              Previous versions always triggered dojo.windowUnloaded. See
+                       //              dojo.addOnWindowUnload for more info.
+                       var mll = d._windowUnloaders;
+                       while(mll.length){
+                               (mll.pop())();
+                       }
+               };
+
+               var _onWindowUnloadAttached = 0;
+               d.addOnWindowUnload = function(/*Object?|Function?*/obj, /*String|Function?*/functionName){
+                       // summary:
+                       //              registers a function to be triggered when window.onunload
+                       //              fires. 
+                       //      description:
+                       //              The first time that addOnWindowUnload is called Dojo
+                       //              will register a page listener to trigger your unload
+                       //              handler with. Note that registering these handlers may
+                       //              destory "fastback" page caching in browsers that support
+                       //              it. Be careful trying to modify the DOM or access
+                       //              JavaScript properties during this phase of page unloading:
+                       //              they may not always be available. Consider
+                       //              dojo.addOnUnload() if you need to modify the DOM or do
+                       //              heavy JavaScript work since it fires at the eqivalent of
+                       //              the page's "onbeforeunload" event.
+                       // example:
+                       //      |       dojo.addOnWindowUnload(functionPointer)
+                       //      |       dojo.addOnWindowUnload(object, "functionName");
+                       //      |       dojo.addOnWindowUnload(object, function(){ /* ... */});
+
+                       d._onto(d._windowUnloaders, obj, functionName);
+                       if(!_onWindowUnloadAttached){
+                               _onWindowUnloadAttached = 1;
+                               _handleNodeEvent("onunload", d.windowUnloaded);
+                       }
+               };
+
+               var _onUnloadAttached = 0;
+               d.addOnUnload = function(/*Object?|Function?*/obj, /*String|Function?*/functionName){
+                       // summary:
+                       //              registers a function to be triggered when the page unloads.
+                       //      description:
+                       //              The first time that addOnUnload is called Dojo will
+                       //              register a page listener to trigger your unload handler
+                       //              with. 
+                       //
+                       //              In a browser enviroment, the functions will be triggered
+                       //              during the window.onbeforeunload event. Be careful of doing
+                       //              too much work in an unload handler. onbeforeunload can be
+                       //              triggered if a link to download a file is clicked, or if
+                       //              the link is a javascript: link. In these cases, the
+                       //              onbeforeunload event fires, but the document is not
+                       //              actually destroyed. So be careful about doing destructive
+                       //              operations in a dojo.addOnUnload callback.
+                       //
+                       //              Further note that calling dojo.addOnUnload will prevent
+                       //              browsers from using a "fast back" cache to make page
+                       //              loading via back button instantaneous. 
+                       // example:
+                       //      |       dojo.addOnUnload(functionPointer)
+                       //      |       dojo.addOnUnload(object, "functionName")
+                       //      |       dojo.addOnUnload(object, function(){ /* ... */});
+
+                       d._onto(d._unloaders, obj, functionName);
+                       if(!_onUnloadAttached){
+                               _onUnloadAttached = 1;
+                               _handleNodeEvent("onbeforeunload", dojo.unloaded);
+                       }
+               };
+
+       })();
+
+       //START DOMContentLoaded
+       dojo._initFired = false;
+       dojo._loadInit = function(e){
+               if(!dojo._initFired){
+                       dojo._initFired = true;
+
+                       //Help out IE to avoid memory leak.
+                       if(!dojo.config.afterOnLoad && window.detachEvent){
+                               window.detachEvent("onload", dojo._loadInit);
+                       }
+
+                       if(dojo._inFlightCount == 0){
+                               dojo._modulesLoaded();
+                       }
+               }
+       }
+
+       if(!dojo.config.afterOnLoad){
+               if(document.addEventListener){
+                       //Standards. Hooray! Assumption here that if standards based,
+                       //it knows about DOMContentLoaded. It is OK if it does not, the fall through
+                       //to window onload should be good enough.
+                       document.addEventListener("DOMContentLoaded", dojo._loadInit, false);
+                       window.addEventListener("load", dojo._loadInit, false);
+               }else if(window.attachEvent){
+                       window.attachEvent("onload", dojo._loadInit);
+               }
+       }
+
+               if(dojo.isIE){
+               //      for Internet Explorer. readyState will not be achieved on init
+               //      call, but dojo doesn't need it however, we'll include it
+               //      because we don't know if there are other functions added that
+               //      might.  Note that this has changed because the build process
+               //      strips all comments -- including conditional ones.
+               if(!dojo.config.afterOnLoad && !dojo.config.skipIeDomLoaded){
+                       document.write('<scr'+'ipt defer src="//:" '
+                               + 'onreadystatechange="if(this.readyState==\'complete\'){' + dojo._scopeName + '._loadInit();}">'
+                               + '</scr'+'ipt>'
+                       );
+               }
+
+               try{
+                       document.namespaces.add("v","urn:schemas-microsoft-com:vml");
+                       var vmlElems = ["*", "group", "roundrect", "oval", "shape", "rect", "imagedata"],
+                               i = 0, l = 1, s = document.createStyleSheet();
+                       if(dojo.isIE >= 8){
+                               i = 1;
+                               l = vmlElems.length;
+                       }
+                       for(; i < l; ++i){
+                               s.addRule("v\\:" + vmlElems[i], "behavior:url(#default#VML); display:inline-block");
+                       }
+               }catch(e){}
+       }
+               //END DOMContentLoaded
+
+
+       /*
+       OpenAjax.subscribe("OpenAjax", "onload", function(){
+               if(dojo._inFlightCount == 0){
+                       dojo._modulesLoaded();
+               }
+       });
+
+       OpenAjax.subscribe("OpenAjax", "onunload", function(){
+               dojo.unloaded();
+       });
+       */
+} //if (typeof window != 'undefined')
+
+//Register any module paths set up in djConfig. Need to do this
+//in the hostenvs since hostenv_browser can read djConfig from a
+//script tag's attribute.
+(function(){
+       var mp = dojo.config["modulePaths"];
+       if(mp){
+               for(var param in mp){
+                       dojo.registerModulePath(param, mp[param]);
+               }
+       }
+})();
+
+//Load debug code if necessary.
+if(dojo.config.isDebug){
+       dojo.require("dojo._firebug.firebug");
+}
+
+if(dojo.config.debugAtAllCosts){
+       dojo.config.useXDomain = true;
+       dojo.require("dojo._base._loader.loader_xd");
+       dojo.require("dojo._base._loader.loader_debug");
+       dojo.require("dojo.i18n");
+}
+
+if(!dojo._hasResource["dojo._base.lang"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.lang"] = true;
+dojo.provide("dojo._base.lang");
+
+(function(){
+       var d = dojo, opts = Object.prototype.toString;
+
+       // Crockford (ish) functions
+
+       dojo.isString = function(/*anything*/ it){
+               //      summary:
+               //              Return true if it is a String
+               return (typeof it == "string" || it instanceof String); // Boolean
+       }
+
+       dojo.isArray = function(/*anything*/ it){
+               //      summary:
+               //              Return true if it is an Array.
+               //              Does not work on Arrays created in other windows.
+               return it && (it instanceof Array || typeof it == "array"); // Boolean
+       }
+
+       dojo.isFunction = function(/*anything*/ it){
+               // summary:
+               //              Return true if it is a Function
+               return opts.call(it) === "[object Function]";
+       };
+
+       dojo.isObject = function(/*anything*/ it){
+               // summary:
+               //              Returns true if it is a JavaScript object (or an Array, a Function
+               //              or null)
+               return it !== undefined &&
+                       (it === null || typeof it == "object" || d.isArray(it) || d.isFunction(it)); // Boolean
+       }
+
+       dojo.isArrayLike = function(/*anything*/ it){
+               //      summary:
+               //              similar to dojo.isArray() but more permissive
+               //      description:
+               //              Doesn't strongly test for "arrayness".  Instead, settles for "isn't
+               //              a string or number and has a length property". Arguments objects
+               //              and DOM collections will return true when passed to
+               //              dojo.isArrayLike(), but will return false when passed to
+               //              dojo.isArray().
+               //      returns:
+               //              If it walks like a duck and quacks like a duck, return `true`
+               return it && it !== undefined && // Boolean
+                       // keep out built-in constructors (Number, String, ...) which have length
+                       // properties
+                       !d.isString(it) && !d.isFunction(it) &&
+                       !(it.tagName && it.tagName.toLowerCase() == 'form') &&
+                       (d.isArray(it) || isFinite(it.length));
+       }
+
+       dojo.isAlien = function(/*anything*/ it){
+               // summary:
+               //              Returns true if it is a built-in function or some other kind of
+               //              oddball that *should* report as a function but doesn't
+               return it && !d.isFunction(it) && /\{\s*\[native code\]\s*\}/.test(String(it)); // Boolean
+       }
+
+       dojo.extend = function(/*Object*/ constructor, /*Object...*/ props){
+               // summary:
+               //              Adds all properties and methods of props to constructor's
+               //              prototype, making them available to all instances created with
+               //              constructor.
+               for(var i=1, l=arguments.length; i<l; i++){
+                       d._mixin(constructor.prototype, arguments[i]);
+               }
+               return constructor; // Object
+       }
+
+       dojo._hitchArgs = function(scope, method /*,...*/){
+               var pre = d._toArray(arguments, 2);
+               var named = d.isString(method);
+               return function(){
+                       // arrayify arguments
+                       var args = d._toArray(arguments);
+                       // locate our method
+                       var f = named ? (scope||d.global)[method] : method;
+                       // invoke with collected args
+                       return f && f.apply(scope || this, pre.concat(args)); // mixed
+               } // Function
+       }
+
+       dojo.hitch = function(/*Object*/scope, /*Function|String*/method /*,...*/){
+               //      summary:
+               //              Returns a function that will only ever execute in the a given scope.
+               //              This allows for easy use of object member functions
+               //              in callbacks and other places in which the "this" keyword may
+               //              otherwise not reference the expected scope.
+               //              Any number of default positional arguments may be passed as parameters 
+               //              beyond "method".
+               //              Each of these values will be used to "placehold" (similar to curry)
+               //              for the hitched function.
+               //      scope:
+               //              The scope to use when method executes. If method is a string,
+               //              scope is also the object containing method.
+               //      method:
+               //              A function to be hitched to scope, or the name of the method in
+               //              scope to be hitched.
+               //      example:
+               //      |       dojo.hitch(foo, "bar")();
+               //              runs foo.bar() in the scope of foo
+               //      example:
+               //      |       dojo.hitch(foo, myFunction);
+               //              returns a function that runs myFunction in the scope of foo
+               //      example:
+               //              Expansion on the default positional arguments passed along from
+               //              hitch. Passed args are mixed first, additional args after.
+               //      |       var foo = { bar: function(a, b, c){ console.log(a, b, c); } };
+               //      |       var fn = dojo.hitch(foo, "bar", 1, 2);
+               //      |       fn(3); // logs "1, 2, 3"
+               //      example:
+               //      |       var foo = { bar: 2 };
+               //      |       dojo.hitch(foo, function(){ this.bar = 10; })();
+               //              execute an anonymous function in scope of foo
+               
+               if(arguments.length > 2){
+                       return d._hitchArgs.apply(d, arguments); // Function
+               }
+               if(!method){
+                       method = scope;
+                       scope = null;
+               }
+               if(d.isString(method)){
+                       scope = scope || d.global;
+                       if(!scope[method]){ throw(['dojo.hitch: scope["', method, '"] is null (scope="', scope, '")'].join('')); }
+                       return function(){ return scope[method].apply(scope, arguments || []); }; // Function
+               }
+               return !scope ? method : function(){ return method.apply(scope, arguments || []); }; // Function
+       }
+
+       /*=====
+       dojo.delegate = function(obj, props){
+               //      summary:
+               //              Returns a new object which "looks" to obj for properties which it
+               //              does not have a value for. Optionally takes a bag of properties to
+               //              seed the returned object with initially.
+               //      description:
+               //              This is a small implementaton of the Boodman/Crockford delegation
+               //              pattern in JavaScript. An intermediate object constructor mediates
+               //              the prototype chain for the returned object, using it to delegate
+               //              down to obj for property lookup when object-local lookup fails.
+               //              This can be thought of similarly to ES4's "wrap", save that it does
+               //              not act on types but rather on pure objects.
+               //      obj:
+               //              The object to delegate to for properties not found directly on the
+               //              return object or in props.
+               //      props:
+               //              an object containing properties to assign to the returned object
+               //      returns:
+               //              an Object of anonymous type
+               //      example:
+               //      |       var foo = { bar: "baz" };
+               //      |       var thinger = dojo.delegate(foo, { thud: "xyzzy"});
+               //      |       thinger.bar == "baz"; // delegated to foo
+               //      |       foo.thud == undefined; // by definition
+               //      |       thinger.thud == "xyzzy"; // mixed in from props
+               //      |       foo.bar = "thonk";
+               //      |       thinger.bar == "thonk"; // still delegated to foo's bar
+       }
+       =====*/
+
+       dojo.delegate = dojo._delegate = (function(){
+               // boodman/crockford delegation w/ cornford optimization
+               function TMP(){}
+               return function(obj, props){
+                       TMP.prototype = obj;
+                       var tmp = new TMP();
+                       TMP.prototype = null;
+                       if(props){
+                               d._mixin(tmp, props);
+                       }
+                       return tmp; // Object
+               }
+       })();
+
+       /*=====
+       dojo._toArray = function(obj, offset, startWith){
+               //      summary:
+               //              Converts an array-like object (i.e. arguments, DOMCollection) to an
+               //              array. Returns a new Array with the elements of obj.
+               //      obj: Object
+               //              the object to "arrayify". We expect the object to have, at a
+               //              minimum, a length property which corresponds to integer-indexed
+               //              properties.
+               //      offset: Number?
+               //              the location in obj to start iterating from. Defaults to 0.
+               //              Optional.
+               //      startWith: Array?
+               //              An array to pack with the properties of obj. If provided,
+               //              properties in obj are appended at the end of startWith and
+               //              startWith is the returned array.
+       }
+       =====*/
+
+       var efficient = function(obj, offset, startWith){
+               return (startWith||[]).concat(Array.prototype.slice.call(obj, offset||0));
+       };
+
+               var slow = function(obj, offset, startWith){
+               var arr = startWith||[];
+               for(var x = offset || 0; x < obj.length; x++){
+                       arr.push(obj[x]);
+               }
+               return arr;
+       };
+       
+       dojo._toArray =
+                               d.isIE ?  function(obj){
+                       return ((obj.item) ? slow : efficient).apply(this, arguments);
+               } :
+                               efficient;
+
+       dojo.partial = function(/*Function|String*/method /*, ...*/){
+               //      summary:
+               //              similar to hitch() except that the scope object is left to be
+               //              whatever the execution context eventually becomes.
+               //      description:
+               //              Calling dojo.partial is the functional equivalent of calling:
+               //              |       dojo.hitch(null, funcName, ...);
+               var arr = [ null ];
+               return d.hitch.apply(d, arr.concat(d._toArray(arguments))); // Function
+       }
+
+       var extraNames = d._extraNames, extraLen = extraNames.length, empty = {};
+
+       dojo.clone = function(/*anything*/ o){
+               // summary:
+               //              Clones objects (including DOM nodes) and all children.
+               //              Warning: do not clone cyclic structures.
+               if(!o || typeof o != "object" || d.isFunction(o)){
+                       // null, undefined, any non-object, or function
+                       return o;       // anything
+               }
+               if(o.nodeType && o.cloneNode){
+                       // DOM Node
+                       return o.cloneNode(true); // Node
+               }
+               if(o instanceof Date){
+                       // Date
+                       return new Date(o.getTime());   // Date
+               }
+               var r, i, l, s, name;
+               if(d.isArray(o)){
+                       // array
+                       r = [];
+                       for(i = 0, l = o.length; i < l; ++i){
+                               if(i in o){
+                                       r.push(d.clone(o[i]));
+                               }
+                       }
+// we don't clone functions for performance reasons
+//             }else if(d.isFunction(o)){
+//                     // function
+//                     r = function(){ return o.apply(this, arguments); };
+               }else{
+                       // generic objects
+                       r = o.constructor ? new o.constructor() : {};
+               }
+               for(name in o){
+                       // the "tobj" condition avoid copying properties in "source"
+                       // inherited from Object.prototype.  For example, if target has a custom
+                       // toString() method, don't overwrite it with the toString() method
+                       // that source inherited from Object.prototype
+                       s = o[name];
+                       if(!(name in r) || (r[name] !== s && (!(name in empty) || empty[name] !== s))){
+                               r[name] = d.clone(s);
+                       }
+               }
+                               // IE doesn't recognize some custom functions in for..in
+               if(extraLen){
+                       for(i = 0; i < extraLen; ++i){
+                               name = extraNames[i];
+                               s = o[name];
+                               if(!(name in r) || (r[name] !== s && (!(name in empty) || empty[name] !== s))){
+                                       r[name] = s; // functions only, we don't clone them
+                               }
+                       }
+               }
+                               return r; // Object
+       }
+
+       /*=====
+       dojo.trim = function(str){
+               //      summary:
+               //              Trims whitespace from both sides of the string
+               //      str: String
+               //              String to be trimmed
+               //      returns: String
+               //              Returns the trimmed string
+               //      description:
+               //              This version of trim() was selected for inclusion into the base due
+               //              to its compact size and relatively good performance
+               //              (see [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript)
+               //              Uses String.prototype.trim instead, if available.
+               //              The fastest but longest version of this function is located at
+               //              dojo.string.trim()
+               return "";      // String
+       }
+       =====*/
+
+       dojo.trim = String.prototype.trim ?
+               function(str){ return str.trim(); } :
+               function(str){ return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); };
+
+       /*=====
+       dojo.replace = function(tmpl, map, pattern){
+               //      summary:
+               //              Performs parameterized substitutions on a string. Throws an
+               //              exception if any parameter is unmatched. 
+               //      tmpl: String
+               //              String to be used as a template.
+               //      map: Object|Function
+               //              If an object, it is used as a dictionary to look up substitutions.
+               //              If a function, it is called for every substitution with following
+               //              parameters: a whole match, a name, an offset, and the whole template
+               //              string (see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace
+               //              for more details).
+               //      pattern: RegEx?
+               //              Optional regular expression objects that overrides the default pattern.
+               //              Must be global and match one item. The default is: /\{([^\}]+)\}/g,
+               //              which matches patterns like that: "{xxx}", where "xxx" is any sequence
+               //              of characters, which doesn't include "}".
+               //      returns: String
+               //              Returns the substituted string.
+               //      example:
+               //      |       // uses a dictionary for substitutions:
+               //      |       dojo.replace("Hello, {name.first} {name.last} AKA {nick}!",
+               //      |         {
+               //      |           nick: "Bob",
+               //      |           name: {
+               //      |             first:  "Robert",
+               //      |             middle: "X",
+               //      |             last:   "Cringely"
+               //      |           }
+               //      |         });
+               //      |       // returns: Hello, Robert Cringely AKA Bob!
+               //      example:
+               //      |       // uses an array for substitutions:
+               //      |       dojo.replace("Hello, {0} {2}!",
+               //      |         ["Robert", "X", "Cringely"]);
+               //      |       // returns: Hello, Robert Cringely!
+               //      example:
+               //      |       // uses a function for substitutions:
+               //      |       function sum(a){
+               //      |         var t = 0;
+               //      |         dojo.forEach(a, function(x){ t += x; });
+               //      |         return t;
+               //      |       }
+               //      |       dojo.replace(
+               //      |         "{count} payments averaging {avg} USD per payment.",
+               //      |         dojo.hitch(
+               //      |           { payments: [11, 16, 12] },
+               //      |           function(_, key){
+               //      |             switch(key){
+               //      |               case "count": return this.payments.length;
+               //      |               case "min":   return Math.min.apply(Math, this.payments);
+               //      |               case "max":   return Math.max.apply(Math, this.payments);
+               //      |               case "sum":   return sum(this.payments);
+               //      |               case "avg":   return sum(this.payments) / this.payments.length;
+               //      |             }
+               //      |           }
+               //      |         )
+               //      |       );
+               //      |       // prints: 3 payments averaging 13 USD per payment.
+               //      example:
+               //      |       // uses an alternative PHP-like pattern for substitutions:
+               //      |       dojo.replace("Hello, ${0} ${2}!",
+               //      |         ["Robert", "X", "Cringely"], /\$\{([^\}]+)\}/g);
+               //      |       // returns: Hello, Robert Cringely!
+               return "";      // String
+       }
+       =====*/
+
+       var _pattern = /\{([^\}]+)\}/g;
+       dojo.replace = function(tmpl, map, pattern){
+               return tmpl.replace(pattern || _pattern, d.isFunction(map) ?
+                       map : function(_, k){ return d.getObject(k, false, map); });
+       };
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base.array"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.array"] = true;
+
+dojo.provide("dojo._base.array");
+
+(function(){
+       var _getParts = function(arr, obj, cb){
+               return [ 
+                       (typeof arr == "string") ? arr.split("") : arr, 
+                       obj || dojo.global,
+                       // FIXME: cache the anonymous functions we create here?
+                       (typeof cb == "string") ? new Function("item", "index", "array", cb) : cb
+               ];
+       };
+
+       var everyOrSome = function(/*Boolean*/every, /*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
+               var _p = _getParts(arr, thisObject, callback); arr = _p[0];
+               for(var i=0,l=arr.length; i<l; ++i){
+                       var result = !!_p[2].call(_p[1], arr[i], i, arr);
+                       if(every ^ result){
+                               return result; // Boolean
+                       }
+               }
+               return every; // Boolean
+       };
+
+       dojo.mixin(dojo, {
+               indexOf: function(      /*Array*/               array, 
+                                                       /*Object*/              value,
+                                                       /*Integer?*/    fromIndex,
+                                                       /*Boolean?*/    findLast){
+                       // summary:
+                       //              locates the first index of the provided value in the
+                       //              passed array. If the value is not found, -1 is returned.
+                       // description:
+                       //              This method corresponds to the JavaScript 1.6 Array.indexOf method, with one difference: when
+                       //              run over sparse arrays, the Dojo function invokes the callback for every index whereas JavaScript 
+                       //              1.6's indexOf skips the holes in the sparse array.
+                       //              For details on this method, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/indexOf
+
+                       var step = 1, end = array.length || 0, i = 0;
+                       if(findLast){
+                               i = end - 1;
+                               step = end = -1;
+                       }
+                       if(fromIndex != undefined){ i = fromIndex; }
+                       if((findLast && i > end) || i < end){
+                               for(; i != end; i += step){
+                                       if(array[i] == value){ return i; }
+                               }
+                       }
+                       return -1;      // Number
+               },
+
+               lastIndexOf: function(/*Array*/array, /*Object*/value, /*Integer?*/fromIndex){
+                       // summary:
+                       //              locates the last index of the provided value in the passed
+                       //              array. If the value is not found, -1 is returned.
+                       // description:
+                       //              This method corresponds to the JavaScript 1.6 Array.lastIndexOf method, with one difference: when
+                       //              run over sparse arrays, the Dojo function invokes the callback for every index whereas JavaScript 
+                       //              1.6's lastIndexOf skips the holes in the sparse array.
+                       //              For details on this method, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/lastIndexOf
+                       return dojo.indexOf(array, value, fromIndex, true); // Number
+               },
+
+               forEach: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
+                       //      summary:
+                       //              for every item in arr, callback is invoked. Return values are ignored.
+                       //              If you want to break out of the loop, consider using dojo.every() or dojo.some().
+                       //              forEach does not allow breaking out of the loop over the items in arr.
+                       //      arr:
+                       //              the array to iterate over. If a string, operates on individual characters.
+                       //      callback:
+                       //              a function is invoked with three arguments: item, index, and array
+                       //      thisObject:
+                       //              may be used to scope the call to callback
+                       //      description:
+                       //              This function corresponds to the JavaScript 1.6 Array.forEach() method, with one difference: when 
+                       //              run over sparse arrays, this implemenation passes the "holes" in the sparse array to
+                       //              the callback function with a value of undefined. JavaScript 1.6's forEach skips the holes in the sparse array.
+                       //              For more details, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/forEach
+                       //      example:
+                       //      |       // log out all members of the array:
+                       //      |       dojo.forEach(
+                       //      |               [ "thinger", "blah", "howdy", 10 ],
+                       //      |               function(item){
+                       //      |                       console.log(item);
+                       //      |               }
+                       //      |       );
+                       //      example:
+                       //      |       // log out the members and their indexes
+                       //      |       dojo.forEach(
+                       //      |               [ "thinger", "blah", "howdy", 10 ],
+                       //      |               function(item, idx, arr){
+                       //      |                       console.log(item, "at index:", idx);
+                       //      |               }
+                       //      |       );
+                       //      example:
+                       //      |       // use a scoped object member as the callback
+                       //      |       
+                       //      |       var obj = {
+                       //      |               prefix: "logged via obj.callback:", 
+                       //      |               callback: function(item){
+                       //      |                       console.log(this.prefix, item);
+                       //      |               }
+                       //      |       };
+                       //      |       
+                       //      |       // specifying the scope function executes the callback in that scope
+                       //      |       dojo.forEach(
+                       //      |               [ "thinger", "blah", "howdy", 10 ],
+                       //      |               obj.callback,
+                       //      |               obj
+                       //      |       );
+                       //      |       
+                       //      |       // alternately, we can accomplish the same thing with dojo.hitch()
+                       //      |       dojo.forEach(
+                       //      |               [ "thinger", "blah", "howdy", 10 ],
+                       //      |               dojo.hitch(obj, "callback")
+                       //      |       );
+
+                       // match the behavior of the built-in forEach WRT empty arrs
+                       if(!arr || !arr.length){ return; }
+
+                       // FIXME: there are several ways of handilng thisObject. Is
+                       // dojo.global always the default context?
+                       var _p = _getParts(arr, thisObject, callback); arr = _p[0];
+                       for(var i=0,l=arr.length; i<l; ++i){ 
+                               _p[2].call(_p[1], arr[i], i, arr);
+                       }
+               },
+
+               every: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
+                       // summary:
+                       //              Determines whether or not every item in arr satisfies the
+                       //              condition implemented by callback.
+                       // arr:
+                       //              the array to iterate on. If a string, operates on individual characters.
+                       // callback:
+                       //              a function is invoked with three arguments: item, index,
+                       //              and array and returns true if the condition is met.
+                       // thisObject:
+                       //              may be used to scope the call to callback
+                       // description:
+                       //              This function corresponds to the JavaScript 1.6 Array.every() method, with one difference: when 
+                       //              run over sparse arrays, this implemenation passes the "holes" in the sparse array to
+                       //              the callback function with a value of undefined. JavaScript 1.6's every skips the holes in the sparse array.
+                       //              For more details, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/every
+                       // example:
+                       //      |       // returns false
+                       //      |       dojo.every([1, 2, 3, 4], function(item){ return item>1; });
+                       // example:
+                       //      |       // returns true 
+                       //      |       dojo.every([1, 2, 3, 4], function(item){ return item>0; });
+                       return everyOrSome(true, arr, callback, thisObject); // Boolean
+               },
+
+               some: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
+                       // summary:
+                       //              Determines whether or not any item in arr satisfies the
+                       //              condition implemented by callback.
+                       // arr:
+                       //              the array to iterate over. If a string, operates on individual characters.
+                       // callback:
+                       //              a function is invoked with three arguments: item, index,
+                       //              and array and returns true if the condition is met.
+                       // thisObject:
+                       //              may be used to scope the call to callback
+                       // description:
+                       //              This function corresponds to the JavaScript 1.6 Array.some() method, with one difference: when 
+                       //              run over sparse arrays, this implemenation passes the "holes" in the sparse array to
+                       //              the callback function with a value of undefined. JavaScript 1.6's some skips the holes in the sparse array.
+                       //              For more details, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/some
+                       // example:
+                       //      |       // is true
+                       //      |       dojo.some([1, 2, 3, 4], function(item){ return item>1; });
+                       // example:
+                       //      |       // is false
+                       //      |       dojo.some([1, 2, 3, 4], function(item){ return item<1; });
+                       return everyOrSome(false, arr, callback, thisObject); // Boolean
+               },
+
+               map: function(/*Array|String*/arr, /*Function|String*/callback, /*Function?*/thisObject){
+                       // summary:
+                       //              applies callback to each element of arr and returns
+                       //              an Array with the results
+                       // arr:
+                       //              the array to iterate on. If a string, operates on
+                       //              individual characters.
+                       // callback:
+                       //              a function is invoked with three arguments, (item, index,
+                       //              array),  and returns a value
+                       // thisObject:
+                       //              may be used to scope the call to callback
+                       // description:
+                       //              This function corresponds to the JavaScript 1.6 Array.map() method, with one difference: when 
+                       //              run over sparse arrays, this implemenation passes the "holes" in the sparse array to
+                       //              the callback function with a value of undefined. JavaScript 1.6's map skips the holes in the sparse array.
+                       //              For more details, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+                       // example:
+                       //      |       // returns [2, 3, 4, 5]
+                       //      |       dojo.map([1, 2, 3, 4], function(item){ return item+1 });
+
+                       var _p = _getParts(arr, thisObject, callback); arr = _p[0];
+                       var outArr = (arguments[3] ? (new arguments[3]()) : []);
+                       for(var i=0,l=arr.length; i<l; ++i){
+                               outArr.push(_p[2].call(_p[1], arr[i], i, arr));
+                       }
+                       return outArr; // Array
+               },
+
+               filter: function(/*Array*/arr, /*Function|String*/callback, /*Object?*/thisObject){
+                       // summary:
+                       //              Returns a new Array with those items from arr that match the
+                       //              condition implemented by callback.
+                       // arr:
+                       //              the array to iterate over.
+                       // callback:
+                       //              a function that is invoked with three arguments (item,
+                       //              index, array). The return of this function is expected to
+                       //              be a boolean which determines whether the passed-in item
+                       //              will be included in the returned array.
+                       // thisObject:
+                       //              may be used to scope the call to callback
+                       // description:
+                       //              This function corresponds to the JavaScript 1.6 Array.filter() method, with one difference: when 
+                       //              run over sparse arrays, this implemenation passes the "holes" in the sparse array to
+                       //              the callback function with a value of undefined. JavaScript 1.6's filter skips the holes in the sparse array. 
+                       //              For more details, see:
+                       //                      https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+                       // example:
+                       //      |       // returns [2, 3, 4]
+                       //      |       dojo.filter([1, 2, 3, 4], function(item){ return item>1; });
+
+                       var _p = _getParts(arr, thisObject, callback); arr = _p[0];
+                       var outArr = [];
+                       for(var i=0,l=arr.length; i<l; ++i){
+                               if(_p[2].call(_p[1], arr[i], i, arr)){
+                                       outArr.push(arr[i]);
+                               }
+                       }
+                       return outArr; // Array
+               }
+       });
+})();
+/*
+*/
+
+}
+
+if(!dojo._hasResource["dojo._base.declare"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.declare"] = true;
+dojo.provide("dojo._base.declare");
+
+
+
+
+(function(){
+       var d = dojo, mix = d._mixin, op = Object.prototype, opts = op.toString,
+               xtor = new Function, counter = 0, cname = "constructor";
+
+       function err(msg){ throw new Error("declare: " + msg); }
+
+       // C3 Method Resolution Order (see http://www.python.org/download/releases/2.3/mro/)
+       function c3mro(bases){
+               var result = [], roots = [{cls: 0, refs: []}], nameMap = {}, clsCount = 1,
+                       l = bases.length, i = 0, j, lin, base, top, proto, rec, name, refs;
+
+               // build a list of bases naming them if needed
+               for(; i < l; ++i){
+                       base = bases[i];
+                       if(!base){
+                               err("mixin #" + i + " is null");
+                       }
+                       lin = base._meta ? base._meta.bases : [base];
+                       top = 0;
+                       // add bases to the name map
+                       for(j = lin.length - 1; j >= 0; --j){
+                               proto = lin[j].prototype;
+                               if(!proto.hasOwnProperty("declaredClass")){
+                                       proto.declaredClass = "uniqName_" + (counter++);
+                               }
+                               name = proto.declaredClass;
+                               if(!nameMap.hasOwnProperty(name)){
+                                       nameMap[name] = {count: 0, refs: [], cls: lin[j]};
+                                       ++clsCount;
+                               }
+                               rec = nameMap[name];
+                               if(top && top !== rec){
+                                       rec.refs.push(top);
+                                       ++top.count;
+                               }
+                               top = rec;
+                       }
+                       ++top.count;
+                       roots[0].refs.push(top);
+               }
+
+               // remove classes without external references recursively
+               while(roots.length){
+                       top = roots.pop();
+                       result.push(top.cls);
+                       --clsCount;
+                       // optimization: follow a single-linked chain
+                       while(refs = top.refs, refs.length == 1){
+                               top = refs[0];
+                               if(!top || --top.count){
+                                       // branch or end of chain => do not end to roots
+                                       top = 0;
+                                       break;
+                               }
+                               result.push(top.cls);
+                               --clsCount;
+                       }
+                       if(top){
+                               // branch
+                               for(i = 0, l = refs.length; i < l; ++i){
+                                       top = refs[i];
+                                       if(!--top.count){
+                                               roots.push(top);
+                                       }
+                               }
+                       }
+               }
+               if(clsCount){
+                       err("can't build consistent linearization");
+               }
+
+               // calculate the superclass offset
+               base = bases[0];
+               result[0] = base ?
+                       base._meta && base === result[result.length - base._meta.bases.length] ?
+                               base._meta.bases.length : 1 : 0;
+
+               return result;
+       }
+
+       function inherited(args, a, f){
+               var name, chains, bases, caller, meta, base, proto, opf, pos,
+                       cache = this._inherited = this._inherited || {};
+
+               // crack arguments
+               if(typeof args == "string"){
+                       name = args;
+                       args = a;
+                       a = f;
+               }
+               f = 0;
+
+               caller = args.callee;
+               name = name || caller.nom;
+               if(!name){
+                       err("can't deduce a name to call inherited()");
+               }
+
+               meta = this.constructor._meta;
+               bases = meta.bases;
+
+               pos = cache.p;
+               if(name != cname){
+                       // method
+                       if(cache.c !== caller){
+                               // cache bust
+                               pos = 0;
+                               base = bases[0];
+                               meta = base._meta;
+                               if(meta.hidden[name] !== caller){
+                                       // error detection
+                                       chains = meta.chains;
+                                       if(chains && typeof chains[name] == "string"){
+                                               err("calling chained method with inherited: " + name);
+                                       }
+                                       // find caller
+                                       do{
+                                               meta = base._meta;
+                                               proto = base.prototype;
+                                               if(meta && (proto[name] === caller && proto.hasOwnProperty(name) || meta.hidden[name] === caller)){
+                                                       break;
+                                               }
+                                       }while(base = bases[++pos]); // intentional assignment
+                                       pos = base ? pos : -1;
+                               }
+                       }
+                       // find next
+                       base = bases[++pos];
+                       if(base){
+                               proto = base.prototype;
+                               if(base._meta && proto.hasOwnProperty(name)){
+                                       f = proto[name];
+                               }else{
+                                       opf = op[name];
+                                       do{
+                                               proto = base.prototype;
+                                               f = proto[name];
+                                               if(f && (base._meta ? proto.hasOwnProperty(name) : f !== opf)){
+                                                       break;
+                                               }
+                                       }while(base = bases[++pos]); // intentional assignment
+                               }
+                       }
+                       f = base && f || op[name];
+               }else{
+                       // constructor
+                       if(cache.c !== caller){
+                               // cache bust
+                               pos = 0;
+                               meta = bases[0]._meta;
+                               if(meta && meta.ctor !== caller){
+                                       // error detection
+                                       chains = meta.chains;
+                                       if(!chains || chains.constructor !== "manual"){
+                                               err("calling chained constructor with inherited");
+                                       }
+                                       // find caller
+                                       while(base = bases[++pos]){ // intentional assignment
+                                               meta = base._meta;
+                                               if(meta && meta.ctor === caller){
+                                                       break;
+                                               }
+                                       };
+                                       pos = base ? pos : -1;
+                               }
+                       }
+                       // find next
+                       while(base = bases[++pos]){     // intentional assignment
+                               meta = base._meta;
+                               f = meta ? meta.ctor : base;
+                               if(f){
+                                       break;
+                               }
+                       }
+                       f = base && f;
+               }
+
+               // cache the found super method
+               cache.c = f;
+               cache.p = pos;
+
+               // now we have the result
+               if(f){
+                       return a === true ? f : f.apply(this, a || args);
+               }
+               // intentionally if a super method was not found
+       }
+
+       function getInherited(name, args){
+               if(typeof name == "string"){
+                       return this.inherited(name, args, true);
+               }
+               return this.inherited(name, true);
+       }
+
+       // emulation of "instanceof"
+       function isInstanceOf(cls){
+               var bases = this.constructor._meta.bases;
+               for(var i = 0, l = bases.length; i < l; ++i){
+                       if(bases[i] === cls){
+                               return true;
+                       }
+               }
+               return this instanceof cls;
+       }
+
+       // imlementation of safe mixin function
+       function safeMixin(target, source){
+               var name, t, i = 0, l = d._extraNames.length;
+               // add props adding metadata for incoming functions skipping a constructor
+               for(name in source){
+                       t = source[name];
+                       if((t !== op[name] || !(name in op)) && name != cname){
+                               if(opts.call(t) == "[object Function]"){
+                                       // non-trivial function method => attach its name
+                                       t.nom = name;
+                               }
+                               target[name] = t;
+                       }
+               }
+               // process unenumerable methods on IE
+               for(; i < l; ++i){
+                       name = d._extraNames[i];
+                       t = source[name];
+                       if((t !== op[name] || !(name in op)) && name != cname){
+                               if(opts.call(t) == "[object Function]"){
+                                       // non-trivial function method => attach its name
+                                       t.nom = name;
+                               }
+                               target[name] = t;
+                       }
+               }
+               return target;
+       }
+
+       function extend(source){
+               safeMixin(this.prototype, source);
+               return this;
+       }
+
+       // chained constructor compatible with the legacy dojo.declare()
+       function chainedConstructor(bases, ctorSpecial){
+               return function(){
+                       var a = arguments, args = a, a0 = a[0], f, i, m,
+                               l = bases.length, preArgs;
+                       //this._inherited = {};
+                       // perform the shaman's rituals of the original dojo.declare()
+                       // 1) call two types of the preamble
+                       if(ctorSpecial && (a0 && a0.preamble || this.preamble)){
+                               // full blown ritual
+                               preArgs = new Array(bases.length);
+                               // prepare parameters
+                               preArgs[0] = a;
+                               for(i = 0;;){
+                                       // process the preamble of the 1st argument
+                                       a0 = a[0];
+                                       if(a0){
+                                               f = a0.preamble;
+                                               if(f){
+                                                       a = f.apply(this, a) || a;
+                                               }
+                                       }
+                                       // process the preamble of this class
+                                       f = bases[i].prototype;
+                                       f = f.hasOwnProperty("preamble") && f.preamble;
+                                       if(f){
+                                               a = f.apply(this, a) || a;
+                                       }
+                                       // one pecularity of the preamble:
+                                       // it is called if it is not needed,
+                                       // e.g., there is no constructor to call
+                                       // let's watch for the last constructor
+                                       // (see ticket #9795)
+                                       if(++i == l){
+                                               break;
+                                       }
+                                       preArgs[i] = a;
+                               }
+                       }
+                       // 2) call all non-trivial constructors using prepared arguments
+                       for(i = l - 1; i >= 0; --i){
+                               f = bases[i];
+                               m = f._meta;
+                               f = m ? m.ctor : f;
+                               if(f){
+                                       f.apply(this, preArgs ? preArgs[i] : a);
+                               }
+                       }
+                       // 3) continue the original ritual: call the postscript
+                       f = this.postscript;
+                       if(f){
+                               f.apply(this, args);
+                       }
+               };
+       }
+
+
+       // chained constructor compatible with the legacy dojo.declare()
+       function singleConstructor(ctor, ctorSpecial){
+               return function(){
+                       var a = arguments, t = a, a0 = a[0], f;
+                       //this._inherited = {};
+                       // perform the shaman's rituals of the original dojo.declare()
+                       // 1) call two types of the preamble
+                       if(ctorSpecial){
+                               // full blown ritual
+                               if(a0){
+                                       // process the preamble of the 1st argument
+                                       f = a0.preamble;
+                                       if(f){
+                                               t = f.apply(this, t) || t;
+                                       }
+                               }
+                               f = this.preamble;
+                               if(f){
+                                       // process the preamble of this class
+                                       f.apply(this, t);
+                                       // one pecularity of the preamble:
+                                       // it is called even if it is not needed,
+                                       // e.g., there is no constructor to call
+                                       // let's watch for the last constructor
+                                       // (see ticket #9795)
+                               }
+                       }
+                       // 2) call a constructor
+                       if(ctor){
+                               ctor.apply(this, a);
+                       }
+                       // 3) continue the original ritual: call the postscript
+                       f = this.postscript;
+                       if(f){
+                               f.apply(this, a);
+                       }
+               };
+       }
+
+       // plain vanilla constructor (can use inherited() to call its base constructor)
+       function simpleConstructor(bases){
+               return function(){
+                       var a = arguments, i = 0, f;
+                       //this._inherited = {};
+                       // perform the shaman's rituals of the original dojo.declare()
+                       // 1) do not call the preamble
+                       // 2) call the top constructor (it can use this.inherited())
+                       for(; f = bases[i]; ++i){ // intentional assignment
+                               m = f._meta;
+                               f = m ? m.ctor : f;
+                               if(f){
+                                       f.apply(this, a);
+                                       break;
+                               }
+                       }
+                       // 3) call the postscript
+                       f = this.postscript;
+                       if(f){
+                               f.apply(this, a);
+                       }
+               };
+       }
+
+       function chain(name, bases, reversed){
+               return function(){
+                       var b, m, f, i = 0, step = 1;
+                       if(reversed){
+                               i = bases.length - 1;
+                               step = -1;
+                       }
+                       for(; b = bases[i]; i += step){ // intentional assignment
+                               m = b._meta;
+                               f = (m ? m.hidden : b.prototype)[name];
+                               if(f){
+                                       f.apply(this, arguments);
+                               }
+                       }
+               };
+       }
+
+       d.declare = function(className, superclass, props){
+               var proto, i, t, ctor, name, bases, chains, mixins = 1, parents = superclass;
+
+               // crack parameters
+               if(typeof className != "string"){
+                       props = superclass;
+                       superclass = className;
+                       className = "";
+               }
+               props = props || {};
+
+               // build a prototype
+               if(opts.call(superclass) == "[object Array]"){
+                       // C3 MRO
+                       bases = c3mro(superclass);
+                       t = bases[0];
+                       mixins = bases.length - t;
+                       superclass = bases[mixins];
+               }else{
+                       bases = [0];
+                       if(superclass){
+                               t = superclass._meta;
+                               bases = bases.concat(t ? t.bases : superclass);
+                       }
+               }
+               if(superclass){
+                       for(i = mixins - 1;; --i){
+                               // delegation
+                               xtor.prototype = superclass.prototype;
+                               proto = new xtor;
+                               if(!i){
+                                       // stop if nothing to add (the last base)
+                                       break;
+                               }
+                               // mix in properties
+                               t = bases[i];
+                               mix(proto, t._meta ? t._meta.hidden : t.prototype);
+                               // chain in new constructor
+                               ctor = new Function;
+                               ctor.superclass = superclass;
+                               ctor.prototype = proto;
+                               superclass = proto.constructor = ctor;
+                       }
+               }else{
+                       proto = {};
+               }
+               // add all properties
+               safeMixin(proto, props);
+               // add constructor
+               t = props.constructor;
+               if(t !== op.constructor){
+                       t.nom = cname;
+                       proto.constructor = t;
+               }
+               xtor.prototype = 0;     // cleanup
+
+               // collect chains and flags
+               for(i = mixins - 1; i; --i){ // intentional assignment
+                       t = bases[i]._meta;
+                       if(t && t.chains){
+                               chains = mix(chains || {}, t.chains);
+                       }
+               }
+               if(proto["-chains-"]){
+                       chains = mix(chains || {}, proto["-chains-"]);
+               }
+
+               // build ctor
+               t = !chains || !chains.hasOwnProperty(cname);
+               bases[0] = ctor = (chains && chains.constructor === "manual") ? simpleConstructor(bases) :
+                       (bases.length == 1 ? singleConstructor(props.constructor, t) : chainedConstructor(bases, t));
+
+               // add meta information to the constructor
+               ctor._meta  = {bases: bases, hidden: props, chains: chains,
+                       parents: parents, ctor: props.constructor};
+               ctor.superclass = superclass && superclass.prototype;
+               ctor.extend = extend;
+               ctor.prototype = proto;
+               proto.constructor = ctor;
+
+               // add "standard" methods to the ptototype
+               proto.getInherited = getInherited;
+               proto.inherited = inherited;
+               proto.isInstanceOf = isInstanceOf;
+
+               // add name if specified
+               if(className){
+                       proto.declaredClass = className;
+                       d.setObject(className, ctor);
+               }
+
+               // build chains and add them to the prototype
+               if(chains){
+                       for(name in chains){
+                               if(proto[name] && typeof chains[name] == "string" && name != cname){
+                                       t = proto[name] = chain(name, bases, chains[name] === "after");
+                                       t.nom = name;
+                               }
+                       }
+               }
+               // chained methods do not return values
+               // no need to chain "invisible" functions
+
+               return ctor;    // Function
+       };
+
+       d.safeMixin = safeMixin;
+
+       /*=====
+       dojo.declare = function(className, superclass, props){
+               //      summary:
+               //              Create a feature-rich constructor from compact notation.
+               //      className: String?:
+               //              The optional name of the constructor (loosely, a "class")
+               //              stored in the "declaredClass" property in the created prototype.
+               //              It will be used as a global name for a created constructor.
+               //      superclass: Function|Function[]:
+               //              May be null, a Function, or an Array of Functions. This argument
+               //              specifies a list of bases (the left-most one is the most deepest
+               //              base).
+               //      props: Object:
+               //              An object whose properties are copied to the created prototype.
+               //              Add an instance-initialization function by making it a property
+               //              named "constructor".
+               //      returns:
+               //              New constructor function.
+               //      description:
+               //              Create a constructor using a compact notation for inheritance and
+               //              prototype extension.
+               //
+               //              Mixin ancestors provide a type of multiple inheritance.
+               //              Prototypes of mixin ancestors are copied to the new class:
+               //              changes to mixin prototypes will not affect classes to which
+               //              they have been mixed in.
+               //
+               //              Ancestors can be compound classes created by this version of
+               //              dojo.declare. In complex cases all base classes are going to be
+               //              linearized according to C3 MRO algorithm
+               //              (see http://www.python.org/download/releases/2.3/mro/ for more
+               //              details).
+               //
+               //              "className" is cached in "declaredClass" property of the new class,
+               //              if it was supplied. The immediate super class will be cached in
+               //              "superclass" property of the new class.
+               //
+               //              Methods in "props" will be copied and modified: "nom" property
+               //              (the declared name of the method) will be added to all copied
+               //              functions to help identify them for the internal machinery. Be
+               //              very careful, while reusing methods: if you use the same
+               //              function under different names, it can produce errors in some
+               //              cases.
+               //
+               //              It is possible to use constructors created "manually" (without
+               //              dojo.declare) as bases. They will be called as usual during the
+               //              creation of an instance, their methods will be chained, and even
+               //              called by "this.inherited()".
+               //
+               //              Special property "-chains-" governs how to chain methods. It is
+               //              a dictionary, which uses method names as keys, and hint strings
+               //              as values. If a hint string is "after", this method will be
+               //              called after methods of its base classes. If a hint string is
+               //              "before", this method will be called before methods of its base
+               //              classes.
+               //
+               //              If "constructor" is not mentioned in "-chains-" property, it will
+               //              be chained using the legacy mode: using "after" chaining,
+               //              calling preamble() method before each constructor, if available,
+               //              and calling postscript() after all constructors were executed.
+               //              If the hint is "after", it is chained as a regular method, but
+               //              postscript() will be called after the chain of constructors.
+               //              "constructor" cannot be chained "before", but it allows
+               //              a special hint string: "manual", which means that constructors
+               //              are not going to be chained in any way, and programmer will call
+               //              them manually using this.inherited(). In the latter case
+               //              postscript() will be called after the construction.
+               //
+               //              All chaining hints are "inherited" from base classes and
+               //              potentially can be overridden. Be very careful when overriding
+               //              hints! Make sure that all chained methods can work in a proposed
+               //              manner of chaining.
+               //
+               //              Once a method was chained, it is impossible to unchain it. The
+               //              only exception is "constructor". You don't need to define a
+               //              method in order to supply a chaining hint.
+               //
+               //              If a method is chained, it cannot use this.inherited() because
+               //              all other methods in the hierarchy will be called automatically.
+               //
+               //              Usually constructors and initializers of any kind are chained
+               //              using "after" and destructors of any kind are chained as
+               //              "before". Note that chaining assumes that chained methods do not
+               //              return any value: any returned value will be discarded.
+               //
+               //      example:
+               //      |       dojo.declare("my.classes.bar", my.classes.foo, {
+               //      |               // properties to be added to the class prototype
+               //      |               someValue: 2,
+               //      |               // initialization function
+               //      |               constructor: function(){
+               //      |                       this.myComplicatedObject = new ReallyComplicatedObject();
+               //      |               },
+               //      |               // other functions
+               //      |               someMethod: function(){
+               //      |                       doStuff();
+               //      |               }
+               //      |       });
+               //
+               //      example:
+               //      |       var MyBase = dojo.declare(null, {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |       var MyClass1 = dojo.declare(MyBase, {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |       var MyClass2 = dojo.declare(MyBase, {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |       var MyDiamond = dojo.declare([MyClass1, MyClass2], {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //
+               //      example:
+               //      |       var F = function(){ console.log("raw constructor"); };
+               //      |       F.prototype.method = function(){
+               //      |               console.log("raw method");
+               //      |       };
+               //      |       var A = dojo.declare(F, {
+               //      |               constructor: function(){
+               //      |                       console.log("A.constructor");
+               //      |               },
+               //      |               method: function(){
+               //      |                       console.log("before calling F.method...");
+               //      |                       this.inherited(arguments);
+               //      |                       console.log("...back in A");
+               //      |               }
+               //      |       });
+               //      |       new A().method();
+               //      |       // will print:
+               //      |       // raw constructor
+               //      |       // A.constructor
+               //      |       // before calling F.method...
+               //      |       // raw method
+               //      |       // ...back in A
+               //
+               //      example:
+               //      |       var A = dojo.declare(null, {
+               //      |               "-chains-": {
+               //      |                       destroy: "before"
+               //      |               }
+               //      |       });
+               //      |       var B = dojo.declare(A, {
+               //      |               constructor: function(){
+               //      |                       console.log("B.constructor");
+               //      |               },
+               //      |               destroy: function(){
+               //      |                       console.log("B.destroy");
+               //      |               }
+               //      |       });
+               //      |       var C = dojo.declare(B, {
+               //      |               constructor: function(){
+               //      |                       console.log("C.constructor");
+               //      |               },
+               //      |               destroy: function(){
+               //      |                       console.log("C.destroy");
+               //      |               }
+               //      |       });
+               //      |       new C().destroy();
+               //      |       // prints:
+               //      |       // B.constructor
+               //      |       // C.constructor
+               //      |       // C.destroy
+               //      |       // B.destroy
+               //
+               //      example:
+               //      |       var A = dojo.declare(null, {
+               //      |               "-chains-": {
+               //      |                       constructor: "manual"
+               //      |               }
+               //      |       });
+               //      |       var B = dojo.declare(A, {
+               //      |               constructor: function(){
+               //      |                       // ...
+               //      |                       // call the base constructor with new parameters
+               //      |                       this.inherited(arguments, [1, 2, 3]);
+               //      |                       // ...
+               //      |               }
+               //      |       });
+               //
+               //      example:
+               //      |       var A = dojo.declare(null, {
+               //      |               "-chains-": {
+               //      |                       m1: "before"
+               //      |               },
+               //      |               m1: function(){
+               //      |                       console.log("A.m1");
+               //      |               },
+               //      |               m2: function(){
+               //      |                       console.log("A.m2");
+               //      |               }
+               //      |       });
+               //      |       var B = dojo.declare(A, {
+               //      |               "-chains-": {
+               //      |                       m2: "after"
+               //      |               },
+               //      |               m1: function(){
+               //      |                       console.log("B.m1");
+               //      |               },
+               //      |               m2: function(){
+               //      |                       console.log("B.m2");
+               //      |               }
+               //      |       });
+               //      |       var x = new B();
+               //      |       x.m1();
+               //      |       // prints:
+               //      |       // B.m1
+               //      |       // A.m1
+               //      |       x.m2();
+               //      |       // prints:
+               //      |       // A.m2
+               //      |       // B.m2
+               return new Function(); // Function
+       };
+       =====*/
+
+       /*=====
+       dojo.safeMixin = function(target, source){
+               //      summary:
+               //              Mix in properties skipping a constructor and decorating functions
+               //              like it is done by dojo.declare.
+               //      target: Object
+               //              Target object to accept new properties.
+               //      source: Object
+               //              Source object for new properties.
+               //      description:
+               //              This function is used to mix in properties like dojo._mixin does,
+               //              but it skips a constructor property and decorates functions like
+               //              dojo.declare does.
+               //
+               //              It is meant to be used with classes and objects produced with
+               //              dojo.declare. Functions mixed in with dojo.safeMixin can use
+               //              this.inherited() like normal methods.
+               //
+               //              This function is used to implement extend() method of a constructor
+               //              produced with dojo.declare().
+               //
+               //      example:
+               //      |       var A = dojo.declare(null, {
+               //      |               m1: function(){
+               //      |                       console.log("A.m1");
+               //      |               },
+               //      |               m2: function(){
+               //      |                       console.log("A.m2");
+               //      |               }
+               //      |       });
+               //      |       var B = dojo.declare(A, {
+               //      |               m1: function(){
+               //      |                       this.inherited(arguments);
+               //      |                       console.log("B.m1");
+               //      |               }
+               //      |       });
+               //      |       B.extend({
+               //      |               m2: function(){
+               //      |                       this.inherited(arguments);
+               //      |                       console.log("B.m2");
+               //      |               }
+               //      |       });
+               //      |       var x = new B();
+               //      |       dojo.safeMixin(x, {
+               //      |               m1: function(){
+               //      |                       this.inherited(arguments);
+               //      |                       console.log("X.m1");
+               //      |               },
+               //      |               m2: function(){
+               //      |                       this.inherited(arguments);
+               //      |                       console.log("X.m2");
+               //      |               }
+               //      |       });
+               //      |       x.m2();
+               //      |       // prints:
+               //      |       // A.m1
+               //      |       // B.m1
+               //      |       // X.m1
+       };
+       =====*/
+
+       /*=====
+       Object.inherited = function(name, args, newArgs){
+               //      summary:
+               //              Calls a super method.
+               //      name: String?
+               //              The optional method name. Should be the same as the caller's
+               //              name. Usually "name" is specified in complex dynamic cases, when
+               //              the calling method was dynamically added, undecorated by
+               //              dojo.declare, and it cannot be determined.
+               //      args: Arguments
+               //              The caller supply this argument, which should be the original
+               //              "arguments".
+               //      newArgs: Object?
+               //              If "true", the found function will be returned without
+               //              executing it.
+               //              If Array, it will be used to call a super method. Otherwise
+               //              "args" will be used.
+               //      returns:
+               //              Whatever is returned by a super method, or a super method itself,
+               //              if "true" was specified as newArgs.
+               //      description:
+               //              This method is used inside method of classes produced with
+               //              dojo.declare to call a super method (next in the chain). It is
+               //              used for manually controlled chaining. Consider using the regular
+               //              chaining, because it is faster. Use "this.inherited()" only in
+               //              complex cases.
+               //
+               //              This method cannot me called from automatically chained
+               //              constructors including the case of a special (legacy)
+               //              constructor chaining. It cannot be called from chained methods.
+               //
+               //              If "this.inherited()" cannot find the next-in-chain method, it
+               //              does nothing and returns "undefined". The last method in chain
+               //              can be a default method implemented in Object, which will be
+               //              called last.
+               //
+               //              If "name" is specified, it is assumed that the method that
+               //              received "args" is the parent method for this call. It is looked
+               //              up in the chain list and if it is found the next-in-chain method
+               //              is called. If it is not found, the first-in-chain method is
+               //              called.
+               //
+               //              If "name" is not specified, it will be derived from the calling
+               //              method (using a methoid property "nom").
+               //
+               //      example:
+               //      |       var B = dojo.declare(A, {
+               //      |               method1: function(a, b, c){
+               //      |                       this.inherited(arguments);
+               //      |               },
+               //      |               method2: function(a, b){
+               //      |                       return this.inherited(arguments, [a + b]);
+               //      |               }
+               //      |       });
+               //      |       // next method is not in the chain list because it is added
+               //      |       // manually after the class was created.
+               //      |       B.prototype.method3 = function(){
+               //      |               console.log("This is a dynamically-added method.");
+               //      |               this.inherited("method3", arguments);
+               //      |       };
+               //      example:
+               //      |       var B = dojo.declare(A, {
+               //      |               method: function(a, b){
+               //      |                       var super = this.inherited(arguments, true);
+               //      |                       // ...
+               //      |                       if(!super){
+               //      |                               console.log("there is no super method");
+               //      |                               return 0;
+               //      |                       }
+               //      |                       return super.apply(this, arguments);
+               //      |               }
+               //      |       });
+               return  {};     // Object
+       }
+       =====*/
+
+       /*=====
+       Object.getInherited = function(name, args){
+               //      summary:
+               //              Returns a super method.
+               //      name: String?
+               //              The optional method name. Should be the same as the caller's
+               //              name. Usually "name" is specified in complex dynamic cases, when
+               //              the calling method was dynamically added, undecorated by
+               //              dojo.declare, and it cannot be determined.
+               //      args: Arguments
+               //              The caller supply this argument, which should be the original
+               //              "arguments".
+               //      returns:
+               //              Returns a super method (Function) or "undefined".
+               //      description:
+               //              This method is a convenience method for "this.inherited()".
+               //              It uses the same algorithm but instead of executing a super
+               //              method, it returns it, or "undefined" if not found.
+               //
+               //      example:
+               //      |       var B = dojo.declare(A, {
+               //      |               method: function(a, b){
+               //      |                       var super = this.getInherited(arguments);
+               //      |                       // ...
+               //      |                       if(!super){
+               //      |                               console.log("there is no super method");
+               //      |                               return 0;
+               //      |                       }
+               //      |                       return super.apply(this, arguments);
+               //      |               }
+               //      |       });
+               return  {};     // Object
+       }
+       =====*/
+
+       /*=====
+       Object.isInstanceOf = function(cls){
+               //      summary:
+               //              Checks the inheritance cahin to see if it is inherited from this
+               //              class.
+               //      cls: Function
+               //              Class constructor.
+               //      returns:
+               //              "true", if this object is inherited from this class, "false"
+               //              otherwise.
+               //      description:
+               //              This method is used with instances of classes produced with
+               //              dojo.declare to determine of they support a certain interface or
+               //              not. It models "instanceof" operator.
+               //
+               //      example:
+               //      |       var A = dojo.declare(null, {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |       var B = dojo.declare(null, {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |       var C = dojo.declare([A, B], {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |       var D = dojo.declare(A, {
+               //      |               // constructor, properties, and methods go here
+               //      |               // ...
+               //      |       });
+               //      |
+               //      |       var a = new A(), b = new B(), c = new C(), d = new D();
+               //      |
+               //      |       console.log(a.isInstanceOf(A)); // true
+               //      |       console.log(b.isInstanceOf(A)); // false
+               //      |       console.log(c.isInstanceOf(A)); // true
+               //      |       console.log(d.isInstanceOf(A)); // true
+               //      |
+               //      |       console.log(a.isInstanceOf(B)); // false
+               //      |       console.log(b.isInstanceOf(B)); // true
+               //      |       console.log(c.isInstanceOf(B)); // true
+               //      |       console.log(d.isInstanceOf(B)); // false
+               //      |
+               //      |       console.log(a.isInstanceOf(C)); // false
+               //      |       console.log(b.isInstanceOf(C)); // false
+               //      |       console.log(c.isInstanceOf(C)); // true
+               //      |       console.log(d.isInstanceOf(C)); // false
+               //      |
+               //      |       console.log(a.isInstanceOf(D)); // false
+               //      |       console.log(b.isInstanceOf(D)); // false
+               //      |       console.log(c.isInstanceOf(D)); // false
+               //      |       console.log(d.isInstanceOf(D)); // true
+               return  {};     // Object
+       }
+       =====*/
+
+       /*=====
+       Object.extend = function(source){
+               //      summary:
+               //              Adds all properties and methods of source to constructor's
+               //              prototype, making them available to all instances created with
+               //              constructor. This method is specific to constructors created with
+               //              dojo.declare.
+               //      source: Object
+               //              Source object which properties are going to be copied to the
+               //              constructor's prototype.
+               //      description:
+               //              Adds source properties to the constructor's prototype. It can
+               //              override existing properties.
+               //
+               //              This method is similar to dojo.extend function, but it is specific
+               //              to constructors produced by dojo.declare. It is implemented
+               //              using dojo.safeMixin, and it skips a constructor property,
+               //              and properly decorates copied functions.
+               //
+               //      example:
+               //      |       var A = dojo.declare(null, {
+               //      |               m1: function(){},
+               //      |               s1: "Popokatepetl"
+               //      |       });
+               //      |       A.extend({
+               //      |               m1: function(){},
+               //      |               m2: function(){},
+               //      |               f1: true,
+               //      |               d1: 42
+               //      |       });
+       };
+       =====*/
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base.connect"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.connect"] = true;
+dojo.provide("dojo._base.connect");
+
+
+// this file courtesy of the TurboAjax Group, licensed under a Dojo CLA
+
+// low-level delegation machinery
+dojo._listener = {
+       // create a dispatcher function
+       getDispatcher: function(){
+               // following comments pulled out-of-line to prevent cloning them 
+               // in the returned function.
+               // - indices (i) that are really in the array of listeners (ls) will 
+               //   not be in Array.prototype. This is the 'sparse array' trick
+               //   that keeps us safe from libs that take liberties with built-in 
+               //   objects
+               // - listener is invoked with current scope (this)
+               return function(){
+                       var ap=Array.prototype, c=arguments.callee, ls=c._listeners, t=c.target;
+                       // return value comes from original target function
+                       var r = t && t.apply(this, arguments);
+                       // make local copy of listener array so it is immutable during processing
+                       var lls;
+                                                                                       lls = [].concat(ls);
+                                                       
+                       // invoke listeners after target function
+                       for(var i in lls){
+                               if(!(i in ap)){
+                                       lls[i].apply(this, arguments);
+                               }
+                       }
+                       // return value comes from original target function
+                       return r;
+               }
+       },
+       // add a listener to an object
+       add: function(/*Object*/ source, /*String*/ method, /*Function*/ listener){
+               // Whenever 'method' is invoked, 'listener' will have the same scope.
+               // Trying to supporting a context object for the listener led to 
+               // complexity. 
+               // Non trivial to provide 'once' functionality here
+               // because listener could be the result of a dojo.hitch call,
+               // in which case two references to the same hitch target would not
+               // be equivalent. 
+               source = source || dojo.global;
+               // The source method is either null, a dispatcher, or some other function
+               var f = source[method];
+               // Ensure a dispatcher
+               if(!f||!f._listeners){
+                       var d = dojo._listener.getDispatcher();
+                       // original target function is special
+                       d.target = f;
+                       // dispatcher holds a list of listeners
+                       d._listeners = []; 
+                       // redirect source to dispatcher
+                       f = source[method] = d;
+               }
+               // The contract is that a handle is returned that can 
+               // identify this listener for disconnect. 
+               //
+               // The type of the handle is private. Here is it implemented as Integer. 
+               // DOM event code has this same contract but handle is Function 
+               // in non-IE browsers.
+               //
+               // We could have separate lists of before and after listeners.
+               return f._listeners.push(listener) ; /*Handle*/
+       },
+       // remove a listener from an object
+       remove: function(/*Object*/ source, /*String*/ method, /*Handle*/ handle){
+               var f = (source||dojo.global)[method];
+               // remember that handle is the index+1 (0 is not a valid handle)
+               if(f && f._listeners && handle--){
+                       delete f._listeners[handle];
+               }
+       }
+};
+
+// Multiple delegation for arbitrary methods.
+
+// This unit knows nothing about DOM, but we include DOM aware documentation
+// and dontFix argument here to help the autodocs. Actual DOM aware code is in
+// event.js.
+
+dojo.connect = function(/*Object|null*/ obj, 
+                                               /*String*/ event, 
+                                               /*Object|null*/ context, 
+                                               /*String|Function*/ method,
+                                               /*Boolean?*/ dontFix){
+       // summary:
+       //              `dojo.connect` is the core event handling and delegation method in
+       //              Dojo. It allows one function to "listen in" on the execution of
+       //              any other, triggering the second whenever the first is called. Many
+       //              listeners may be attached to a function, and source functions may
+       //              be either regular function calls or DOM events.
+       //
+       // description:
+       //              Connects listeners to actions, so that after event fires, a
+       //              listener is called with the same arguments passed to the orginal
+       //              function.
+       //
+       //              Since `dojo.connect` allows the source of events to be either a
+       //              "regular" JavaScript function or a DOM event, it provides a uniform
+       //              interface for listening to all the types of events that an
+       //              application is likely to deal with though a single, unified
+       //              interface. DOM programmers may want to think of it as
+       //              "addEventListener for everything and anything".
+       //
+       //              When setting up a connection, the `event` parameter must be a
+       //              string that is the name of the method/event to be listened for. If
+       //              `obj` is null, `dojo.global` is assumed, meaning that connections
+       //              to global methods are supported but also that you may inadvertantly
+       //              connect to a global by passing an incorrect object name or invalid
+       //              reference.
+       //
+       //              `dojo.connect` generally is forgiving. If you pass the name of a
+       //              function or method that does not yet exist on `obj`, connect will
+       //              not fail, but will instead set up a stub method. Similarly, null
+       //              arguments may simply be omitted such that fewer than 4 arguments
+       //              may be required to set up a connection See the examples for deails.
+       //
+       //              The return value is a handle that is needed to 
+       //              remove this connection with `dojo.disconnect`.
+       //
+       // obj: 
+       //              The source object for the event function. 
+       //              Defaults to `dojo.global` if null.
+       //              If obj is a DOM node, the connection is delegated 
+       //              to the DOM event manager (unless dontFix is true).
+       //
+       // event:
+       //              String name of the event function in obj. 
+       //              I.e. identifies a property `obj[event]`.
+       //
+       // context: 
+       //              The object that method will receive as "this".
+       //
+       //              If context is null and method is a function, then method
+       //              inherits the context of event.
+       //      
+       //              If method is a string then context must be the source 
+       //              object object for method (context[method]). If context is null,
+       //              dojo.global is used.
+       //
+       // method:
+       //              A function reference, or name of a function in context. 
+       //              The function identified by method fires after event does. 
+       //              method receives the same arguments as the event.
+       //              See context argument comments for information on method's scope.
+       //
+       // dontFix:
+       //              If obj is a DOM node, set dontFix to true to prevent delegation 
+       //              of this connection to the DOM event manager.
+       //
+       // example:
+       //              When obj.onchange(), do ui.update():
+       //      |       dojo.connect(obj, "onchange", ui, "update");
+       //      |       dojo.connect(obj, "onchange", ui, ui.update); // same
+       //
+       // example:
+       //              Using return value for disconnect:
+       //      |       var link = dojo.connect(obj, "onchange", ui, "update");
+       //      |       ...
+       //      |       dojo.disconnect(link);
+       //
+       // example:
+       //              When onglobalevent executes, watcher.handler is invoked:
+       //      |       dojo.connect(null, "onglobalevent", watcher, "handler");
+       //
+       // example:
+       //              When ob.onCustomEvent executes, customEventHandler is invoked:
+       //      |       dojo.connect(ob, "onCustomEvent", null, "customEventHandler");
+       //      |       dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same
+       //
+       // example:
+       //              When ob.onCustomEvent executes, customEventHandler is invoked
+       //              with the same scope (this):
+       //      |       dojo.connect(ob, "onCustomEvent", null, customEventHandler);
+       //      |       dojo.connect(ob, "onCustomEvent", customEventHandler); // same
+       //
+       // example:
+       //              When globalEvent executes, globalHandler is invoked
+       //              with the same scope (this):
+       //      |       dojo.connect(null, "globalEvent", null, globalHandler);
+       //      |       dojo.connect("globalEvent", globalHandler); // same
+
+       // normalize arguments
+       var a=arguments, args=[], i=0;
+       // if a[0] is a String, obj was ommited
+       args.push(dojo.isString(a[0]) ? null : a[i++], a[i++]);
+       // if the arg-after-next is a String or Function, context was NOT omitted
+       var a1 = a[i+1];
+       args.push(dojo.isString(a1)||dojo.isFunction(a1) ? a[i++] : null, a[i++]);
+       // absorb any additional arguments
+       for(var l=a.length; i<l; i++){  args.push(a[i]); }
+       // do the actual work
+       return dojo._connect.apply(this, args); /*Handle*/
+}
+
+// used by non-browser hostenvs. always overriden by event.js
+dojo._connect = function(obj, event, context, method){
+       var l=dojo._listener, h=l.add(obj, event, dojo.hitch(context, method)); 
+       return [obj, event, h, l]; // Handle
+}
+
+dojo.disconnect = function(/*Handle*/ handle){
+       // summary:
+       //              Remove a link created by dojo.connect.
+       // description:
+       //              Removes the connection between event and the method referenced by handle.
+       // handle:
+       //              the return value of the dojo.connect call that created the connection.
+       if(handle && handle[0] !== undefined){
+               dojo._disconnect.apply(this, handle);
+               // let's not keep this reference
+               delete handle[0];
+       }
+}
+
+dojo._disconnect = function(obj, event, handle, listener){
+       listener.remove(obj, event, handle);
+}
+
+// topic publish/subscribe
+
+dojo._topics = {};
+
+dojo.subscribe = function(/*String*/ topic, /*Object|null*/ context, /*String|Function*/ method){
+       //      summary:
+       //              Attach a listener to a named topic. The listener function is invoked whenever the
+       //              named topic is published (see: dojo.publish).
+       //              Returns a handle which is needed to unsubscribe this listener.
+       //      context:
+       //              Scope in which method will be invoked, or null for default scope.
+       //      method:
+       //              The name of a function in context, or a function reference. This is the function that
+       //              is invoked when topic is published.
+       //      example:
+       //      |       dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); });
+       //      |       dojo.publish("alerts", [ "read this", "hello world" ]);                                                                                                                                 
+
+       // support for 2 argument invocation (omitting context) depends on hitch
+       return [topic, dojo._listener.add(dojo._topics, topic, dojo.hitch(context, method))]; /*Handle*/
+}
+
+dojo.unsubscribe = function(/*Handle*/ handle){
+       //      summary:
+       //              Remove a topic listener. 
+       //      handle:
+       //              The handle returned from a call to subscribe.
+       //      example:
+       //      |       var alerter = dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); };
+       //      |       ...
+       //      |       dojo.unsubscribe(alerter);
+       if(handle){
+               dojo._listener.remove(dojo._topics, handle[0], handle[1]);
+       }
+}
+
+dojo.publish = function(/*String*/ topic, /*Array*/ args){
+       //      summary:
+       //              Invoke all listener method subscribed to topic.
+       //      topic:
+       //              The name of the topic to publish.
+       //      args:
+       //              An array of arguments. The arguments will be applied 
+       //              to each topic subscriber (as first class parameters, via apply).
+       //      example:
+       //      |       dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); };
+       //      |       dojo.publish("alerts", [ "read this", "hello world" ]); 
+
+       // Note that args is an array, which is more efficient vs variable length
+       // argument list.  Ideally, var args would be implemented via Array
+       // throughout the APIs.
+       var f = dojo._topics[topic];
+       if(f){
+               f.apply(this, args||[]);
+       }
+}
+
+dojo.connectPublisher = function(      /*String*/ topic, 
+                                                                       /*Object|null*/ obj, 
+                                                                       /*String*/ event){
+       //      summary:
+       //              Ensure that everytime obj.event() is called, a message is published
+       //              on the topic. Returns a handle which can be passed to
+       //              dojo.disconnect() to disable subsequent automatic publication on
+       //              the topic.
+       //      topic:
+       //              The name of the topic to publish.
+       //      obj: 
+       //              The source object for the event function. Defaults to dojo.global
+       //              if null.
+       //      event:
+       //              The name of the event function in obj. 
+       //              I.e. identifies a property obj[event].
+       //      example:
+       //      |       dojo.connectPublisher("/ajax/start", dojo, "xhrGet");
+       var pf = function(){ dojo.publish(topic, arguments); }
+       return (event) ? dojo.connect(obj, event, pf) : dojo.connect(obj, pf); //Handle
+};
+
+}
+
+if(!dojo._hasResource["dojo._base.Deferred"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.Deferred"] = true;
+dojo.provide("dojo._base.Deferred");
+
+
+dojo.Deferred = function(/*Function?*/ canceller){
+       // summary:
+       //              Encapsulates a sequence of callbacks in response to a value that
+       //              may not yet be available.  This is modeled after the Deferred class
+       //              from Twisted <http://twistedmatrix.com>.
+       // description:
+       //              JavaScript has no threads, and even if it did, threads are hard.
+       //              Deferreds are a way of abstracting non-blocking events, such as the
+       //              final response to an XMLHttpRequest. Deferreds create a promise to
+       //              return a response a some point in the future and an easy way to
+       //              register your interest in receiving that response.
+       //
+       //              The most important methods for Deffered users are:
+       //
+       //                      * addCallback(handler)
+       //                      * addErrback(handler)
+       //                      * callback(result)
+       //                      * errback(result)
+       //
+       //              In general, when a function returns a Deferred, users then "fill
+       //              in" the second half of the contract by registering callbacks and
+       //              error handlers. You may register as many callback and errback
+       //              handlers as you like and they will be executed in the order
+       //              registered when a result is provided. Usually this result is
+       //              provided as the result of an asynchronous operation. The code
+       //              "managing" the Deferred (the code that made the promise to provide
+       //              an answer later) will use the callback() and errback() methods to
+       //              communicate with registered listeners about the result of the
+       //              operation. At this time, all registered result handlers are called
+       //              *with the most recent result value*.
+       //
+       //              Deferred callback handlers are treated as a chain, and each item in
+       //              the chain is required to return a value that will be fed into
+       //              successive handlers. The most minimal callback may be registered
+       //              like this:
+       //
+       //              |       var d = new dojo.Deferred();
+       //              |       d.addCallback(function(result){ return result; });
+       //
+       //              Perhaps the most common mistake when first using Deferreds is to
+       //              forget to return a value (in most cases, the value you were
+       //              passed).
+       //
+       //              The sequence of callbacks is internally represented as a list of
+       //              2-tuples containing the callback/errback pair.  For example, the
+       //              following call sequence:
+       //              
+       //              |       var d = new dojo.Deferred();
+       //              |       d.addCallback(myCallback);
+       //              |       d.addErrback(myErrback);
+       //              |       d.addBoth(myBoth);
+       //              |       d.addCallbacks(myCallback, myErrback);
+       //
+       //              is translated into a Deferred with the following internal
+       //              representation:
+       //
+       //              |       [
+       //              |               [myCallback, null],
+       //              |               [null, myErrback],
+       //              |               [myBoth, myBoth],
+       //              |               [myCallback, myErrback]
+       //              |       ]
+       //
+       //              The Deferred also keeps track of its current status (fired).  Its
+       //              status may be one of three things:
+       //
+       //                      * -1: no value yet (initial condition)
+       //                      * 0: success
+       //                      * 1: error
+       //      
+       //              A Deferred will be in the error state if one of the following three
+       //              conditions are met:
+       //
+       //                      1. The result given to callback or errback is "instanceof" Error
+       //                      2. The previous callback or errback raised an exception while
+       //                         executing
+       //                      3. The previous callback or errback returned a value
+       //                         "instanceof" Error
+       //
+       //              Otherwise, the Deferred will be in the success state. The state of
+       //              the Deferred determines the next element in the callback sequence
+       //              to run.
+       //
+       //              When a callback or errback occurs with the example deferred chain,
+       //              something equivalent to the following will happen (imagine
+       //              that exceptions are caught and returned):
+       //
+       //              |       // d.callback(result) or d.errback(result)
+       //              |       if(!(result instanceof Error)){
+       //              |               result = myCallback(result);
+       //              |       }
+       //              |       if(result instanceof Error){
+       //              |               result = myErrback(result);
+       //              |       }
+       //              |       result = myBoth(result);
+       //              |       if(result instanceof Error){
+       //              |               result = myErrback(result);
+       //              |       }else{
+       //              |               result = myCallback(result);
+       //              |       }
+       //
+       //              The result is then stored away in case another step is added to the
+       //              callback sequence.      Since the Deferred already has a value
+       //              available, any new callbacks added will be called immediately.
+       //
+       //              There are two other "advanced" details about this implementation
+       //              that are useful:
+       //
+       //              Callbacks are allowed to return Deferred instances themselves, so
+       //              you can build complicated sequences of events with ease.
+       //
+       //              The creator of the Deferred may specify a canceller.  The canceller
+       //              is a function that will be called if Deferred.cancel is called
+       //              before the Deferred fires. You can use this to implement clean
+       //              aborting of an XMLHttpRequest, etc. Note that cancel will fire the
+       //              deferred with a CancelledError (unless your canceller returns
+       //              another kind of error), so the errbacks should be prepared to
+       //              handle that error for cancellable Deferreds.
+       // example:
+       //      |       var deferred = new dojo.Deferred();
+       //      |       setTimeout(function(){ deferred.callback({success: true}); }, 1000);
+       //      |       return deferred;
+       // example:
+       //              Deferred objects are often used when making code asynchronous. It
+       //              may be easiest to write functions in a synchronous manner and then
+       //              split code using a deferred to trigger a response to a long-lived
+       //              operation. For example, instead of register a callback function to
+       //              denote when a rendering operation completes, the function can
+       //              simply return a deferred:
+       //
+       //              |       // callback style:
+       //              |       function renderLotsOfData(data, callback){
+       //              |               var success = false
+       //              |               try{
+       //              |                       for(var x in data){
+       //              |                               renderDataitem(data[x]);
+       //              |                       }
+       //              |                       success = true;
+       //              |               }catch(e){ }
+       //              |               if(callback){
+       //              |                       callback(success);
+       //              |               }
+       //              |       }
+       //
+       //              |       // using callback style
+       //              |       renderLotsOfData(someDataObj, function(success){
+       //              |               // handles success or failure
+       //              |               if(!success){
+       //              |                       promptUserToRecover();
+       //              |               }
+       //              |       });
+       //              |       // NOTE: no way to add another callback here!!
+       // example:
+       //              Using a Deferred doesn't simplify the sending code any, but it
+       //              provides a standard interface for callers and senders alike,
+       //              providing both with a simple way to service multiple callbacks for
+       //              an operation and freeing both sides from worrying about details
+       //              such as "did this get called already?". With Deferreds, new
+       //              callbacks can be added at any time.
+       //
+       //              |       // Deferred style:
+       //              |       function renderLotsOfData(data){
+       //              |               var d = new dojo.Deferred();
+       //              |               try{
+       //              |                       for(var x in data){
+       //              |                               renderDataitem(data[x]);
+       //              |                       }
+       //              |                       d.callback(true);
+       //              |               }catch(e){ 
+       //              |                       d.errback(new Error("rendering failed"));
+       //              |               }
+       //              |               return d;
+       //              |       }
+       //
+       //              |       // using Deferred style
+       //              |       renderLotsOfData(someDataObj).addErrback(function(){
+       //              |               promptUserToRecover();
+       //              |       });
+       //              |       // NOTE: addErrback and addCallback both return the Deferred
+       //              |       // again, so we could chain adding callbacks or save the
+       //              |       // deferred for later should we need to be notified again.
+       // example:
+       //              In this example, renderLotsOfData is syncrhonous and so both
+       //              versions are pretty artificial. Putting the data display on a
+       //              timeout helps show why Deferreds rock:
+       //
+       //              |       // Deferred style and async func
+       //              |       function renderLotsOfData(data){
+       //              |               var d = new dojo.Deferred();
+       //              |               setTimeout(function(){
+       //              |                       try{
+       //              |                               for(var x in data){
+       //              |                                       renderDataitem(data[x]);
+       //              |                               }
+       //              |                               d.callback(true);
+       //              |                       }catch(e){ 
+       //              |                               d.errback(new Error("rendering failed"));
+       //              |                       }
+       //              |               }, 100);
+       //              |               return d;
+       //              |       }
+       //
+       //              |       // using Deferred style
+       //              |       renderLotsOfData(someDataObj).addErrback(function(){
+       //              |               promptUserToRecover();
+       //              |       });
+       //
+       //              Note that the caller doesn't have to change his code at all to
+       //              handle the asynchronous case.
+
+       this.chain = [];
+       this.id = this._nextId();
+       this.fired = -1;
+       this.paused = 0;
+       this.results = [null, null];
+       this.canceller = canceller;
+       this.silentlyCancelled = false;
+       this.isFiring = false;
+};
+
+dojo.extend(dojo.Deferred, {
+       /*
+       makeCalled: function(){
+               // summary:
+               //              returns a new, empty deferred, which is already in the called
+               //              state. Calling callback() or errback() on this deferred will
+               //              yeild an error and adding new handlers to it will result in
+               //              them being called immediately.
+               var deferred = new dojo.Deferred();
+               deferred.callback();
+               return deferred;
+       },
+
+       toString: function(){
+               var state;
+               if(this.fired == -1){
+                       state = 'unfired';
+               }else{
+                       state = this.fired ? 'success' : 'error';
+               }
+               return 'Deferred(' + this.id + ', ' + state + ')';
+       },
+       */
+
+       _nextId: (function(){
+               var n = 1;
+               return function(){ return n++; };
+       })(),
+
+       cancel: function(){
+               // summary:     
+               //              Cancels a Deferred that has not yet received a value, or is
+               //              waiting on another Deferred as its value.
+               // description:
+               //              If a canceller is defined, the canceller is called. If the
+               //              canceller did not return an error, or there was no canceller,
+               //              then the errback chain is started.
+               var err;
+               if(this.fired == -1){
+                       if(this.canceller){
+                               err = this.canceller(this);
+                       }else{
+                               this.silentlyCancelled = true;
+                       }
+                       if(this.fired == -1){
+                               if(!(err instanceof Error)){
+                                       var res = err;
+                                       var msg = "Deferred Cancelled";
+                                       if(err && err.toString){
+                                               msg += ": " + err.toString();
+                                       }
+                                       err = new Error(msg);
+                                       err.dojoType = "cancel";
+                                       err.cancelResult = res;
+                               }
+                               this.errback(err);
+                       }
+               }else if(       (this.fired == 0) &&
+                                       (this.results[0] instanceof dojo.Deferred)
+               ){
+                       this.results[0].cancel();
+               }
+       },
+                       
+
+       _resback: function(res){
+               // summary:
+               //              The private primitive that means either callback or errback
+               this.fired = ((res instanceof Error) ? 1 : 0);
+               this.results[this.fired] = res;
+               this._fire();
+       },
+
+       _check: function(){
+               if(this.fired != -1){
+                       if(!this.silentlyCancelled){
+                               throw new Error("already called!");
+                       }
+                       this.silentlyCancelled = false;
+                       return;
+               }
+       },
+
+       callback: function(res){
+               //      summary:        
+               //              Begin the callback sequence with a non-error value.
+               
+               /*
+               callback or errback should only be called once on a given
+               Deferred.
+               */
+               this._check();
+               this._resback(res);
+       },
+
+       errback: function(/*Error*/res){
+               //      summary: 
+               //              Begin the callback sequence with an error result.
+               this._check();
+               if(!(res instanceof Error)){
+                       res = new Error(res);
+               }
+               this._resback(res);
+       },
+
+       addBoth: function(/*Function|Object*/cb, /*String?*/cbfn){
+               //      summary:
+               //              Add the same function as both a callback and an errback as the
+               //              next element on the callback sequence.This is useful for code
+               //              that you want to guarantee to run, e.g. a finalizer.
+               var enclosed = dojo.hitch.apply(dojo, arguments);
+               return this.addCallbacks(enclosed, enclosed); // dojo.Deferred
+       },
+
+       addCallback: function(/*Function|Object*/cb, /*String?*/cbfn /*...*/){
+               //      summary: 
+               //              Add a single callback to the end of the callback sequence.
+               return this.addCallbacks(dojo.hitch.apply(dojo, arguments)); // dojo.Deferred
+       },
+
+       addErrback: function(cb, cbfn){
+               //      summary: 
+               //              Add a single callback to the end of the callback sequence.
+               return this.addCallbacks(null, dojo.hitch.apply(dojo, arguments)); // dojo.Deferred
+       },
+
+       addCallbacks: function(cb, eb){
+               // summary: 
+               //              Add separate callback and errback to the end of the callback
+               //              sequence.
+               this.chain.push([cb, eb])
+               if(this.fired >= 0 && !this.isFiring){
+                       this._fire();
+               }
+               return this; // dojo.Deferred
+       },
+
+       _fire: function(){
+               // summary: 
+               //              Used internally to exhaust the callback sequence when a result
+               //              is available.
+               this.isFiring = true;
+               var chain = this.chain;
+               var fired = this.fired;
+               var res = this.results[fired];
+               var self = this;
+               var cb = null;
+               while(
+                       (chain.length > 0) &&
+                       (this.paused == 0)
+               ){
+                       // Array
+                       var f = chain.shift()[fired];
+                       if(!f){ continue; }
+                       var func = function(){
+                               var ret = f(res);
+                               //If no response, then use previous response.
+                               if(typeof ret != "undefined"){
+                                       res = ret;
+                               }
+                               fired = ((res instanceof Error) ? 1 : 0);
+                               if(res instanceof dojo.Deferred){
+                                       cb = function(res){
+                                               self._resback(res);
+                                               // inlined from _pause()
+                                               self.paused--;
+                                               if(
+                                                       (self.paused == 0) && 
+                                                       (self.fired >= 0)
+                                               ){
+                                                       self._fire();
+                                               }
+                                       }
+                                       // inlined from _unpause
+                                       this.paused++;
+                               }
+                       };
+                       if(dojo.config.debugAtAllCosts){
+                               func.call(this);
+                       }else{
+                               try{
+                                       func.call(this);
+                               }catch(err){
+                                       fired = 1;
+                                       res = err;
+                               }
+                       }
+               }
+               this.fired = fired;
+               this.results[fired] = res;
+               this.isFiring = false;
+               if((cb)&&(this.paused)){
+                       // this is for "tail recursion" in case the dependent
+                       // deferred is already fired
+                       res.addBoth(cb);
+               }
+       }
+});
+
+}
+
+if(!dojo._hasResource["dojo._base.json"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.json"] = true;
+dojo.provide("dojo._base.json");
+
+dojo.fromJson = function(/*String*/ json){
+       // summary:
+       //              Parses a [JSON](http://json.org) string to return a JavaScript object.
+       // description:
+       //              Throws for invalid JSON strings, but it does not use a strict JSON parser. It
+       //              delegates to eval().
+       // json: 
+       //              a string literal of a JSON item, for instance:
+       //                      `'{ "foo": [ "bar", 1, { "baz": "thud" } ] }'`
+
+       return eval("(" + json + ")"); // Object
+}
+
+dojo._escapeString = function(/*String*/str){
+       //summary:
+       //              Adds escape sequences for non-visual characters, double quote and
+       //              backslash and surrounds with double quotes to form a valid string
+       //              literal.
+       return ('"' + str.replace(/(["\\])/g, '\\$1') + '"').
+               replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n").
+               replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r"); // string
+}
+
+dojo.toJsonIndentStr = "\t";
+dojo.toJson = function(/*Object*/ it, /*Boolean?*/ prettyPrint, /*String?*/ _indentStr){
+       //      summary:
+       //              Returns a [JSON](http://json.org) serialization of an object.
+       //      description:
+       //              Returns a [JSON](http://json.org) serialization of an object.
+       //              Note that this doesn't check for infinite recursion, so don't do that!
+       //      it:
+       //              an object to be serialized. Objects may define their own
+       //              serialization via a special "__json__" or "json" function
+       //              property. If a specialized serializer has been defined, it will
+       //              be used as a fallback.
+       //      prettyPrint:
+       //              if true, we indent objects and arrays to make the output prettier.
+       //              The variable `dojo.toJsonIndentStr` is used as the indent string --
+       //              to use something other than the default (tab), change that variable
+       //              before calling dojo.toJson().
+       //      _indentStr:
+       //              private variable for recursive calls when pretty printing, do not use.
+       //      example:
+       //              simple serialization of a trivial object
+       //              |       var jsonStr = dojo.toJson({ howdy: "stranger!", isStrange: true });
+       //              |       doh.is('{"howdy":"stranger!","isStrange":true}', jsonStr);
+       //      example:
+       //              a custom serializer for an objects of a particular class:
+       //              |       dojo.declare("Furby", null, {
+       //              |               furbies: "are strange",
+       //              |               furbyCount: 10,
+       //              |               __json__: function(){
+       //              |               },
+       //              |       });
+
+       if(it === undefined){
+               return "undefined";
+       }
+       var objtype = typeof it;
+       if(objtype == "number" || objtype == "boolean"){
+               return it + "";
+       }
+       if(it === null){
+               return "null";
+       }
+       if(dojo.isString(it)){ 
+               return dojo._escapeString(it); 
+       }
+       // recurse
+       var recurse = arguments.callee;
+       // short-circuit for objects that support "json" serialization
+       // if they return "self" then just pass-through...
+       var newObj;
+       _indentStr = _indentStr || "";
+       var nextIndent = prettyPrint ? _indentStr + dojo.toJsonIndentStr : "";
+       var tf = it.__json__||it.json;
+       if(dojo.isFunction(tf)){
+               newObj = tf.call(it);
+               if(it !== newObj){
+                       return recurse(newObj, prettyPrint, nextIndent);
+               }
+       }
+       if(it.nodeType && it.cloneNode){ // isNode
+               // we can't seriailize DOM nodes as regular objects because they have cycles
+               // DOM nodes could be serialized with something like outerHTML, but
+               // that can be provided by users in the form of .json or .__json__ function.
+               throw new Error("Can't serialize DOM nodes");
+       }
+
+       var sep = prettyPrint ? " " : "";
+       var newLine = prettyPrint ? "\n" : "";
+
+       // array
+       if(dojo.isArray(it)){
+               var res = dojo.map(it, function(obj){
+                       var val = recurse(obj, prettyPrint, nextIndent);
+                       if(typeof val != "string"){
+                               val = "undefined";
+                       }
+                       return newLine + nextIndent + val;
+               });
+               return "[" + res.join("," + sep) + newLine + _indentStr + "]";
+       }
+       /*
+       // look in the registry
+       try {
+               window.o = it;
+               newObj = dojo.json.jsonRegistry.match(it);
+               return recurse(newObj, prettyPrint, nextIndent);
+       }catch(e){
+               // console.log(e);
+       }
+       // it's a function with no adapter, skip it
+       */
+       if(objtype == "function"){
+               return null; // null
+       }
+       // generic object code path
+       var output = [], key;
+       for(key in it){
+               var keyStr, val;
+               if(typeof key == "number"){
+                       keyStr = '"' + key + '"';
+               }else if(typeof key == "string"){
+                       keyStr = dojo._escapeString(key);
+               }else{
+                       // skip non-string or number keys
+                       continue;
+               }
+               val = recurse(it[key], prettyPrint, nextIndent);
+               if(typeof val != "string"){
+                       // skip non-serializable values
+                       continue;
+               }
+               // FIXME: use += on Moz!!
+               //       MOW NOTE: using += is a pain because you have to account for the dangling comma...
+               output.push(newLine + nextIndent + keyStr + ":" + sep + val);
+       }
+       return "{" + output.join("," + sep) + newLine + _indentStr + "}"; // String
+}
+
+}
+
+if(!dojo._hasResource["dojo._base.Color"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.Color"] = true;
+dojo.provide("dojo._base.Color");
+
+
+
+(function(){
+
+       var d = dojo;
+
+       dojo.Color = function(/*Array|String|Object*/ color){
+               // summary:
+               //              Takes a named string, hex string, array of rgb or rgba values,
+               //              an object with r, g, b, and a properties, or another `dojo.Color` object
+               //              and creates a new Color instance to work from.
+               //
+               // example:
+               //              Work with a Color instance:
+               //       | var c = new dojo.Color();
+               //       | c.setColor([0,0,0]); // black
+               //       | var hex = c.toHex(); // #000000
+               //
+               // example:
+               //              Work with a node's color:
+               //       | var color = dojo.style("someNode", "backgroundColor");
+               //       | var n = new dojo.Color(color);
+               //       | // adjust the color some
+               //       | n.r *= .5;
+               //       | console.log(n.toString()); // rgb(128, 255, 255);
+               if(color){ this.setColor(color); }
+       };
+
+       // FIXME:
+       //      there's got to be a more space-efficient way to encode or discover
+       //      these!!  Use hex?
+       dojo.Color.named = {
+               black:      [0,0,0],
+               silver:     [192,192,192],
+               gray:       [128,128,128],
+               white:      [255,255,255],
+               maroon:         [128,0,0],
+               red:        [255,0,0],
+               purple:         [128,0,128],
+               fuchsia:        [255,0,255],
+               green:      [0,128,0],
+               lime:       [0,255,0],
+               olive:          [128,128,0],
+               yellow:         [255,255,0],
+               navy:       [0,0,128],
+               blue:       [0,0,255],
+               teal:           [0,128,128],
+               aqua:           [0,255,255],
+               transparent: d.config.transparentColor || [255,255,255]
+       };
+
+       dojo.extend(dojo.Color, {
+               r: 255, g: 255, b: 255, a: 1,
+               _set: function(r, g, b, a){
+                       var t = this; t.r = r; t.g = g; t.b = b; t.a = a;
+               },
+               setColor: function(/*Array|String|Object*/ color){
+                       // summary:
+                       //              Takes a named string, hex string, array of rgb or rgba values,
+                       //              an object with r, g, b, and a properties, or another `dojo.Color` object
+                       //              and sets this color instance to that value.
+                       //
+                       // example:
+                       //      |       var c = new dojo.Color(); // no color
+                       //      |       c.setColor("#ededed"); // greyish
+                       if(d.isString(color)){
+                               d.colorFromString(color, this);
+                       }else if(d.isArray(color)){
+                               d.colorFromArray(color, this);
+                       }else{
+                               this._set(color.r, color.g, color.b, color.a);
+                               if(!(color instanceof d.Color)){ this.sanitize(); }
+                       }
+                       return this;    // dojo.Color
+               },
+               sanitize: function(){
+                       // summary:
+                       //              Ensures the object has correct attributes
+                       // description:
+                       //              the default implementation does nothing, include dojo.colors to
+                       //              augment it with real checks
+                       return this;    // dojo.Color
+               },
+               toRgb: function(){
+                       // summary:
+                       //              Returns 3 component array of rgb values
+                       // example:
+                       //      |       var c = new dojo.Color("#000000");
+                       //      |       console.log(c.toRgb()); // [0,0,0]
+                       var t = this;
+                       return [t.r, t.g, t.b]; // Array
+               },
+               toRgba: function(){
+                       // summary:
+                       //              Returns a 4 component array of rgba values from the color
+                       //              represented by this object.
+                       var t = this;
+                       return [t.r, t.g, t.b, t.a];    // Array
+               },
+               toHex: function(){
+                       // summary:
+                       //              Returns a CSS color string in hexadecimal representation
+                       // example:
+                       //      |       console.log(new dojo.Color([0,0,0]).toHex()); // #000000
+                       var arr = d.map(["r", "g", "b"], function(x){
+                               var s = this[x].toString(16);
+                               return s.length < 2 ? "0" + s : s;
+                       }, this);
+                       return "#" + arr.join("");      // String
+               },
+               toCss: function(/*Boolean?*/ includeAlpha){
+                       // summary:
+                       //              Returns a css color string in rgb(a) representation
+                       // example:
+                       //      |       var c = new dojo.Color("#FFF").toCss();
+                       //      |       console.log(c); // rgb('255','255','255')
+                       var t = this, rgb = t.r + ", " + t.g + ", " + t.b;
+                       return (includeAlpha ? "rgba(" + rgb + ", " + t.a : "rgb(" + rgb) + ")";        // String
+               },
+               toString: function(){
+                       // summary:
+                       //              Returns a visual representation of the color
+                       return this.toCss(true); // String
+               }
+       });
+
+       dojo.blendColors = function(
+               /*dojo.Color*/ start,
+               /*dojo.Color*/ end,
+               /*Number*/ weight,
+               /*dojo.Color?*/ obj
+       ){
+               // summary:
+               //              Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend,
+               //              can reuse a previously allocated dojo.Color object for the result
+               var t = obj || new d.Color();
+               d.forEach(["r", "g", "b", "a"], function(x){
+                       t[x] = start[x] + (end[x] - start[x]) * weight;
+                       if(x != "a"){ t[x] = Math.round(t[x]); }
+               });
+               return t.sanitize();    // dojo.Color
+       };
+
+       dojo.colorFromRgb = function(/*String*/ color, /*dojo.Color?*/ obj){
+               // summary:
+               //              Returns a `dojo.Color` instance from a string of the form
+               //              "rgb(...)" or "rgba(...)". Optionally accepts a `dojo.Color`
+               //              object to update with the parsed value and return instead of
+               //              creating a new object.
+               // returns:
+               //              A dojo.Color object. If obj is passed, it will be the return value.
+               var m = color.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);
+               return m && dojo.colorFromArray(m[1].split(/\s*,\s*/), obj);    // dojo.Color
+       };
+
+       dojo.colorFromHex = function(/*String*/ color, /*dojo.Color?*/ obj){
+               // summary:
+               //              Converts a hex string with a '#' prefix to a color object.
+               //              Supports 12-bit #rgb shorthand. Optionally accepts a
+               //              `dojo.Color` object to update with the parsed value.
+               //
+               // returns:
+               //              A dojo.Color object. If obj is passed, it will be the return value.
+               //
+               // example:
+               //       | var thing = dojo.colorFromHex("#ededed"); // grey, longhand
+               //
+               // example:
+               //      | var thing = dojo.colorFromHex("#000"); // black, shorthand
+               var t = obj || new d.Color(),
+                       bits = (color.length == 4) ? 4 : 8,
+                       mask = (1 << bits) - 1;
+               color = Number("0x" + color.substr(1));
+               if(isNaN(color)){
+                       return null; // dojo.Color
+               }
+               d.forEach(["b", "g", "r"], function(x){
+                       var c = color & mask;
+                       color >>= bits;
+                       t[x] = bits == 4 ? 17 * c : c;
+               });
+               t.a = 1;
+               return t;       // dojo.Color
+       };
+
+       dojo.colorFromArray = function(/*Array*/ a, /*dojo.Color?*/ obj){
+               // summary:
+               //              Builds a `dojo.Color` from a 3 or 4 element array, mapping each
+               //              element in sequence to the rgb(a) values of the color.
+               // example:
+               //              | var myColor = dojo.colorFromArray([237,237,237,0.5]); // grey, 50% alpha 
+               // returns:
+               //              A dojo.Color object. If obj is passed, it will be the return value.
+               var t = obj || new d.Color();
+               t._set(Number(a[0]), Number(a[1]), Number(a[2]), Number(a[3]));
+               if(isNaN(t.a)){ t.a = 1; }
+               return t.sanitize();    // dojo.Color
+       };
+
+       dojo.colorFromString = function(/*String*/ str, /*dojo.Color?*/ obj){
+               // summary:
+               //              Parses `str` for a color value. Accepts hex, rgb, and rgba
+               //              style color values.
+               // description:
+               //              Acceptable input values for str may include arrays of any form
+               //              accepted by dojo.colorFromArray, hex strings such as "#aaaaaa", or
+               //              rgb or rgba strings such as "rgb(133, 200, 16)" or "rgba(10, 10,
+               //              10, 50)"
+               // returns:
+               //              A dojo.Color object. If obj is passed, it will be the return value.
+               var a = d.Color.named[str];
+               return a && d.colorFromArray(a, obj) || d.colorFromRgb(str, obj) || d.colorFromHex(str, obj);
+       };
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base"] = true;
+dojo.provide("dojo._base");
+
+
+
+
+
+
+
+
+
+}
+
+if(!dojo._hasResource["dojo._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.window"] = true;
+dojo.provide("dojo._base.window");
+
+/*=====
+dojo.doc = {
+       // summary:
+       //              Alias for the current document. 'dojo.doc' can be modified
+       //              for temporary context shifting. Also see dojo.withDoc().
+       // description:
+       //    Refer to dojo.doc rather
+       //    than referring to 'window.document' to ensure your code runs
+       //    correctly in managed contexts.
+       // example:
+       //      |       n.appendChild(dojo.doc.createElement('div'));
+}
+=====*/
+dojo.doc = window["document"] || null;
+
+dojo.body = function(){
+       // summary:
+       //              Return the body element of the document
+       //              return the body object associated with dojo.doc
+       // example:
+       //      |       dojo.body().appendChild(dojo.doc.createElement('div'));
+
+       // Note: document.body is not defined for a strict xhtml document
+       // Would like to memoize this, but dojo.doc can change vi dojo.withDoc().
+       return dojo.doc.body || dojo.doc.getElementsByTagName("body")[0]; // Node
+}
+
+dojo.setContext = function(/*Object*/globalObject, /*DocumentElement*/globalDocument){
+       // summary:
+       //              changes the behavior of many core Dojo functions that deal with
+       //              namespace and DOM lookup, changing them to work in a new global
+       //              context (e.g., an iframe). The varibles dojo.global and dojo.doc
+       //              are modified as a result of calling this function and the result of
+       //              `dojo.body()` likewise differs.
+       dojo.global = globalObject;
+       dojo.doc = globalDocument;
+};
+
+dojo.withGlobal = function(    /*Object*/globalObject, 
+                                                       /*Function*/callback, 
+                                                       /*Object?*/thisObject, 
+                                                       /*Array?*/cbArguments){
+       // summary:
+       //              Invoke callback with globalObject as dojo.global and
+       //              globalObject.document as dojo.doc.
+       // description:
+       //              Invoke callback with globalObject as dojo.global and
+       //              globalObject.document as dojo.doc. If provided, globalObject
+       //              will be executed in the context of object thisObject
+       //              When callback() returns or throws an error, the dojo.global
+       //              and dojo.doc will be restored to its previous state.
+
+       var oldGlob = dojo.global;
+       try{
+               dojo.global = globalObject;
+               return dojo.withDoc.call(null, globalObject.document, callback, thisObject, cbArguments);
+       }finally{
+               dojo.global = oldGlob;
+       }
+}
+
+dojo.withDoc = function(       /*DocumentElement*/documentObject, 
+                                                       /*Function*/callback, 
+                                                       /*Object?*/thisObject, 
+                                                       /*Array?*/cbArguments){
+       // summary:
+       //              Invoke callback with documentObject as dojo.doc.
+       // description:
+       //              Invoke callback with documentObject as dojo.doc. If provided,
+       //              callback will be executed in the context of object thisObject
+       //              When callback() returns or throws an error, the dojo.doc will
+       //              be restored to its previous state.
+
+       var oldDoc = dojo.doc,
+               oldLtr = dojo._bodyLtr,
+               oldQ = dojo.isQuirks;
+
+       try{
+               dojo.doc = documentObject;
+               delete dojo._bodyLtr; // uncache
+               dojo.isQuirks = dojo.doc.compatMode == "BackCompat"; // no need to check for QuirksMode which was Opera 7 only
+
+               if(thisObject && typeof callback == "string"){
+                       callback = thisObject[callback];
+               }
+
+               return callback.apply(thisObject, cbArguments || []);
+       }finally{
+               dojo.doc = oldDoc;
+               delete dojo._bodyLtr; // in case it was undefined originally, and set to true/false by the alternate document
+               if(oldLtr !== undefined){ dojo._bodyLtr = oldLtr; }
+               dojo.isQuirks = oldQ;
+       }
+};
+       
+
+}
+
+if(!dojo._hasResource["dojo._base.event"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.event"] = true;
+dojo.provide("dojo._base.event");
+
+
+// this file courtesy of the TurboAjax Group, licensed under a Dojo CLA
+
+(function(){
+       // DOM event listener machinery
+       var del = (dojo._event_listener = {
+               add: function(/*DOMNode*/ node, /*String*/ name, /*Function*/ fp){
+                       if(!node){return;} 
+                       name = del._normalizeEventName(name);
+                       fp = del._fixCallback(name, fp);
+                       var oname = name;
+                       if(
+                                                               !dojo.isIE && 
+                                                               (name == "mouseenter" || name == "mouseleave")
+                       ){
+                               var ofp = fp;
+                               //oname = name;
+                               name = (name == "mouseenter") ? "mouseover" : "mouseout";
+                               fp = function(e){
+                                       if(!dojo.isDescendant(e.relatedTarget, node)){
+                                               // e.type = oname; // FIXME: doesn't take? SJM: event.type is generally immutable.
+                                               return ofp.call(this, e); 
+                                       }
+                               }
+                       }
+                       node.addEventListener(name, fp, false);
+                       return fp; /*Handle*/
+               },
+               remove: function(/*DOMNode*/ node, /*String*/ event, /*Handle*/ handle){
+                       // summary:
+                       //              clobbers the listener from the node
+                       // node:
+                       //              DOM node to attach the event to
+                       // event:
+                       //              the name of the handler to remove the function from
+                       // handle:
+                       //              the handle returned from add
+                       if(node){
+                               event = del._normalizeEventName(event);
+                               if(!dojo.isIE && (event == "mouseenter" || event == "mouseleave")){
+                                       event = (event == "mouseenter") ? "mouseover" : "mouseout";
+                               }
+
+                               node.removeEventListener(event, handle, false);
+                       }
+               },
+               _normalizeEventName: function(/*String*/ name){
+                       // Generally, name should be lower case, unless it is special
+                       // somehow (e.g. a Mozilla DOM event).
+                       // Remove 'on'.
+                       return name.slice(0,2) =="on" ? name.slice(2) : name;
+               },
+               _fixCallback: function(/*String*/ name, fp){
+                       // By default, we only invoke _fixEvent for 'keypress'
+                       // If code is added to _fixEvent for other events, we have
+                       // to revisit this optimization.
+                       // This also applies to _fixEvent overrides for Safari and Opera
+                       // below.
+                       return name != "keypress" ? fp : function(e){ return fp.call(this, del._fixEvent(e, this)); };
+               },
+               _fixEvent: function(evt, sender){
+                       // _fixCallback only attaches us to keypress.
+                       // Switch on evt.type anyway because we might 
+                       // be called directly from dojo.fixEvent.
+                       switch(evt.type){
+                               case "keypress":
+                                       del._setKeyChar(evt);
+                                       break;
+                       }
+                       return evt;
+               },
+               _setKeyChar: function(evt){
+                       evt.keyChar = evt.charCode ? String.fromCharCode(evt.charCode) : '';
+                       evt.charOrCode = evt.keyChar || evt.keyCode;
+               },
+               // For IE and Safari: some ctrl-key combinations (mostly w/punctuation) do not emit a char code in IE
+               // we map those virtual key codes to ascii here
+               // not valid for all (non-US) keyboards, so maybe we shouldn't bother
+               _punctMap: { 
+                       106:42, 
+                       111:47, 
+                       186:59, 
+                       187:43, 
+                       188:44, 
+                       189:45, 
+                       190:46, 
+                       191:47, 
+                       192:96, 
+                       219:91, 
+                       220:92, 
+                       221:93, 
+                       222:39 
+               }
+       });
+
+       // DOM events
+       
+       dojo.fixEvent = function(/*Event*/ evt, /*DOMNode*/ sender){
+               // summary:
+               //              normalizes properties on the event object including event
+               //              bubbling methods, keystroke normalization, and x/y positions
+               // evt: Event
+               //              native event object
+               // sender: DOMNode
+               //              node to treat as "currentTarget"
+               return del._fixEvent(evt, sender);
+       }
+
+       dojo.stopEvent = function(/*Event*/ evt){
+               // summary:
+               //              prevents propagation and clobbers the default action of the
+               //              passed event
+               // evt: Event
+               //              The event object. If omitted, window.event is used on IE.
+               evt.preventDefault();
+               evt.stopPropagation();
+               // NOTE: below, this method is overridden for IE
+       }
+
+       // the default listener to use on dontFix nodes, overriden for IE
+       var node_listener = dojo._listener;
+       
+       // Unify connect and event listeners
+       dojo._connect = function(obj, event, context, method, dontFix){
+               // FIXME: need a more strict test
+               var isNode = obj && (obj.nodeType||obj.attachEvent||obj.addEventListener);
+               // choose one of three listener options: raw (connect.js), DOM event on a Node, custom event on a Node
+               // we need the third option to provide leak prevention on broken browsers (IE)
+               var lid = isNode ? (dontFix ? 2 : 1) : 0, l = [dojo._listener, del, node_listener][lid];
+               // create a listener
+               var h = l.add(obj, event, dojo.hitch(context, method));
+               // formerly, the disconnect package contained "l" directly, but if client code
+               // leaks the disconnect package (by connecting it to a node), referencing "l" 
+               // compounds the problem.
+               // instead we return a listener id, which requires custom _disconnect below.
+               // return disconnect package
+               return [ obj, event, h, lid ];
+       }
+
+       dojo._disconnect = function(obj, event, handle, listener){
+               ([dojo._listener, del, node_listener][listener]).remove(obj, event, handle);
+       }
+
+       // Constants
+
+       // Public: client code should test
+       // keyCode against these named constants, as the
+       // actual codes can vary by browser.
+       dojo.keys = {
+               // summary:
+               //              Definitions for common key values
+               BACKSPACE: 8,
+               TAB: 9,
+               CLEAR: 12,
+               ENTER: 13,
+               SHIFT: 16,
+               CTRL: 17,
+               ALT: 18,
+               META: dojo.isSafari ? 91 : 224,         // the apple key on macs
+               PAUSE: 19,
+               CAPS_LOCK: 20,
+               ESCAPE: 27,
+               SPACE: 32,
+               PAGE_UP: 33,
+               PAGE_DOWN: 34,
+               END: 35,
+               HOME: 36,
+               LEFT_ARROW: 37,
+               UP_ARROW: 38,
+               RIGHT_ARROW: 39,
+               DOWN_ARROW: 40,
+               INSERT: 45,
+               DELETE: 46,
+               HELP: 47,
+               LEFT_WINDOW: 91,
+               RIGHT_WINDOW: 92,
+               SELECT: 93,
+               NUMPAD_0: 96,
+               NUMPAD_1: 97,
+               NUMPAD_2: 98,
+               NUMPAD_3: 99,
+               NUMPAD_4: 100,
+               NUMPAD_5: 101,
+               NUMPAD_6: 102,
+               NUMPAD_7: 103,
+               NUMPAD_8: 104,
+               NUMPAD_9: 105,
+               NUMPAD_MULTIPLY: 106,
+               NUMPAD_PLUS: 107,
+               NUMPAD_ENTER: 108,
+               NUMPAD_MINUS: 109,
+               NUMPAD_PERIOD: 110,
+               NUMPAD_DIVIDE: 111,
+               F1: 112,
+               F2: 113,
+               F3: 114,
+               F4: 115,
+               F5: 116,
+               F6: 117,
+               F7: 118,
+               F8: 119,
+               F9: 120,
+               F10: 121,
+               F11: 122,
+               F12: 123,
+               F13: 124,
+               F14: 125,
+               F15: 126,
+               NUM_LOCK: 144,
+               SCROLL_LOCK: 145,
+               // virtual key mapping
+               copyKey: dojo.isMac && !dojo.isAIR ? (dojo.isSafari ? 91 : 224 ) : 17
+       };
+       
+       var evtCopyKey = dojo.isMac ? "metaKey" : "ctrlKey";
+       
+       dojo.isCopyKey = function(e){
+               // summary:
+               //              Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
+               // e: Event
+               //              Event object to examine
+               return e[evtCopyKey];   // Boolean
+       };
+
+       // Public: decoding mouse buttons from events
+
+/*=====
+       dojo.mouseButtons = {
+               // LEFT: Number
+               //              Numeric value of the left mouse button for the platform.
+               LEFT:   0,
+               // MIDDLE: Number
+               //              Numeric value of the middle mouse button for the platform.
+               MIDDLE: 1,
+               // RIGHT: Number
+               //              Numeric value of the right mouse button for the platform.
+               RIGHT:  2,
+       
+               isButton: function(e, button){
+                       // summary:
+                       //              Checks an event object for a pressed button
+                       // e: Event
+                       //              Event object to examine
+                       // button: Number
+                       //              The button value (example: dojo.mouseButton.LEFT)
+                       return e.button == button; // Boolean
+               },
+               isLeft: function(e){
+                       // summary:
+                       //              Checks an event object for the pressed left button
+                       // e: Event
+                       //              Event object to examine
+                       return e.button == 0; // Boolean
+               },
+               isMiddle: function(e){
+                       // summary:
+                       //              Checks an event object for the pressed middle button
+                       // e: Event
+                       //              Event object to examine
+                       return e.button == 1; // Boolean
+               },
+               isRight: function(e){
+                       // summary:
+                       //              Checks an event object for the pressed right button
+                       // e: Event
+                       //              Event object to examine
+                       return e.button == 2; // Boolean
+               }
+       };
+=====*/
+
+               if(dojo.isIE){
+               dojo.mouseButtons = {
+                       LEFT:   1,
+                       MIDDLE: 4,
+                       RIGHT:  2,
+                       // helper functions
+                       isButton: function(e, button){ return e.button & button; },
+                       isLeft:   function(e){ return e.button & 1; },
+                       isMiddle: function(e){ return e.button & 4; },
+                       isRight:  function(e){ return e.button & 2; }
+               };
+       }else{
+                       dojo.mouseButtons = {
+                       LEFT:   0,
+                       MIDDLE: 1,
+                       RIGHT:  2,
+                       // helper functions
+                       isButton: function(e, button){ return e.button == button; },
+                       isLeft:   function(e){ return e.button == 0; },
+                       isMiddle: function(e){ return e.button == 1; },
+                       isRight:  function(e){ return e.button == 2; }
+               };
+               }
+       
+               // IE event normalization
+       if(dojo.isIE){ 
+               var _trySetKeyCode = function(e, code){
+                       try{
+                               // squelch errors when keyCode is read-only
+                               // (e.g. if keyCode is ctrl or shift)
+                               return (e.keyCode = code);
+                       }catch(e){
+                               return 0;
+                       }
+               }
+
+               // by default, use the standard listener
+               var iel = dojo._listener;
+               var listenersName = (dojo._ieListenersName = "_" + dojo._scopeName + "_listeners");
+               // dispatcher tracking property
+               if(!dojo.config._allow_leaks){
+                       // custom listener that handles leak protection for DOM events
+                       node_listener = iel = dojo._ie_listener = {
+                               // support handler indirection: event handler functions are 
+                               // referenced here. Event dispatchers hold only indices.
+                               handlers: [],
+                               // add a listener to an object
+                               add: function(/*Object*/ source, /*String*/ method, /*Function*/ listener){
+                                       source = source || dojo.global;
+                                       var f = source[method];
+                                       if(!f||!f[listenersName]){
+                                               var d = dojo._getIeDispatcher();
+                                               // original target function is special
+                                               d.target = f && (ieh.push(f) - 1);
+                                               // dispatcher holds a list of indices into handlers table
+                                               d[listenersName] = [];
+                                               // redirect source to dispatcher
+                                               f = source[method] = d;
+                                       }
+                                       return f[listenersName].push(ieh.push(listener) - 1) ; /*Handle*/
+                               },
+                               // remove a listener from an object
+                               remove: function(/*Object*/ source, /*String*/ method, /*Handle*/ handle){
+                                       var f = (source||dojo.global)[method], l = f && f[listenersName];
+                                       if(f && l && handle--){
+                                               delete ieh[l[handle]];
+                                               delete l[handle];
+                                       }
+                               }
+                       };
+                       // alias used above
+                       var ieh = iel.handlers;
+               }
+
+               dojo.mixin(del, {
+                       add: function(/*DOMNode*/ node, /*String*/ event, /*Function*/ fp){
+                               if(!node){return;} // undefined
+                               event = del._normalizeEventName(event);
+                               if(event=="onkeypress"){
+                                       // we need to listen to onkeydown to synthesize
+                                       // keypress events that otherwise won't fire
+                                       // on IE
+                                       var kd = node.onkeydown;
+                                       if(!kd || !kd[listenersName] || !kd._stealthKeydownHandle){
+                                               var h = del.add(node, "onkeydown", del._stealthKeyDown);
+                                               kd = node.onkeydown;
+                                               kd._stealthKeydownHandle = h;
+                                               kd._stealthKeydownRefs = 1;
+                                       }else{
+                                               kd._stealthKeydownRefs++;
+                                       }
+                               }
+                               return iel.add(node, event, del._fixCallback(fp));
+                       },
+                       remove: function(/*DOMNode*/ node, /*String*/ event, /*Handle*/ handle){
+                               event = del._normalizeEventName(event);
+                               iel.remove(node, event, handle); 
+                               if(event=="onkeypress"){
+                                       var kd = node.onkeydown;
+                                       if(--kd._stealthKeydownRefs <= 0){
+                                               iel.remove(node, "onkeydown", kd._stealthKeydownHandle);
+                                               delete kd._stealthKeydownHandle;
+                                       }
+                               }
+                       },
+                       _normalizeEventName: function(/*String*/ eventName){
+                               // Generally, eventName should be lower case, unless it is
+                               // special somehow (e.g. a Mozilla event)
+                               // ensure 'on'
+                               return eventName.slice(0,2) != "on" ? "on" + eventName : eventName;
+                       },
+                       _nop: function(){},
+                       _fixEvent: function(/*Event*/ evt, /*DOMNode*/ sender){
+                               // summary:
+                               //              normalizes properties on the event object including event
+                               //              bubbling methods, keystroke normalization, and x/y positions
+                               // evt:
+                               //              native event object
+                               // sender:
+                               //              node to treat as "currentTarget"
+                               if(!evt){
+                                       var w = sender && (sender.ownerDocument || sender.document || sender).parentWindow || window;
+                                       evt = w.event; 
+                               }
+                               if(!evt){return(evt);}
+                               evt.target = evt.srcElement; 
+                               evt.currentTarget = (sender || evt.srcElement); 
+                               evt.layerX = evt.offsetX;
+                               evt.layerY = evt.offsetY;
+                               // FIXME: scroll position query is duped from dojo.html to
+                               // avoid dependency on that entire module. Now that HTML is in
+                               // Base, we should convert back to something similar there.
+                               var se = evt.srcElement, doc = (se && se.ownerDocument) || document;
+                               // DO NOT replace the following to use dojo.body(), in IE, document.documentElement should be used
+                               // here rather than document.body
+                               var docBody = ((dojo.isIE < 6) || (doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;
+                               var offset = dojo._getIeDocumentElementOffset();
+                               evt.pageX = evt.clientX + dojo._fixIeBiDiScrollLeft(docBody.scrollLeft || 0) - offset.x;
+                               evt.pageY = evt.clientY + (docBody.scrollTop || 0) - offset.y;
+                               if(evt.type == "mouseover"){ 
+                                       evt.relatedTarget = evt.fromElement;
+                               }
+                               if(evt.type == "mouseout"){ 
+                                       evt.relatedTarget = evt.toElement;
+                               }
+                               evt.stopPropagation = del._stopPropagation;
+                               evt.preventDefault = del._preventDefault;
+                               return del._fixKeys(evt);
+                       },
+                       _fixKeys: function(evt){
+                               switch(evt.type){
+                                       case "keypress":
+                                               var c = ("charCode" in evt ? evt.charCode : evt.keyCode);
+                                               if (c==10){
+                                                       // CTRL-ENTER is CTRL-ASCII(10) on IE, but CTRL-ENTER on Mozilla
+                                                       c=0;
+                                                       evt.keyCode = 13;
+                                               }else if(c==13||c==27){
+                                                       c=0; // Mozilla considers ENTER and ESC non-printable
+                                               }else if(c==3){
+                                                       c=99; // Mozilla maps CTRL-BREAK to CTRL-c
+                                               }
+                                               // Mozilla sets keyCode to 0 when there is a charCode
+                                               // but that stops the event on IE.
+                                               evt.charCode = c;
+                                               del._setKeyChar(evt);
+                                               break;
+                               }
+                               return evt;
+                       },
+                       _stealthKeyDown: function(evt){
+                               // IE doesn't fire keypress for most non-printable characters.
+                               // other browsers do, we simulate it here.
+                               var kp = evt.currentTarget.onkeypress;
+                               // only works if kp exists and is a dispatcher
+                               if(!kp || !kp[listenersName]){ return; }
+                               // munge key/charCode
+                               var k=evt.keyCode;
+                               // These are Windows Virtual Key Codes
+                               // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
+                               var unprintable = k!=13 && k!=32 && k!=27 && (k<48||k>90) && (k<96||k>111) && (k<186||k>192) && (k<219||k>222);
+                               // synthesize keypress for most unprintables and CTRL-keys
+                               if(unprintable||evt.ctrlKey){
+                                       var c = unprintable ? 0 : k;
+                                       if(evt.ctrlKey){
+                                               if(k==3 || k==13){
+                                                       return; // IE will post CTRL-BREAK, CTRL-ENTER as keypress natively 
+                                               }else if(c>95 && c<106){ 
+                                                       c -= 48; // map CTRL-[numpad 0-9] to ASCII
+                                               }else if((!evt.shiftKey)&&(c>=65&&c<=90)){ 
+                                                       c += 32; // map CTRL-[A-Z] to lowercase
+                                               }else{ 
+                                                       c = del._punctMap[c] || c; // map other problematic CTRL combinations to ASCII
+                                               }
+                                       }
+                                       // simulate a keypress event
+                                       var faux = del._synthesizeEvent(evt, {type: 'keypress', faux: true, charCode: c});
+                                       kp.call(evt.currentTarget, faux);
+                                       evt.cancelBubble = faux.cancelBubble;
+                                       evt.returnValue = faux.returnValue;
+                                       _trySetKeyCode(evt, faux.keyCode);
+                               }
+                       },
+                       // Called in Event scope
+                       _stopPropagation: function(){
+                               this.cancelBubble = true; 
+                       },
+                       _preventDefault: function(){
+                               // Setting keyCode to 0 is the only way to prevent certain keypresses (namely
+                               // ctrl-combinations that correspond to menu accelerator keys).
+                               // Otoh, it prevents upstream listeners from getting this information
+                               // Try to split the difference here by clobbering keyCode only for ctrl 
+                               // combinations. If you still need to access the key upstream, bubbledKeyCode is
+                               // provided as a workaround.
+                               this.bubbledKeyCode = this.keyCode;
+                               if(this.ctrlKey){_trySetKeyCode(this, 0);}
+                               this.returnValue = false;
+                       }
+               });
+                               
+               // override stopEvent for IE
+               dojo.stopEvent = function(evt){
+                       evt = evt || window.event;
+                       del._stopPropagation.call(evt);
+                       del._preventDefault.call(evt);
+               }
+       }
+       
+       del._synthesizeEvent = function(evt, props){
+                       var faux = dojo.mixin({}, evt, props);
+                       del._setKeyChar(faux);
+                       // FIXME: would prefer to use dojo.hitch: dojo.hitch(evt, evt.preventDefault); 
+                       // but it throws an error when preventDefault is invoked on Safari
+                       // does Event.preventDefault not support "apply" on Safari?
+                       faux.preventDefault = function(){ evt.preventDefault(); }; 
+                       faux.stopPropagation = function(){ evt.stopPropagation(); }; 
+                       return faux;
+       }
+       
+               // Opera event normalization
+       if(dojo.isOpera){
+               dojo.mixin(del, {
+                       _fixEvent: function(evt, sender){
+                               switch(evt.type){
+                                       case "keypress":
+                                               var c = evt.which;
+                                               if(c==3){
+                                                       c=99; // Mozilla maps CTRL-BREAK to CTRL-c
+                                               }
+                                               // can't trap some keys at all, like INSERT and DELETE
+                                               // there is no differentiating info between DELETE and ".", or INSERT and "-"
+                                               c = c<41 && !evt.shiftKey ? 0 : c;
+                                               if(evt.ctrlKey && !evt.shiftKey && c>=65 && c<=90){
+                                                       // lowercase CTRL-[A-Z] keys
+                                                       c += 32;
+                                               }
+                                               return del._synthesizeEvent(evt, { charCode: c });
+                               }
+                               return evt;
+                       }
+               });
+       }
+       
+               // Webkit event normalization
+       if(dojo.isWebKit){
+                               del._add = del.add;
+               del._remove = del.remove;
+
+               dojo.mixin(del, {
+                       add: function(/*DOMNode*/ node, /*String*/ event, /*Function*/ fp){
+                               if(!node){return;} // undefined
+                               var handle = del._add(node, event, fp);
+                               if(del._normalizeEventName(event) == "keypress"){
+                                       // we need to listen to onkeydown to synthesize
+                                       // keypress events that otherwise won't fire
+                                       // in Safari 3.1+: https://lists.webkit.org/pipermail/webkit-dev/2007-December/002992.html
+                                       handle._stealthKeyDownHandle = del._add(node, "keydown", function(evt){
+                                               //A variation on the IE _stealthKeydown function
+                                               //Synthesize an onkeypress event, but only for unprintable characters.
+                                               var k=evt.keyCode;
+                                               // These are Windows Virtual Key Codes
+                                               // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
+                                               var unprintable = k!=13 && k!=32 && (k<48 || k>90) && (k<96 || k>111) && (k<186 || k>192) && (k<219 || k>222);
+                                               // synthesize keypress for most unprintables and CTRL-keys
+                                               if(unprintable || evt.ctrlKey){
+                                                       var c = unprintable ? 0 : k;
+                                                       if(evt.ctrlKey){
+                                                               if(k==3 || k==13){
+                                                                       return; // IE will post CTRL-BREAK, CTRL-ENTER as keypress natively 
+                                                               }else if(c>95 && c<106){ 
+                                                                       c -= 48; // map CTRL-[numpad 0-9] to ASCII
+                                                               }else if(!evt.shiftKey && c>=65 && c<=90){ 
+                                                                       c += 32; // map CTRL-[A-Z] to lowercase
+                                                               }else{ 
+                                                                       c = del._punctMap[c] || c; // map other problematic CTRL combinations to ASCII
+                                                               }
+                                                       }
+                                                       // simulate a keypress event
+                                                       var faux = del._synthesizeEvent(evt, {type: 'keypress', faux: true, charCode: c});
+                                                       fp.call(evt.currentTarget, faux);
+                                               }
+                                       });
+                               }
+                               return handle; /*Handle*/
+                       },
+
+                       remove: function(/*DOMNode*/ node, /*String*/ event, /*Handle*/ handle){
+                               if(node){
+                                       if(handle._stealthKeyDownHandle){
+                                               del._remove(node, "keydown", handle._stealthKeyDownHandle);
+                                       }
+                                       del._remove(node, event, handle);
+                               }
+                       },
+                       _fixEvent: function(evt, sender){
+                               switch(evt.type){
+                                       case "keypress":
+                                               if(evt.faux){ return evt; }
+                                               var c = evt.charCode;
+                                               c = c>=32 ? c : 0;
+                                               return del._synthesizeEvent(evt, {charCode: c, faux: true});
+                               }
+                               return evt;
+                       }
+               });
+               }
+       })();
+
+if(dojo.isIE){
+       // keep this out of the closure
+       // closing over 'iel' or 'ieh' b0rks leak prevention
+       // ls[i] is an index into the master handler array
+       dojo._ieDispatcher = function(args, sender){
+               var ap = Array.prototype,
+                       h = dojo._ie_listener.handlers,
+                       c = args.callee,
+                       ls = c[dojo._ieListenersName],
+                       t = h[c.target];
+               // return value comes from original target function
+               var r = t && t.apply(sender, args);
+               // make local copy of listener array so it's immutable during processing
+               var lls = [].concat(ls);
+               // invoke listeners after target function
+               for(var i in lls){
+                       var f = h[lls[i]];
+                       if(!(i in ap) && f){
+                               f.apply(sender, args);
+                       }
+               }
+               return r;
+       }
+       dojo._getIeDispatcher = function(){
+               // ensure the returned function closes over nothing ("new Function" apparently doesn't close)
+               return new Function(dojo._scopeName + "._ieDispatcher(arguments, this)"); // function
+       }
+       // keep this out of the closure to reduce RAM allocation
+       dojo._event_listener._fixCallback = function(fp){
+               var f = dojo._event_listener._fixEvent;
+               return function(e){ return fp.call(this, f(e, this)); };
+       }
+}
+
+}
+
+if(!dojo._hasResource["dojo._base.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.html"] = true;
+
+dojo.provide("dojo._base.html");
+
+// FIXME: need to add unit tests for all the semi-public methods
+
+try{
+       document.execCommand("BackgroundImageCache", false, true);
+}catch(e){
+       // sane browsers don't have cache "issues"
+}
+
+// =============================
+// DOM Functions
+// =============================
+
+/*=====
+dojo.byId = function(id, doc){
+       //      summary:
+       //              Returns DOM node with matching `id` attribute or `null`
+       //              if not found. If `id` is a DomNode, this function is a no-op.
+       //
+       //      id: String|DOMNode
+       //              A string to match an HTML id attribute or a reference to a DOM Node
+       //
+       //      doc: Document?
+       //              Document to work in. Defaults to the current value of
+       //              dojo.doc.  Can be used to retrieve
+       //              node references from other documents.
+       //
+       //      example:
+       //      Look up a node by ID:
+       //      |       var n = dojo.byId("foo");
+       //
+       //      example:
+       //      Check if a node exists, and use it.
+       //      |       var n = dojo.byId("bar");
+       //      |       if(n){ doStuff() ... }
+       //
+       //      example:
+       //      Allow string or DomNode references to be passed to a custom function:
+       //      |       var foo = function(nodeOrId){
+       //      |               nodeOrId = dojo.byId(nodeOrId);
+       //      |               // ... more stuff
+       //      |       }
+=====*/
+
+if(dojo.isIE || dojo.isOpera){
+       dojo.byId = function(id, doc){
+               if(typeof id != "string"){
+                       return id;
+               }
+               var _d = doc || dojo.doc, te = _d.getElementById(id);
+               // attributes.id.value is better than just id in case the 
+               // user has a name=id inside a form
+               if(te && (te.attributes.id.value == id || te.id == id)){
+                       return te;
+               }else{
+                       var eles = _d.all[id];
+                       if(!eles || eles.nodeName){
+                               eles = [eles];
+                       }
+                       // if more than 1, choose first with the correct id
+                       var i=0;
+                       while((te=eles[i++])){
+                               if((te.attributes && te.attributes.id && te.attributes.id.value == id)
+                                       || te.id == id){
+                                       return te;
+                               }
+                       }
+               }
+       };
+}else{
+       dojo.byId = function(id, doc){
+               // inline'd type check
+               return (typeof id == "string") ? (doc || dojo.doc).getElementById(id) : id; // DomNode
+       };
+}
+/*=====
+};
+=====*/
+
+(function(){
+       var d = dojo;
+       var byId = d.byId;
+
+       var _destroyContainer = null,
+               _destroyDoc;
+               d.addOnWindowUnload(function(){
+               _destroyContainer = null; //prevent IE leak
+       });
+       
+/*=====
+       dojo._destroyElement = function(node){
+               // summary:
+               //              Existing alias for `dojo.destroy`. Deprecated, will be removed
+               //              in 2.0
+       }
+=====*/
+       dojo._destroyElement = dojo.destroy = function(/*String|DomNode*/node){
+               //      summary:
+               //              Removes a node from its parent, clobbering it and all of its
+               //              children.
+               //
+               //      description:
+               //              Removes a node from its parent, clobbering it and all of its
+               //              children. Function only works with DomNodes, and returns nothing.
+               //
+               //      node:
+               //              A String ID or DomNode reference of the element to be destroyed
+               //
+               //      example:
+               //      Destroy a node byId:
+               //      |       dojo.destroy("someId");
+               //
+               //      example:
+               //      Destroy all nodes in a list by reference:
+               //      |       dojo.query(".someNode").forEach(dojo.destroy);
+
+               node = byId(node);
+               try{
+                       var doc = node.ownerDocument;
+                       // cannot use _destroyContainer.ownerDocument since this can throw an exception on IE
+                       if(!_destroyContainer || _destroyDoc != doc){
+                               _destroyContainer = doc.createElement("div");
+                               _destroyDoc = doc;
+                       }
+                       _destroyContainer.appendChild(node.parentNode ? node.parentNode.removeChild(node) : node);
+                       // NOTE: see http://trac.dojotoolkit.org/ticket/2931. This may be a bug and not a feature
+                       _destroyContainer.innerHTML = "";
+               }catch(e){
+                       /* squelch */
+               }
+       };
+
+       dojo.isDescendant = function(/*DomNode|String*/node, /*DomNode|String*/ancestor){
+               //      summary:
+               //              Returns true if node is a descendant of ancestor
+               //      node: string id or node reference to test
+               //      ancestor: string id or node reference of potential parent to test against
+               //
+               // example:
+               //      Test is node id="bar" is a descendant of node id="foo"
+               //      |       if(dojo.isDescendant("bar", "foo")){ ... }
+               try{
+                       node = byId(node);
+                       ancestor = byId(ancestor);
+                       while(node){
+                               if(node == ancestor){
+                                       return true; // Boolean
+                               }
+                               node = node.parentNode;
+                       }
+               }catch(e){ /* squelch, return false */ }
+               return false; // Boolean
+       };
+
+       dojo.setSelectable = function(/*DomNode|String*/node, /*Boolean*/selectable){
+               //      summary: 
+               //              Enable or disable selection on a node
+               //      node:
+               //              id or reference to node
+               //      selectable:
+               //              state to put the node in. false indicates unselectable, true 
+               //              allows selection.
+               //      example:
+               //      Make the node id="bar" unselectable
+               //      |       dojo.setSelectable("bar"); 
+               //      example:
+               //      Make the node id="bar" selectable
+               //      |       dojo.setSelectable("bar", true);
+               node = byId(node);
+                               if(d.isMozilla){
+                       node.style.MozUserSelect = selectable ? "" : "none";
+               }else if(d.isKhtml || d.isWebKit){
+                                       node.style.KhtmlUserSelect = selectable ? "auto" : "none";
+                               }else if(d.isIE){
+                       var v = (node.unselectable = selectable ? "" : "on");
+                       d.query("*", node).forEach("item.unselectable = '"+v+"'");
+               }
+                               //FIXME: else?  Opera?
+       };
+
+       var _insertBefore = function(/*DomNode*/node, /*DomNode*/ref){
+               var parent = ref.parentNode;
+               if(parent){
+                       parent.insertBefore(node, ref);
+               }
+       };
+
+       var _insertAfter = function(/*DomNode*/node, /*DomNode*/ref){
+               //      summary:
+               //              Try to insert node after ref
+               var parent = ref.parentNode;
+               if(parent){
+                       if(parent.lastChild == ref){
+                               parent.appendChild(node);
+                       }else{
+                               parent.insertBefore(node, ref.nextSibling);
+                       }
+               }
+       };
+
+       dojo.place = function(node, refNode, position){
+               //      summary:
+               //              Attempt to insert node into the DOM, choosing from various positioning options.
+               //              Returns the first argument resolved to a DOM node.
+               //
+               //      node: String|DomNode
+               //              id or node reference, or HTML fragment starting with "<" to place relative to refNode
+               //
+               //      refNode: String|DomNode
+               //              id or node reference to use as basis for placement
+               //
+               //      position: String|Number?
+               //              string noting the position of node relative to refNode or a
+               //              number indicating the location in the childNodes collection of refNode.
+               //              Accepted string values are:
+               //      |       * before
+               //      |       * after
+               //      |       * replace
+               //      |       * only
+               //      |       * first
+               //      |       * last
+               //              "first" and "last" indicate positions as children of refNode, "replace" replaces refNode,
+               //              "only" replaces all children.  position defaults to "last" if not specified
+               //
+               //      returns: DomNode
+               //              Returned values is the first argument resolved to a DOM node.
+               //
+               //              .place() is also a method of `dojo.NodeList`, allowing `dojo.query` node lookups.
+               //
+               // example:
+               //              Place a node by string id as the last child of another node by string id:
+               //      |       dojo.place("someNode", "anotherNode");
+               //
+               // example:
+               //              Place a node by string id before another node by string id
+               //      |       dojo.place("someNode", "anotherNode", "before");
+               //
+               // example:
+               //              Create a Node, and place it in the body element (last child):
+               //      |       dojo.place("<div></div>", dojo.body());
+               //
+               // example:
+               //              Put a new LI as the first child of a list by id:
+               //      |       dojo.place("<li></li>", "someUl", "first");
+
+               refNode = byId(refNode);
+               if(typeof node == "string"){ // inline'd type check
+                       node = node.charAt(0) == "<" ? d._toDom(node, refNode.ownerDocument) : byId(node);
+               }
+               if(typeof position == "number"){ // inline'd type check
+                       var cn = refNode.childNodes;
+                       if(!cn.length || cn.length <= position){
+                               refNode.appendChild(node);
+                       }else{
+                               _insertBefore(node, cn[position < 0 ? 0 : position]);
+                       }
+               }else{
+                       switch(position){
+                               case "before":
+                                       _insertBefore(node, refNode);
+                                       break;
+                               case "after":
+                                       _insertAfter(node, refNode);
+                                       break;
+                               case "replace":
+                                       refNode.parentNode.replaceChild(node, refNode);
+                                       break;
+                               case "only":
+                                       d.empty(refNode);
+                                       refNode.appendChild(node);
+                                       break;
+                               case "first":
+                                       if(refNode.firstChild){
+                                               _insertBefore(node, refNode.firstChild);
+                                               break;
+                                       }
+                                       // else fallthrough...
+                               default: // aka: last
+                                       refNode.appendChild(node);
+                       }
+               }
+               return node; // DomNode
+       }
+
+       // Box functions will assume this model.
+       // On IE/Opera, BORDER_BOX will be set if the primary document is in quirks mode.
+       // Can be set to change behavior of box setters.
+
+       // can be either:
+       //      "border-box"
+       //      "content-box" (default)
+       dojo.boxModel = "content-box";
+
+       // We punt per-node box mode testing completely.
+       // If anybody cares, we can provide an additional (optional) unit 
+       // that overrides existing code to include per-node box sensitivity.
+
+       // Opera documentation claims that Opera 9 uses border-box in BackCompat mode.
+       // but experiments (Opera 9.10.8679 on Windows Vista) indicate that it actually continues to use content-box.
+       // IIRC, earlier versions of Opera did in fact use border-box.
+       // Opera guys, this is really confusing. Opera being broken in quirks mode is not our fault.
+
+               if(d.isIE /*|| dojo.isOpera*/){
+               // client code may have to adjust if compatMode varies across iframes
+               d.boxModel = document.compatMode == "BackCompat" ? "border-box" : "content-box";
+       }
+       
+       // =============================
+       // Style Functions
+       // =============================
+
+       // getComputedStyle drives most of the style code.
+       // Wherever possible, reuse the returned object.
+       //
+       // API functions below that need to access computed styles accept an 
+       // optional computedStyle parameter.
+       // If this parameter is omitted, the functions will call getComputedStyle themselves.
+       // This way, calling code can access computedStyle once, and then pass the reference to 
+       // multiple API functions.
+
+/*=====
+       dojo.getComputedStyle = function(node){
+               //      summary:
+               //              Returns a "computed style" object.
+               //
+               //      description:
+               //              Gets a "computed style" object which can be used to gather
+               //              information about the current state of the rendered node.
+               //
+               //              Note that this may behave differently on different browsers.
+               //              Values may have different formats and value encodings across
+               //              browsers.
+               //
+               //              Note also that this method is expensive.  Wherever possible,
+               //              reuse the returned object.
+               //
+               //              Use the dojo.style() method for more consistent (pixelized)
+               //              return values.
+               //
+               //      node: DOMNode
+               //              A reference to a DOM node. Does NOT support taking an
+               //              ID string for speed reasons.
+               //      example:
+               //      |       dojo.getComputedStyle(dojo.byId('foo')).borderWidth;
+               //
+               //      example:
+               //      Reusing the returned object, avoiding multiple lookups:
+               //      |       var cs = dojo.getComputedStyle(dojo.byId("someNode"));
+               //      |       var w = cs.width, h = cs.height;
+               return; // CSS2Properties
+       }
+=====*/
+
+       // Although we normally eschew argument validation at this
+       // level, here we test argument 'node' for (duck)type,
+       // by testing nodeType, ecause 'document' is the 'parentNode' of 'body'
+       // it is frequently sent to this function even 
+       // though it is not Element.
+       var gcs;
+               if(d.isWebKit){
+                       gcs = function(/*DomNode*/node){
+                       var s;
+                       if(node.nodeType == 1){
+                               var dv = node.ownerDocument.defaultView;
+                               s = dv.getComputedStyle(node, null);
+                               if(!s && node.style){
+                                       node.style.display = "";
+                                       s = dv.getComputedStyle(node, null);
+                               }
+                       }
+                       return s || {};
+               };
+               }else if(d.isIE){
+               gcs = function(node){
+                       // IE (as of 7) doesn't expose Element like sane browsers
+                       return node.nodeType == 1 /* ELEMENT_NODE*/ ? node.currentStyle : {};
+               };
+       }else{
+               gcs = function(node){
+                       return node.nodeType == 1 ?
+                               node.ownerDocument.defaultView.getComputedStyle(node, null) : {};
+               };
+       }
+               dojo.getComputedStyle = gcs;
+
+               if(!d.isIE){
+                       d._toPixelValue = function(element, value){
+                       // style values can be floats, client code may want
+                       // to round for integer pixels.
+                       return parseFloat(value) || 0;
+               };
+               }else{
+               d._toPixelValue = function(element, avalue){
+                       if(!avalue){ return 0; }
+                       // on IE7, medium is usually 4 pixels
+                       if(avalue == "medium"){ return 4; }
+                       // style values can be floats, client code may
+                       // want to round this value for integer pixels.
+                       if(avalue.slice && avalue.slice(-2) == 'px'){ return parseFloat(avalue); }
+                       with(element){
+                               var sLeft = style.left;
+                               var rsLeft = runtimeStyle.left;
+                               runtimeStyle.left = currentStyle.left;
+                               try{
+                                       // 'avalue' may be incompatible with style.left, which can cause IE to throw
+                                       // this has been observed for border widths using "thin", "medium", "thick" constants
+                                       // those particular constants could be trapped by a lookup
+                                       // but perhaps there are more
+                                       style.left = avalue;
+                                       avalue = style.pixelLeft;
+                               }catch(e){
+                                       avalue = 0;
+                               }
+                               style.left = sLeft;
+                               runtimeStyle.left = rsLeft;
+                       }
+                       return avalue;
+               }
+       }
+               var px = d._toPixelValue;
+
+       // FIXME: there opacity quirks on FF that we haven't ported over. Hrm.
+       /*=====
+       dojo._getOpacity = function(node){
+                       //      summary:
+                       //              Returns the current opacity of the passed node as a
+                       //              floating-point value between 0 and 1.
+                       //      node: DomNode
+                       //              a reference to a DOM node. Does NOT support taking an
+                       //              ID string for speed reasons.
+                       //      returns: Number between 0 and 1
+                       return; // Number
+       }
+       =====*/
+
+               var astr = "DXImageTransform.Microsoft.Alpha";
+       var af = function(n, f){
+               try{
+                       return n.filters.item(astr);
+               }catch(e){
+                       return f ? {} : null;
+               }
+       };
+
+               dojo._getOpacity =
+                       d.isIE ? function(node){
+                       try{
+                               return af(node).Opacity / 100; // Number
+                       }catch(e){
+                               return 1; // Number
+                       }
+               } :
+                       function(node){
+                       return gcs(node).opacity;
+               };
+
+       /*=====
+       dojo._setOpacity = function(node, opacity){
+                       //      summary:
+                       //              set the opacity of the passed node portably. Returns the
+                       //              new opacity of the node.
+                       //      node: DOMNode
+                       //              a reference to a DOM node. Does NOT support taking an
+                       //              ID string for performance reasons.
+                       //      opacity: Number
+                       //              A Number between 0 and 1. 0 specifies transparent.
+                       //      returns: Number between 0 and 1
+                       return; // Number
+       }
+       =====*/
+
+       dojo._setOpacity =
+                               d.isIE ? function(/*DomNode*/node, /*Number*/opacity){
+                       var ov = opacity * 100;
+                       node.style.zoom = 1.0;
+
+                       // on IE7 Alpha(Filter opacity=100) makes text look fuzzy so disable it altogether (bug #2661),
+                       //but still update the opacity value so we can get a correct reading if it is read later.
+                       af(node, 1).Enabled = !(opacity == 1);
+
+                       if(!af(node)){
+                               node.style.filter += " progid:" + astr + "(Opacity=" + ov + ")";
+                       }else{
+                               af(node, 1).Opacity = ov;
+                       }
+
+                       if(node.nodeName.toLowerCase() == "tr"){
+                               d.query("> td", node).forEach(function(i){
+                                       d._setOpacity(i, opacity);
+                               });
+                       }
+                       return opacity;
+               } :
+                               function(node, opacity){
+                       return node.style.opacity = opacity;
+               };
+
+       var _pixelNamesCache = {
+               left: true, top: true
+       };
+       var _pixelRegExp = /margin|padding|width|height|max|min|offset/;  // |border
+       var _toStyleValue = function(node, type, value){
+               type = type.toLowerCase(); // FIXME: should we really be doing string case conversion here? Should we cache it? Need to profile!
+                               if(d.isIE){
+                       if(value == "auto"){
+                               if(type == "height"){ return node.offsetHeight; }
+                               if(type == "width"){ return node.offsetWidth; }
+                       }
+                       if(type == "fontweight"){
+                               switch(value){
+                                       case 700: return "bold";
+                                       case 400:
+                                       default: return "normal";
+                               }
+                       }
+               }
+                               if(!(type in _pixelNamesCache)){
+                       _pixelNamesCache[type] = _pixelRegExp.test(type);
+               }
+               return _pixelNamesCache[type] ? px(node, value) : value;
+       };
+
+       var _floatStyle = d.isIE ? "styleFloat" : "cssFloat",
+               _floatAliases = { "cssFloat": _floatStyle, "styleFloat": _floatStyle, "float": _floatStyle }
+       ;
+
+       // public API
+
+       dojo.style = function(  /*DomNode|String*/ node,
+                                                       /*String?|Object?*/ style,
+                                                       /*String?*/ value){
+               //      summary:
+               //              Accesses styles on a node. If 2 arguments are
+               //              passed, acts as a getter. If 3 arguments are passed, acts
+               //              as a setter.
+               //      description:
+               //              Getting the style value uses the computed style for the node, so the value
+               //              will be a calculated value, not just the immediate node.style value.
+               //              Also when getting values, use specific style names,
+               //              like "borderBottomWidth" instead of "border" since compound values like
+               //              "border" are not necessarily reflected as expected.
+               //              If you want to get node dimensions, use `dojo.marginBox()`, 
+               //              `dojo.contentBox()` or `dojo.position()`.
+               //      node:
+               //              id or reference to node to get/set style for
+               //      style:
+               //              the style property to set in DOM-accessor format
+               //              ("borderWidth", not "border-width") or an object with key/value
+               //              pairs suitable for setting each property.
+               //      value:
+               //              If passed, sets value on the node for style, handling
+               //              cross-browser concerns.  When setting a pixel value,
+               //              be sure to include "px" in the value. For instance, top: "200px".
+               //              Otherwise, in some cases, some browsers will not apply the style.
+               //      example:
+               //              Passing only an ID or node returns the computed style object of
+               //              the node:
+               //      |       dojo.style("thinger");
+               //      example:
+               //              Passing a node and a style property returns the current
+               //              normalized, computed value for that property:
+               //      |       dojo.style("thinger", "opacity"); // 1 by default
+               //
+               //      example:
+               //              Passing a node, a style property, and a value changes the
+               //              current display of the node and returns the new computed value
+               //      |       dojo.style("thinger", "opacity", 0.5); // == 0.5
+               //
+               //      example:
+               //              Passing a node, an object-style style property sets each of the values in turn and returns the computed style object of the node:
+               //      |       dojo.style("thinger", {
+               //      |               "opacity": 0.5,
+               //      |               "border": "3px solid black",
+               //      |               "height": "300px"
+               //      |       });
+               //
+               //      example:
+               //              When the CSS style property is hyphenated, the JavaScript property is camelCased.
+               //              font-size becomes fontSize, and so on.
+               //      |       dojo.style("thinger",{
+               //      |               fontSize:"14pt",
+               //      |               letterSpacing:"1.2em"
+               //      |       });
+               //
+               //      example:
+               //              dojo.NodeList implements .style() using the same syntax, omitting the "node" parameter, calling
+               //              dojo.style() on every element of the list. See: `dojo.query()` and `dojo.NodeList()`
+               //      |       dojo.query(".someClassName").style("visibility","hidden");
+               //      |       // or
+               //      |       dojo.query("#baz > div").style({
+               //      |               opacity:0.75,
+               //      |               fontSize:"13pt"
+               //      |       });
+
+               var n = byId(node), args = arguments.length, op = (style == "opacity");
+               style = _floatAliases[style] || style;
+               if(args == 3){
+                       return op ? d._setOpacity(n, value) : n.style[style] = value; /*Number*/
+               }
+               if(args == 2 && op){
+                       return d._getOpacity(n);
+               }
+               var s = gcs(n);
+               if(args == 2 && typeof style != "string"){ // inline'd type check
+                       for(var x in style){
+                               d.style(node, x, style[x]);
+                       }
+                       return s;
+               }
+               return (args == 1) ? s : _toStyleValue(n, style, s[style] || n.style[style]); /* CSS2Properties||String||Number */
+       }
+
+       // =============================
+       // Box Functions
+       // =============================
+
+       dojo._getPadExtents = function(/*DomNode*/n, /*Object*/computedStyle){
+               //      summary:
+               //              Returns object with special values specifically useful for node
+               //              fitting.
+               //      description:
+               //              Returns an object with `w`, `h`, `l`, `t` properties:
+               //      |               l/t = left/top padding (respectively)
+               //      |               w = the total of the left and right padding 
+               //      |               h = the total of the top and bottom padding
+               //              If 'node' has position, l/t forms the origin for child nodes.
+               //              The w/h are used for calculating boxes.
+               //              Normally application code will not need to invoke this
+               //              directly, and will use the ...box... functions instead.
+               var 
+                       s = computedStyle||gcs(n),
+                       l = px(n, s.paddingLeft),
+                       t = px(n, s.paddingTop);
+               return {
+                       l: l,
+                       t: t,
+                       w: l+px(n, s.paddingRight),
+                       h: t+px(n, s.paddingBottom)
+               };
+       }
+
+       dojo._getBorderExtents = function(/*DomNode*/n, /*Object*/computedStyle){
+               //      summary:
+               //              returns an object with properties useful for noting the border
+               //              dimensions.
+               //      description:
+               //              * l/t = the sum of left/top border (respectively)
+               //              * w = the sum of the left and right border
+               //              * h = the sum of the top and bottom border
+               //
+               //              The w/h are used for calculating boxes.
+               //              Normally application code will not need to invoke this
+               //              directly, and will use the ...box... functions instead.
+               var 
+                       ne = "none",
+                       s = computedStyle||gcs(n),
+                       bl = (s.borderLeftStyle != ne ? px(n, s.borderLeftWidth) : 0),
+                       bt = (s.borderTopStyle != ne ? px(n, s.borderTopWidth) : 0);
+               return {
+                       l: bl,
+                       t: bt,
+                       w: bl + (s.borderRightStyle!=ne ? px(n, s.borderRightWidth) : 0),
+                       h: bt + (s.borderBottomStyle!=ne ? px(n, s.borderBottomWidth) : 0)
+               };
+       }
+
+       dojo._getPadBorderExtents = function(/*DomNode*/n, /*Object*/computedStyle){
+               //      summary:
+               //              Returns object with properties useful for box fitting with
+               //              regards to padding.
+               // description:
+               //              * l/t = the sum of left/top padding and left/top border (respectively)
+               //              * w = the sum of the left and right padding and border
+               //              * h = the sum of the top and bottom padding and border
+               //
+               //              The w/h are used for calculating boxes.
+               //              Normally application code will not need to invoke this
+               //              directly, and will use the ...box... functions instead.
+               var 
+                       s = computedStyle||gcs(n),
+                       p = d._getPadExtents(n, s),
+                       b = d._getBorderExtents(n, s);
+               return {
+                       l: p.l + b.l,
+                       t: p.t + b.t,
+                       w: p.w + b.w,
+                       h: p.h + b.h
+               };
+       }
+
+       dojo._getMarginExtents = function(n, computedStyle){
+               //      summary:
+               //              returns object with properties useful for box fitting with
+               //              regards to box margins (i.e., the outer-box).
+               //
+               //              * l/t = marginLeft, marginTop, respectively
+               //              * w = total width, margin inclusive
+               //              * h = total height, margin inclusive
+               //
+               //              The w/h are used for calculating boxes.
+               //              Normally application code will not need to invoke this
+               //              directly, and will use the ...box... functions instead.
+               var 
+                       s = computedStyle||gcs(n),
+                       l = px(n, s.marginLeft),
+                       t = px(n, s.marginTop),
+                       r = px(n, s.marginRight),
+                       b = px(n, s.marginBottom);
+               if(d.isWebKit && (s.position != "absolute")){
+                       // FIXME: Safari's version of the computed right margin
+                       // is the space between our right edge and the right edge 
+                       // of our offsetParent.
+                       // What we are looking for is the actual margin value as 
+                       // determined by CSS.
+                       // Hack solution is to assume left/right margins are the same.
+                       r = l;
+               }
+               return {
+                       l: l,
+                       t: t,
+                       w: l+r,
+                       h: t+b
+               };
+       }
+
+       // Box getters work in any box context because offsetWidth/clientWidth
+       // are invariant wrt box context
+       //
+       // They do *not* work for display: inline objects that have padding styles
+       // because the user agent ignores padding (it's bogus styling in any case)
+       //
+       // Be careful with IMGs because they are inline or block depending on 
+       // browser and browser mode.
+
+       // Although it would be easier to read, there are not separate versions of 
+       // _getMarginBox for each browser because:
+       // 1. the branching is not expensive
+       // 2. factoring the shared code wastes cycles (function call overhead)
+       // 3. duplicating the shared code wastes bytes
+
+       dojo._getMarginBox = function(/*DomNode*/node, /*Object*/computedStyle){
+               // summary:
+               //              returns an object that encodes the width, height, left and top
+               //              positions of the node's margin box.
+               var s = computedStyle || gcs(node), me = d._getMarginExtents(node, s);
+               var l = node.offsetLeft - me.l, t = node.offsetTop - me.t, p = node.parentNode;
+                               if(d.isMoz){
+                       // Mozilla:
+                       // If offsetParent has a computed overflow != visible, the offsetLeft is decreased
+                       // by the parent's border.
+                       // We don't want to compute the parent's style, so instead we examine node's
+                       // computed left/top which is more stable.
+                       var sl = parseFloat(s.left), st = parseFloat(s.top);
+                       if(!isNaN(sl) && !isNaN(st)){
+                               l = sl, t = st;
+                       }else{
+                               // If child's computed left/top are not parseable as a number (e.g. "auto"), we
+                               // have no choice but to examine the parent's computed style.
+                               if(p && p.style){
+                                       var pcs = gcs(p);
+                                       if(pcs.overflow != "visible"){
+                                               var be = d._getBorderExtents(p, pcs);
+                                               l += be.l, t += be.t;
+                                       }
+                               }
+                       }
+               }else if(d.isOpera || (d.isIE > 7 && !d.isQuirks)){
+                       // On Opera and IE 8, offsetLeft/Top includes the parent's border
+                       if(p){
+                               be = d._getBorderExtents(p);
+                               l -= be.l;
+                               t -= be.t;
+                       }
+               }
+                               return {
+                       l: l,
+                       t: t,
+                       w: node.offsetWidth + me.w,
+                       h: node.offsetHeight + me.h 
+               };
+       }
+
+       dojo._getContentBox = function(node, computedStyle){
+               // summary:
+               //              Returns an object that encodes the width, height, left and top
+               //              positions of the node's content box, irrespective of the
+               //              current box model.
+
+               // clientWidth/Height are important since the automatically account for scrollbars
+               // fallback to offsetWidth/Height for special cases (see #3378)
+               var s = computedStyle || gcs(node),
+                       pe = d._getPadExtents(node, s),
+                       be = d._getBorderExtents(node, s),
+                       w = node.clientWidth,
+                       h
+               ;
+               if(!w){
+                       w = node.offsetWidth, h = node.offsetHeight;
+               }else{
+                       h = node.clientHeight, be.w = be.h = 0;
+               }
+               // On Opera, offsetLeft includes the parent's border
+                               if(d.isOpera){ pe.l += be.l; pe.t += be.t; };
+                               return {
+                       l: pe.l,
+                       t: pe.t,
+                       w: w - pe.w - be.w,
+                       h: h - pe.h - be.h
+               };
+       }
+
+       dojo._getBorderBox = function(node, computedStyle){
+               var s = computedStyle || gcs(node),
+                       pe = d._getPadExtents(node, s),
+                       cb = d._getContentBox(node, s)
+               ;
+               return {
+                       l: cb.l - pe.l,
+                       t: cb.t - pe.t,
+                       w: cb.w + pe.w,
+                       h: cb.h + pe.h
+               };
+       }
+
+       // Box setters depend on box context because interpretation of width/height styles
+       // vary wrt box context.
+       //
+       // The value of dojo.boxModel is used to determine box context.
+       // dojo.boxModel can be set directly to change behavior.
+       //
+       // Beware of display: inline objects that have padding styles
+       // because the user agent ignores padding (it's a bogus setup anyway)
+       //
+       // Be careful with IMGs because they are inline or block depending on 
+       // browser and browser mode.
+       //
+       // Elements other than DIV may have special quirks, like built-in
+       // margins or padding, or values not detectable via computedStyle.
+       // In particular, margins on TABLE do not seems to appear 
+       // at all in computedStyle on Mozilla.
+
+       dojo._setBox = function(/*DomNode*/node, /*Number?*/l, /*Number?*/t, /*Number?*/w, /*Number?*/h, /*String?*/u){
+               //      summary:
+               //              sets width/height/left/top in the current (native) box-model
+               //              dimentions. Uses the unit passed in u.
+               //      node:
+               //              DOM Node reference. Id string not supported for performance
+               //              reasons.
+               //      l:
+               //              left offset from parent.
+               //      t:
+               //              top offset from parent.
+               //      w:
+               //              width in current box model.
+               //      h:
+               //              width in current box model.
+               //      u:
+               //              unit measure to use for other measures. Defaults to "px".
+               u = u || "px";
+               var s = node.style;
+               if(!isNaN(l)){ s.left = l + u; }
+               if(!isNaN(t)){ s.top = t + u; }
+               if(w >= 0){ s.width = w + u; }
+               if(h >= 0){ s.height = h + u; }
+       }
+
+       dojo._isButtonTag = function(/*DomNode*/node) {
+               // summary:
+               //              True if the node is BUTTON or INPUT.type="button".
+               return node.tagName == "BUTTON"
+                       || node.tagName=="INPUT" && (node.getAttribute("type")||'').toUpperCase() == "BUTTON"; // boolean
+       }
+
+       dojo._usesBorderBox = function(/*DomNode*/node){
+               //      summary:
+               //              True if the node uses border-box layout.
+
+               // We could test the computed style of node to see if a particular box
+               // has been specified, but there are details and we choose not to bother.
+
+               // TABLE and BUTTON (and INPUT type=button) are always border-box by default.
+               // If you have assigned a different box to either one via CSS then
+               // box functions will break.
+
+               var n = node.tagName;
+               return d.boxModel=="border-box" || n=="TABLE" || d._isButtonTag(node); // boolean
+       }
+
+       dojo._setContentSize = function(/*DomNode*/node, /*Number*/widthPx, /*Number*/heightPx, /*Object*/computedStyle){
+               //      summary:
+               //              Sets the size of the node's contents, irrespective of margins,
+               //              padding, or borders.
+               if(d._usesBorderBox(node)){
+                       var pb = d._getPadBorderExtents(node, computedStyle);
+                       if(widthPx >= 0){ widthPx += pb.w; }
+                       if(heightPx >= 0){ heightPx += pb.h; }
+               }
+               d._setBox(node, NaN, NaN, widthPx, heightPx);
+       }
+
+       dojo._setMarginBox = function(/*DomNode*/node,  /*Number?*/leftPx, /*Number?*/topPx,
+                                                                                                       /*Number?*/widthPx, /*Number?*/heightPx,
+                                                                                                       /*Object*/computedStyle){
+               //      summary:
+               //              sets the size of the node's margin box and placement
+               //              (left/top), irrespective of box model. Think of it as a
+               //              passthrough to dojo._setBox that handles box-model vagaries for
+               //              you.
+
+               var s = computedStyle || gcs(node),
+               // Some elements have special padding, margin, and box-model settings.
+               // To use box functions you may need to set padding, margin explicitly.
+               // Controlling box-model is harder, in a pinch you might set dojo.boxModel.
+                       bb = d._usesBorderBox(node),
+                       pb = bb ? _nilExtents : d._getPadBorderExtents(node, s)
+               ;
+               if(d.isWebKit){
+                       // on Safari (3.1.2), button nodes with no explicit size have a default margin
+                       // setting an explicit size eliminates the margin.
+                       // We have to swizzle the width to get correct margin reading.
+                       if(d._isButtonTag(node)){
+                               var ns = node.style;
+                               if(widthPx >= 0 && !ns.width) { ns.width = "4px"; }
+                               if(heightPx >= 0 && !ns.height) { ns.height = "4px"; }
+                       }
+               }
+               var mb = d._getMarginExtents(node, s);
+               if(widthPx >= 0){ widthPx = Math.max(widthPx - pb.w - mb.w, 0); }
+               if(heightPx >= 0){ heightPx = Math.max(heightPx - pb.h - mb.h, 0); }
+               d._setBox(node, leftPx, topPx, widthPx, heightPx);
+       }
+
+       var _nilExtents = { l:0, t:0, w:0, h:0 };
+
+       // public API
+
+       dojo.marginBox = function(/*DomNode|String*/node, /*Object?*/box){
+               //      summary:
+               //              Getter/setter for the margin-box of node.
+               //      description:
+               //              Getter/setter for the margin-box of node.
+               //              Returns an object in the expected format of box (regardless
+               //              if box is passed). The object might look like:
+               //                      `{ l: 50, t: 200, w: 300: h: 150 }`
+               //              for a node offset from its parent 50px to the left, 200px from
+               //              the top with a margin width of 300px and a margin-height of
+               //              150px.
+               //      node:
+               //              id or reference to DOM Node to get/set box for
+               //      box:
+               //              If passed, denotes that dojo.marginBox() should
+               //              update/set the margin box for node. Box is an object in the
+               //              above format. All properties are optional if passed.
+               //      example:
+               //      Retrieve the marginbox of a passed node
+               //      |       var box = dojo.marginBox("someNodeId");
+               //      |       console.dir(box);
+               //
+               //      example:
+               //      Set a node's marginbox to the size of another node
+               //      |       var box = dojo.marginBox("someNodeId");
+               //      |       dojo.marginBox("someOtherNode", box);
+               
+               var n = byId(node), s = gcs(n), b = box;
+               return !b ? d._getMarginBox(n, s) : d._setMarginBox(n, b.l, b.t, b.w, b.h, s); // Object
+       }
+
+       dojo.contentBox = function(/*DomNode|String*/node, /*Object?*/box){
+               //      summary:
+               //              Getter/setter for the content-box of node.
+               //      description:
+               //              Returns an object in the expected format of box (regardless if box is passed).
+               //              The object might look like:
+               //                      `{ l: 50, t: 200, w: 300: h: 150 }`
+               //              for a node offset from its parent 50px to the left, 200px from
+               //              the top with a content width of 300px and a content-height of
+               //              150px. Note that the content box may have a much larger border
+               //              or margin box, depending on the box model currently in use and
+               //              CSS values set/inherited for node.
+               //      node:
+               //              id or reference to DOM Node to get/set box for
+               //      box:
+               //              If passed, denotes that dojo.contentBox() should
+               //              update/set the content box for node. Box is an object in the
+               //              above format. All properties are optional if passed.
+               var n = byId(node), s = gcs(n), b = box;
+               return !b ? d._getContentBox(n, s) : d._setContentSize(n, b.w, b.h, s); // Object
+       }
+
+       // =============================
+       // Positioning 
+       // =============================
+
+       var _sumAncestorProperties = function(node, prop){
+               if(!(node = (node||0).parentNode)){return 0}
+               var val, retVal = 0, _b = d.body();
+               while(node && node.style){
+                       if(gcs(node).position == "fixed"){
+                               return 0;
+                       }
+                       val = node[prop];
+                       if(val){
+                               retVal += val - 0;
+                               // opera and khtml #body & #html has the same values, we only
+                               // need one value
+                               if(node == _b){ break; }
+                       }
+                       node = node.parentNode;
+               }
+               return retVal;  //      integer
+       }
+
+       dojo._docScroll = function(){
+               var n = d.global;
+               return "pageXOffset" in n? { x:n.pageXOffset, y:n.pageYOffset } :
+                       (n=d.doc.documentElement, n.clientHeight? { x:d._fixIeBiDiScrollLeft(n.scrollLeft), y:n.scrollTop } :
+                       (n=d.body(), { x:n.scrollLeft||0, y:n.scrollTop||0 }));
+       };
+
+       dojo._isBodyLtr = function(){
+               return "_bodyLtr" in d? d._bodyLtr :
+                       d._bodyLtr = (d.body().dir || d.doc.documentElement.dir || "ltr").toLowerCase() == "ltr"; // Boolean 
+       }
+
+               dojo._getIeDocumentElementOffset = function(){
+               //      summary:
+               //              returns the offset in x and y from the document body to the
+               //              visual edge of the page
+               //      description:
+               // The following values in IE contain an offset:
+               //      |               event.clientX
+               //      |               event.clientY
+               //      |               node.getBoundingClientRect().left
+               //      |               node.getBoundingClientRect().top
+               //              But other position related values do not contain this offset,
+               //              such as node.offsetLeft, node.offsetTop, node.style.left and
+               //              node.style.top. The offset is always (2, 2) in LTR direction.
+               //              When the body is in RTL direction, the offset counts the width
+               //              of left scroll bar's width.  This function computes the actual
+               //              offset.
+
+               //NOTE: assumes we're being called in an IE browser
+
+               var de = d.doc.documentElement; // only deal with HTML element here, _abs handles body/quirks 
+
+               if(d.isIE < 8){
+                       var r = de.getBoundingClientRect(); // works well for IE6+
+                       //console.debug('rect left,top = ' + r.left+','+r.top + ', html client left/top = ' + de.clientLeft+','+de.clientTop + ', rtl = ' + (!d._isBodyLtr()) + ', quirks = ' + d.isQuirks);
+                       var l = r.left,
+                           t = r.top;
+                       if(d.isIE < 7){
+                               l += de.clientLeft;     // scrollbar size in strict/RTL, or,
+                               t += de.clientTop;      // HTML border size in strict
+                       }
+                       return {
+                               x: l < 0? 0 : l, // FRAME element border size can lead to inaccurate negative values
+                               y: t < 0? 0 : t
+                       };
+               }else{
+                       return {
+                               x: 0,
+                               y: 0
+                       };
+               }
+
+       };
+       
+       dojo._fixIeBiDiScrollLeft = function(/*Integer*/ scrollLeft){
+               // In RTL direction, scrollLeft should be a negative value, but IE < 8
+               // returns a positive one. All codes using documentElement.scrollLeft
+               // must call this function to fix this error, otherwise the position
+               // will offset to right when there is a horizontal scrollbar.
+
+                               var dd = d.doc;
+               if(d.isIE < 8 && !d._isBodyLtr()){
+                       var de = d.isQuirks ? dd.body : dd.documentElement;
+                       return scrollLeft + de.clientWidth - de.scrollWidth; // Integer
+               }
+                               return scrollLeft; // Integer
+       }
+
+       // FIXME: need a setter for coords or a moveTo!!
+       dojo._abs = dojo.position = function(/*DomNode*/node, /*Boolean?*/includeScroll){
+               //      summary:
+               //              Gets the position and size of the passed element relative to
+               //              the viewport (if includeScroll==false), or relative to the
+               //              document root (if includeScroll==true).
+               //
+               //      description:
+               //              Returns an object of the form:
+               //                      { x: 100, y: 300, w: 20, h: 15 }
+               //              If includeScroll==true, the x and y values will include any
+               //              document offsets that may affect the position relative to the
+               //              viewport.
+               //              Uses the border-box model (inclusive of border and padding but
+               //              not margin).  Does not act as a setter.
+
+               var db = d.body(), dh = db.parentNode, ret;
+               node = byId(node);
+               if(node["getBoundingClientRect"]){
+                       // IE6+, FF3+, super-modern WebKit, and Opera 9.6+ all take this branch
+                       ret = node.getBoundingClientRect();
+                       ret = { x: ret.left, y: ret.top, w: ret.right - ret.left, h: ret.bottom - ret.top };
+                                       if(d.isIE){
+                               // On IE there's a 2px offset that we need to adjust for, see _getIeDocumentElementOffset()
+                               var offset = d._getIeDocumentElementOffset();
+
+                               // fixes the position in IE, quirks mode
+                               ret.x -= offset.x + (d.isQuirks ? db.clientLeft+db.offsetLeft : 0);
+                               ret.y -= offset.y + (d.isQuirks ? db.clientTop+db.offsetTop : 0);
+                       }else if(d.isFF == 3){
+                               // In FF3 you have to subtract the document element margins.
+                               // Fixed in FF3.5 though.
+                               var cs = gcs(dh);
+                               ret.x -= px(dh, cs.marginLeft) + px(dh, cs.borderLeftWidth);
+                               ret.y -= px(dh, cs.marginTop) + px(dh, cs.borderTopWidth);
+                       }
+                               }else{
+                       // FF2 and older WebKit
+                       ret = {
+                               x: 0,
+                               y: 0,
+                               w: node.offsetWidth,
+                               h: node.offsetHeight
+                       };
+                       if(node["offsetParent"]){
+                               ret.x -= _sumAncestorProperties(node, "scrollLeft");
+                               ret.y -= _sumAncestorProperties(node, "scrollTop");
+
+                               var curnode = node;
+                               do{
+                                       var n = curnode.offsetLeft,
+                                               t = curnode.offsetTop;
+                                       ret.x += isNaN(n) ? 0 : n;
+                                       ret.y += isNaN(t) ? 0 : t;
+
+                                       cs = gcs(curnode);
+                                       if(curnode != node){
+                                                               if(d.isMoz){
+                                                       // tried left+right with differently sized left/right borders
+                                                       // it really is 2xleft border in FF, not left+right, even in RTL!
+                                                       ret.x += 2 * px(curnode,cs.borderLeftWidth);
+                                                       ret.y += 2 * px(curnode,cs.borderTopWidth);
+                                               }else{
+                                                                       ret.x += px(curnode, cs.borderLeftWidth);
+                                                       ret.y += px(curnode, cs.borderTopWidth);
+                                                               }
+                                                       }
+                                       // static children in a static div in FF2 are affected by the div's border as well
+                                       // but offsetParent will skip this div!
+                                                       if(d.isMoz && cs.position=="static"){
+                                               var parent=curnode.parentNode;
+                                               while(parent!=curnode.offsetParent){
+                                                       var pcs=gcs(parent);
+                                                       if(pcs.position=="static"){
+                                                               ret.x += px(curnode,pcs.borderLeftWidth);
+                                                               ret.y += px(curnode,pcs.borderTopWidth);
+                                                       }
+                                                       parent=parent.parentNode;
+                                               }
+                                       }
+                                                       curnode = curnode.offsetParent;
+                               }while((curnode != dh) && curnode);
+                       }else if(node.x && node.y){
+                               ret.x += isNaN(node.x) ? 0 : node.x;
+                               ret.y += isNaN(node.y) ? 0 : node.y;
+                       }
+               }
+               // account for document scrolling
+               // if offsetParent is used, ret value already includes scroll position
+               // so we may have to actually remove that value if !includeScroll
+               if(includeScroll){
+                       var scroll = d._docScroll();
+                       ret.x += scroll.x;
+                       ret.y += scroll.y;
+               }
+
+               return ret; // Object
+       }
+
+       dojo.coords = function(/*DomNode|String*/node, /*Boolean?*/includeScroll){
+               //      summary:
+               //              Deprecated: Use position() for border-box x/y/w/h
+               //              or marginBox() for margin-box w/h/l/t.
+               //              Returns an object representing a node's size and position.
+               //
+               //      description:
+               //              Returns an object that measures margin-box (w)idth/(h)eight
+               //              and absolute position x/y of the border-box. Also returned
+               //              is computed (l)eft and (t)op values in pixels from the
+               //              node's offsetParent as returned from marginBox().
+               //              Return value will be in the form:
+               //|                     { l: 50, t: 200, w: 300: h: 150, x: 100, y: 300 }
+               //              Does not act as a setter. If includeScroll is passed, the x and
+               //              y params are affected as one would expect in dojo.position().
+               var n = byId(node), s = gcs(n), mb = d._getMarginBox(n, s);
+               var abs = d.position(n, includeScroll);
+               mb.x = abs.x;
+               mb.y = abs.y;
+               return mb;
+       }
+
+       // =============================
+       // Element attribute Functions
+       // =============================
+
+       // dojo.attr() should conform to http://www.w3.org/TR/DOM-Level-2-Core/
+
+       var _propNames = {
+                       // properties renamed to avoid clashes with reserved words
+                       "class":   "className",
+                       "for":     "htmlFor",
+                       // properties written as camelCase
+                       tabindex:  "tabIndex",
+                       readonly:  "readOnly",
+                       colspan:   "colSpan",
+                       frameborder: "frameBorder",
+                       rowspan:   "rowSpan",
+                       valuetype: "valueType"
+               },
+               _attrNames = {
+                       // original attribute names
+                       classname: "class",
+                       htmlfor:   "for",
+                       // for IE
+                       tabindex:  "tabIndex",
+                       readonly:  "readOnly"
+               },
+               _forcePropNames = {
+                       innerHTML: 1,
+                       className: 1,
+                       htmlFor:   d.isIE,
+                       value:     1
+               };
+
+       var _fixAttrName = function(/*String*/ name){
+               return _attrNames[name.toLowerCase()] || name;
+       };
+
+       var _hasAttr = function(node, name){
+               var attr = node.getAttributeNode && node.getAttributeNode(name);
+               return attr && attr.specified; // Boolean
+       };
+
+       // There is a difference in the presence of certain properties and their default values
+       // between browsers. For example, on IE "disabled" is present on all elements,
+       // but it is value is "false"; "tabIndex" of <div> returns 0 by default on IE, yet other browsers
+       // can return -1.
+
+       dojo.hasAttr = function(/*DomNode|String*/node, /*String*/name){
+               //      summary:
+               //              Returns true if the requested attribute is specified on the
+               //              given element, and false otherwise.
+               //      node:
+               //              id or reference to the element to check
+               //      name:
+               //              the name of the attribute
+               //      returns:
+               //              true if the requested attribute is specified on the
+               //              given element, and false otherwise
+               var lc = name.toLowerCase();
+               return _forcePropNames[_propNames[lc] || name] || _hasAttr(byId(node), _attrNames[lc] || name); // Boolean
+       }
+
+       var _evtHdlrMap = {}, _ctr = 0,
+               _attrId = dojo._scopeName + "attrid",
+               // the next dictionary lists elements with read-only innerHTML on IE
+               _roInnerHtml = {col: 1, colgroup: 1,
+                       // frameset: 1, head: 1, html: 1, style: 1,
+                       table: 1, tbody: 1, tfoot: 1, thead: 1, tr: 1, title: 1};
+
+       dojo.attr = function(/*DomNode|String*/node, /*String|Object*/name, /*String?*/value){
+               //      summary:
+               //              Gets or sets an attribute on an HTML element.
+               //      description:
+               //              Handles normalized getting and setting of attributes on DOM
+               //              Nodes. If 2 arguments are passed, and a the second argumnt is a
+               //              string, acts as a getter.
+               //
+               //              If a third argument is passed, or if the second argument is a
+               //              map of attributes, acts as a setter.
+               //
+               //              When passing functions as values, note that they will not be
+               //              directly assigned to slots on the node, but rather the default
+               //              behavior will be removed and the new behavior will be added
+               //              using `dojo.connect()`, meaning that event handler properties
+               //              will be normalized and that some caveats with regards to
+               //              non-standard behaviors for onsubmit apply. Namely that you
+               //              should cancel form submission using `dojo.stopEvent()` on the
+               //              passed event object instead of returning a boolean value from
+               //              the handler itself.
+               //      node:
+               //              id or reference to the element to get or set the attribute on
+               //      name:
+               //              the name of the attribute to get or set.
+               //      value:
+               //              The value to set for the attribute
+               //      returns:
+               //              when used as a getter, the value of the requested attribute
+               //              or null if that attribute does not have a specified or
+               //              default value;
+               //
+               //              when used as a setter, the DOM node
+               //
+               //      example:
+               //      |       // get the current value of the "foo" attribute on a node
+               //      |       dojo.attr(dojo.byId("nodeId"), "foo");
+               //      |       // or we can just pass the id:
+               //      |       dojo.attr("nodeId", "foo");
+               //
+               //      example:
+               //      |       // use attr() to set the tab index
+               //      |       dojo.attr("nodeId", "tabIndex", 3);
+               //      |
+               //
+               //      example:
+               //      Set multiple values at once, including event handlers:
+               //      |       dojo.attr("formId", {
+               //      |               "foo": "bar",
+               //      |               "tabIndex": -1,
+               //      |               "method": "POST",
+               //      |               "onsubmit": function(e){
+               //      |                       // stop submitting the form. Note that the IE behavior
+               //      |                       // of returning true or false will have no effect here
+               //      |                       // since our handler is connect()ed to the built-in
+               //      |                       // onsubmit behavior and so we need to use
+               //      |                       // dojo.stopEvent() to ensure that the submission
+               //      |                       // doesn't proceed.
+               //      |                       dojo.stopEvent(e);
+               //      |
+               //      |                       // submit the form with Ajax
+               //      |                       dojo.xhrPost({ form: "formId" });
+               //      |               }
+               //      |       });
+               //
+               //      example:
+               //      Style is s special case: Only set with an object hash of styles
+               //      |       dojo.attr("someNode",{
+               //      |               id:"bar",
+               //      |               style:{
+               //      |                       width:"200px", height:"100px", color:"#000"
+               //      |               }
+               //      |       });
+               //
+               //      example:
+               //      Again, only set style as an object hash of styles:
+               //      |       var obj = { color:"#fff", backgroundColor:"#000" };
+               //      |       dojo.attr("someNode", "style", obj);
+               //      |
+               //      |       // though shorter to use `dojo.style()` in this case:
+               //      |       dojo.style("someNode", obj);
+
+               node = byId(node);
+               var args = arguments.length, prop;
+               if(args == 2 && typeof name != "string"){ // inline'd type check
+                       // the object form of setter: the 2nd argument is a dictionary
+                       for(var x in name){
+                               d.attr(node, x, name[x]);
+                       }
+                       return node; // DomNode
+               }
+               var lc = name.toLowerCase(),
+                       propName = _propNames[lc] || name,
+                       forceProp = _forcePropNames[propName],
+                       attrName = _attrNames[lc] || name;
+               if(args == 3){
+                       // setter
+                       do{
+                               if(propName == "style" && typeof value != "string"){ // inline'd type check
+                                       // special case: setting a style
+                                       d.style(node, value);
+                                       break;
+                               }
+                               if(propName == "innerHTML"){
+                                       // special case: assigning HTML
+                                                                               if(d.isIE && node.tagName.toLowerCase() in _roInnerHtml){
+                                               d.empty(node);
+                                               node.appendChild(d._toDom(value, node.ownerDocument));
+                                       }else{
+                                                                                       node[propName] = value;
+                                                                               }
+                                                                               break;
+                               }
+                               if(d.isFunction(value)){
+                                       // special case: assigning an event handler
+                                       // clobber if we can
+                                       var attrId = d.attr(node, _attrId);
+                                       if(!attrId){
+                                               attrId = _ctr++;
+                                               d.attr(node, _attrId, attrId);
+                                       }
+                                       if(!_evtHdlrMap[attrId]){
+                                               _evtHdlrMap[attrId] = {};
+                                       }
+                                       var h = _evtHdlrMap[attrId][propName];
+                                       if(h){
+                                               d.disconnect(h);
+                                       }else{
+                                               try{
+                                                       delete node[propName];
+                                               }catch(e){}
+                                       }
+                                       // ensure that event objects are normalized, etc.
+                                       _evtHdlrMap[attrId][propName] = d.connect(node, propName, value);
+                                       break;
+                               }
+                               if(forceProp || typeof value == "boolean"){
+                                       // special case: forcing assignment to the property
+                                       // special case: setting boolean to a property instead of attribute
+                                       node[propName] = value;
+                                       break;
+                               }
+                               // node's attribute
+                               node.setAttribute(attrName, value);
+                       }while(false);
+                       return node; // DomNode
+               }
+               // getter
+               // should we access this attribute via a property or
+               // via getAttribute()?
+               value = node[propName];
+               if(forceProp && typeof value != "undefined"){
+                       // node's property
+                       return value;   // Anything
+               }
+               if(propName != "href" && (typeof value == "boolean" || d.isFunction(value))){
+                       // node's property
+                       return value;   // Anything
+               }
+               // node's attribute
+               // we need _hasAttr() here to guard against IE returning a default value
+               return _hasAttr(node, attrName) ? node.getAttribute(attrName) : null; // Anything
+       }
+
+       dojo.removeAttr = function(/*DomNode|String*/ node, /*String*/ name){
+               //      summary:
+               //              Removes an attribute from an HTML element.
+               //      node:
+               //              id or reference to the element to remove the attribute from
+               //      name:
+               //              the name of the attribute to remove
+               byId(node).removeAttribute(_fixAttrName(name));
+       }
+
+       dojo.getNodeProp = function(/*DomNode|String*/ node, /*String*/ name){
+               //      summary:
+               //              Returns an effective value of a property or an attribute.
+               //      node:
+               //              id or reference to the element to remove the attribute from
+               //      name:
+               //              the name of the attribute
+               node = byId(node);
+               var lc = name.toLowerCase(),
+                       propName = _propNames[lc] || name;
+               if((propName in node) && propName != "href"){
+                       // node's property
+                       return node[propName];  // Anything
+               }
+               // node's attribute
+               var attrName = _attrNames[lc] || name;
+               return _hasAttr(node, attrName) ? node.getAttribute(attrName) : null; // Anything
+       }
+
+       dojo.create = function(tag, attrs, refNode, pos){
+               //      summary:
+               //              Create an element, allowing for optional attribute decoration
+               //              and placement.
+               //
+               // description:
+               //              A DOM Element creation function. A shorthand method for creating a node or
+               //              a fragment, and allowing for a convenient optional attribute setting step,
+               //              as well as an optional DOM placement reference.
+               //|
+               //              Attributes are set by passing the optional object through `dojo.attr`.
+               //              See `dojo.attr` for noted caveats and nuances, and API if applicable.
+               //|
+               //              Placement is done via `dojo.place`, assuming the new node to be the action 
+               //              node, passing along the optional reference node and position.
+               //
+               // tag: String|DomNode
+               //              A string of the element to create (eg: "div", "a", "p", "li", "script", "br"),
+               //              or an existing DOM node to process.
+               //
+               // attrs: Object
+               //              An object-hash of attributes to set on the newly created node.
+               //              Can be null, if you don't want to set any attributes/styles.
+               //              See: `dojo.attr` for a description of available attributes.
+               //
+               // refNode: String?|DomNode?
+               //              Optional reference node. Used by `dojo.place` to place the newly created
+               //              node somewhere in the dom relative to refNode. Can be a DomNode reference
+               //              or String ID of a node.
+               //
+               // pos: String?
+               //              Optional positional reference. Defaults to "last" by way of `dojo.place`,
+               //              though can be set to "first","after","before","last", "replace" or "only"
+               //              to further control the placement of the new node relative to the refNode.
+               //              'refNode' is required if a 'pos' is specified.
+               //
+               // returns: DomNode
+               //
+               // example:
+               //      Create a DIV:
+               //      |       var n = dojo.create("div");
+               //
+               // example:
+               //      Create a DIV with content:
+               //      |       var n = dojo.create("div", { innerHTML:"<p>hi</p>" });
+               //
+               // example:
+               //      Place a new DIV in the BODY, with no attributes set
+               //      |       var n = dojo.create("div", null, dojo.body());
+               //
+               // example:
+               //      Create an UL, and populate it with LI's. Place the list as the first-child of a 
+               //      node with id="someId":
+               //      |       var ul = dojo.create("ul", null, "someId", "first");
+               //      |       var items = ["one", "two", "three", "four"];
+               //      |       dojo.forEach(items, function(data){
+               //      |               dojo.create("li", { innerHTML: data }, ul);
+               //      |       });
+               //
+               // example:
+               //      Create an anchor, with an href. Place in BODY:
+               //      |       dojo.create("a", { href:"foo.html", title:"Goto FOO!" }, dojo.body());
+               //
+               // example:
+               //      Create a `dojo.NodeList()` from a new element (for syntatic sugar):
+               //      |       dojo.query(dojo.create('div'))
+               //      |               .addClass("newDiv")
+               //      |               .onclick(function(e){ console.log('clicked', e.target) })
+               //      |               .place("#someNode"); // redundant, but cleaner.
+
+               var doc = d.doc;
+               if(refNode){
+                       refNode = byId(refNode);
+                       doc = refNode.ownerDocument;
+               }
+               if(typeof tag == "string"){ // inline'd type check
+                       tag = doc.createElement(tag);
+               }
+               if(attrs){ d.attr(tag, attrs); }
+               if(refNode){ d.place(tag, refNode, pos); }
+               return tag; // DomNode
+       }
+
+       /*=====
+       dojo.empty = function(node){
+                       //      summary:
+                       //              safely removes all children of the node.
+                       //      node: DOMNode|String
+                       //              a reference to a DOM node or an id.
+                       //      example:
+                       //      Destroy node's children byId:
+                       //      |       dojo.empty("someId");
+                       //
+                       //      example:
+                       //      Destroy all nodes' children in a list by reference:
+                       //      |       dojo.query(".someNode").forEach(dojo.empty);
+       }
+       =====*/
+
+       d.empty =
+                               d.isIE ?  function(node){
+                       node = byId(node);
+                       for(var c; c = node.lastChild;){ // intentional assignment
+                               d.destroy(c);
+                       }
+               } :
+                               function(node){
+                       byId(node).innerHTML = "";
+               };
+
+       /*=====
+       dojo._toDom = function(frag, doc){
+                       //      summary:
+                       //              instantiates an HTML fragment returning the corresponding DOM.
+                       //      frag: String
+                       //              the HTML fragment
+                       //      doc: DocumentNode?
+                       //              optional document to use when creating DOM nodes, defaults to
+                       //              dojo.doc if not specified.
+                       //      returns: DocumentFragment
+                       //
+                       //      example:
+                       //      Create a table row:
+                       //      |       var tr = dojo._toDom("<tr><td>First!</td></tr>");
+       }
+       =====*/
+
+       // support stuff for dojo._toDom
+       var tagWrap = {
+                       option: ["select"],
+                       tbody: ["table"],
+                       thead: ["table"],
+                       tfoot: ["table"],
+                       tr: ["table", "tbody"],
+                       td: ["table", "tbody", "tr"],
+                       th: ["table", "thead", "tr"],
+                       legend: ["fieldset"],
+                       caption: ["table"],
+                       colgroup: ["table"],
+                       col: ["table", "colgroup"],
+                       li: ["ul"]
+               },
+               reTag = /<\s*([\w\:]+)/,
+               masterNode = {}, masterNum = 0,
+               masterName = "__" + d._scopeName + "ToDomId";
+
+       // generate start/end tag strings to use
+       // for the injection for each special tag wrap case.
+       for(var param in tagWrap){
+               var tw = tagWrap[param];
+               tw.pre  = param == "option" ? '<select multiple="multiple">' : "<" + tw.join("><") + ">";
+               tw.post = "</" + tw.reverse().join("></") + ">";
+               // the last line is destructive: it reverses the array,
+               // but we don't care at this point
+       }
+
+       d._toDom = function(frag, doc){
+               //      summary:
+               //              converts HTML string into DOM nodes.
+
+               doc = doc || d.doc;
+               var masterId = doc[masterName];
+               if(!masterId){
+                       doc[masterName] = masterId = ++masterNum + "";
+                       masterNode[masterId] = doc.createElement("div");
+               }
+
+               // make sure the frag is a string.
+               frag += "";
+
+               // find the starting tag, and get node wrapper
+               var match = frag.match(reTag),
+                       tag = match ? match[1].toLowerCase() : "",
+                       master = masterNode[masterId],
+                       wrap, i, fc, df;
+               if(match && tagWrap[tag]){
+                       wrap = tagWrap[tag];
+                       master.innerHTML = wrap.pre + frag + wrap.post;
+                       for(i = wrap.length; i; --i){
+                               master = master.firstChild;
+                       }
+               }else{
+                       master.innerHTML = frag;
+               }
+
+               // one node shortcut => return the node itself
+               if(master.childNodes.length == 1){
+                       return master.removeChild(master.firstChild); // DOMNode
+               }
+
+               // return multiple nodes as a document fragment
+               df = doc.createDocumentFragment();
+               while(fc = master.firstChild){ // intentional assignment
+                       df.appendChild(fc);
+               }
+               return df; // DOMNode
+       }
+
+       // =============================
+       // (CSS) Class Functions
+       // =============================
+       var _className = "className";
+
+       dojo.hasClass = function(/*DomNode|String*/node, /*String*/classStr){
+               //      summary:
+               //              Returns whether or not the specified classes are a portion of the
+               //              class list currently applied to the node.
+               //
+               //      node:
+               //              String ID or DomNode reference to check the class for.
+               //
+               //      classStr:
+               //              A string class name to look for.
+               //
+               //      example:
+               //      Do something if a node with id="someNode" has class="aSillyClassName" present
+               //      |       if(dojo.hasClass("someNode","aSillyClassName")){ ... }
+
+               return ((" "+ byId(node)[_className] +" ").indexOf(" " + classStr + " ") >= 0);  // Boolean
+       };
+
+       var spaces = /\s+/, a1 = [""],
+               str2array = function(s){
+                       if(typeof s == "string" || s instanceof String){
+                               if(s.indexOf(" ") < 0){
+                                       a1[0] = s;
+                                       return a1;
+                               }else{
+                                       return s.split(spaces);
+                               }
+                       }
+                       // assumed to be an array
+                       return s;
+               };
+
+       dojo.addClass = function(/*DomNode|String*/node, /*String|Array*/classStr){
+               //      summary:
+               //              Adds the specified classes to the end of the class list on the
+               //              passed node. Will not re-apply duplicate classes.
+               //
+               //      node:
+               //              String ID or DomNode reference to add a class string too
+               //
+               //      classStr:
+               //              A String class name to add, or several space-separated class names,
+               //              or an array of class names.
+               //
+               // example:
+               //      Add a class to some node:
+               //      |       dojo.addClass("someNode", "anewClass");
+               //
+               // example:
+               //      Add two classes at once:
+               //      |       dojo.addClass("someNode", "firstClass secondClass");
+               //
+               // example:
+               //      Add two classes at once (using array):
+               //      |       dojo.addClass("someNode", ["firstClass", "secondClass"]);
+               //
+               // example:
+               //      Available in `dojo.NodeList` for multiple additions
+               //      |       dojo.query("ul > li").addClass("firstLevel");
+
+               node = byId(node);
+               classStr = str2array(classStr);
+               var cls = " " + node[_className] + " ";
+               for(var i = 0, len = classStr.length, c; i < len; ++i){
+                       c = classStr[i];
+                       if(c && cls.indexOf(" " + c + " ") < 0){
+                               cls += c + " ";
+                       }
+               }
+               node[_className] = d.trim(cls);
+       };
+
+       dojo.removeClass = function(/*DomNode|String*/node, /*String|Array?*/classStr){
+               // summary:
+               //              Removes the specified classes from node. No `dojo.hasClass`
+               //              check is required.
+               //
+               // node:
+               //              String ID or DomNode reference to remove the class from.
+               //
+               // classStr:
+               //              An optional String class name to remove, or several space-separated
+               //              class names, or an array of class names. If omitted, all class names
+               //              will be deleted.
+               //
+               // example:
+               //      Remove a class from some node:
+               //      |       dojo.removeClass("someNode", "firstClass");
+               //
+               // example:
+               //      Remove two classes from some node:
+               //      |       dojo.removeClass("someNode", "firstClass secondClass");
+               //
+               // example:
+               //      Remove two classes from some node (using array):
+               //      |       dojo.removeClass("someNode", ["firstClass", "secondClass"]);
+               //
+               // example:
+               //      Remove all classes from some node:
+               //      |       dojo.removeClass("someNode");
+               //
+               // example:
+               //      Available in `dojo.NodeList()` for multiple removal
+               //      |       dojo.query(".foo").removeClass("foo");
+
+               node = byId(node);
+               var cls;
+               if(classStr !== undefined){
+                       classStr = str2array(classStr);
+                       cls = " " + node[_className] + " ";
+                       for(var i = 0, len = classStr.length; i < len; ++i){
+                               cls = cls.replace(" " + classStr[i] + " ", " ");
+                       }
+                       cls = d.trim(cls);
+               }else{
+                       cls = "";
+               }
+               if(node[_className] != cls){ node[_className] = cls; }
+       };
+
+       dojo.toggleClass = function(/*DomNode|String*/node, /*String|Array*/classStr, /*Boolean?*/condition){
+               //      summary:
+               //              Adds a class to node if not present, or removes if present.
+               //              Pass a boolean condition if you want to explicitly add or remove.
+               //      condition:
+               //              If passed, true means to add the class, false means to remove.
+               //
+               // example:
+               //      |       dojo.toggleClass("someNode", "hovered");
+               //
+               // example:
+               //      Forcefully add a class
+               //      |       dojo.toggleClass("someNode", "hovered", true);
+               //
+               // example:
+               //      Available in `dojo.NodeList()` for multiple toggles
+               //      |       dojo.query(".toggleMe").toggleClass("toggleMe");
+
+               if(condition === undefined){
+                       condition = !d.hasClass(node, classStr);
+               }
+               d[condition ? "addClass" : "removeClass"](node, classStr);
+       };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base.NodeList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.NodeList"] = true;
+dojo.provide("dojo._base.NodeList");
+
+
+
+(function(){
+
+       var d = dojo;
+
+       var ap = Array.prototype, aps = ap.slice, apc = ap.concat;
+
+       var tnl = function(/*Array*/ a, /*dojo.NodeList?*/ parent, /*Function?*/ NodeListCtor){
+               // summary:
+               //              decorate an array to make it look like a `dojo.NodeList`.
+               // a:
+               //              Array of nodes to decorate.
+               // parent:
+               //              An optional parent NodeList that generated the current
+               //              list of nodes. Used to call _stash() so the parent NodeList
+               //              can be accessed via end() later.
+               // NodeListCtor:
+               //              An optional constructor function to use for any
+               //              new NodeList calls. This allows a certain chain of
+               //              NodeList calls to use a different object than dojo.NodeList.
+               if(!a.sort){
+                       // make sure it's a real array before we pass it on to be wrapped
+                       a = aps.call(a, 0);
+               }
+               var ctor = NodeListCtor || this._NodeListCtor || d._NodeListCtor;
+               a.constructor = ctor;
+               dojo._mixin(a, ctor.prototype);
+               a._NodeListCtor = ctor;
+               return parent ? a._stash(parent) : a;
+       };
+
+       var loopBody = function(f, a, o){
+               a = [0].concat(aps.call(a, 0));
+               o = o || d.global;
+               return function(node){
+                       a[0] = node;
+                       return f.apply(o, a);
+               };
+       };
+
+       // adapters
+
+       var adaptAsForEach = function(f, o){
+               //      summary:
+               //              adapts a single node function to be used in the forEach-type
+               //              actions. The initial object is returned from the specialized
+               //              function.
+               //      f: Function
+               //              a function to adapt
+               //      o: Object?
+               //              an optional context for f
+               return function(){
+                       this.forEach(loopBody(f, arguments, o));
+                       return this;    // Object
+               };
+       };
+
+       var adaptAsMap = function(f, o){
+               //      summary:
+               //              adapts a single node function to be used in the map-type
+               //              actions. The return is a new array of values, as via `dojo.map`
+               //      f: Function
+               //              a function to adapt
+               //      o: Object?
+               //              an optional context for f
+               return function(){
+                       return this.map(loopBody(f, arguments, o));
+               };
+       };
+
+       var adaptAsFilter = function(f, o){
+               //      summary:
+               //              adapts a single node function to be used in the filter-type actions
+               //      f: Function
+               //              a function to adapt
+               //      o: Object?
+               //              an optional context for f
+               return function(){
+                       return this.filter(loopBody(f, arguments, o));
+               };
+       };
+
+       var adaptWithCondition = function(f, g, o){
+               //      summary:
+               //              adapts a single node function to be used in the map-type
+               //              actions, behaves like forEach() or map() depending on arguments
+               //      f: Function
+               //              a function to adapt
+               //      g: Function
+               //              a condition function, if true runs as map(), otherwise runs as forEach()
+               //      o: Object?
+               //              an optional context for f and g
+               return function(){
+                       var a = arguments, body = loopBody(f, a, o);
+                       if(g.call(o || d.global, a)){
+                               return this.map(body);  // self
+                       }
+                       this.forEach(body);
+                       return this;    // self
+               };
+       };
+
+       var magicGuard = function(a){
+               //      summary:
+               //              the guard function for dojo.attr() and dojo.style()
+               return a.length == 1 && (typeof a[0] == "string"); // inline'd type check
+       };
+
+       var orphan = function(node){
+               //      summary:
+               //              function to orphan nodes
+               var p = node.parentNode;
+               if(p){
+                       p.removeChild(node);
+               }
+       };
+       // FIXME: should we move orphan() to dojo.html?
+
+       dojo.NodeList = function(){
+               //      summary:
+               //              dojo.NodeList is an of Array subclass which adds syntactic
+               //              sugar for chaining, common iteration operations, animation, and
+               //              node manipulation. NodeLists are most often returned as the
+               //              result of dojo.query() calls.
+               //      description:
+               //              dojo.NodeList instances provide many utilities that reflect
+               //              core Dojo APIs for Array iteration and manipulation, DOM
+               //              manipulation, and event handling. Instead of needing to dig up
+               //              functions in the dojo.* namespace, NodeLists generally make the
+               //              full power of Dojo available for DOM manipulation tasks in a
+               //              simple, chainable way.
+               //      example:
+               //              create a node list from a node
+               //              |       new dojo.NodeList(dojo.byId("foo"));
+               //      example:
+               //              get a NodeList from a CSS query and iterate on it
+               //              |       var l = dojo.query(".thinger");
+               //              |       l.forEach(function(node, index, nodeList){
+               //              |               console.log(index, node.innerHTML);
+               //              |       });
+               //      example:
+               //              use native and Dojo-provided array methods to manipulate a
+               //              NodeList without needing to use dojo.* functions explicitly:
+               //              |       var l = dojo.query(".thinger");
+               //              |       // since NodeLists are real arrays, they have a length
+               //              |       // property that is both readable and writable and
+               //              |       // push/pop/shift/unshift methods
+               //              |       console.log(l.length);
+               //              |       l.push(dojo.create("span"));
+               //              |
+               //              |       // dojo's normalized array methods work too:
+               //              |       console.log( l.indexOf(dojo.byId("foo")) );
+               //              |       // ...including the special "function as string" shorthand
+               //              |       console.log( l.every("item.nodeType == 1") );
+               //              |
+               //              |       // NodeLists can be [..] indexed, or you can use the at()
+               //              |       // function to get specific items wrapped in a new NodeList:
+               //              |       var node = l[3]; // the 4th element
+               //              |       var newList = l.at(1, 3); // the 2nd and 4th elements
+               //      example:
+               //              the style functions you expect are all there too:
+               //              |       // style() as a getter...
+               //              |       var borders = dojo.query(".thinger").style("border");
+               //              |       // ...and as a setter:
+               //              |       dojo.query(".thinger").style("border", "1px solid black");
+               //              |       // class manipulation
+               //              |       dojo.query("li:nth-child(even)").addClass("even");
+               //              |       // even getting the coordinates of all the items
+               //              |       var coords = dojo.query(".thinger").coords();
+               //      example:
+               //              DOM manipulation functions from the dojo.* namespace area also
+               //              available:
+               //              |       // remove all of the elements in the list from their
+               //              |       // parents (akin to "deleting" them from the document)
+               //              |       dojo.query(".thinger").orphan();
+               //              |       // place all elements in the list at the front of #foo
+               //              |       dojo.query(".thinger").place("foo", "first");
+               //      example:
+               //              Event handling couldn't be easier. `dojo.connect` is mapped in,
+               //              and shortcut handlers are provided for most DOM events:
+               //              |       // like dojo.connect(), but with implicit scope
+               //              |       dojo.query("li").connect("onclick", console, "log");
+               //              |
+               //              |       // many common event handlers are already available directly:
+               //              |       dojo.query("li").onclick(console, "log");
+               //              |       var toggleHovered = dojo.hitch(dojo, "toggleClass", "hovered");
+               //              |       dojo.query("p")
+               //              |               .onmouseenter(toggleHovered)
+               //              |               .onmouseleave(toggleHovered);
+               //      example:
+               //              chainability is a key advantage of NodeLists:
+               //              |       dojo.query(".thinger")
+               //              |               .onclick(function(e){ /* ... */ })
+               //              |               .at(1, 3, 8) // get a subset
+               //              |                       .style("padding", "5px")
+               //              |                       .forEach(console.log);
+
+               return tnl(Array.apply(null, arguments));
+       };
+
+       //Allow things that new up a NodeList to use a delegated or alternate NodeList implementation.
+       d._NodeListCtor = d.NodeList;
+
+       var nl = d.NodeList, nlp = nl.prototype;
+
+       // expose adapters and the wrapper as private functions
+
+       nl._wrap = nlp._wrap = tnl;
+       nl._adaptAsMap = adaptAsMap;
+       nl._adaptAsForEach = adaptAsForEach;
+       nl._adaptAsFilter  = adaptAsFilter;
+       nl._adaptWithCondition = adaptWithCondition;
+
+       // mass assignment
+
+       // add array redirectors
+       d.forEach(["slice", "splice"], function(name){
+               var f = ap[name];
+               //Use a copy of the this array via this.slice() to allow .end() to work right in the splice case.
+               // CANNOT apply ._stash()/end() to splice since it currently modifies
+               // the existing this array -- it would break backward compatibility if we copy the array before
+               // the splice so that we can use .end(). So only doing the stash option to this._wrap for slice.
+               nlp[name] = function(){ return this._wrap(f.apply(this, arguments), name == "slice" ? this : null); };
+       });
+       // concat should be here but some browsers with native NodeList have problems with it
+
+       // add array.js redirectors
+       d.forEach(["indexOf", "lastIndexOf", "every", "some"], function(name){
+               var f = d[name];
+               nlp[name] = function(){ return f.apply(d, [this].concat(aps.call(arguments, 0))); };
+       });
+
+       // add conditional methods
+       d.forEach(["attr", "style"], function(name){
+               nlp[name] = adaptWithCondition(d[name], magicGuard);
+       });
+
+       // add forEach actions
+       d.forEach(["connect", "addClass", "removeClass", "toggleClass", "empty", "removeAttr"], function(name){
+               nlp[name] = adaptAsForEach(d[name]);
+       });
+
+       dojo.extend(dojo.NodeList, {
+               _normalize: function(/*String||Element||Object||NodeList*/content, /*DOMNode?*/refNode){
+                       // summary:
+                       //              normalizes data to an array of items to insert.
+                       // description:
+                       //              If content is an object, it can have special properties "template" and
+                       //              "parse". If "template" is defined, then the template value is run through
+                       //              dojo.string.substitute (if dojo.string.substitute has been dojo.required elsewhere),
+                       //              or if templateFunc is a function on the content, that function will be used to
+                       //              transform the template into a final string to be used for for passing to dojo._toDom.
+                       //              If content.parse is true, then it is remembered for later, for when the content
+                       //              nodes are inserted into the DOM. At that point, the nodes will be parsed for widgets
+                       //              (if dojo.parser has been dojo.required elsewhere).
+
+                       //Wanted to just use a DocumentFragment, but for the array/NodeList
+                       //case that meant  using cloneNode, but we may not want that.
+                       //Cloning should only happen if the node operations span
+                       //multiple refNodes. Also, need a real array, not a NodeList from the
+                       //DOM since the node movements could change those NodeLists.
+
+                       var parse = content.parse === true ? true : false;
+
+                       //Do we have an object that needs to be run through a template?
+                       if(typeof content.template == "string"){
+                               var templateFunc = content.templateFunc || (dojo.string && dojo.string.substitute);
+                               content = templateFunc ? templateFunc(content.template, content) : content;
+                       }
+
+                       var type = (typeof content);
+                       if(type == "string" || type == "number"){
+                               content = dojo._toDom(content, (refNode && refNode.ownerDocument));
+                               if(content.nodeType == 11){
+                                       //DocumentFragment. It cannot handle cloneNode calls, so pull out the children.
+                                       content = dojo._toArray(content.childNodes);
+                               }else{
+                                       content = [content];
+                               }
+                       }else if(!dojo.isArrayLike(content)){
+                               content = [content];
+                       }else if(!dojo.isArray(content)){
+                               //To get to this point, content is array-like, but
+                               //not an array, which likely means a DOM NodeList. Convert it now.
+                               content = dojo._toArray(content);
+                       }
+
+                       //Pass around the parse info
+                       if(parse){
+                               content._runParse = true;
+                       }
+                       return content; //Array
+               },
+
+               _cloneNode: function(/*DOMNode*/ node){
+                       // summary:
+                       //              private utiltity to clone a node. Not very interesting in the vanilla
+                       //              dojo.NodeList case, but delegates could do interesting things like
+                       //              clone event handlers if that is derivable from the node.
+                       return node.cloneNode(true);
+               },
+
+               _place: function(/*Array*/ary, /*DOMNode*/refNode, /*String*/position, /*Boolean*/useClone){
+                       // summary:
+                       //              private utility to handle placing an array of nodes relative to another node.
+                       // description:
+                       //              Allows for cloning the nodes in the array, and for
+                       //              optionally parsing widgets, if ary._runParse is true.
+
+                       //Avoid a disallowed operation if trying to do an innerHTML on a non-element node.
+                       if(refNode.nodeType != 1 && position == "only"){
+                               return;
+                       }
+                       var rNode = refNode, tempNode;
+
+                       //Always cycle backwards in case the array is really a
+                       //DOM NodeList and the DOM operations take it out of the live collection.
+                       var length = ary.length;
+                       for(var i = length - 1; i >= 0; i--){
+                               var node = (useClone ? this._cloneNode(ary[i]) : ary[i]);
+
+                               //If need widget parsing, use a temp node, instead of waiting after inserting into
+                               //real DOM because we need to start widget parsing at one node up from current node,
+                               //which could cause some already parsed widgets to be parsed again.
+                               if(ary._runParse && dojo.parser && dojo.parser.parse){
+                                       if(!tempNode){
+                                               tempNode = rNode.ownerDocument.createElement("div");
+                                       }
+                                       tempNode.appendChild(node);
+                                       dojo.parser.parse(tempNode);
+                                       node = tempNode.firstChild;
+                                       while(tempNode.firstChild){
+                                               tempNode.removeChild(tempNode.firstChild);
+                                       }
+                               }
+
+                               if(i == length - 1){
+                                       dojo.place(node, rNode, position);
+                               }else{
+                                       rNode.parentNode.insertBefore(node, rNode);
+                               }
+                               rNode = node;
+                       }
+               },
+
+               _stash: function(parent){
+                       // summary:
+                       //              private function to hold to a parent NodeList. end() to return the parent NodeList.
+                       //
+                       // example:
+                       // How to make a `dojo.NodeList` method that only returns the third node in
+                       // the dojo.NodeList but allows access to the original NodeList by using this._stash:
+                       //      |       dojo.extend(dojo.NodeList, {
+                       //      |               third: function(){
+                       //  |                   var newNodeList = dojo.NodeList(this[2]);
+                       //      |                       return newNodeList._stash(this);
+                       //      |               }
+                       //      |       });
+                       //      |       // then see how _stash applies a sub-list, to be .end()'ed out of
+                       //      |       dojo.query(".foo")
+                       //      |               .third()
+                       //      |                       .addClass("thirdFoo")
+                       //      |               .end()
+                       //      |               // access to the orig .foo list
+                       //      |               .removeClass("foo")
+                       //      |
+                       //
+                       this._parent = parent;
+                       return this; //dojo.NodeList
+               },
+
+               end: function(){
+                       // summary:
+                       //              Ends use of the current `dojo.NodeList` by returning the previous dojo.NodeList
+                       //              that generated the current dojo.NodeList.
+                       // description:
+                       //              Returns the `dojo.NodeList` that generated the current `dojo.NodeList`. If there
+                       //              is no parent dojo.NodeList, an empty dojo.NodeList is returned.
+                       // example:
+                       //      |       dojo.query("a")
+                       //      |               .filter(".disabled")
+                       //      |                       // operate on the anchors that only have a disabled class
+                       //      |                       .style("color", "grey")
+                       //      |               .end()
+                       //      |               // jump back to the list of anchors
+                       //      |               .style(...)
+                       //
+                       if(this._parent){
+                               return this._parent;
+                       }else{
+                               //Just return empy list.
+                               return new this._NodeListCtor();
+                       }
+               },
+
+               // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array#Methods
+
+               // FIXME: handle return values for #3244
+               //              http://trac.dojotoolkit.org/ticket/3244
+
+               // FIXME:
+               //              need to wrap or implement:
+               //                      join (perhaps w/ innerHTML/outerHTML overload for toString() of items?)
+               //                      reduce
+               //                      reduceRight
+
+               /*=====
+               slice: function(begin, end){
+                       // summary:
+                       //              Returns a new NodeList, maintaining this one in place
+                       // description:
+                       //              This method behaves exactly like the Array.slice method
+                       //              with the caveat that it returns a dojo.NodeList and not a
+                       //              raw Array. For more details, see Mozilla's (slice
+                       //              documentation)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:slice]
+                       // begin: Integer
+                       //              Can be a positive or negative integer, with positive
+                       //              integers noting the offset to begin at, and negative
+                       //              integers denoting an offset from the end (i.e., to the left
+                       //              of the end)
+                       // end: Integer?
+                       //              Optional parameter to describe what position relative to
+                       //              the NodeList's zero index to end the slice at. Like begin,
+                       //              can be positive or negative.
+                       return this._wrap(a.slice.apply(this, arguments));
+               },
+
+               splice: function(index, howmany, item){
+                       // summary:
+                       //              Returns a new NodeList, manipulating this NodeList based on
+                       //              the arguments passed, potentially splicing in new elements
+                       //              at an offset, optionally deleting elements
+                       // description:
+                       //              This method behaves exactly like the Array.splice method
+                       //              with the caveat that it returns a dojo.NodeList and not a
+                       //              raw Array. For more details, see Mozilla's (splice
+                       //              documentation)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:splice]
+                       //              For backwards compatibility, calling .end() on the spliced NodeList
+                       //              does not return the original NodeList -- splice alters the NodeList in place.
+                       // index: Integer
+                       //              begin can be a positive or negative integer, with positive
+                       //              integers noting the offset to begin at, and negative
+                       //              integers denoting an offset from the end (i.e., to the left
+                       //              of the end)
+                       // howmany: Integer?
+                       //              Optional parameter to describe what position relative to
+                       //              the NodeList's zero index to end the slice at. Like begin,
+                       //              can be positive or negative.
+                       // item: Object...?
+                       //              Any number of optional parameters may be passed in to be
+                       //              spliced into the NodeList
+                       // returns:
+                       //              dojo.NodeList
+                       return this._wrap(a.splice.apply(this, arguments));
+               },
+
+               indexOf: function(value, fromIndex){
+                       //      summary:
+                       //              see dojo.indexOf(). The primary difference is that the acted-on 
+                       //              array is implicitly this NodeList
+                       // value: Object:
+                       //              The value to search for.
+                       // fromIndex: Integer?:
+                       //              The loction to start searching from. Optional. Defaults to 0.
+                       //      description:
+                       //              For more details on the behavior of indexOf, see Mozilla's
+                       //              (indexOf
+                       //              docs)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf]
+                       //      returns:
+                       //              Positive Integer or 0 for a match, -1 of not found.
+                       return d.indexOf(this, value, fromIndex); // Integer
+               },
+
+               lastIndexOf: function(value, fromIndex){
+                       // summary:
+                       //              see dojo.lastIndexOf(). The primary difference is that the
+                       //              acted-on array is implicitly this NodeList
+                       //      description:
+                       //              For more details on the behavior of lastIndexOf, see
+                       //              Mozilla's (lastIndexOf
+                       //              docs)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:lastIndexOf]
+                       // value: Object
+                       //              The value to search for.
+                       // fromIndex: Integer?
+                       //              The loction to start searching from. Optional. Defaults to 0.
+                       // returns:
+                       //              Positive Integer or 0 for a match, -1 of not found.
+                       return d.lastIndexOf(this, value, fromIndex); // Integer
+               },
+
+               every: function(callback, thisObject){
+                       //      summary:
+                       //              see `dojo.every()` and the (Array.every
+                       //              docs)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:every].
+                       //              Takes the same structure of arguments and returns as
+                       //              dojo.every() with the caveat that the passed array is
+                       //              implicitly this NodeList
+                       // callback: Function: the callback
+                       // thisObject: Object?: the context
+                       return d.every(this, callback, thisObject); // Boolean
+               },
+
+               some: function(callback, thisObject){
+                       //      summary:
+                       //              Takes the same structure of arguments and returns as
+                       //              `dojo.some()` with the caveat that the passed array is
+                       //              implicitly this NodeList.  See `dojo.some()` and Mozilla's
+                       //              (Array.some
+                       //              documentation)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:some].
+                       // callback: Function: the callback
+                       // thisObject: Object?: the context
+                       return d.some(this, callback, thisObject); // Boolean
+               },
+               =====*/
+
+               concat: function(item){
+                       // summary:
+                       //              Returns a new NodeList comprised of items in this NodeList
+                       //              as well as items passed in as parameters
+                       // description:
+                       //              This method behaves exactly like the Array.concat method
+                       //              with the caveat that it returns a `dojo.NodeList` and not a
+                       //              raw Array. For more details, see the (Array.concat
+                       //              docs)[http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:concat]
+                       // item: Object?
+                       //              Any number of optional parameters may be passed in to be
+                       //              spliced into the NodeList
+                       // returns:
+                       //              dojo.NodeList
+
+                       //return this._wrap(apc.apply(this, arguments));
+                       // the line above won't work for the native NodeList :-(
+
+                       // implementation notes:
+                       // 1) Native NodeList is not an array, and cannot be used directly
+                       // in concat() --- the latter doesn't recognize it as an array, and
+                       // does not inline it, but append as a single entity.
+                       // 2) On some browsers (e.g., Safari) the "constructor" property is
+                       // read-only and cannot be changed. So we have to test for both
+                       // native NodeList and dojo.NodeList in this property to recognize
+                       // the node list.
+
+                       var t = d.isArray(this) ? this : aps.call(this, 0),
+                               m = d.map(arguments, function(a){
+                                       return a && !d.isArray(a) &&
+                                               (typeof NodeList != "undefined" && a.constructor === NodeList || a.constructor === this._NodeListCtor) ?
+                                                       aps.call(a, 0) : a;
+                               });
+                       return this._wrap(apc.apply(t, m), this);       // dojo.NodeList
+               },
+
+               map: function(/*Function*/ func, /*Function?*/ obj){
+                       //      summary:
+                       //              see dojo.map(). The primary difference is that the acted-on
+                       //              array is implicitly this NodeList and the return is a
+                       //              dojo.NodeList (a subclass of Array)
+                       ///return d.map(this, func, obj, d.NodeList); // dojo.NodeList
+                       return this._wrap(d.map(this, func, obj), this); // dojo.NodeList
+               },
+
+               forEach: function(callback, thisObj){
+                       //      summary:
+                       //              see `dojo.forEach()`. The primary difference is that the acted-on 
+                       //              array is implicitly this NodeList. If you want the option to break out
+                       //              of the forEach loop, use every() or some() instead.
+                       d.forEach(this, callback, thisObj);
+                       // non-standard return to allow easier chaining
+                       return this; // dojo.NodeList 
+               },
+
+               /*=====
+               coords: function(){
+                       //      summary:
+                       //              Returns the box objects of all elements in a node list as
+                       //              an Array (*not* a NodeList). Acts like `dojo.coords`, though assumes
+                       //              the node passed is each node in this list.
+
+                       return d.map(this, d.coords); // Array
+               },
+
+               position: function(){
+                       //      summary:
+                       //              Returns border-box objects (x/y/w/h) of all elements in a node list
+                       //              as an Array (*not* a NodeList). Acts like `dojo.position`, though
+                       //              assumes the node passed is each node in this list. 
+
+                       return d.map(this, d.position); // Array
+               },
+
+               attr: function(property, value){
+                       //      summary:
+                       //              gets or sets the DOM attribute for every element in the
+                       //              NodeList. See also `dojo.attr`
+                       //      property: String
+                       //              the attribute to get/set
+                       //      value: String?
+                       //              optional. The value to set the property to
+                       //      returns:
+                       //              if no value is passed, the result is an array of attribute values
+                       //              If a value is passed, the return is this NodeList
+                       //      example:
+                       //              Make all nodes with a particular class focusabl:
+                       //      |       dojo.query(".focusable").attr("tabIndex", -1);
+                       //      example:
+                       //              Disable a group of buttons:
+                       //      |       dojo.query("button.group").attr("disalbed", true);
+                       //      example:
+                       //              innerHTML can be assigned or retreived as well:
+                       //      |       // get the innerHTML (as an array) for each list item
+                       //      |       var ih = dojo.query("li.replaceable").attr("innerHTML");
+                       return; // dojo.NodeList
+                       return; // Array
+               },
+
+               style: function(property, value){
+                       //      summary:
+                       //              gets or sets the CSS property for every element in the NodeList
+                       //      property: String
+                       //              the CSS property to get/set, in JavaScript notation
+                       //              ("lineHieght" instead of "line-height")
+                       //      value: String?
+                       //              optional. The value to set the property to
+                       //      returns:
+                       //              if no value is passed, the result is an array of strings.
+                       //              If a value is passed, the return is this NodeList
+                       return; // dojo.NodeList
+                       return; // Array
+               },
+
+               addClass: function(className){
+                       //      summary:
+                       //              adds the specified class to every node in the list
+                       //      className: String|Array
+                       //              A String class name to add, or several space-separated class names,
+                       //              or an array of class names.
+                       return; // dojo.NodeList
+               },
+
+               removeClass: function(className){
+                       //      summary:
+                       //              removes the specified class from every node in the list
+                       //      className: String|Array?
+                       //              An optional String class name to remove, or several space-separated
+                       //              class names, or an array of class names. If omitted, all class names
+                       //              will be deleted.
+                       //      returns:
+                       //              dojo.NodeList, this list
+                       return; // dojo.NodeList
+               },
+
+               toggleClass: function(className, condition){
+                       //      summary:
+                       //              Adds a class to node if not present, or removes if present.
+                       //              Pass a boolean condition if you want to explicitly add or remove.
+                       //      condition: Boolean?
+                       //              If passed, true means to add the class, false means to remove.
+                       //      className: String
+                       //              the CSS class to add
+                       return; // dojo.NodeList
+               },
+
+               connect: function(methodName, objOrFunc, funcName){
+                       //      summary:
+                       //              attach event handlers to every item of the NodeList. Uses dojo.connect()
+                       //              so event properties are normalized
+                       //      methodName: String
+                       //              the name of the method to attach to. For DOM events, this should be
+                       //              the lower-case name of the event
+                       //      objOrFunc: Object|Function|String
+                       //              if 2 arguments are passed (methodName, objOrFunc), objOrFunc should
+                       //              reference a function or be the name of the function in the global
+                       //              namespace to attach. If 3 arguments are provided
+                       //              (methodName, objOrFunc, funcName), objOrFunc must be the scope to 
+                       //              locate the bound function in
+                       //      funcName: String?
+                       //              optional. A string naming the function in objOrFunc to bind to the
+                       //              event. May also be a function reference.
+                       //      example:
+                       //              add an onclick handler to every button on the page
+                       //              |       dojo.query("div:nth-child(odd)").connect("onclick", function(e){
+                       //              |               console.log("clicked!");
+                       //              |       });
+                       // example:
+                       //              attach foo.bar() to every odd div's onmouseover
+                       //              |       dojo.query("div:nth-child(odd)").connect("onmouseover", foo, "bar");
+               },
+
+               empty: function(){
+                       //      summary:
+                       //              clears all content from each node in the list. Effectively
+                       //              equivalent to removing all child nodes from every item in
+                       //              the list.
+                       return this.forEach("item.innerHTML='';"); // dojo.NodeList
+                       // FIXME: should we be checking for and/or disposing of widgets below these nodes?
+               },
+               =====*/
+
+               // useful html methods
+               coords: adaptAsMap(d.coords),
+               position: adaptAsMap(d.position),
+
+               // FIXME: connectPublisher()? connectRunOnce()?
+
+               /*
+               destroy: function(){
+                       //      summary:
+                       //              destroys every item in  the list.
+                       this.forEach(d.destroy);
+                       // FIXME: should we be checking for and/or disposing of widgets below these nodes?
+               },
+               */
+
+               place: function(/*String||Node*/ queryOrNode, /*String*/ position){
+                       //      summary:
+                       //              places elements of this node list relative to the first element matched
+                       //              by queryOrNode. Returns the original NodeList. See: `dojo.place`
+                       //      queryOrNode:
+                       //              may be a string representing any valid CSS3 selector or a DOM node.
+                       //              In the selector case, only the first matching element will be used 
+                       //              for relative positioning.
+                       //      position:
+                       //              can be one of:
+                       //              |       "last" (default)
+                       //              |       "first"
+                       //              |       "before"
+                       //              |       "after"
+                       //              |       "only"
+                       //              |       "replace"
+                       //              or an offset in the childNodes property
+                       var item = d.query(queryOrNode)[0];
+                       return this.forEach(function(node){ d.place(node, item, position); }); // dojo.NodeList
+               },
+
+               orphan: function(/*String?*/ simpleFilter){
+                       //      summary:
+                       //              removes elements in this list that match the simple filter
+                       //              from their parents and returns them as a new NodeList.
+                       //      simpleFilter:
+                       //              single-expression CSS rule. For example, ".thinger" or
+                       //              "#someId[attrName='value']" but not "div > span". In short,
+                       //              anything which does not invoke a descent to evaluate but
+                       //              can instead be used to test a single node is acceptable.
+                       //      returns:
+                       //              `dojo.NodeList` containing the orpahned elements 
+                       return (simpleFilter ? d._filterQueryResult(this, simpleFilter) : this).forEach(orphan); // dojo.NodeList
+               },
+
+               adopt: function(/*String||Array||DomNode*/ queryOrListOrNode, /*String?*/ position){
+                       //      summary:
+                       //              places any/all elements in queryOrListOrNode at a
+                       //              position relative to the first element in this list.
+                       //              Returns a dojo.NodeList of the adopted elements.
+                       //      queryOrListOrNode:
+                       //              a DOM node or a query string or a query result.
+                       //              Represents the nodes to be adopted relative to the
+                       //              first element of this NodeList.
+                       //      position:
+                       //              can be one of:
+                       //              |       "last" (default)
+                       //              |       "first"
+                       //              |       "before"
+                       //              |       "after"
+                       //              |       "only"
+                       //              |       "replace"
+                       //              or an offset in the childNodes property
+                       return d.query(queryOrListOrNode).place(this[0], position)._stash(this);        // dojo.NodeList
+               },
+
+               // FIXME: do we need this?
+               query: function(/*String*/ queryStr){
+                       //      summary:
+                       //              Returns a new list whose memebers match the passed query,
+                       //              assuming elements of the current NodeList as the root for
+                       //              each search.
+                       //      example:
+                       //              assume a DOM created by this markup:
+                       //      |       <div id="foo">
+                       //      |               <p>
+                       //      |                       bacon is tasty, <span>dontcha think?</span>
+                       //      |               </p>
+                       //      |       </div>
+                       //      |       <div id="bar">
+                       //      |               <p>great commedians may not be funny <span>in person</span></p>
+                       //      |       </div>
+                       //              If we are presented with the following defintion for a NodeList:
+                       //      |       var l = new dojo.NodeList(dojo.byId("foo"), dojo.byId("bar"));
+                       //              it's possible to find all span elements under paragraphs
+                       //              contained by these elements with this sub-query:
+                       //      |       var spans = l.query("p span");
+
+                       // FIXME: probably slow
+                       if(!queryStr){ return this; }
+                       var ret = this.map(function(node){
+                               // FIXME: why would we ever get undefined here?
+                               return d.query(queryStr, node).filter(function(subNode){ return subNode !== undefined; });
+                       });
+                       return this._wrap(apc.apply([], ret), this);    // dojo.NodeList
+               },
+
+               filter: function(/*String|Function*/ simpleFilter){
+                       //      summary:
+                       //              "masks" the built-in javascript filter() method (supported
+                       //              in Dojo via `dojo.filter`) to support passing a simple
+                       //              string filter in addition to supporting filtering function
+                       //              objects.
+                       //      simpleFilter:
+                       //              If a string, a single-expression CSS rule. For example,
+                       //              ".thinger" or "#someId[attrName='value']" but not "div >
+                       //              span". In short, anything which does not invoke a descent
+                       //              to evaluate but can instead be used to test a single node
+                       //              is acceptable.
+                       //      example:
+                       //              "regular" JS filter syntax as exposed in dojo.filter:
+                       //              |       dojo.query("*").filter(function(item){
+                       //              |               // highlight every paragraph
+                       //              |               return (item.nodeName == "p");
+                       //              |       }).style("backgroundColor", "yellow");
+                       // example:
+                       //              the same filtering using a CSS selector
+                       //              |       dojo.query("*").filter("p").styles("backgroundColor", "yellow");
+
+                       var a = arguments, items = this, start = 0;
+                       if(typeof simpleFilter == "string"){ // inline'd type check
+                               items = d._filterQueryResult(this, a[0]);
+                               if(a.length == 1){
+                                       // if we only got a string query, pass back the filtered results
+                                       return items._stash(this); // dojo.NodeList
+                               }
+                               // if we got a callback, run it over the filtered items
+                               start = 1;
+                       }
+                       return this._wrap(d.filter(items, a[start], a[start + 1]), this);       // dojo.NodeList
+               },
+
+               /*
+               // FIXME: should this be "copyTo" and include parenting info?
+               clone: function(){
+                       // summary:
+                       //              creates node clones of each element of this list
+                       //              and returns a new list containing the clones
+               },
+               */
+
+               addContent: function(/*String||DomNode||Object||dojo.NodeList*/ content, /*String||Integer?*/ position){
+                       //      summary:
+                       //              add a node, NodeList or some HTML as a string to every item in the
+                       //              list.  Returns the original list.
+                       //      description:
+                       //              a copy of the HTML content is added to each item in the
+                       //              list, with an optional position argument. If no position
+                       //              argument is provided, the content is appended to the end of
+                       //              each item.
+                       //      content:
+                       //              DOM node, HTML in string format, a NodeList or an Object. If a DOM node or
+                       //              NodeList, the content will be cloned if the current NodeList has more than one
+                       //              element. Only the DOM nodes are cloned, no event handlers. If it is an Object,
+                       //              it should be an object with at "template" String property that has the HTML string
+                       //              to insert. If dojo.string has already been dojo.required, then dojo.string.substitute
+                       //              will be used on the "template" to generate the final HTML string. Other allowed
+                       //              properties on the object are: "parse" if the HTML
+                       //              string should be parsed for widgets (dojo.require("dojo.parser") to get that
+                       //              option to work), and "templateFunc" if a template function besides dojo.string.substitute
+                       //              should be used to transform the "template".
+                       //      position:
+                       //              can be one of:
+                       //              |       "last"||"end" (default)
+                       //              |       "first||"start"
+                       //              |       "before"
+                       //              |       "after"
+                       //              |       "replace" (replaces nodes in this NodeList with new content)
+                       //              |       "only" (removes other children of the nodes so new content is hte only child)
+                       //              or an offset in the childNodes property
+                       //      example:
+                       //              appends content to the end if the position is ommitted
+                       //      |       dojo.query("h3 > p").addContent("hey there!");
+                       //      example:
+                       //              add something to the front of each element that has a
+                       //              "thinger" property:
+                       //      |       dojo.query("[thinger]").addContent("...", "first");
+                       //      example:
+                       //              adds a header before each element of the list
+                       //      |       dojo.query(".note").addContent("<h4>NOTE:</h4>", "before");
+                       //      example:
+                       //              add a clone of a DOM node to the end of every element in
+                       //              the list, removing it from its existing parent.
+                       //      |       dojo.query(".note").addContent(dojo.byId("foo"));
+                       //  example:
+                       //      Append nodes from a templatized string.
+                       //              dojo.require("dojo.string");
+                       //              dojo.query(".note").addContent({
+                       //              template: '<b>${id}: </b><span>${name}</span>',
+                       //                      id: "user332",
+                       //              name: "Mr. Anderson"
+                       //      });
+                       //  example:
+                       //      Append nodes from a templatized string that also has widgets parsed.
+                       //      dojo.require("dojo.string");
+                       //      dojo.require("dojo.parser");
+                       //      var notes = dojo.query(".note").addContent({
+                       //              template: '<button dojoType="dijit.form.Button">${text}</button>',
+                       //              parse: true,
+                       //              text: "Send"
+                       //      });
+                       content = this._normalize(content, this[0]);
+                       for(var i = 0, node; node = this[i]; i++){
+                               this._place(content, node, position, i > 0);
+                       }
+                       return this; //dojo.NodeList
+               },
+
+               instantiate: function(/*String|Object*/ declaredClass, /*Object?*/ properties){
+                       //      summary:
+                       //              Create a new instance of a specified class, using the
+                       //              specified properties and each node in the nodeList as a
+                       //              srcNodeRef.
+                       //      example:
+                       //              Grabs all buttons in the page and converts them to diji.form.Buttons.
+                       //      |       var buttons = dojo.query("button").instantiate("dijit.form.Button", {showLabel: true});
+                       var c = d.isFunction(declaredClass) ? declaredClass : d.getObject(declaredClass);
+                       properties = properties || {};
+                       return this.forEach(function(node){
+                               new c(properties, node);
+                       });     // dojo.NodeList
+               },
+
+               at: function(/*===== index =====*/){
+                       //      summary:
+                       //              Returns a new NodeList comprised of items in this NodeList
+                       //              at the given index or indices.
+                       //      index: Integer...
+                       //              One or more 0-based indices of items in the current
+                       //              NodeList.
+                       //      returns:
+                       //              dojo.NodeList
+                       var t = new this._NodeListCtor();
+                       d.forEach(arguments, function(i){ if(this[i]){ t.push(this[i]); }}, this);
+                       return t._stash(this); // dojo.NodeList
+               }
+
+       });
+
+       nl.events = [
+               // summary: list of all DOM events used in NodeList
+               "blur", "focus", "change", "click", "error", "keydown", "keypress",
+               "keyup", "load", "mousedown", "mouseenter", "mouseleave", "mousemove",
+               "mouseout", "mouseover", "mouseup", "submit"
+       ];
+
+       // syntactic sugar for DOM events
+       d.forEach(nl.events, function(evt){
+                       var _oe = "on"+evt;
+                       nlp[_oe] = function(a, b){
+                               return this.connect(_oe, a, b);
+                       }
+                               // FIXME: should these events trigger publishes?
+                               /*
+                               return (a ? this.connect(_oe, a, b) :
+                                                       this.forEach(function(n){
+                                                               // FIXME:
+                                                               //              listeners get buried by
+                                                               //              addEventListener and can't be dug back
+                                                               //              out to be triggered externally.
+                                                               // see:
+                                                               //              http://developer.mozilla.org/en/docs/DOM:element
+
+                                                               console.log(n, evt, _oe);
+
+                                                               // FIXME: need synthetic event support!
+                                                               var _e = { target: n, faux: true, type: evt };
+                                                               // dojo._event_listener._synthesizeEvent({}, { target: n, faux: true, type: evt });
+                                                               try{ n[evt](_e); }catch(e){ console.log(e); }
+                                                               try{ n[_oe](_e); }catch(e){ console.log(e); }
+                                                       })
+                               );
+                               */
+               }
+       );
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base.query"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.query"] = true;
+if(typeof dojo != "undefined"){
+       dojo.provide("dojo._base.query");
+       
+       
+
+}
+
+/*
+       dojo.query() architectural overview:
+
+               dojo.query is a relatively full-featured CSS3 query library. It is
+               designed to take any valid CSS3 selector and return the nodes matching
+               the selector. To do this quickly, it processes queries in several
+               steps, applying caching where profitable.
+               
+               The steps (roughly in reverse order of the way they appear in the code):
+                       1.) check to see if we already have a "query dispatcher"
+                               - if so, use that with the given parameterization. Skip to step 4.
+                       2.) attempt to determine which branch to dispatch the query to:
+                               - JS (optimized DOM iteration)
+                               - native (FF3.1+, Safari 3.1+, IE 8+)
+                       3.) tokenize and convert to executable "query dispatcher"
+                               - this is where the lion's share of the complexity in the
+                                 system lies. In the DOM version, the query dispatcher is
+                                 assembled as a chain of "yes/no" test functions pertaining to
+                                 a section of a simple query statement (".blah:nth-child(odd)"
+                                 but not "div div", which is 2 simple statements). Individual
+                                 statement dispatchers are cached (to prevent re-definition)
+                                 as are entire dispatch chains (to make re-execution of the
+                                 same query fast)
+                       4.) the resulting query dispatcher is called in the passed scope
+                           (by default the top-level document)
+                               - for DOM queries, this results in a recursive, top-down
+                                 evaluation of nodes based on each simple query section
+                               - for native implementations, this may mean working around spec
+                                 bugs. So be it.
+                       5.) matched nodes are pruned to ensure they are unique (if necessary)
+*/
+
+;(function(d){
+       // define everything in a closure for compressability reasons. "d" is an
+       // alias to "dojo" (or the toolkit alias object, e.g., "acme").
+
+       ////////////////////////////////////////////////////////////////////////
+       // Toolkit aliases
+       ////////////////////////////////////////////////////////////////////////
+
+       // if you are extracing dojo.query for use in your own system, you will
+       // need to provide these methods and properties. No other porting should be
+       // necessary, save for configuring the system to use a class other than
+       // dojo.NodeList as the return instance instantiator
+       var trim =                      d.trim;
+       var each =                      d.forEach;
+       //                                      d.isIE; // float
+       //                                      d.isSafari; // float
+       //                                      d.isOpera; // float
+       //                                      d.isWebKit; // float
+       //                                      d.doc ; // document element
+       var qlc = d._NodeListCtor =             d.NodeList;
+
+       var getDoc = function(){ return d.doc; };
+       // NOTE(alex): the spec is idiotic. CSS queries should ALWAYS be case-sensitive, but nooooooo
+       var cssCaseBug = ((d.isWebKit||d.isMozilla) && ((getDoc().compatMode) == "BackCompat"));
+
+       ////////////////////////////////////////////////////////////////////////
+       // Global utilities
+       ////////////////////////////////////////////////////////////////////////
+
+
+       // on browsers that support the "children" collection we can avoid a lot of
+       // iteration on chaff (non-element) nodes.
+       // why.
+       var childNodesName = !!getDoc().firstChild["children"] ? "children" : "childNodes";
+
+       var specials = ">~+";
+
+       // global thunk to determine whether we should treat the current query as
+       // case sensitive or not. This switch is flipped by the query evaluator
+       // based on the document passed as the context to search.
+       var caseSensitive = false;
+
+       // how high?
+       var yesman = function(){ return true; };
+
+       ////////////////////////////////////////////////////////////////////////
+       // Tokenizer
+       ////////////////////////////////////////////////////////////////////////
+
+       var getQueryParts = function(query){
+               //      summary: 
+               //              state machine for query tokenization
+               //      description:
+               //              instead of using a brittle and slow regex-based CSS parser,
+               //              dojo.query implements an AST-style query representation. This
+               //              representation is only generated once per query. For example,
+               //              the same query run multiple times or under different root nodes
+               //              does not re-parse the selector expression but instead uses the
+               //              cached data structure. The state machine implemented here
+               //              terminates on the last " " (space) charachter and returns an
+               //              ordered array of query component structures (or "parts"). Each
+               //              part represents an operator or a simple CSS filtering
+               //              expression. The structure for parts is documented in the code
+               //              below.
+
+
+               // NOTE: 
+               //              this code is designed to run fast and compress well. Sacrifices
+               //              to readibility and maintainability have been made.  Your best
+               //              bet when hacking the tokenizer is to put The Donnas on *really*
+               //              loud (may we recommend their "Spend The Night" release?) and
+               //              just assume you're gonna make mistakes. Keep the unit tests
+               //              open and run them frequently. Knowing is half the battle ;-)
+               if(specials.indexOf(query.slice(-1)) >= 0){
+                       // if we end with a ">", "+", or "~", that means we're implicitly
+                       // searching all children, so make it explicit
+                       query += " * "
+               }else{
+                       // if you have not provided a terminator, one will be provided for
+                       // you...
+                       query += " ";
+               }
+
+               var ts = function(/*Integer*/ s, /*Integer*/ e){
+                       // trim and slice. 
+
+                       // take an index to start a string slice from and an end position
+                       // and return a trimmed copy of that sub-string
+                       return trim(query.slice(s, e));
+               }
+
+               // the overall data graph of the full query, as represented by queryPart objects
+               var queryParts = []; 
+
+
+               // state keeping vars
+               var inBrackets = -1, inParens = -1, inMatchFor = -1, 
+                       inPseudo = -1, inClass = -1, inId = -1, inTag = -1, 
+                       lc = "", cc = "", pStart;
+
+               // iteration vars
+               var x = 0, // index in the query
+                       ql = query.length,
+                       currentPart = null, // data structure representing the entire clause
+                       _cp = null; // the current pseudo or attr matcher
+
+               // several temporary variables are assigned to this structure durring a
+               // potential sub-expression match:
+               //              attr:
+               //                      a string representing the current full attribute match in a
+               //                      bracket expression
+               //              type:
+               //                      if there's an operator in a bracket expression, this is
+               //                      used to keep track of it
+               //              value:
+               //                      the internals of parenthetical expression for a pseudo. for
+               //                      :nth-child(2n+1), value might be "2n+1"
+
+               var endTag = function(){
+                       // called when the tokenizer hits the end of a particular tag name.
+                       // Re-sets state variables for tag matching and sets up the matcher
+                       // to handle the next type of token (tag or operator).
+                       if(inTag >= 0){
+                               var tv = (inTag == x) ? null : ts(inTag, x); // .toLowerCase();
+                               currentPart[ (specials.indexOf(tv) < 0) ? "tag" : "oper" ] = tv;
+                               inTag = -1;
+                       }
+               }
+
+               var endId = function(){
+                       // called when the tokenizer might be at the end of an ID portion of a match
+                       if(inId >= 0){
+                               currentPart.id = ts(inId, x).replace(/\\/g, "");
+                               inId = -1;
+                       }
+               }
+
+               var endClass = function(){
+                       // called when the tokenizer might be at the end of a class name
+                       // match. CSS allows for multiple classes, so we augment the
+                       // current item with another class in its list
+                       if(inClass >= 0){
+                               currentPart.classes.push(ts(inClass+1, x).replace(/\\/g, ""));
+                               inClass = -1;
+                       }
+               }
+
+               var endAll = function(){
+                       // at the end of a simple fragment, so wall off the matches
+                       endId(); endTag(); endClass();
+               }
+
+               var endPart = function(){
+                       endAll();
+                       if(inPseudo >= 0){
+                               currentPart.pseudos.push({ name: ts(inPseudo+1, x) });
+                       }
+                       // hint to the selector engine to tell it whether or not it
+                       // needs to do any iteration. Many simple selectors don't, and
+                       // we can avoid significant construction-time work by advising
+                       // the system to skip them
+                       currentPart.loops = (   
+                                       currentPart.pseudos.length || 
+                                       currentPart.attrs.length || 
+                                       currentPart.classes.length      );
+
+                       currentPart.oquery = currentPart.query = ts(pStart, x); // save the full expression as a string
+
+
+                       // otag/tag are hints to suggest to the system whether or not
+                       // it's an operator or a tag. We save a copy of otag since the
+                       // tag name is cast to upper-case in regular HTML matches. The
+                       // system has a global switch to figure out if the current
+                       // expression needs to be case sensitive or not and it will use
+                       // otag or tag accordingly
+                       currentPart.otag = currentPart.tag = (currentPart["oper"]) ? null : (currentPart.tag || "*");
+
+                       if(currentPart.tag){
+                               // if we're in a case-insensitive HTML doc, we likely want
+                               // the toUpperCase when matching on element.tagName. If we
+                               // do it here, we can skip the string op per node
+                               // comparison
+                               currentPart.tag = currentPart.tag.toUpperCase();
+                       }
+
+                       // add the part to the list
+                       if(queryParts.length && (queryParts[queryParts.length-1].oper)){
+                               // operators are always infix, so we remove them from the
+                               // list and attach them to the next match. The evaluator is
+                               // responsible for sorting out how to handle them.
+                               currentPart.infixOper = queryParts.pop();
+                               currentPart.query = currentPart.infixOper.query + " " + currentPart.query;
+                               /*
+                               console.debug(  "swapping out the infix", 
+                                                               currentPart.infixOper, 
+                                                               "and attaching it to", 
+                                                               currentPart);
+                               */
+                       }
+                       queryParts.push(currentPart);
+
+                       currentPart = null;
+               }
+
+               // iterate over the query, charachter by charachter, building up a 
+               // list of query part objects
+               for(; lc=cc, cc=query.charAt(x), x < ql; x++){
+                       //              cc: the current character in the match
+                       //              lc: the last charachter (if any)
+
+                       // someone is trying to escape something, so don't try to match any
+                       // fragments. We assume we're inside a literal.
+                       if(lc == "\\"){ continue; } 
+                       if(!currentPart){ // a part was just ended or none has yet been created
+                               // NOTE: I hate all this alloc, but it's shorter than writing tons of if's
+                               pStart = x;
+                               //      rules describe full CSS sub-expressions, like:
+                               //              #someId
+                               //              .className:first-child
+                               //      but not:
+                               //              thinger > div.howdy[type=thinger]
+                               //      the indidual components of the previous query would be
+                               //      split into 3 parts that would be represented a structure
+                               //      like:
+                               //              [
+                               //                      {
+                               //                              query: "thinger",
+                               //                              tag: "thinger",
+                               //                      },
+                               //                      {
+                               //                              query: "div.howdy[type=thinger]",
+                               //                              classes: ["howdy"],
+                               //                              infixOper: {
+                               //                                      query: ">",
+                               //                                      oper: ">",
+                               //                              }
+                               //                      },
+                               //              ]
+                               currentPart = {
+                                       query: null, // the full text of the part's rule
+                                       pseudos: [], // CSS supports multiple pseud-class matches in a single rule
+                                       attrs: [],      // CSS supports multi-attribute match, so we need an array
+                                       classes: [], // class matches may be additive, e.g.: .thinger.blah.howdy
+                                       tag: null,      // only one tag...
+                                       oper: null, // ...or operator per component. Note that these wind up being exclusive.
+                                       id: null,       // the id component of a rule
+                                       getTag: function(){
+                                               return (caseSensitive) ? this.otag : this.tag;
+                                       }
+                               };
+
+                               // if we don't have a part, we assume we're going to start at
+                               // the beginning of a match, which should be a tag name. This
+                               // might fault a little later on, but we detect that and this
+                               // iteration will still be fine.
+                               inTag = x; 
+                       }
+
+                       if(inBrackets >= 0){
+                               // look for a the close first
+                               if(cc == "]"){ // if we're in a [...] clause and we end, do assignment
+                                       if(!_cp.attr){
+                                               // no attribute match was previously begun, so we
+                                               // assume this is an attribute existance match in the
+                                               // form of [someAttributeName]
+                                               _cp.attr = ts(inBrackets+1, x);
+                                       }else{
+                                               // we had an attribute already, so we know that we're
+                                               // matching some sort of value, as in [attrName=howdy]
+                                               _cp.matchFor = ts((inMatchFor||inBrackets+1), x);
+                                       }
+                                       var cmf = _cp.matchFor;
+                                       if(cmf){
+                                               // try to strip quotes from the matchFor value. We want
+                                               // [attrName=howdy] to match the same 
+                                               //      as [attrName = 'howdy' ]
+                                               if(     (cmf.charAt(0) == '"') || (cmf.charAt(0)  == "'") ){
+                                                       _cp.matchFor = cmf.slice(1, -1);
+                                               }
+                                       }
+                                       // end the attribute by adding it to the list of attributes. 
+                                       currentPart.attrs.push(_cp);
+                                       _cp = null; // necessary?
+                                       inBrackets = inMatchFor = -1;
+                               }else if(cc == "="){
+                                       // if the last char was an operator prefix, make sure we
+                                       // record it along with the "=" operator. 
+                                       var addToCc = ("|~^$*".indexOf(lc) >=0 ) ? lc : "";
+                                       _cp.type = addToCc+cc;
+                                       _cp.attr = ts(inBrackets+1, x-addToCc.length);
+                                       inMatchFor = x+1;
+                               }
+                               // now look for other clause parts
+                       }else if(inParens >= 0){
+                               // if we're in a parenthetical expression, we need to figure
+                               // out if it's attached to a pseduo-selector rule like
+                               // :nth-child(1)
+                               if(cc == ")"){
+                                       if(inPseudo >= 0){
+                                               _cp.value = ts(inParens+1, x);
+                                       }
+                                       inPseudo = inParens = -1;
+                               }
+                       }else if(cc == "#"){
+                               // start of an ID match
+                               endAll();
+                               inId = x+1;
+                       }else if(cc == "."){
+                               // start of a class match
+                               endAll();
+                               inClass = x;
+                       }else if(cc == ":"){
+                               // start of a pseudo-selector match
+                               endAll();
+                               inPseudo = x;
+                       }else if(cc == "["){
+                               // start of an attribute match. 
+                               endAll();
+                               inBrackets = x;
+                               // provide a new structure for the attribute match to fill-in
+                               _cp = {
+                                       /*=====
+                                       attr: null, type: null, matchFor: null
+                                       =====*/
+                               };
+                       }else if(cc == "("){
+                               // we really only care if we've entered a parenthetical
+                               // expression if we're already inside a pseudo-selector match
+                               if(inPseudo >= 0){
+                                       // provide a new structure for the pseudo match to fill-in
+                                       _cp = { 
+                                               name: ts(inPseudo+1, x), 
+                                               value: null
+                                       }
+                                       currentPart.pseudos.push(_cp);
+                               }
+                               inParens = x;
+                       }else if(
+                               (cc == " ") && 
+                               // if it's a space char and the last char is too, consume the
+                               // current one without doing more work
+                               (lc != cc)
+                       ){
+                               endPart();
+                       }
+               }
+               return queryParts;
+       };
+       
+
+       ////////////////////////////////////////////////////////////////////////
+       // DOM query infrastructure
+       ////////////////////////////////////////////////////////////////////////
+
+       var agree = function(first, second){
+               // the basic building block of the yes/no chaining system. agree(f1,
+               // f2) generates a new function which returns the boolean results of
+               // both of the passed functions to a single logical-anded result. If
+               // either are not possed, the other is used exclusively.
+               if(!first){ return second; }
+               if(!second){ return first; }
+
+               return function(){
+                       return first.apply(window, arguments) && second.apply(window, arguments);
+               }
+       };
+
+       var getArr = function(i, arr){
+               // helps us avoid array alloc when we don't need it
+               var r = arr||[]; // FIXME: should this be 'new d._NodeListCtor()' ?
+               if(i){ r.push(i); }
+               return r;
+       };
+
+       var _isElement = function(n){ return (1 == n.nodeType); };
+
+       // FIXME: need to coalesce _getAttr with defaultGetter
+       var blank = "";
+       var _getAttr = function(elem, attr){
+               if(!elem){ return blank; }
+               if(attr == "class"){
+                       return elem.className || blank;
+               }
+               if(attr == "for"){
+                       return elem.htmlFor || blank;
+               }
+               if(attr == "style"){
+                       return elem.style.cssText || blank;
+               }
+               return (caseSensitive ? elem.getAttribute(attr) : elem.getAttribute(attr, 2)) || blank;
+       };
+
+       var attrs = {
+               "*=": function(attr, value){
+                       return function(elem){
+                               // E[foo*="bar"]
+                               //              an E element whose "foo" attribute value contains
+                               //              the substring "bar"
+                               return (_getAttr(elem, attr).indexOf(value)>=0);
+                       }
+               },
+               "^=": function(attr, value){
+                       // E[foo^="bar"]
+                       //              an E element whose "foo" attribute value begins exactly
+                       //              with the string "bar"
+                       return function(elem){
+                               return (_getAttr(elem, attr).indexOf(value)==0);
+                       }
+               },
+               "$=": function(attr, value){
+                       // E[foo$="bar"]        
+                       //              an E element whose "foo" attribute value ends exactly
+                       //              with the string "bar"
+                       var tval = " "+value;
+                       return function(elem){
+                               var ea = " "+_getAttr(elem, attr);
+                               return (ea.lastIndexOf(value)==(ea.length-value.length));
+                       }
+               },
+               "~=": function(attr, value){
+                       // E[foo~="bar"]        
+                       //              an E element whose "foo" attribute value is a list of
+                       //              space-separated values, one of which is exactly equal
+                       //              to "bar"
+
+                       // return "[contains(concat(' ',@"+attr+",' '), ' "+ value +" ')]";
+                       var tval = " "+value+" ";
+                       return function(elem){
+                               var ea = " "+_getAttr(elem, attr)+" ";
+                               return (ea.indexOf(tval)>=0);
+                       }
+               },
+               "|=": function(attr, value){
+                       // E[hreflang|="en"]
+                       //              an E element whose "hreflang" attribute has a
+                       //              hyphen-separated list of values beginning (from the
+                       //              left) with "en"
+                       var valueDash = " "+value+"-";
+                       return function(elem){
+                               var ea = " "+_getAttr(elem, attr);
+                               return (
+                                       (ea == value) ||
+                                       (ea.indexOf(valueDash)==0)
+                               );
+                       }
+               },
+               "=": function(attr, value){
+                       return function(elem){
+                               return (_getAttr(elem, attr) == value);
+                       }
+               }
+       };
+
+       // avoid testing for node type if we can. Defining this in the negative
+       // here to avoid negation in the fast path.
+       var _noNES = (typeof getDoc().firstChild.nextElementSibling == "undefined");
+       var _ns = !_noNES ? "nextElementSibling" : "nextSibling";
+       var _ps = !_noNES ? "previousElementSibling" : "previousSibling";
+       var _simpleNodeTest = (_noNES ? _isElement : yesman);
+
+       var _lookLeft = function(node){
+               // look left
+               while(node = node[_ps]){
+                       if(_simpleNodeTest(node)){ return false; }
+               }
+               return true;
+       };
+
+       var _lookRight = function(node){
+               // look right
+               while(node = node[_ns]){
+                       if(_simpleNodeTest(node)){ return false; }
+               }
+               return true;
+       };
+
+       var getNodeIndex = function(node){
+               var root = node.parentNode;
+               var i = 0,
+                       tret = root[childNodesName],
+                       ci = (node["_i"]||-1),
+                       cl = (root["_l"]||-1);
+
+               if(!tret){ return -1; }
+               var l = tret.length;
+
+               // we calcuate the parent length as a cheap way to invalidate the
+               // cache. It's not 100% accurate, but it's much more honest than what
+               // other libraries do
+               if( cl == l && ci >= 0 && cl >= 0 ){
+                       // if it's legit, tag and release
+                       return ci;
+               }
+
+               // else re-key things
+               root["_l"] = l;
+               ci = -1;
+               for(var te = root["firstElementChild"]||root["firstChild"]; te; te = te[_ns]){
+                       if(_simpleNodeTest(te)){ 
+                               te["_i"] = ++i;
+                               if(node === te){ 
+                                       // NOTE:
+                                       //      shortcuting the return at this step in indexing works
+                                       //      very well for benchmarking but we avoid it here since
+                                       //      it leads to potential O(n^2) behavior in sequential
+                                       //      getNodexIndex operations on a previously un-indexed
+                                       //      parent. We may revisit this at a later time, but for
+                                       //      now we just want to get the right answer more often
+                                       //      than not.
+                                       ci = i;
+                               }
+                       }
+               }
+               return ci;
+       };
+
+       var isEven = function(elem){
+               return !((getNodeIndex(elem)) % 2);
+       };
+
+       var isOdd = function(elem){
+               return ((getNodeIndex(elem)) % 2);
+       };
+
+       var pseudos = {
+               "checked": function(name, condition){
+                       return function(elem){
+                               return !!("checked" in elem ? elem.checked : elem.selected);
+                       }
+               },
+               "first-child": function(){ return _lookLeft; },
+               "last-child": function(){ return _lookRight; },
+               "only-child": function(name, condition){
+                       return function(node){ 
+                               if(!_lookLeft(node)){ return false; }
+                               if(!_lookRight(node)){ return false; }
+                               return true;
+                       };
+               },
+               "empty": function(name, condition){
+                       return function(elem){
+                               // DomQuery and jQuery get this wrong, oddly enough.
+                               // The CSS 3 selectors spec is pretty explicit about it, too.
+                               var cn = elem.childNodes;
+                               var cnl = elem.childNodes.length;
+                               // if(!cnl){ return true; }
+                               for(var x=cnl-1; x >= 0; x--){
+                                       var nt = cn[x].nodeType;
+                                       if((nt === 1)||(nt == 3)){ return false; }
+                               }
+                               return true;
+                       }
+               },
+               "contains": function(name, condition){
+                       var cz = condition.charAt(0);
+                       if( cz == '"' || cz == "'" ){ //remove quote
+                               condition = condition.slice(1, -1);
+                       }
+                       return function(elem){
+                               return (elem.innerHTML.indexOf(condition) >= 0);
+                       }
+               },
+               "not": function(name, condition){
+                       var p = getQueryParts(condition)[0];
+                       var ignores = { el: 1 }; 
+                       if(p.tag != "*"){
+                               ignores.tag = 1;
+                       }
+                       if(!p.classes.length){
+                               ignores.classes = 1;
+                       }
+                       var ntf = getSimpleFilterFunc(p, ignores);
+                       return function(elem){
+                               return (!ntf(elem));
+                       }
+               },
+               "nth-child": function(name, condition){
+                       var pi = parseInt;
+                       // avoid re-defining function objects if we can
+                       if(condition == "odd"){
+                               return isOdd;
+                       }else if(condition == "even"){
+                               return isEven;
+                       }
+                       // FIXME: can we shorten this?
+                       if(condition.indexOf("n") != -1){
+                               var tparts = condition.split("n", 2);
+                               var pred = tparts[0] ? ((tparts[0] == '-') ? -1 : pi(tparts[0])) : 1;
+                               var idx = tparts[1] ? pi(tparts[1]) : 0;
+                               var lb = 0, ub = -1;
+                               if(pred > 0){
+                                       if(idx < 0){
+                                               idx = (idx % pred) && (pred + (idx % pred));
+                                       }else if(idx>0){
+                                               if(idx >= pred){
+                                                       lb = idx - idx % pred;
+                                               }
+                                               idx = idx % pred;
+                                       }
+                               }else if(pred<0){
+                                       pred *= -1;
+                                       // idx has to be greater than 0 when pred is negative;
+                                       // shall we throw an error here?
+                                       if(idx > 0){
+                                               ub = idx;
+                                               idx = idx % pred;
+                                       }
+                               }
+                               if(pred > 0){
+                                       return function(elem){
+                                               var i = getNodeIndex(elem);
+                                               return (i>=lb) && (ub<0 || i<=ub) && ((i % pred) == idx);
+                                       }
+                               }else{
+                                       condition = idx;
+                               }
+                       }
+                       var ncount = pi(condition);
+                       return function(elem){
+                               return (getNodeIndex(elem) == ncount);
+                       }
+               }
+       };
+
+       var defaultGetter = (d.isIE) ? function(cond){
+               var clc = cond.toLowerCase();
+               if(clc == "class"){ cond = "className"; }
+               return function(elem){
+                       return (caseSensitive ? elem.getAttribute(cond) : elem[cond]||elem[clc]);
+               }
+       } : function(cond){
+               return function(elem){
+                       return (elem && elem.getAttribute && elem.hasAttribute(cond));
+               }
+       };
+
+       var getSimpleFilterFunc = function(query, ignores){
+               // generates a node tester function based on the passed query part. The
+               // query part is one of the structures generatd by the query parser
+               // when it creates the query AST. The "ignores" object specifies which
+               // (if any) tests to skip, allowing the system to avoid duplicating
+               // work where it may have already been taken into account by other
+               // factors such as how the nodes to test were fetched in the first
+               // place
+               if(!query){ return yesman; }
+               ignores = ignores||{};
+
+               var ff = null;
+
+               if(!("el" in ignores)){
+                       ff = agree(ff, _isElement);
+               }
+
+               if(!("tag" in ignores)){
+                       if(query.tag != "*"){
+                               ff = agree(ff, function(elem){
+                                       return (elem && (elem.tagName == query.getTag()));
+                               });
+                       }
+               }
+
+               if(!("classes" in ignores)){
+                       each(query.classes, function(cname, idx, arr){
+                               // get the class name
+                               /*
+                               var isWildcard = cname.charAt(cname.length-1) == "*";
+                               if(isWildcard){
+                                       cname = cname.substr(0, cname.length-1);
+                               }
+                               // I dislike the regex thing, even if memozied in a cache, but it's VERY short
+                               var re = new RegExp("(?:^|\\s)" + cname + (isWildcard ? ".*" : "") + "(?:\\s|$)");
+                               */
+                               var re = new RegExp("(?:^|\\s)" + cname + "(?:\\s|$)");
+                               ff = agree(ff, function(elem){
+                                       return re.test(elem.className);
+                               });
+                               ff.count = idx;
+                       });
+               }
+
+               if(!("pseudos" in ignores)){
+                       each(query.pseudos, function(pseudo){
+                               var pn = pseudo.name;
+                               if(pseudos[pn]){
+                                       ff = agree(ff, pseudos[pn](pn, pseudo.value));
+                               }
+                       });
+               }
+
+               if(!("attrs" in ignores)){
+                       each(query.attrs, function(attr){
+                               var matcher;
+                               var a = attr.attr;
+                               // type, attr, matchFor
+                               if(attr.type && attrs[attr.type]){
+                                       matcher = attrs[attr.type](a, attr.matchFor);
+                               }else if(a.length){
+                                       matcher = defaultGetter(a);
+                               }
+                               if(matcher){
+                                       ff = agree(ff, matcher);
+                               }
+                       });
+               }
+
+               if(!("id" in ignores)){
+                       if(query.id){
+                               ff = agree(ff, function(elem){ 
+                                       return (!!elem && (elem.id == query.id));
+                               });
+                       }
+               }
+
+               if(!ff){
+                       if(!("default" in ignores)){
+                               ff = yesman; 
+                       }
+               }
+               return ff;
+       };
+
+       var _nextSibling = function(filterFunc){
+               return function(node, ret, bag){
+                       while(node = node[_ns]){
+                               if(_noNES && (!_isElement(node))){ continue; }
+                               if(
+                                       (!bag || _isUnique(node, bag)) &&
+                                       filterFunc(node)
+                               ){
+                                       ret.push(node);
+                               }
+                               break;
+                       }
+                       return ret;
+               }
+       };
+
+       var _nextSiblings = function(filterFunc){
+               return function(root, ret, bag){
+                       var te = root[_ns];
+                       while(te){
+                               if(_simpleNodeTest(te)){
+                                       if(bag && !_isUnique(te, bag)){
+                                               break;
+                                       }
+                                       if(filterFunc(te)){
+                                               ret.push(te);
+                                       }
+                               }
+                               te = te[_ns];
+                       }
+                       return ret;
+               }
+       };
+
+       // get an array of child *elements*, skipping text and comment nodes
+       var _childElements = function(filterFunc){
+               filterFunc = filterFunc||yesman;
+               return function(root, ret, bag){
+                       // get an array of child elements, skipping text and comment nodes
+                       var te, x = 0, tret = root[childNodesName];
+                       while(te = tret[x++]){
+                               if(
+                                       _simpleNodeTest(te) &&
+                                       (!bag || _isUnique(te, bag)) &&
+                                       (filterFunc(te, x))
+                               ){ 
+                                       ret.push(te);
+                               }
+                       }
+                       return ret;
+               };
+       };
+       
+       /*
+       // thanks, Dean!
+       var itemIsAfterRoot = d.isIE ? function(item, root){
+               return (item.sourceIndex > root.sourceIndex);
+       } : function(item, root){
+               return (item.compareDocumentPosition(root) == 2);
+       };
+       */
+
+       // test to see if node is below root
+       var _isDescendant = function(node, root){
+               var pn = node.parentNode;
+               while(pn){
+                       if(pn == root){
+                               break;
+                       }
+                       pn = pn.parentNode;
+               }
+               return !!pn;
+       };
+
+       var _getElementsFuncCache = {};
+
+       var getElementsFunc = function(query){
+               var retFunc = _getElementsFuncCache[query.query];
+               // if we've got a cached dispatcher, just use that
+               if(retFunc){ return retFunc; }
+               // else, generate a new on
+
+               // NOTE:
+               //              this function returns a function that searches for nodes and
+               //              filters them.  The search may be specialized by infix operators
+               //              (">", "~", or "+") else it will default to searching all
+               //              descendants (the " " selector). Once a group of children is
+               //              founde, a test function is applied to weed out the ones we
+               //              don't want. Many common cases can be fast-pathed. We spend a
+               //              lot of cycles to create a dispatcher that doesn't do more work
+               //              than necessary at any point since, unlike this function, the
+               //              dispatchers will be called every time. The logic of generating
+               //              efficient dispatchers looks like this in pseudo code:
+               //
+               //              # if it's a purely descendant query (no ">", "+", or "~" modifiers)
+               //              if infixOperator == " ":
+               //                      if only(id):
+               //                              return def(root):
+               //                                      return d.byId(id, root);
+               //
+               //                      elif id:
+               //                              return def(root):
+               //                                      return filter(d.byId(id, root));
+               //
+               //                      elif cssClass && getElementsByClassName:
+               //                              return def(root):
+               //                                      return filter(root.getElementsByClassName(cssClass));
+               //
+               //                      elif only(tag):
+               //                              return def(root):
+               //                                      return root.getElementsByTagName(tagName);
+               //
+               //                      else:
+               //                              # search by tag name, then filter
+               //                              return def(root):
+               //                                      return filter(root.getElementsByTagName(tagName||"*"));
+               //
+               //              elif infixOperator == ">":
+               //                      # search direct children
+               //                      return def(root):
+               //                              return filter(root.children);
+               //
+               //              elif infixOperator == "+":
+               //                      # search next sibling
+               //                      return def(root):
+               //                              return filter(root.nextElementSibling);
+               //
+               //              elif infixOperator == "~":
+               //                      # search rightward siblings
+               //                      return def(root):
+               //                              return filter(nextSiblings(root));
+
+               var io = query.infixOper;
+               var oper = (io ? io.oper : "");
+               // the default filter func which tests for all conditions in the query
+               // part. This is potentially inefficient, so some optimized paths may
+               // re-define it to test fewer things.
+               var filterFunc = getSimpleFilterFunc(query, { el: 1 });
+               var qt = query.tag;
+               var wildcardTag = ("*" == qt);
+               var ecs = getDoc()["getElementsByClassName"]; 
+
+               if(!oper){
+                       // if there's no infix operator, then it's a descendant query. ID
+                       // and "elements by class name" variants can be accelerated so we
+                       // call them out explicitly:
+                       if(query.id){
+                               // testing shows that the overhead of yesman() is acceptable
+                               // and can save us some bytes vs. re-defining the function
+                               // everywhere.
+                               filterFunc = (!query.loops && wildcardTag) ? 
+                                       yesman : 
+                                       getSimpleFilterFunc(query, { el: 1, id: 1 });
+
+                               retFunc = function(root, arr){
+                                       var te = d.byId(query.id, (root.ownerDocument||root));
+                                       if(!te || !filterFunc(te)){ return; }
+                                       if(9 == root.nodeType){ // if root's a doc, we just return directly
+                                               return getArr(te, arr);
+                                       }else{ // otherwise check ancestry
+                                               if(_isDescendant(te, root)){
+                                                       return getArr(te, arr);
+                                               }
+                                       }
+                               }
+                       }else if(
+                               ecs && 
+                               // isAlien check. Workaround for Prototype.js being totally evil/dumb.
+                               /\{\s*\[native code\]\s*\}/.test(String(ecs)) && 
+                               query.classes.length &&
+                               !cssCaseBug
+                       ){
+                               // it's a class-based query and we've got a fast way to run it.
+
+                               // ignore class and ID filters since we will have handled both
+                               filterFunc = getSimpleFilterFunc(query, { el: 1, classes: 1, id: 1 });
+                               var classesString = query.classes.join(" ");
+                               retFunc = function(root, arr, bag){
+                                       var ret = getArr(0, arr), te, x=0;
+                                       var tret = root.getElementsByClassName(classesString);
+                                       while((te = tret[x++])){
+                                               if(filterFunc(te, root) && _isUnique(te, bag)){
+                                                       ret.push(te);
+                                               }
+                                       }
+                                       return ret;
+                               };
+
+                       }else if(!wildcardTag && !query.loops){
+                               // it's tag only. Fast-path it.
+                               retFunc = function(root, arr, bag){
+                                       var ret = getArr(0, arr), te, x=0;
+                                       var tret = root.getElementsByTagName(query.getTag());
+                                       while((te = tret[x++])){
+                                               if(_isUnique(te, bag)){
+                                                       ret.push(te);
+                                               }
+                                       }
+                                       return ret;
+                               };
+                       }else{
+                               // the common case:
+                               //              a descendant selector without a fast path. By now it's got
+                               //              to have a tag selector, even if it's just "*" so we query
+                               //              by that and filter
+                               filterFunc = getSimpleFilterFunc(query, { el: 1, tag: 1, id: 1 });
+                               retFunc = function(root, arr, bag){
+                                       var ret = getArr(0, arr), te, x=0;
+                                       // we use getTag() to avoid case sensitivity issues
+                                       var tret = root.getElementsByTagName(query.getTag());
+                                       while((te = tret[x++])){
+                                               if(filterFunc(te, root) && _isUnique(te, bag)){
+                                                       ret.push(te);
+                                               }
+                                       }
+                                       return ret;
+                               };
+                       }
+               }else{
+                       // the query is scoped in some way. Instead of querying by tag we
+                       // use some other collection to find candidate nodes
+                       var skipFilters = { el: 1 };
+                       if(wildcardTag){
+                               skipFilters.tag = 1;
+                       }
+                       filterFunc = getSimpleFilterFunc(query, skipFilters);
+                       if("+" == oper){
+                               retFunc = _nextSibling(filterFunc);
+                       }else if("~" == oper){
+                               retFunc = _nextSiblings(filterFunc);
+                       }else if(">" == oper){
+                               retFunc = _childElements(filterFunc);
+                       }
+               }
+               // cache it and return
+               return _getElementsFuncCache[query.query] = retFunc;
+       };
+
+       var filterDown = function(root, queryParts){
+               // NOTE:
+               //              this is the guts of the DOM query system. It takes a list of
+               //              parsed query parts and a root and finds children which match
+               //              the selector represented by the parts
+               var candidates = getArr(root), qp, x, te, qpl = queryParts.length, bag, ret;
+
+               for(var i = 0; i < qpl; i++){
+                       ret = [];
+                       qp = queryParts[i];
+                       x = candidates.length - 1;
+                       if(x > 0){
+                               // if we have more than one root at this level, provide a new
+                               // hash to use for checking group membership but tell the
+                               // system not to post-filter us since we will already have been
+                               // gauranteed to be unique
+                               bag = {};
+                               ret.nozip = true;
+                       }
+                       var gef = getElementsFunc(qp);
+                       for(var j = 0; (te = candidates[j]); j++){
+                               // for every root, get the elements that match the descendant
+                               // selector, adding them to the "ret" array and filtering them
+                               // via membership in this level's bag. If there are more query
+                               // parts, then this level's return will be used as the next
+                               // level's candidates
+                               gef(te, ret, bag);
+                       }
+                       if(!ret.length){ break; }
+                       candidates = ret;
+               }
+               return ret;
+       };
+
+       ////////////////////////////////////////////////////////////////////////
+       // the query runner
+       ////////////////////////////////////////////////////////////////////////
+
+       // these are the primary caches for full-query results. The query
+       // dispatcher functions are generated then stored here for hash lookup in
+       // the future
+       var _queryFuncCacheDOM = {},
+               _queryFuncCacheQSA = {};
+
+       // this is the second level of spliting, from full-length queries (e.g.,
+       // "div.foo .bar") into simple query expressions (e.g., ["div.foo",
+       // ".bar"])
+       var getStepQueryFunc = function(query){
+               var qparts = getQueryParts(trim(query));
+
+               // if it's trivial, avoid iteration and zipping costs
+               if(qparts.length == 1){
+                       // we optimize this case here to prevent dispatch further down the
+                       // chain, potentially slowing things down. We could more elegantly
+                       // handle this in filterDown(), but it's slower for simple things
+                       // that need to be fast (e.g., "#someId").
+                       var tef = getElementsFunc(qparts[0]);
+                       return function(root){
+                               var r = tef(root, new qlc());
+                               if(r){ r.nozip = true; }
+                               return r;
+                       }
+               }
+
+               // otherwise, break it up and return a runner that iterates over the parts recursively
+               return function(root){
+                       return filterDown(root, qparts);
+               }
+       };
+
+       // NOTES:
+       //      * we can't trust QSA for anything but document-rooted queries, so
+       //        caching is split into DOM query evaluators and QSA query evaluators
+       //      * caching query results is dirty and leak-prone (or, at a minimum,
+       //        prone to unbounded growth). Other toolkits may go this route, but
+       //        they totally destroy their own ability to manage their memory
+       //        footprint. If we implement it, it should only ever be with a fixed
+       //        total element reference # limit and an LRU-style algorithm since JS
+       //        has no weakref support. Caching compiled query evaluators is also
+       //        potentially problematic, but even on large documents the size of the
+       //        query evaluators is often < 100 function objects per evaluator (and
+       //        LRU can be applied if it's ever shown to be an issue).
+       //      * since IE's QSA support is currently only for HTML documents and even
+       //        then only in IE 8's "standards mode", we have to detect our dispatch
+       //        route at query time and keep 2 separate caches. Ugg.
+
+       // we need to determine if we think we can run a given query via
+       // querySelectorAll or if we'll need to fall back on DOM queries to get
+       // there. We need a lot of information about the environment and the query
+       // to make the determiniation (e.g. does it support QSA, does the query in
+       // question work in the native QSA impl, etc.).
+       var nua = navigator.userAgent;
+       // some versions of Safari provided QSA, but it was buggy and crash-prone.
+       // We need te detect the right "internal" webkit version to make this work.
+       var wk = "WebKit/";
+       var is525 = (
+               d.isWebKit && 
+               (nua.indexOf(wk) > 0) && 
+               (parseFloat(nua.split(wk)[1]) > 528)
+       );
+
+       // IE QSA queries may incorrectly include comment nodes, so we throw the
+       // zipping function into "remove" comments mode instead of the normal "skip
+       // it" which every other QSA-clued browser enjoys
+       var noZip = d.isIE ? "commentStrip" : "nozip";
+
+       var qsa = "querySelectorAll";
+       var qsaAvail = (
+               !!getDoc()[qsa] && 
+               // see #5832
+               (!d.isSafari || (d.isSafari > 3.1) || is525 )
+       );
+
+       //Don't bother with n+3 type of matches, IE complains if we modify those.
+       var infixSpaceRe = /n\+\d|([^ ])?([>~+])([^ =])?/g;
+       var infixSpaceFunc = function(match, pre, ch, post) {
+               return ch ? (pre ? pre + " " : "") + ch + (post ? " " + post : "") : /*n+3*/ match;
+       };
+
+       var getQueryFunc = function(query, forceDOM){
+               //Normalize query. The CSS3 selectors spec allows for omitting spaces around
+               //infix operators, >, ~ and +
+               //Do the work here since detection for spaces is used as a simple "not use QSA"
+               //test below.
+               query = query.replace(infixSpaceRe, infixSpaceFunc);
+
+               if(qsaAvail){
+                       // if we've got a cached variant and we think we can do it, run it!
+                       var qsaCached = _queryFuncCacheQSA[query];
+                       if(qsaCached && !forceDOM){ return qsaCached; }
+               }
+
+               // else if we've got a DOM cached variant, assume that we already know
+               // all we need to and use it
+               var domCached = _queryFuncCacheDOM[query];
+               if(domCached){ return domCached; }
+
+               // TODO: 
+               //              today we're caching DOM and QSA branches separately so we
+               //              recalc useQSA every time. If we had a way to tag root+query
+               //              efficiently, we'd be in good shape to do a global cache.
+
+               var qcz = query.charAt(0);
+               var nospace = (-1 == query.indexOf(" "));
+
+               // byId searches are wicked fast compared to QSA, even when filtering
+               // is required
+               if( (query.indexOf("#") >= 0) && (nospace) ){
+                       forceDOM = true;
+               }
+
+               var useQSA = ( 
+                       qsaAvail && (!forceDOM) &&
+                       // as per CSS 3, we can't currently start w/ combinator:
+                       //              http://www.w3.org/TR/css3-selectors/#w3cselgrammar
+                       (specials.indexOf(qcz) == -1) && 
+                       // IE's QSA impl sucks on pseudos
+                       (!d.isIE || (query.indexOf(":") == -1)) &&
+
+                       (!(cssCaseBug && (query.indexOf(".") >= 0))) &&
+
+                       // FIXME:
+                       //              need to tighten up browser rules on ":contains" and "|=" to
+                       //              figure out which aren't good
+                       //              Latest webkit (around 531.21.8) does not seem to do well with :checked on option
+                       //              elements, even though according to spec, selected options should
+                       //              match :checked. So go nonQSA for it:
+                       //              http://bugs.dojotoolkit.org/ticket/5179
+                       (query.indexOf(":contains") == -1) && (query.indexOf(":checked") == -1) && 
+                       (query.indexOf("|=") == -1) // some browsers don't grok it
+               );
+
+               // TODO: 
+               //              if we've got a descendant query (e.g., "> .thinger" instead of
+               //              just ".thinger") in a QSA-able doc, but are passed a child as a
+               //              root, it should be possible to give the item a synthetic ID and
+               //              trivially rewrite the query to the form "#synid > .thinger" to
+               //              use the QSA branch
+
+
+               if(useQSA){
+                       var tq = (specials.indexOf(query.charAt(query.length-1)) >= 0) ? 
+                                               (query + " *") : query;
+                       return _queryFuncCacheQSA[query] = function(root){
+                               try{
+                                       // the QSA system contains an egregious spec bug which
+                                       // limits us, effectively, to only running QSA queries over
+                                       // entire documents.  See:
+                                       //              http://ejohn.org/blog/thoughts-on-queryselectorall/
+                                       //      despite this, we can also handle QSA runs on simple
+                                       //      selectors, but we don't want detection to be expensive
+                                       //      so we're just checking for the presence of a space char
+                                       //      right now. Not elegant, but it's cheaper than running
+                                       //      the query parser when we might not need to
+                                       if(!((9 == root.nodeType) || nospace)){ throw ""; }
+                                       var r = root[qsa](tq);
+                                       // skip expensive duplication checks and just wrap in a NodeList
+                                       r[noZip] = true;
+                                       return r;
+                               }catch(e){
+                                       // else run the DOM branch on this query, ensuring that we
+                                       // default that way in the future
+                                       return getQueryFunc(query, true)(root);
+                               }
+                       }
+               }else{
+                       // DOM branch
+                       var parts = query.split(/\s*,\s*/);
+                       return _queryFuncCacheDOM[query] = ((parts.length < 2) ? 
+                               // if not a compound query (e.g., ".foo, .bar"), cache and return a dispatcher
+                               getStepQueryFunc(query) : 
+                               // if it *is* a complex query, break it up into its
+                               // constituent parts and return a dispatcher that will
+                               // merge the parts when run
+                               function(root){
+                                       var pindex = 0, // avoid array alloc for every invocation
+                                               ret = [],
+                                               tp;
+                                       while((tp = parts[pindex++])){
+                                               ret = ret.concat(getStepQueryFunc(tp)(root));
+                                       }
+                                       return ret;
+                               }
+                       );
+               }
+       };
+
+       var _zipIdx = 0;
+
+       // NOTE:
+       //              this function is Moo inspired, but our own impl to deal correctly
+       //              with XML in IE
+       var _nodeUID = d.isIE ? function(node){
+               if(caseSensitive){
+                       // XML docs don't have uniqueID on their nodes
+                       return (node.getAttribute("_uid") || node.setAttribute("_uid", ++_zipIdx) || _zipIdx);
+
+               }else{
+                       return node.uniqueID;
+               }
+       } : 
+       function(node){
+               return (node._uid || (node._uid = ++_zipIdx));
+       };
+
+       // determine if a node in is unique in a "bag". In this case we don't want
+       // to flatten a list of unique items, but rather just tell if the item in
+       // question is already in the bag. Normally we'd just use hash lookup to do
+       // this for us but IE's DOM is busted so we can't really count on that. On
+       // the upside, it gives us a built in unique ID function. 
+       var _isUnique = function(node, bag){
+               if(!bag){ return 1; }
+               var id = _nodeUID(node);
+               if(!bag[id]){ return bag[id] = 1; }
+               return 0;
+       };
+
+       // attempt to efficiently determine if an item in a list is a dupe,
+       // returning a list of "uniques", hopefully in doucment order
+       var _zipIdxName = "_zipIdx";
+       var _zip = function(arr){
+               if(arr && arr.nozip){ 
+                       return (qlc._wrap) ? qlc._wrap(arr) : arr;
+               }
+               // var ret = new d._NodeListCtor();
+               var ret = new qlc();
+               if(!arr || !arr.length){ return ret; }
+               if(arr[0]){
+                       ret.push(arr[0]);
+               }
+               if(arr.length < 2){ return ret; }
+
+               _zipIdx++;
+               
+               // we have to fork here for IE and XML docs because we can't set
+               // expandos on their nodes (apparently). *sigh*
+               if(d.isIE && caseSensitive){
+                       var szidx = _zipIdx+"";
+                       arr[0].setAttribute(_zipIdxName, szidx);
+                       for(var x = 1, te; te = arr[x]; x++){
+                               if(arr[x].getAttribute(_zipIdxName) != szidx){ 
+                                       ret.push(te);
+                               }
+                               te.setAttribute(_zipIdxName, szidx);
+                       }
+               }else if(d.isIE && arr.commentStrip){
+                       try{
+                               for(var x = 1, te; te = arr[x]; x++){
+                                       if(_isElement(te)){ 
+                                               ret.push(te);
+                                       }
+                               }
+                       }catch(e){ /* squelch */ }
+               }else{
+                       if(arr[0]){ arr[0][_zipIdxName] = _zipIdx; }
+                       for(var x = 1, te; te = arr[x]; x++){
+                               if(arr[x][_zipIdxName] != _zipIdx){ 
+                                       ret.push(te);
+                               }
+                               te[_zipIdxName] = _zipIdx;
+                       }
+               }
+               return ret;
+       };
+
+       // the main executor
+       d.query = function(/*String*/ query, /*String|DOMNode?*/ root){
+               //      summary:
+               //              Returns nodes which match the given CSS3 selector, searching the
+               //              entire document by default but optionally taking a node to scope
+               //              the search by. Returns an instance of dojo.NodeList.
+               //      description:
+               //              dojo.query() is the swiss army knife of DOM node manipulation in
+               //              Dojo. Much like Prototype's "$$" (bling-bling) function or JQuery's
+               //              "$" function, dojo.query provides robust, high-performance
+               //              CSS-based node selector support with the option of scoping searches
+               //              to a particular sub-tree of a document.
+               //
+               //              Supported Selectors:
+               //              --------------------
+               //
+               //              dojo.query() supports a rich set of CSS3 selectors, including:
+               //
+               //                      * class selectors (e.g., `.foo`)
+               //                      * node type selectors like `span`
+               //                      * ` ` descendant selectors
+               //                      * `>` child element selectors 
+               //                      * `#foo` style ID selectors
+               //                      * `*` universal selector
+               //                      * `~`, the immediately preceeded-by sibling selector
+               //                      * `+`, the preceeded-by sibling selector
+               //                      * attribute queries:
+               //                      |       * `[foo]` attribute presence selector
+               //                      |       * `[foo='bar']` attribute value exact match
+               //                      |       * `[foo~='bar']` attribute value list item match
+               //                      |       * `[foo^='bar']` attribute start match
+               //                      |       * `[foo$='bar']` attribute end match
+               //                      |       * `[foo*='bar']` attribute substring match
+               //                      * `:first-child`, `:last-child`, and `:only-child` positional selectors
+               //                      * `:empty` content emtpy selector
+               //                      * `:checked` pseudo selector
+               //                      * `:nth-child(n)`, `:nth-child(2n+1)` style positional calculations
+               //                      * `:nth-child(even)`, `:nth-child(odd)` positional selectors
+               //                      * `:not(...)` negation pseudo selectors
+               //
+               //              Any legal combination of these selectors will work with
+               //              `dojo.query()`, including compound selectors ("," delimited).
+               //              Very complex and useful searches can be constructed with this
+               //              palette of selectors and when combined with functions for
+               //              manipulation presented by dojo.NodeList, many types of DOM
+               //              manipulation operations become very straightforward.
+               //              
+               //              Unsupported Selectors:
+               //              ----------------------
+               //
+               //              While dojo.query handles many CSS3 selectors, some fall outside of
+               //              what's resaonable for a programmatic node querying engine to
+               //              handle. Currently unsupported selectors include:
+               //              
+               //                      * namespace-differentiated selectors of any form
+               //                      * all `::` pseduo-element selectors
+               //                      * certain pseduo-selectors which don't get a lot of day-to-day use:
+               //                      |       * `:root`, `:lang()`, `:target`, `:focus`
+               //                      * all visual and state selectors:
+               //                      |       * `:root`, `:active`, `:hover`, `:visisted`, `:link`,
+               //                                `:enabled`, `:disabled`
+               //                      * `:*-of-type` pseudo selectors
+               //              
+               //              dojo.query and XML Documents:
+               //              -----------------------------
+               //              
+               //              `dojo.query` (as of dojo 1.2) supports searching XML documents
+               //              in a case-sensitive manner. If an HTML document is served with
+               //              a doctype that forces case-sensitivity (e.g., XHTML 1.1
+               //              Strict), dojo.query() will detect this and "do the right
+               //              thing". Case sensitivity is dependent upon the document being
+               //              searched and not the query used. It is therefore possible to
+               //              use case-sensitive queries on strict sub-documents (iframes,
+               //              etc.) or XML documents while still assuming case-insensitivity
+               //              for a host/root document.
+               //
+               //              Non-selector Queries:
+               //              ---------------------
+               //
+               //              If something other than a String is passed for the query,
+               //              `dojo.query` will return a new `dojo.NodeList` instance
+               //              constructed from that parameter alone and all further
+               //              processing will stop. This means that if you have a reference
+               //              to a node or NodeList, you can quickly construct a new NodeList
+               //              from the original by calling `dojo.query(node)` or
+               //              `dojo.query(list)`.
+               //
+               //      query:
+               //              The CSS3 expression to match against. For details on the syntax of
+               //              CSS3 selectors, see <http://www.w3.org/TR/css3-selectors/#selectors>
+               //      root:
+               //              A DOMNode (or node id) to scope the search from. Optional.
+               //      returns: dojo.NodeList
+               //              An instance of `dojo.NodeList`. Many methods are available on
+               //              NodeLists for searching, iterating, manipulating, and handling
+               //              events on the matched nodes in the returned list.
+               //      example:
+               //              search the entire document for elements with the class "foo":
+               //      |       dojo.query(".foo");
+               //              these elements will match:
+               //      |       <span class="foo"></span>
+               //      |       <span class="foo bar"></span>
+               //      |       <p class="thud foo"></p>
+               //      example:
+               //              search the entire document for elements with the classes "foo" *and* "bar":
+               //      |       dojo.query(".foo.bar");
+               //              these elements will match:
+               //      |       <span class="foo bar"></span>
+               //              while these will not:
+               //      |       <span class="foo"></span>
+               //      |       <p class="thud foo"></p>
+               //      example:
+               //              find `<span>` elements which are descendants of paragraphs and
+               //              which have a "highlighted" class:
+               //      |       dojo.query("p span.highlighted");
+               //              the innermost span in this fragment matches:
+               //      |       <p class="foo">
+               //      |               <span>...
+               //      |                       <span class="highlighted foo bar">...</span>
+               //      |               </span>
+               //      |       </p>
+               //      example:
+               //              set an "odd" class on all odd table rows inside of the table
+               //              `#tabular_data`, using the `>` (direct child) selector to avoid
+               //              affecting any nested tables:
+               //      |       dojo.query("#tabular_data > tbody > tr:nth-child(odd)").addClass("odd");
+               //      example:
+               //              remove all elements with the class "error" from the document
+               //              and store them in a list:
+               //      |       var errors = dojo.query(".error").orphan();
+               //      example:
+               //              add an onclick handler to every submit button in the document
+               //              which causes the form to be sent via Ajax instead:
+               //      |       dojo.query("input[type='submit']").onclick(function(e){
+               //      |               dojo.stopEvent(e); // prevent sending the form
+               //      |               var btn = e.target;
+               //      |               dojo.xhrPost({
+               //      |                       form: btn.form,
+               //      |                       load: function(data){
+               //      |                               // replace the form with the response
+               //      |                               var div = dojo.doc.createElement("div");
+               //      |                               dojo.place(div, btn.form, "after");
+               //      |                               div.innerHTML = data;
+               //      |                               dojo.style(btn.form, "display", "none");
+               //      |                       }
+               //      |               });
+               //      |       });
+
+               //Set list constructor to desired value. This can change
+               //between calls, so always re-assign here.
+               qlc = d._NodeListCtor;
+
+               if(!query){
+                       return new qlc();
+               }
+
+               if(query.constructor == qlc){
+                       return query;
+               }
+               if(typeof query != "string"){ // inline'd type check
+                       return new qlc(query); // dojo.NodeList
+               }
+               if(typeof root == "string"){ // inline'd type check
+                       root = d.byId(root);
+                       if(!root){ return new qlc(); }
+               }
+
+               root = root||getDoc();
+               var od = root.ownerDocument||root.documentElement;
+
+               // throw the big case sensitivity switch
+
+               // NOTE:
+               //              Opera in XHTML mode doesn't detect case-sensitivity correctly
+               //              and it's not clear that there's any way to test for it
+               caseSensitive = (root.contentType && root.contentType=="application/xml") || 
+                                               (d.isOpera && (root.doctype || od.toString() == "[object XMLDocument]")) ||
+                                               (!!od) && 
+                                               (d.isIE ? od.xml : (root.xmlVersion||od.xmlVersion));
+
+               // NOTE: 
+               //              adding "true" as the 2nd argument to getQueryFunc is useful for
+               //              testing the DOM branch without worrying about the
+               //              behavior/performance of the QSA branch.
+               var r = getQueryFunc(query)(root);
+
+               // FIXME:
+               //              need to investigate this branch WRT #8074 and #8075
+               if(r && r.nozip && !qlc._wrap){
+                       return r;
+               }
+               return _zip(r); // dojo.NodeList
+       }
+
+       // FIXME: need to add infrastructure for post-filtering pseudos, ala :last
+       d.query.pseudos = pseudos;
+
+       // one-off function for filtering a NodeList based on a simple selector
+       d._filterQueryResult = function(nodeList, simpleFilter){
+               var tmpNodeList = new d._NodeListCtor();
+               var filterFunc = getSimpleFilterFunc(getQueryParts(simpleFilter)[0]);
+               for(var x = 0, te; te = nodeList[x]; x++){
+                       if(filterFunc(te)){ tmpNodeList.push(te); }
+               }
+               return tmpNodeList;
+       }
+})(this["queryPortability"]||this["acme"]||dojo);
+
+/*
+*/
+
+}
+
+if(!dojo._hasResource["dojo._base.xhr"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.xhr"] = true;
+dojo.provide("dojo._base.xhr");
+
+
+
+
+
+(function(){
+       var _d = dojo, cfg = _d.config;
+
+       function setValue(/*Object*/obj, /*String*/name, /*String*/value){
+               //summary:
+               //              For the named property in object, set the value. If a value
+               //              already exists and it is a string, convert the value to be an
+               //              array of values.
+
+               //Skip it if there is no value
+               if(value === null){
+                       return;
+               }
+
+               var val = obj[name];
+               if(typeof val == "string"){ // inline'd type check
+                       obj[name] = [val, value];
+               }else if(_d.isArray(val)){
+                       val.push(value);
+               }else{
+                       obj[name] = value;
+               }
+       }
+       
+       dojo.fieldToObject = function(/*DOMNode||String*/ inputNode){
+               // summary:
+               //              Serialize a form field to a JavaScript object.
+               //
+               // description:
+               //              Returns the value encoded in a form field as
+               //              as a string or an array of strings. Disabled form elements
+               //              and unchecked radio and checkboxes are skipped. Multi-select
+               //              elements are returned as an array of string values.
+               var ret = null;
+               var item = _d.byId(inputNode);
+               if(item){
+                       var _in = item.name;
+                       var type = (item.type||"").toLowerCase();
+                       if(_in && type && !item.disabled){
+                               if(type == "radio" || type == "checkbox"){
+                                       if(item.checked){ ret = item.value }
+                               }else if(item.multiple){
+                                       ret = [];
+                                       _d.query("option", item).forEach(function(opt){
+                                               if(opt.selected){
+                                                       ret.push(opt.value);
+                                               }
+                                       });
+                               }else{
+                                       ret = item.value;
+                               }
+                       }
+               }
+               return ret; // Object
+       }
+
+       dojo.formToObject = function(/*DOMNode||String*/ formNode){
+               // summary:
+               //              Serialize a form node to a JavaScript object.
+               // description:
+               //              Returns the values encoded in an HTML form as
+               //              string properties in an object which it then returns. Disabled form
+               //              elements, buttons, and other non-value form elements are skipped.
+               //              Multi-select elements are returned as an array of string values.
+               //
+               // example:
+               //              This form:
+               //              |       <form id="test_form">
+               //              |               <input type="text" name="blah" value="blah">
+               //              |               <input type="text" name="no_value" value="blah" disabled>
+               //              |               <input type="button" name="no_value2" value="blah">
+               //              |               <select type="select" multiple name="multi" size="5">
+               //              |                       <option value="blah">blah</option>
+               //              |                       <option value="thud" selected>thud</option>
+               //              |                       <option value="thonk" selected>thonk</option>
+               //              |               </select>
+               //              |       </form>
+               //
+               //              yields this object structure as the result of a call to
+               //              formToObject():
+               //
+               //              |       { 
+               //              |               blah: "blah",
+               //              |               multi: [
+               //              |                       "thud",
+               //              |                       "thonk"
+               //              |               ]
+               //              |       };
+
+               var ret = {};
+               var exclude = "file|submit|image|reset|button|";
+               _d.forEach(dojo.byId(formNode).elements, function(item){
+                       var _in = item.name;
+                       var type = (item.type||"").toLowerCase();
+                       if(_in && type && exclude.indexOf(type) == -1 && !item.disabled){
+                               setValue(ret, _in, _d.fieldToObject(item));
+                               if(type == "image"){
+                                       ret[_in+".x"] = ret[_in+".y"] = ret[_in].x = ret[_in].y = 0;
+                               }
+                       }
+               });
+               return ret; // Object
+       }
+
+       dojo.objectToQuery = function(/*Object*/ map){
+               //      summary:
+               //              takes a name/value mapping object and returns a string representing
+               //              a URL-encoded version of that object.
+               //      example:
+               //              this object:
+               //
+               //              |       { 
+               //              |               blah: "blah",
+               //              |               multi: [
+               //              |                       "thud",
+               //              |                       "thonk"
+               //              |               ]
+               //              |       };
+               //
+               //      yields the following query string:
+               //      
+               //      |       "blah=blah&multi=thud&multi=thonk"
+
+               // FIXME: need to implement encodeAscii!!
+               var enc = encodeURIComponent;
+               var pairs = [];
+               var backstop = {};
+               for(var name in map){
+                       var value = map[name];
+                       if(value != backstop[name]){
+                               var assign = enc(name) + "=";
+                               if(_d.isArray(value)){
+                                       for(var i=0; i < value.length; i++){
+                                               pairs.push(assign + enc(value[i]));
+                                       }
+                               }else{
+                                       pairs.push(assign + enc(value));
+                               }
+                       }
+               }
+               return pairs.join("&"); // String
+       }
+
+       dojo.formToQuery = function(/*DOMNode||String*/ formNode){
+               // summary:
+               //              Returns a URL-encoded string representing the form passed as either a
+               //              node or string ID identifying the form to serialize
+               return _d.objectToQuery(_d.formToObject(formNode)); // String
+       }
+
+       dojo.formToJson = function(/*DOMNode||String*/ formNode, /*Boolean?*/prettyPrint){
+               // summary:
+               //              Create a serialized JSON string from a form node or string
+               //              ID identifying the form to serialize
+               return _d.toJson(_d.formToObject(formNode), prettyPrint); // String
+       }
+
+       dojo.queryToObject = function(/*String*/ str){
+               // summary:
+               //              Create an object representing a de-serialized query section of a
+               //              URL. Query keys with multiple values are returned in an array.
+               //
+               // example:
+               //              This string:
+               //
+               //      |               "foo=bar&foo=baz&thinger=%20spaces%20=blah&zonk=blarg&"
+               //              
+               //              results in this object structure:
+               //
+               //      |               {
+               //      |                       foo: [ "bar", "baz" ],
+               //      |                       thinger: " spaces =blah",
+               //      |                       zonk: "blarg"
+               //      |               }
+               //      
+               //              Note that spaces and other urlencoded entities are correctly
+               //              handled.
+
+               // FIXME: should we grab the URL string if we're not passed one?
+               var ret = {};
+               var qp = str.split("&");
+               var dec = decodeURIComponent;
+               _d.forEach(qp, function(item){
+                       if(item.length){
+                               var parts = item.split("=");
+                               var name = dec(parts.shift());
+                               var val = dec(parts.join("="));
+                               if(typeof ret[name] == "string"){ // inline'd type check
+                                       ret[name] = [ret[name]];
+                               }
+
+                               if(_d.isArray(ret[name])){
+                                       ret[name].push(val);
+                               }else{
+                                       ret[name] = val;
+                               }
+                       }
+               });
+               return ret; // Object
+       }
+
+       // need to block async callbacks from snatching this thread as the result
+       // of an async callback might call another sync XHR, this hangs khtml forever
+       // must checked by watchInFlight()
+
+       dojo._blockAsync = false;
+
+       // MOW: remove dojo._contentHandlers alias in 2.0
+       var handlers = _d._contentHandlers = dojo.contentHandlers = {
+               // summary: 
+               //              A map of availble XHR transport handle types. Name matches the
+               //              `handleAs` attribute passed to XHR calls.
+               //
+               // description:
+               //              A map of availble XHR transport handle types. Name matches the
+               //              `handleAs` attribute passed to XHR calls. Each contentHandler is
+               //              called, passing the xhr object for manipulation. The return value
+               //              from the contentHandler will be passed to the `load` or `handle` 
+               //              functions defined in the original xhr call. 
+               //              
+               // example:
+               //              Creating a custom content-handler:
+               //      |       dojo.contentHandlers.makeCaps = function(xhr){
+               //      |               return xhr.responseText.toUpperCase();
+               //      |       }
+               //      |       // and later:
+               //      |       dojo.xhrGet({ 
+               //      |               url:"foo.txt",
+               //      |               handleAs:"makeCaps",
+               //      |               load: function(data){ /* data is a toUpper version of foo.txt */ }
+               //      |       });
+
+               text: function(xhr){ 
+                       // summary: A contentHandler which simply returns the plaintext response data
+                       return xhr.responseText; 
+               },
+               json: function(xhr){
+                       // summary: A contentHandler which returns a JavaScript object created from the response data
+                       return _d.fromJson(xhr.responseText || null);
+               },
+               "json-comment-filtered": function(xhr){ 
+                       // summary: A contentHandler which expects comment-filtered JSON. 
+                       // description: 
+                       //              A contentHandler which expects comment-filtered JSON. 
+                       //              the json-comment-filtered option was implemented to prevent
+                       //              "JavaScript Hijacking", but it is less secure than standard JSON. Use
+                       //              standard JSON instead. JSON prefixing can be used to subvert hijacking.
+                       //              
+                       //              Will throw a notice suggesting to use application/json mimetype, as
+                       //              json-commenting can introduce security issues. To decrease the chances of hijacking,
+                       //              use the standard `json` contentHandler, and prefix your "JSON" with: {}&& 
+                       //              
+                       //              use djConfig.useCommentedJson = true to turn off the notice
+                       if(!dojo.config.useCommentedJson){
+                               console.warn("Consider using the standard mimetype:application/json."
+                                       + " json-commenting can introduce security issues. To"
+                                       + " decrease the chances of hijacking, use the standard the 'json' handler and"
+                                       + " prefix your json with: {}&&\n"
+                                       + "Use djConfig.useCommentedJson=true to turn off this message.");
+                       }
+
+                       var value = xhr.responseText;
+                       var cStartIdx = value.indexOf("\/*");
+                       var cEndIdx = value.lastIndexOf("*\/");
+                       if(cStartIdx == -1 || cEndIdx == -1){
+                               throw new Error("JSON was not comment filtered");
+                       }
+                       return _d.fromJson(value.substring(cStartIdx+2, cEndIdx));
+               },
+               javascript: function(xhr){ 
+                       // summary: A contentHandler which evaluates the response data, expecting it to be valid JavaScript
+
+                       // FIXME: try Moz and IE specific eval variants?
+                       return _d.eval(xhr.responseText);
+               },
+               xml: function(xhr){
+                       // summary: A contentHandler returning an XML Document parsed from the response data
+                       var result = xhr.responseXML;
+                                               if(_d.isIE && (!result || !result.documentElement)){
+                               //WARNING: this branch used by the xml handling in dojo.io.iframe,
+                               //so be sure to test dojo.io.iframe if making changes below.
+                               var ms = function(n){ return "MSXML" + n + ".DOMDocument"; }
+                               var dp = ["Microsoft.XMLDOM", ms(6), ms(4), ms(3), ms(2)];
+                               _d.some(dp, function(p){
+                                       try{
+                                               var dom = new ActiveXObject(p);
+                                               dom.async = false;
+                                               dom.loadXML(xhr.responseText);
+                                               result = dom;
+                                       }catch(e){ return false; }
+                                       return true;
+                               });
+                       }
+                                               return result; // DOMDocument
+               },
+               "json-comment-optional": function(xhr){
+                       // summary: A contentHandler which checks the presence of comment-filtered JSON and 
+                       //              alternates between the `json` and `json-comment-filtered` contentHandlers.
+                       if(xhr.responseText && /^[^{\[]*\/\*/.test(xhr.responseText)){
+                               return handlers["json-comment-filtered"](xhr);
+                       }else{
+                               return handlers["json"](xhr);
+                       }
+               }
+       };
+
+       /*=====
+       dojo.__IoArgs = function(){
+               //      url: String
+               //              URL to server endpoint.
+               //      content: Object?
+               //              Contains properties with string values. These
+               //              properties will be serialized as name1=value2 and
+               //              passed in the request.
+               //      timeout: Integer?
+               //              Milliseconds to wait for the response. If this time
+               //              passes, the then error callbacks are called.
+               //      form: DOMNode?
+               //              DOM node for a form. Used to extract the form values
+               //              and send to the server.
+               //      preventCache: Boolean?
+               //              Default is false. If true, then a
+               //              "dojo.preventCache" parameter is sent in the request
+               //              with a value that changes with each request
+               //              (timestamp). Useful only with GET-type requests.
+               //      handleAs: String?
+               //              Acceptable values depend on the type of IO
+               //              transport (see specific IO calls for more information).
+               //      rawBody: String?
+               //              Sets the raw body for an HTTP request. If this is used, then the content
+               //              property is ignored. This is mostly useful for HTTP methods that have
+               //              a body to their requests, like PUT or POST. This property can be used instead
+               //              of postData and putData for dojo.rawXhrPost and dojo.rawXhrPut respectively.
+               //      ioPublish: Boolean?
+               //              Set this explicitly to false to prevent publishing of topics related to
+               //              IO operations. Otherwise, if djConfig.ioPublish is set to true, topics
+               //              will be published via dojo.publish for different phases of an IO operation.
+               //              See dojo.__IoPublish for a list of topics that are published.
+               //      load: Function?
+               //              This function will be
+               //              called on a successful HTTP response code.
+               //      error: Function?
+               //              This function will
+               //              be called when the request fails due to a network or server error, the url
+               //              is invalid, etc. It will also be called if the load or handle callback throws an
+               //              exception, unless djConfig.debugAtAllCosts is true.  This allows deployed applications
+               //              to continue to run even when a logic error happens in the callback, while making
+               //              it easier to troubleshoot while in debug mode.
+               //      handle: Function?
+               //              This function will
+               //              be called at the end of every request, whether or not an error occurs.
+               this.url = url;
+               this.content = content;
+               this.timeout = timeout;
+               this.form = form;
+               this.preventCache = preventCache;
+               this.handleAs = handleAs;
+               this.ioPublish = ioPublish;
+               this.load = function(response, ioArgs){
+                       // ioArgs: dojo.__IoCallbackArgs
+                       //              Provides additional information about the request.
+                       // response: Object
+                       //              The response in the format as defined with handleAs.
+               }
+               this.error = function(response, ioArgs){
+                       // ioArgs: dojo.__IoCallbackArgs
+                       //              Provides additional information about the request.
+                       // response: Object
+                       //              The response in the format as defined with handleAs.
+               }
+               this.handle = function(loadOrError, response, ioArgs){
+                       // loadOrError: String
+                       //              Provides a string that tells you whether this function
+                       //              was called because of success (load) or failure (error).
+                       // response: Object
+                       //              The response in the format as defined with handleAs.
+                       // ioArgs: dojo.__IoCallbackArgs
+                       //              Provides additional information about the request.
+               }
+       }
+       =====*/
+
+       /*=====
+       dojo.__IoCallbackArgs = function(args, xhr, url, query, handleAs, id, canDelete, json){
+               //      args: Object
+               //              the original object argument to the IO call.
+               //      xhr: XMLHttpRequest
+               //              For XMLHttpRequest calls only, the
+               //              XMLHttpRequest object that was used for the
+               //              request.
+               //      url: String
+               //              The final URL used for the call. Many times it
+               //              will be different than the original args.url
+               //              value.
+               //      query: String
+               //              For non-GET requests, the
+               //              name1=value1&name2=value2 parameters sent up in
+               //              the request.
+               //      handleAs: String
+               //              The final indicator on how the response will be
+               //              handled.
+               //      id: String
+               //              For dojo.io.script calls only, the internal
+               //              script ID used for the request.
+               //      canDelete: Boolean
+               //              For dojo.io.script calls only, indicates
+               //              whether the script tag that represents the
+               //              request can be deleted after callbacks have
+               //              been called. Used internally to know when
+               //              cleanup can happen on JSONP-type requests.
+               //      json: Object
+               //              For dojo.io.script calls only: holds the JSON
+               //              response for JSONP-type requests. Used
+               //              internally to hold on to the JSON responses.
+               //              You should not need to access it directly --
+               //              the same object should be passed to the success
+               //              callbacks directly.
+               this.args = args;
+               this.xhr = xhr;
+               this.url = url;
+               this.query = query;
+               this.handleAs = handleAs;
+               this.id = id;
+               this.canDelete = canDelete;
+               this.json = json;
+       }
+       =====*/
+
+
+       /*=====
+       dojo.__IoPublish = function(){
+               //      summary:
+               //              This is a list of IO topics that can be published
+               //              if djConfig.ioPublish is set to true. IO topics can be
+               //              published for any Input/Output, network operation. So,
+               //              dojo.xhr, dojo.io.script and dojo.io.iframe can all
+               //              trigger these topics to be published.
+               //      start: String
+               //              "/dojo/io/start" is sent when there are no outstanding IO
+               //              requests, and a new IO request is started. No arguments
+               //              are passed with this topic.
+               //      send: String
+               //              "/dojo/io/send" is sent whenever a new IO request is started.
+               //              It passes the dojo.Deferred for the request with the topic.
+               //      load: String
+               //              "/dojo/io/load" is sent whenever an IO request has loaded
+               //              successfully. It passes the response and the dojo.Deferred
+               //              for the request with the topic.
+               //      error: String
+               //              "/dojo/io/error" is sent whenever an IO request has errored.
+               //              It passes the error and the dojo.Deferred
+               //              for the request with the topic.
+               //      done: String
+               //              "/dojo/io/done" is sent whenever an IO request has completed,
+               //              either by loading or by erroring. It passes the error and
+               //              the dojo.Deferred for the request with the topic.
+               //      stop: String
+               //              "/dojo/io/stop" is sent when all outstanding IO requests have
+               //              finished. No arguments are passed with this topic.
+               this.start = "/dojo/io/start";
+               this.send = "/dojo/io/send";
+               this.load = "/dojo/io/load";
+               this.error = "/dojo/io/error";
+               this.done = "/dojo/io/done";
+               this.stop = "/dojo/io/stop";
+       }
+       =====*/
+
+
+       dojo._ioSetArgs = function(/*dojo.__IoArgs*/args,
+                       /*Function*/canceller,
+                       /*Function*/okHandler,
+                       /*Function*/errHandler){
+               //      summary: 
+               //              sets up the Deferred and ioArgs property on the Deferred so it
+               //              can be used in an io call.
+               //      args:
+               //              The args object passed into the public io call. Recognized properties on
+               //              the args object are:
+               //      canceller:
+               //              The canceller function used for the Deferred object. The function
+               //              will receive one argument, the Deferred object that is related to the
+               //              canceller.
+               //      okHandler:
+               //              The first OK callback to be registered with Deferred. It has the opportunity
+               //              to transform the OK response. It will receive one argument -- the Deferred
+               //              object returned from this function.
+               //      errHandler:
+               //              The first error callback to be registered with Deferred. It has the opportunity
+               //              to do cleanup on an error. It will receive two arguments: error (the 
+               //              Error object) and dfd, the Deferred object returned from this function.
+
+               var ioArgs = {args: args, url: args.url};
+
+               //Get values from form if requestd.
+               var formObject = null;
+               if(args.form){ 
+                       var form = _d.byId(args.form);
+                       //IE requires going through getAttributeNode instead of just getAttribute in some form cases, 
+                       //so use it for all.  See #2844
+                       var actnNode = form.getAttributeNode("action");
+                       ioArgs.url = ioArgs.url || (actnNode ? actnNode.value : null); 
+                       formObject = _d.formToObject(form);
+               }
+
+               // set up the query params
+               var miArgs = [{}];
+       
+               if(formObject){
+                       // potentially over-ride url-provided params w/ form values
+                       miArgs.push(formObject);
+               }
+               if(args.content){
+                       // stuff in content over-rides what's set by form
+                       miArgs.push(args.content);
+               }
+               if(args.preventCache){
+                       miArgs.push({"dojo.preventCache": new Date().valueOf()});
+               }
+               ioArgs.query = _d.objectToQuery(_d.mixin.apply(null, miArgs));
+       
+               // .. and the real work of getting the deferred in order, etc.
+               ioArgs.handleAs = args.handleAs || "text";
+               var d = new _d.Deferred(canceller);
+               d.addCallbacks(okHandler, function(error){
+                       return errHandler(error, d);
+               });
+
+               //Support specifying load, error and handle callback functions from the args.
+               //For those callbacks, the "this" object will be the args object.
+               //The callbacks will get the deferred result value as the
+               //first argument and the ioArgs object as the second argument.
+               var ld = args.load;
+               if(ld && _d.isFunction(ld)){
+                       d.addCallback(function(value){
+                               return ld.call(args, value, ioArgs);
+                       });
+               }
+               var err = args.error;
+               if(err && _d.isFunction(err)){
+                       d.addErrback(function(value){
+                               return err.call(args, value, ioArgs);
+                       });
+               }
+               var handle = args.handle;
+               if(handle && _d.isFunction(handle)){
+                       d.addBoth(function(value){
+                               return handle.call(args, value, ioArgs);
+                       });
+               }
+
+               //Plug in topic publishing, if dojo.publish is loaded.
+               if(cfg.ioPublish && _d.publish && ioArgs.args.ioPublish !== false){
+                       d.addCallbacks(
+                               function(res){
+                                       _d.publish("/dojo/io/load", [d, res]);
+                                       return res;
+                               },
+                               function(res){
+                                       _d.publish("/dojo/io/error", [d, res]);
+                                       return res;
+                               }
+                       );
+                       d.addBoth(function(res){
+                               _d.publish("/dojo/io/done", [d, res]);
+                               return res;
+                       });
+               }
+
+               d.ioArgs = ioArgs;
+       
+               // FIXME: need to wire up the xhr object's abort method to something
+               // analagous in the Deferred
+               return d;
+       }
+
+       var _deferredCancel = function(/*Deferred*/dfd){
+               // summary: canceller function for dojo._ioSetArgs call.
+               
+               dfd.canceled = true;
+               var xhr = dfd.ioArgs.xhr;
+               var _at = typeof xhr.abort;
+               if(_at == "function" || _at == "object" || _at == "unknown"){
+                       xhr.abort();
+               }
+               var err = dfd.ioArgs.error;
+               if(!err){
+                       err = new Error("xhr cancelled");
+                       err.dojoType="cancel";
+               }
+               return err;
+       }
+       var _deferredOk = function(/*Deferred*/dfd){
+               // summary: okHandler function for dojo._ioSetArgs call.
+
+               var ret = handlers[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);
+               return ret === undefined ? null : ret;
+       }
+       var _deferError = function(/*Error*/error, /*Deferred*/dfd){
+               // summary: errHandler function for dojo._ioSetArgs call.
+
+               if(!dfd.ioArgs.args.failOk){
+                       console.error(error);
+               }
+               return error;
+       }
+
+       // avoid setting a timer per request. It degrades performance on IE
+       // something fierece if we don't use unified loops.
+       var _inFlightIntvl = null;
+       var _inFlight = [];
+       
+       
+       //Use a separate count for knowing if we are starting/stopping io calls.
+       //Cannot use _inFlight.length since it can change at a different time than
+       //when we want to do this kind of test. We only want to decrement the count
+       //after a callback/errback has finished, since the callback/errback should be
+       //considered as part of finishing a request.
+       var _pubCount = 0;
+       var _checkPubCount = function(dfd){
+               if(_pubCount <= 0){
+                       _pubCount = 0;
+                       if(cfg.ioPublish && _d.publish && (!dfd || dfd && dfd.ioArgs.args.ioPublish !== false)){
+                               _d.publish("/dojo/io/stop");
+                       }
+               }
+       };
+
+       var _watchInFlight = function(){
+               //summary: 
+               //              internal method that checks each inflight XMLHttpRequest to see
+               //              if it has completed or if the timeout situation applies.
+               
+               var now = (new Date()).getTime();
+               // make sure sync calls stay thread safe, if this callback is called
+               // during a sync call and this results in another sync call before the
+               // first sync call ends the browser hangs
+               if(!_d._blockAsync){
+                       // we need manual loop because we often modify _inFlight (and therefore 'i') while iterating
+                       // note: the second clause is an assigment on purpose, lint may complain
+                       for(var i = 0, tif; i < _inFlight.length && (tif = _inFlight[i]); i++){
+                               var dfd = tif.dfd;
+                               var func = function(){
+                                       if(!dfd || dfd.canceled || !tif.validCheck(dfd)){
+                                               _inFlight.splice(i--, 1); 
+                                               _pubCount -= 1;
+                                       }else if(tif.ioCheck(dfd)){
+                                               _inFlight.splice(i--, 1);
+                                               tif.resHandle(dfd);
+                                               _pubCount -= 1;
+                                       }else if(dfd.startTime){
+                                               //did we timeout?
+                                               if(dfd.startTime + (dfd.ioArgs.args.timeout || 0) < now){
+                                                       _inFlight.splice(i--, 1);
+                                                       var err = new Error("timeout exceeded");
+                                                       err.dojoType = "timeout";
+                                                       dfd.errback(err);
+                                                       //Cancel the request so the io module can do appropriate cleanup.
+                                                       dfd.cancel();
+                                                       _pubCount -= 1;
+                                               }
+                                       }
+                               };
+                               if(dojo.config.debugAtAllCosts){
+                                       func.call(this);
+                               }else{
+                                       try{
+                                               func.call(this);
+                                       }catch(e){
+                                               dfd.errback(e);
+                                       }
+                               }
+                       }
+               }
+
+               _checkPubCount(dfd);
+
+               if(!_inFlight.length){
+                       clearInterval(_inFlightIntvl);
+                       _inFlightIntvl = null;
+                       return;
+               }
+       }
+
+       dojo._ioCancelAll = function(){
+               //summary: Cancels all pending IO requests, regardless of IO type
+               //(xhr, script, iframe).
+               try{
+                       _d.forEach(_inFlight, function(i){
+                               try{
+                                       i.dfd.cancel();
+                               }catch(e){/*squelch*/}
+                       });
+               }catch(e){/*squelch*/}
+       }
+
+       //Automatically call cancel all io calls on unload
+       //in IE for trac issue #2357.
+               if(_d.isIE){
+               _d.addOnWindowUnload(_d._ioCancelAll);
+       }
+       
+       _d._ioNotifyStart = function(/*Deferred*/dfd){
+               // summary:
+               //              If dojo.publish is available, publish topics
+               //              about the start of a request queue and/or the
+               //              the beginning of request.
+               // description:
+               //              Used by IO transports. An IO transport should
+               //              call this method before making the network connection.
+               if(cfg.ioPublish && _d.publish && dfd.ioArgs.args.ioPublish !== false){
+                       if(!_pubCount){
+                               _d.publish("/dojo/io/start");
+                       }
+                       _pubCount += 1;
+                       _d.publish("/dojo/io/send", [dfd]);
+               }
+       }
+
+       _d._ioWatch = function(dfd, validCheck, ioCheck, resHandle){
+               // summary: 
+               //              Watches the io request represented by dfd to see if it completes.
+               // dfd: Deferred
+               //              The Deferred object to watch.
+               // validCheck: Function
+               //              Function used to check if the IO request is still valid. Gets the dfd
+               //              object as its only argument.
+               // ioCheck: Function
+               //              Function used to check if basic IO call worked. Gets the dfd
+               //              object as its only argument.
+               // resHandle: Function
+               //              Function used to process response. Gets the dfd
+               //              object as its only argument.
+               var args = dfd.ioArgs.args;
+               if(args.timeout){
+                       dfd.startTime = (new Date()).getTime();
+               }
+               
+               _inFlight.push({dfd: dfd, validCheck: validCheck, ioCheck: ioCheck, resHandle: resHandle});
+               if(!_inFlightIntvl){
+                       _inFlightIntvl = setInterval(_watchInFlight, 50);
+               }
+               // handle sync requests
+               //A weakness: async calls in flight
+               //could have their handlers called as part of the
+               //_watchInFlight call, before the sync's callbacks
+               // are called.
+               if(args.sync){
+                       _watchInFlight();
+               }
+       }
+
+       var _defaultContentType = "application/x-www-form-urlencoded";
+
+       var _validCheck = function(/*Deferred*/dfd){
+               return dfd.ioArgs.xhr.readyState; //boolean
+       }
+       var _ioCheck = function(/*Deferred*/dfd){
+               return 4 == dfd.ioArgs.xhr.readyState; //boolean
+       }
+       var _resHandle = function(/*Deferred*/dfd){
+               var xhr = dfd.ioArgs.xhr;
+               if(_d._isDocumentOk(xhr)){
+                       dfd.callback(dfd);
+               }else{
+                       var err = new Error("Unable to load " + dfd.ioArgs.url + " status:" + xhr.status);
+                       err.status = xhr.status;
+                       err.responseText = xhr.responseText;
+                       dfd.errback(err);
+               }
+       }
+
+       dojo._ioAddQueryToUrl = function(/*dojo.__IoCallbackArgs*/ioArgs){
+               //summary: Adds query params discovered by the io deferred construction to the URL.
+               //Only use this for operations which are fundamentally GET-type operations.
+               if(ioArgs.query.length){
+                       ioArgs.url += (ioArgs.url.indexOf("?") == -1 ? "?" : "&") + ioArgs.query;
+                       ioArgs.query = null;
+               }               
+       }
+
+       /*=====
+       dojo.declare("dojo.__XhrArgs", dojo.__IoArgs, {
+               constructor: function(){
+                       //      summary:
+                       //              In addition to the properties listed for the dojo._IoArgs type,
+                       //              the following properties are allowed for dojo.xhr* methods.
+                       //      handleAs: String?
+                       //              Acceptable values are: text (default), json, json-comment-optional,
+                       //              json-comment-filtered, javascript, xml. See `dojo.contentHandlers`
+                       //      sync: Boolean?
+                       //              false is default. Indicates whether the request should
+                       //              be a synchronous (blocking) request.
+                       //      headers: Object?
+                       //              Additional HTTP headers to send in the request.
+                       //      failOk: Boolean?
+                       //              false is default. Indicates whether a request should be
+                       //              allowed to fail (and therefore no console error message in
+                       //              the event of a failure)
+                       this.handleAs = handleAs;
+                       this.sync = sync;
+                       this.headers = headers;
+                       this.failOk = failOk;
+               }
+       });
+       =====*/
+
+       dojo.xhr = function(/*String*/ method, /*dojo.__XhrArgs*/ args, /*Boolean?*/ hasBody){
+               //      summary:
+               //              Sends an HTTP request with the given method.
+               //      description:
+               //              Sends an HTTP request with the given method.
+               //              See also dojo.xhrGet(), xhrPost(), xhrPut() and dojo.xhrDelete() for shortcuts
+               //              for those HTTP methods. There are also methods for "raw" PUT and POST methods
+               //              via dojo.rawXhrPut() and dojo.rawXhrPost() respectively.
+               //      method:
+               //              HTTP method to be used, such as GET, POST, PUT, DELETE.  Should be uppercase.
+               //      hasBody:
+               //              If the request has an HTTP body, then pass true for hasBody.
+
+               //Make the Deferred object for this xhr request.
+               var dfd = _d._ioSetArgs(args, _deferredCancel, _deferredOk, _deferError);
+               var ioArgs = dfd.ioArgs;
+
+               //Pass the args to _xhrObj, to allow alternate XHR calls based specific calls, like
+               //the one used for iframe proxies.
+               var xhr = ioArgs.xhr = _d._xhrObj(ioArgs.args);
+               //If XHR factory fails, cancel the deferred.
+               if(!xhr){
+                       dfd.cancel();
+                       return dfd;
+               }
+
+               //Allow for specifying the HTTP body completely.
+               if("postData" in args){
+                       ioArgs.query = args.postData;
+               }else if("putData" in args){
+                       ioArgs.query = args.putData;
+               }else if("rawBody" in args){
+                       ioArgs.query = args.rawBody;
+               }else if((arguments.length > 2 && !hasBody) || "POST|PUT".indexOf(method.toUpperCase()) == -1){
+                       //Check for hasBody being passed. If no hasBody,
+                       //then only append query string if not a POST or PUT request.
+                       _d._ioAddQueryToUrl(ioArgs);
+               }
+
+               // IE 6 is a steaming pile. It won't let you call apply() on the native function (xhr.open).
+               // workaround for IE6's apply() "issues"
+               xhr.open(method, ioArgs.url, args.sync !== true, args.user || undefined, args.password || undefined);
+               if(args.headers){
+                       for(var hdr in args.headers){
+                               if(hdr.toLowerCase() === "content-type" && !args.contentType){
+                                       args.contentType = args.headers[hdr];
+                               }else if(args.headers[hdr]){
+                                       //Only add header if it has a value. This allows for instnace, skipping
+                                       //insertion of X-Requested-With by specifying empty value.
+                                       xhr.setRequestHeader(hdr, args.headers[hdr]);
+                               }
+                       }
+               }
+               // FIXME: is this appropriate for all content types?
+               xhr.setRequestHeader("Content-Type", args.contentType || _defaultContentType);
+               if(!args.headers || !("X-Requested-With" in args.headers)){
+                       xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+               }
+               // FIXME: set other headers here!
+               _d._ioNotifyStart(dfd);
+               if(dojo.config.debugAtAllCosts){
+                       xhr.send(ioArgs.query);
+               }else{
+                       try{
+                               xhr.send(ioArgs.query);
+                       }catch(e){
+                               ioArgs.error = e;
+                               dfd.cancel();
+                       }
+               }
+               _d._ioWatch(dfd, _validCheck, _ioCheck, _resHandle);
+               xhr = null;
+               return dfd; // dojo.Deferred
+       }
+
+       dojo.xhrGet = function(/*dojo.__XhrArgs*/ args){
+               //      summary: 
+               //              Sends an HTTP GET request to the server.
+               return _d.xhr("GET", args); // dojo.Deferred
+       }
+
+       dojo.rawXhrPost = dojo.xhrPost = function(/*dojo.__XhrArgs*/ args){
+               //      summary:
+               //              Sends an HTTP POST request to the server. In addtion to the properties
+               //              listed for the dojo.__XhrArgs type, the following property is allowed:
+               //      postData:
+               //              String. Send raw data in the body of the POST request.
+               return _d.xhr("POST", args, true); // dojo.Deferred
+       }
+
+       dojo.rawXhrPut = dojo.xhrPut = function(/*dojo.__XhrArgs*/ args){
+               //      summary:
+               //              Sends an HTTP PUT request to the server. In addtion to the properties
+               //              listed for the dojo.__XhrArgs type, the following property is allowed:
+               //      putData:
+               //              String. Send raw data in the body of the PUT request.
+               return _d.xhr("PUT", args, true); // dojo.Deferred
+       }
+
+       dojo.xhrDelete = function(/*dojo.__XhrArgs*/ args){
+               //      summary:
+               //              Sends an HTTP DELETE request to the server.
+               return _d.xhr("DELETE", args); //dojo.Deferred
+       }
+
+       /*
+       dojo.wrapForm = function(formNode){
+               //summary:
+               //              A replacement for FormBind, but not implemented yet.
+
+               // FIXME: need to think harder about what extensions to this we might
+               // want. What should we allow folks to do w/ this? What events to
+               // set/send?
+               throw new Error("dojo.wrapForm not yet implemented");
+       }
+       */
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.fx"] = true;
+dojo.provide("dojo._base.fx");
+
+
+
+
+
+/*
+       Animation loosely package based on Dan Pupius' work, contributed under CLA: 
+               http://pupius.co.uk/js/Toolkit.Drawing.js
+*/
+(function(){ 
+       var d = dojo;
+       var _mixin = d._mixin;
+       
+       dojo._Line = function(/*int*/ start, /*int*/ end){
+               //      summary:
+               //              dojo._Line is the object used to generate values from a start value
+               //              to an end value
+               //      start: int
+               //              Beginning value for range
+               //      end: int
+               //              Ending value for range
+               this.start = start;
+               this.end = end;
+       };
+       
+       dojo._Line.prototype.getValue = function(/*float*/ n){
+               //      summary: Returns the point on the line
+               //      n: a floating point number greater than 0 and less than 1
+               return ((this.end - this.start) * n) + this.start; // Decimal
+       };
+       
+       dojo.Animation = function(args){
+               //      summary:
+               //              A generic animation class that fires callbacks into its handlers
+               //              object at various states. 
+               //      description:
+               //              A generic animation class that fires callbacks into its handlers
+               //              object at various states. Nearly all dojo animation functions
+               //              return an instance of this method, usually without calling the
+               //              .play() method beforehand. Therefore, you will likely need to
+               //              call .play() on instances of `dojo.Animation` when one is
+               //              returned.
+               // args: Object
+               //              The 'magic argument', mixing all the properties into this
+               //              animation instance. 
+               
+               _mixin(this, args);
+               if(d.isArray(this.curve)){
+                       this.curve = new d._Line(this.curve[0], this.curve[1]);
+               }
+               
+       };
+       
+       // Alias to drop come 2.0:
+       d._Animation = d.Animation;
+       
+       d.extend(dojo.Animation, {
+               // duration: Integer
+               //              The time in milliseonds the animation will take to run
+               duration: 350,
+       
+       /*=====
+               // curve: dojo._Line|Array
+               //              A two element array of start and end values, or a `dojo._Line` instance to be
+               //              used in the Animation. 
+               curve: null,
+       
+               // easing: Function?
+               //              A Function to adjust the acceleration (or deceleration) of the progress 
+               //              across a dojo._Line
+               easing: null,
+       =====*/
+       
+               // repeat: Integer?
+               //              The number of times to loop the animation
+               repeat: 0,
+       
+               // rate: Integer?
+               //              the time in milliseconds to wait before advancing to next frame 
+               //              (used as a fps timer: 1000/rate = fps)
+               rate: 20 /* 50 fps */,
+       
+       /*===== 
+               // delay: Integer?
+               //              The time in milliseconds to wait before starting animation after it 
+               //              has been .play()'ed
+               delay: null,
+       
+               // beforeBegin: Event?
+               //              Synthetic event fired before a dojo.Animation begins playing (synchronous)
+               beforeBegin: null,
+       
+               // onBegin: Event?
+               //              Synthetic event fired as a dojo.Animation begins playing (useful?)
+               onBegin: null,
+       
+               // onAnimate: Event?
+               //              Synthetic event fired at each interval of a `dojo.Animation`
+               onAnimate: null,
+       
+               // onEnd: Event?
+               //              Synthetic event fired after the final frame of a `dojo.Animation`
+               onEnd: null,
+       
+               // onPlay: Event?
+               //              Synthetic event fired any time a `dojo.Animation` is play()'ed
+               onPlay: null,
+       
+               // onPause: Event?
+               //              Synthetic event fired when a `dojo.Animation` is paused
+               onPause: null,
+       
+               // onStop: Event
+               //              Synthetic event fires when a `dojo.Animation` is stopped
+               onStop: null,
+       
+       =====*/
+       
+               _percent: 0,
+               _startRepeatCount: 0,
+
+               _getStep: function(){
+                       var _p = this._percent,
+                               _e = this.easing
+                       ;
+                       return _e ? _e(_p) : _p;
+               },
+               _fire: function(/*Event*/ evt, /*Array?*/ args){
+                       //      summary:
+                       //              Convenience function.  Fire event "evt" and pass it the
+                       //              arguments specified in "args".
+                       //      description:
+                       //              Convenience function.  Fire event "evt" and pass it the
+                       //              arguments specified in "args".
+                       //              Fires the callback in the scope of the `dojo.Animation` 
+                       //              instance.
+                       //      evt:
+                       //              The event to fire.
+                       //      args:
+                       //              The arguments to pass to the event.
+                       var a = args||[];
+                       if(this[evt]){
+                               if(d.config.debugAtAllCosts){
+                                       this[evt].apply(this, a);
+                               }else{
+                                       try{
+                                               this[evt].apply(this, a);
+                                       }catch(e){
+                                               // squelch and log because we shouldn't allow exceptions in
+                                               // synthetic event handlers to cause the internal timer to run
+                                               // amuck, potentially pegging the CPU. I'm not a fan of this
+                                               // squelch, but hopefully logging will make it clear what's
+                                               // going on
+                                               console.error("exception in animation handler for:", evt);
+                                               console.error(e);
+                                       }
+                               }
+                       }
+                       return this; // dojo.Animation
+               },
+
+               play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+                       // summary:
+                       //              Start the animation.
+                       // delay:
+                       //              How many milliseconds to delay before starting.
+                       // gotoStart:
+                       //              If true, starts the animation from the beginning; otherwise,
+                       //              starts it from its current position.
+                       // returns: dojo.Animation
+                       //              The instance to allow chaining.
+
+                       var _t = this;
+                       if(_t._delayTimer){ _t._clearTimer(); }
+                       if(gotoStart){
+                               _t._stopTimer();
+                               _t._active = _t._paused = false;
+                               _t._percent = 0;
+                       }else if(_t._active && !_t._paused){
+                               return _t;
+                       }
+       
+                       _t._fire("beforeBegin", [_t.node]);
+       
+                       var de = delay || _t.delay,
+                               _p = dojo.hitch(_t, "_play", gotoStart);
+                               
+                       if(de > 0){
+                               _t._delayTimer = setTimeout(_p, de);
+                               return _t;
+                       }
+                       _p();
+                       return _t;
+               },
+       
+               _play: function(gotoStart){
+                       var _t = this;
+                       if(_t._delayTimer){ _t._clearTimer(); }
+                       _t._startTime = new Date().valueOf();
+                       if(_t._paused){
+                               _t._startTime -= _t.duration * _t._percent;
+                       }
+                       _t._endTime = _t._startTime + _t.duration;
+       
+                       _t._active = true;
+                       _t._paused = false;
+                       var value = _t.curve.getValue(_t._getStep());
+                       if(!_t._percent){
+                               if(!_t._startRepeatCount){
+                                       _t._startRepeatCount = _t.repeat;
+                               }
+                               _t._fire("onBegin", [value]);
+                       }
+       
+                       _t._fire("onPlay", [value]);
+       
+                       _t._cycle();
+                       return _t; // dojo.Animation
+               },
+       
+               pause: function(){
+                       // summary: Pauses a running animation.
+                       var _t = this;
+                       if(_t._delayTimer){ _t._clearTimer(); }
+                       _t._stopTimer();
+                       if(!_t._active){ return _t; /*dojo.Animation*/ }
+                       _t._paused = true;
+                       _t._fire("onPause", [_t.curve.getValue(_t._getStep())]);
+                       return _t; // dojo.Animation
+               },
+       
+               gotoPercent: function(/*Decimal*/ percent, /*Boolean?*/ andPlay){
+                       //      summary:
+                       //              Sets the progress of the animation.
+                       //      percent:
+                       //              A percentage in decimal notation (between and including 0.0 and 1.0).
+                       //      andPlay:
+                       //              If true, play the animation after setting the progress.
+                       var _t = this;
+                       _t._stopTimer();
+                       _t._active = _t._paused = true;
+                       _t._percent = percent;
+                       if(andPlay){ _t.play(); }
+                       return _t; // dojo.Animation
+               },
+       
+               stop: function(/*boolean?*/ gotoEnd){
+                       // summary: Stops a running animation.
+                       // gotoEnd: If true, the animation will end.
+                       var _t = this;
+                       if(_t._delayTimer){ _t._clearTimer(); }
+                       if(!_t._timer){ return _t; /* dojo.Animation */ }
+                       _t._stopTimer();
+                       if(gotoEnd){
+                               _t._percent = 1;
+                       }
+                       _t._fire("onStop", [_t.curve.getValue(_t._getStep())]);
+                       _t._active = _t._paused = false;
+                       return _t; // dojo.Animation
+               },
+       
+               status: function(){
+                       // summary: 
+                       //              Returns a string token representation of the status of
+                       //              the animation, one of: "paused", "playing", "stopped"
+                       if(this._active){
+                               return this._paused ? "paused" : "playing"; // String
+                       }
+                       return "stopped"; // String
+               },
+       
+               _cycle: function(){
+                       var _t = this;
+                       if(_t._active){
+                               var curr = new Date().valueOf();
+                               var step = (curr - _t._startTime) / (_t._endTime - _t._startTime);
+       
+                               if(step >= 1){
+                                       step = 1;
+                               }
+                               _t._percent = step;
+       
+                               // Perform easing
+                               if(_t.easing){
+                                       step = _t.easing(step);
+                               }
+       
+                               _t._fire("onAnimate", [_t.curve.getValue(step)]);
+       
+                               if(_t._percent < 1){
+                                       _t._startTimer();
+                               }else{
+                                       _t._active = false;
+       
+                                       if(_t.repeat > 0){
+                                               _t.repeat--;
+                                               _t.play(null, true);
+                                       }else if(_t.repeat == -1){
+                                               _t.play(null, true);
+                                       }else{
+                                               if(_t._startRepeatCount){
+                                                       _t.repeat = _t._startRepeatCount;
+                                                       _t._startRepeatCount = 0;
+                                               }
+                                       }
+                                       _t._percent = 0;
+                                       _t._fire("onEnd", [_t.node]);
+                                       !_t.repeat && _t._stopTimer();
+                               }
+                       }
+                       return _t; // dojo.Animation
+               },
+               
+               _clearTimer: function(){
+                       // summary: Clear the play delay timer
+                       clearTimeout(this._delayTimer);
+                       delete this._delayTimer;
+               }
+               
+       });
+
+       // the local timer, stubbed into all Animation instances
+       var ctr = 0,
+               _globalTimerList = [],
+               timer = null,
+               runner = {
+                       run: function(){}
+               };
+
+       d.extend(d.Animation, {
+
+               _startTimer: function(){
+                       if(!this._timer){
+                               this._timer = d.connect(runner, "run", this, "_cycle");
+                               ctr++;
+                       }
+                       if(!timer){
+                               timer = setInterval(d.hitch(runner, "run"), this.rate);
+                       }
+               },
+
+               _stopTimer: function(){
+                       if(this._timer){
+                               d.disconnect(this._timer);
+                               this._timer = null;
+                               ctr--;
+                       }
+                       if(ctr <= 0){
+                               clearInterval(timer);
+                               timer = null;
+                               ctr = 0;
+                       }
+               }
+
+       });
+
+       var _makeFadeable = 
+                               d.isIE ? function(node){
+                       // only set the zoom if the "tickle" value would be the same as the
+                       // default
+                       var ns = node.style;
+                       // don't set the width to auto if it didn't already cascade that way.
+                       // We don't want to f anyones designs
+                       if(!ns.width.length && d.style(node, "width") == "auto"){
+                               ns.width = "auto";
+                       }
+               } : 
+                               function(){};
+
+       dojo._fade = function(/*Object*/ args){
+               //      summary: 
+               //              Returns an animation that will fade the node defined by
+               //              args.node from the start to end values passed (args.start
+               //              args.end) (end is mandatory, start is optional)
+
+               args.node = d.byId(args.node);
+               var fArgs = _mixin({ properties: {} }, args),
+                       props = (fArgs.properties.opacity = {});
+               
+               props.start = !("start" in fArgs) ?
+                       function(){ 
+                               return +d.style(fArgs.node, "opacity")||0; 
+                       } : fArgs.start;
+               props.end = fArgs.end;
+
+               var anim = d.animateProperty(fArgs);
+               d.connect(anim, "beforeBegin", d.partial(_makeFadeable, fArgs.node));
+
+               return anim; // dojo.Animation
+       };
+
+       /*=====
+       dojo.__FadeArgs = function(node, duration, easing){
+               //      node: DOMNode|String
+               //              The node referenced in the animation
+               //      duration: Integer?
+               //              Duration of the animation in milliseconds.
+               //      easing: Function?
+               //              An easing function.
+               this.node = node;
+               this.duration = duration;
+               this.easing = easing;
+       }
+       =====*/
+
+       dojo.fadeIn = function(/*dojo.__FadeArgs*/ args){
+               // summary: 
+               //              Returns an animation that will fade node defined in 'args' from
+               //              its current opacity to fully opaque.
+               return d._fade(_mixin({ end: 1 }, args)); // dojo.Animation
+       };
+
+       dojo.fadeOut = function(/*dojo.__FadeArgs*/  args){
+               // summary: 
+               //              Returns an animation that will fade node defined in 'args'
+               //              from its current opacity to fully transparent.
+               return d._fade(_mixin({ end: 0 }, args)); // dojo.Animation
+       };
+
+       dojo._defaultEasing = function(/*Decimal?*/ n){
+               // summary: The default easing function for dojo.Animation(s)
+               return 0.5 + ((Math.sin((n + 1.5) * Math.PI)) / 2);
+       };
+
+       var PropLine = function(properties){
+               // PropLine is an internal class which is used to model the values of
+               // an a group of CSS properties across an animation lifecycle. In
+               // particular, the "getValue" function handles getting interpolated
+               // values between start and end for a particular CSS value.
+               this._properties = properties;
+               for(var p in properties){
+                       var prop = properties[p];
+                       if(prop.start instanceof d.Color){
+                               // create a reusable temp color object to keep intermediate results
+                               prop.tempColor = new d.Color();
+                       }
+               }
+       };
+
+       PropLine.prototype.getValue = function(r){
+               var ret = {};
+               for(var p in this._properties){
+                       var prop = this._properties[p],
+                               start = prop.start;
+                       if(start instanceof d.Color){
+                               ret[p] = d.blendColors(start, prop.end, r, prop.tempColor).toCss();
+                       }else if(!d.isArray(start)){
+                               ret[p] = ((prop.end - start) * r) + start + (p != "opacity" ? prop.units || "px" : 0);
+                       }
+               }
+               return ret;
+       };
+
+       /*=====
+       dojo.declare("dojo.__AnimArgs", [dojo.__FadeArgs], {
+               // Properties: Object?
+               //      A hash map of style properties to Objects describing the transition,
+               //      such as the properties of dojo._Line with an additional 'units' property
+               properties: {}
+               
+               //TODOC: add event callbacks
+       });
+       =====*/
+
+       dojo.animateProperty = function(/*dojo.__AnimArgs*/ args){
+               // summary: 
+               //              Returns an animation that will transition the properties of
+               //              node defined in `args` depending how they are defined in
+               //              `args.properties`
+               //
+               // description:
+               //              `dojo.animateProperty` is the foundation of most `dojo.fx`
+               //              animations. It takes an object of "properties" corresponding to
+               //              style properties, and animates them in parallel over a set
+               //              duration.
+               //      
+               // example:
+               //              A simple animation that changes the width of the specified node.
+               //      |       dojo.animateProperty({ 
+               //      |               node: "nodeId",
+               //      |               properties: { width: 400 },
+               //      |       }).play();
+               //              Dojo figures out the start value for the width and converts the
+               //              integer specified for the width to the more expressive but
+               //              verbose form `{ width: { end: '400', units: 'px' } }` which you
+               //              can also specify directly. Defaults to 'px' if ommitted.
+               //
+               // example:
+               //              Animate width, height, and padding over 2 seconds... the
+               //              pedantic way:
+               //      |       dojo.animateProperty({ node: node, duration:2000,
+               //      |               properties: {
+               //      |                       width: { start: '200', end: '400', units:"px" },
+               //      |                       height: { start:'200', end: '400', units:"px" },
+               //      |                       paddingTop: { start:'5', end:'50', units:"px" } 
+               //      |               }
+               //      |       }).play();
+               //              Note 'paddingTop' is used over 'padding-top'. Multi-name CSS properties
+               //              are written using "mixed case", as the hyphen is illegal as an object key.
+               //              
+               // example:
+               //              Plug in a different easing function and register a callback for
+               //              when the animation ends. Easing functions accept values between
+               //              zero and one and return a value on that basis. In this case, an
+               //              exponential-in curve.
+               //      |       dojo.animateProperty({ 
+               //      |               node: "nodeId",
+               //      |               // dojo figures out the start value
+               //      |               properties: { width: { end: 400 } },
+               //      |               easing: function(n){
+               //      |                       return (n==0) ? 0 : Math.pow(2, 10 * (n - 1));
+               //      |               },
+               //      |               onEnd: function(node){
+               //      |                       // called when the animation finishes. The animation
+               //      |                       // target is passed to this function
+               //      |               }
+               //      |       }).play(500); // delay playing half a second
+               //
+               // example:
+               //              Like all `dojo.Animation`s, animateProperty returns a handle to the
+               //              Animation instance, which fires the events common to Dojo FX. Use `dojo.connect`
+               //              to access these events outside of the Animation definiton:
+               //      |       var anim = dojo.animateProperty({
+               //      |               node:"someId",
+               //      |               properties:{
+               //      |                       width:400, height:500
+               //      |               }
+               //      |       });
+               //      |       dojo.connect(anim,"onEnd", function(){
+               //      |               console.log("animation ended");
+               //      |       });
+               //      |       // play the animation now:
+               //      |       anim.play();
+               //
+               // example:
+               //              Each property can be a function whose return value is substituted along.
+               //              Additionally, each measurement (eg: start, end) can be a function. The node
+               //              reference is passed direcly to callbacks.
+               //      |       dojo.animateProperty({
+               //      |               node:"mine",
+               //      |               properties:{
+               //      |                       height:function(node){
+               //      |                               // shrink this node by 50%
+               //      |                               return dojo.position(node).h / 2
+               //      |                       },
+               //      |                       width:{
+               //      |                               start:function(node){ return 100; },
+               //      |                               end:function(node){ return 200; }       
+               //      |                       }
+               //      |               }
+               //      |       }).play();
+               //
+
+               var n = args.node = d.byId(args.node);
+               if(!args.easing){ args.easing = d._defaultEasing; }
+
+               var anim = new d.Animation(args);
+               d.connect(anim, "beforeBegin", anim, function(){
+                       var pm = {};
+                       for(var p in this.properties){
+                               // Make shallow copy of properties into pm because we overwrite
+                               // some values below. In particular if start/end are functions
+                               // we don't want to overwrite them or the functions won't be
+                               // called if the animation is reused.
+                               if(p == "width" || p == "height"){
+                                       this.node.display = "block";
+                               }
+                               var prop = this.properties[p];
+                               if(d.isFunction(prop)){
+                                       prop = prop(n);
+                               }
+                               prop = pm[p] = _mixin({}, (d.isObject(prop) ? prop: { end: prop }));
+
+                               if(d.isFunction(prop.start)){
+                                       prop.start = prop.start(n);
+                               }
+                               if(d.isFunction(prop.end)){
+                                       prop.end = prop.end(n);
+                               }
+                               var isColor = (p.toLowerCase().indexOf("color") >= 0);
+                               function getStyle(node, p){
+                                       // dojo.style(node, "height") can return "auto" or "" on IE; this is more reliable:
+                                       var v = { height: node.offsetHeight, width: node.offsetWidth }[p];
+                                       if(v !== undefined){ return v; }
+                                       v = d.style(node, p);
+                                       return (p == "opacity") ? +v : (isColor ? v : parseFloat(v));
+                               }
+                               if(!("end" in prop)){
+                                       prop.end = getStyle(n, p);
+                               }else if(!("start" in prop)){
+                                       prop.start = getStyle(n, p);
+                               }
+
+                               if(isColor){
+                                       prop.start = new d.Color(prop.start);
+                                       prop.end = new d.Color(prop.end);
+                               }else{
+                                       prop.start = (p == "opacity") ? +prop.start : parseFloat(prop.start);
+                               }
+                       }
+                       this.curve = new PropLine(pm);
+               });
+               d.connect(anim, "onAnimate", d.hitch(d, "style", anim.node));
+               return anim; // dojo.Animation
+       };
+
+       dojo.anim = function(   /*DOMNode|String*/      node, 
+                                                       /*Object*/                      properties, 
+                                                       /*Integer?*/            duration, 
+                                                       /*Function?*/           easing, 
+                                                       /*Function?*/           onEnd,
+                                                       /*Integer?*/            delay){
+               //      summary:
+               //              A simpler interface to `dojo.animateProperty()`, also returns
+               //              an instance of `dojo.Animation` but begins the animation
+               //              immediately, unlike nearly every other Dojo animation API.
+               //      description:
+               //              `dojo.anim` is a simpler (but somewhat less powerful) version
+               //              of `dojo.animateProperty`.  It uses defaults for many basic properties
+               //              and allows for positional parameters to be used in place of the
+               //              packed "property bag" which is used for other Dojo animation
+               //              methods.
+               //
+               //              The `dojo.Animation` object returned from `dojo.anim` will be
+               //              already playing when it is returned from this function, so
+               //              calling play() on it again is (usually) a no-op.
+               //      node:
+               //              a DOM node or the id of a node to animate CSS properties on
+               //      duration:
+               //              The number of milliseconds over which the animation
+               //              should run. Defaults to the global animation default duration
+               //              (350ms).
+               //      easing:
+               //              An easing function over which to calculate acceleration
+               //              and deceleration of the animation through its duration.
+               //              A default easing algorithm is provided, but you may
+               //              plug in any you wish. A large selection of easing algorithms
+               //              are available in `dojo.fx.easing`.
+               //      onEnd:
+               //              A function to be called when the animation finishes
+               //              running.
+               //      delay:
+               //              The number of milliseconds to delay beginning the
+               //              animation by. The default is 0.
+               //      example:
+               //              Fade out a node
+               //      |       dojo.anim("id", { opacity: 0 });
+               //      example:
+               //              Fade out a node over a full second
+               //      |       dojo.anim("id", { opacity: 0 }, 1000);
+               return d.animateProperty({ // dojo.Animation
+                       node: node,
+                       duration: duration || d.Animation.prototype.duration,
+                       properties: properties,
+                       easing: easing,
+                       onEnd: onEnd 
+               }).play(delay || 0);
+       };
+})();
+
+}
+
+if(!dojo._hasResource["dojo._base.browser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.browser"] = true;
+dojo.provide("dojo._base.browser");
+
+
+
+
+
+
+
+
+
+
+//Need this to be the last code segment in base, so do not place any
+//dojo.requireIf calls in this file. Otherwise, due to how the build system
+//puts all requireIf dependencies after the current file, the require calls
+//could be called before all of base is defined.
+dojo.forEach(dojo.config.require, function(i){
+       dojo["require"](i);
+});
+
+}
+
+       //INSERT dojo.i18n._preloadLocalizations HERE
+
+       if(dojo.config.afterOnLoad && dojo.isBrowser){
+               //Dojo is being added to the page after page load, so just trigger
+               //the init sequence after a timeout. Using a timeout so the rest of this
+               //script gets evaluated properly. This work needs to happen after the
+               //dojo.config.require work done in dojo._base.
+               window.setTimeout(dojo._loadInit, 1000);
+       }
+
+})();
+
diff --git a/ricoClient/js/baselibs/dojo.js b/ricoClient/js/baselibs/dojo.js
new file mode 100644 (file)
index 0000000..11d2841
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+       Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
+       Available via Academic Free License >= 2.1 OR the modified BSD license.
+       see: http://dojotoolkit.org/license for details
+*/
+
+/*
+       This is a compiled version of Dojo, built for deployment and not for
+       development. To get an editable version, please visit:
+
+               http://dojotoolkit.org
+
+       for documentation and information on getting the source.
+*/
+
+(function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var _2="",_3="",_4="",_5={},_6={};_1=_1||djConfig.scopeMap;for(var i=0;i<_1.length;i++){var _7=_1[i];_2+="var "+_7[0]+" = {}; "+_7[1]+" = "+_7[0]+";"+_7[1]+"._scopeName = '"+_7[1]+"';";_3+=(i==0?"":",")+_7[0];_4+=(i==0?"":",")+_7[1];_5[_7[0]]=_7[1];_6[_7[1]]=_7[0];}eval(_2+"dojo._scopeArgs = ["+_4+"];");dojo._scopePrefixArgs=_3;dojo._scopePrefix="(function("+_3+"){";dojo._scopeSuffix="})("+_4+")";dojo._scopeMap=_5;dojo._scopeMapRev=_6;}(function(){if(typeof this["loadFirebugConsole"]=="function"){this["loadFirebugConsole"]();}else{this.console=this.console||{};var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var _8=tn+"";console[_8]=("log" in console)?function(){var a=Array.apply({},arguments);a.unshift(_8+":");console["log"](a.join(" "));}:function(){};console[_8]._fake=true;})();}}}if(typeof dojo=="undefined"){dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){dojox={_scopeName:"dojox"};}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox];}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};if(typeof djConfig!="undefined"){for(var _9 in djConfig){d.config[_9]=djConfig[_9];}}dojo.locale=d.config.locale;var _a="$Rev: 20973 $".match(/\d+/);dojo.version={major:1,minor:4,patch:0,flag:"",revision:_a?+_a[0]:NaN,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")";}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());}var _b,_c,_d={};for(var i in {toString:1}){_b=[];break;}dojo._extraNames=_b=_b||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];_c=_b.length;dojo._mixin=function(_e,_f){var _10,s,i;for(_10 in _f){s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}if(_c&&_f){for(i=0;i<_c;++i){_10=_b[i];s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}}return _e;};dojo.mixin=function(obj,_11){if(!obj){obj={};}for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i]);}return obj;};dojo._getProp=function(_12,_13,_14){var obj=_14||d.global;for(var i=0,p;obj&&(p=_12[i]);i++){if(i==0&&d._scopeMap[p]){p=d._scopeMap[p];}obj=(p in obj?obj[p]:(_13?obj[p]={}:undefined));}return obj;};dojo.setObject=function(_15,_16,_17){var _18=_15.split("."),p=_18.pop(),obj=d._getProp(_18,true,_17);return obj&&p?(obj[p]=_16):undefined;};dojo.getObject=function(_19,_1a,_1b){return d._getProp(_19.split("."),_1a,_1b);};dojo.exists=function(_1c,obj){return !!d.getObject(_1c,false,obj);};dojo["eval"]=function(_1d){return d.global.eval?d.global.eval(_1d):eval(_1d);};d.deprecated=d.experimental=function(){};})();(function(){var d=dojo;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(_1e){var mp=d._modulePrefixes;return !!(mp[_1e]&&mp[_1e].value);},_getModulePrefix:function(_1f){var mp=d._modulePrefixes;if(d._moduleHasPrefix(_1f)){return mp[_1f].value;}return _1f;},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(_20,_21,cb){var uri=((_20.charAt(0)=="/"||_20.match(/^\w+:/))?"":d.baseUrl)+_20;try{return !_21?d._loadUri(uri,cb):d._loadUriAndCheck(uri,_21,cb);}catch(e){console.error(e);return false;}};dojo._loadUri=function(uri,cb){if(d._loadedUrls[uri]){return true;}d._inFlightCount++;var _22=d._getText(uri,true);if(_22){d._loadedUrls[uri]=true;d._loadedUrls.push(uri);if(cb){_22="("+_22+")";}else{_22=d._scopePrefix+_22+d._scopeSuffix;}if(!d.isIE){_22+="\r\n//@ sourceURL="+uri;}var _23=d["eval"](_22);if(cb){cb(_23);}}if(--d._inFlightCount==0&&d._postLoad&&d._loaders.length){setTimeout(function(){if(d._inFlightCount==0){d._callLoaded();}},0);}return !!_22;};dojo._loadUriAndCheck=function(uri,_24,cb){var ok=false;try{ok=d._loadUri(uri,cb);}catch(e){console.error("failed loading "+uri+" with error: "+e);}return !!(ok&&d._loadedModules[_24]);};dojo.loaded=function(){d._loadNotifying=true;d._postLoad=true;var mll=d._loaders;d._loaders=[];for(var x=0;x<mll.length;x++){mll[x]();}d._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded();}};dojo.unloaded=function(){var mll=d._unloaders;while(mll.length){(mll.pop())();}};d._onto=function(arr,obj,fn){if(!fn){arr.push(obj);}else{if(fn){var _25=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){_25.call(obj);});}}};dojo.ready=dojo.addOnLoad=function(obj,_26){d._onto(d._loaders,obj,_26);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded();}};var dca=d.config.addOnLoad;if(dca){d.addOnLoad[(dca instanceof Array?"apply":"call")](d,dca);}dojo._modulesLoaded=function(){if(d._postLoad){return;}if(d._inFlightCount>0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(d.config.useXDomain&&d.isOpera)){setTimeout(d.isAIR?function(){d.loaded();}:d._scopeName+".loaded();",0);}else{d.loaded();}};dojo._getModuleSymbols=function(_27){var _28=_27.split(".");for(var i=_28.length;i>0;i--){var _29=_28.slice(0,i).join(".");if(i==1&&!d._moduleHasPrefix(_29)){_28[0]="../"+_28[0];}else{var _2a=d._getModulePrefix(_29);if(_2a!=_29){_28.splice(0,i,_2a);break;}}}return _28;};dojo._global_omit_module_check=false;dojo.loadInit=function(_2b){_2b();};dojo._loadModule=dojo.require=function(_2c,_2d){_2d=d._global_omit_module_check||_2d;var _2e=d._loadedModules[_2c];if(_2e){return _2e;}var _2f=d._getModuleSymbols(_2c).join("/")+".js";var _30=!_2d?_2c:null;var ok=d._loadPath(_2f,_30);if(!ok&&!_2d){throw new Error("Could not load '"+_2c+"'; last tried '"+_2f+"'");}if(!_2d&&!d._isXDomain){_2e=d._loadedModules[_2c];if(!_2e){throw new Error("symbol '"+_2c+"' is not defined after loading '"+_2f+"'");}}return _2e;};dojo.provide=function(_31){_31=_31+"";return (d._loadedModules[_31]=d.getObject(_31,true));};dojo.platformRequire=function(_32){var _33=_32.common||[];var _34=_33.concat(_32[d._name]||_32["default"]||[]);for(var x=0;x<_34.length;x++){var _35=_34[x];if(_35.constructor==Array){d._loadModule.apply(d,_35);}else{d._loadModule(_35);}}};dojo.requireIf=function(_36,_37){if(_36===true){var _38=[];for(var i=1;i<arguments.length;i++){_38.push(arguments[i]);}d.require.apply(d,_38);}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(_39,_3a){d._modulePrefixes[_39]={name:_39,value:_3a};};dojo.requireLocalization=function(_3b,_3c,_3d,_3e){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments);};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),ire=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");dojo._Url=function(){var n=null,_3f=arguments,uri=[_3f[0]];for(var i=1;i<_3f.length;i++){if(!_3f[i]){continue;}var _40=new d._Url(_3f[i]+""),_41=new d._Url(uri[0]+"");if(_40.path==""&&!_40.scheme&&!_40.authority&&!_40.query){if(_40.fragment!=n){_41.fragment=_40.fragment;}_40=_41;}else{if(!_40.scheme){_40.scheme=_41.scheme;if(!_40.authority){_40.authority=_41.authority;if(_40.path.charAt(0)!="/"){var _42=_41.path.substring(0,_41.path.lastIndexOf("/")+1)+_40.path;var _43=_42.split("/");for(var j=0;j<_43.length;j++){if(_43[j]=="."){if(j==_43.length-1){_43[j]="";}else{_43.splice(j,1);j--;}}else{if(j>0&&!(j==1&&_43[0]=="")&&_43[j]==".."&&_43[j-1]!=".."){if(j==(_43.length-1)){_43.splice(j,1);_43[j-1]="";}else{_43.splice(j-1,2);j-=2;}}}}_40.path=_43.join("/");}}}}uri=[];if(_40.scheme){uri.push(_40.scheme,":");}if(_40.authority){uri.push("//",_40.authority);}uri.push(_40.path);if(_40.query){uri.push("?",_40.query);}if(_40.fragment){uri.push("#",_40.fragment);}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[6]||r[7];this.port=r[9]||n;}};dojo._Url.prototype.toString=function(){return this.uri;};dojo.moduleUrl=function(_44,url){var loc=d._getModuleSymbols(_44).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _45=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_45==-1||_45>loc.indexOf("/"))){loc=d.baseUrl+loc;}return new d._Url(loc,url);};})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var _46=document.getElementsByTagName("script");var _47=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_46.length;i++){var src=_46[i].getAttribute("src");if(!src){continue;}var m=src.match(_47);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=_46[i].getAttribute("djConfig");if(cfg){var _48=eval("({ "+cfg+" })");for(var x in _48){dojo.config[x]=_48[x];}}break;}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent,dav=n.appVersion,tv=parseFloat(dav);if(dua.indexOf("Opera")>=0){d.isOpera=tv;}if(dua.indexOf("AdobeAIR")>=0){d.isAIR=1;}d.isKhtml=(dav.indexOf("Konqueror")>=0)?tv:0;d.isWebKit=parseFloat(dua.split("WebKit/")[1])||undefined;d.isChrome=parseFloat(dua.split("Chrome/")[1])||undefined;d.isMac=dav.indexOf("Macintosh")>=0;var _49=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(_49&&!dojo.isChrome){d.isSafari=parseFloat(dav.split("Version/")[1]);if(!d.isSafari||parseFloat(dav.substr(_49+7))<=419.3){d.isSafari=2;}}if(dua.indexOf("Gecko")>=0&&!d.isKhtml&&!d.isWebKit){d.isMozilla=d.isMoz=tv;}if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1]||dua.split("Minefield/")[1])||undefined;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||undefined;var _4a=document.documentMode;if(_4a&&_4a!=5&&Math.floor(d.isIE)!=_4a){d.isIE=_4a;}}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}d.isQuirks=document.compatMode=="BackCompat";d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var _4b,_4c;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_4b=new XMLHttpRequest();}catch(e){}}if(!_4b){for(var i=0;i<3;++i){var _4d=d._XMLHTTP_PROGIDS[i];try{_4b=new ActiveXObject(_4d);}catch(e){_4c=e;}if(_4b){d._XMLHTTP_PROGIDS=[_4d];break;}}}if(!_4b){throw new Error("XMLHTTP not available: "+_4c);}return _4b;};d._isDocumentOk=function(_4e){var _4f=_4e.status||0,lp=location.protocol;return (_4f>=200&&_4f<300)||_4f==304||_4f==1223||(!_4f&&(lp=="file:"||lp=="chrome:"||lp=="app:"));};var _50=window.location+"";var _51=document.getElementsByTagName("base");var _52=(_51&&_51.length>0);d._getText=function(uri,_53){var _54=d._xhrObj();if(!_52&&dojo._Url){uri=(new dojo._Url(_50,uri)).toString();}if(d.config.cacheBust){uri+="";uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_54.open("GET",uri,false);try{_54.send(null);if(!d._isDocumentOk(_54)){var err=Error("Unable to load "+uri+" status:"+_54.status);err.status=_54.status;err.responseText=_54.responseText;throw err;}}catch(e){if(_53){return null;}throw e;}return _54.responseText;};var _55=window;var _56=function(_57,fp){var _58=_55.attachEvent||_55.addEventListener;_57=_55.attachEvent?_57:_57.substring(2);_58(_57,function(){fp.apply(_55,arguments);},false);};d._windowUnloaders=[];d.windowUnloaded=function(){var mll=d._windowUnloaders;while(mll.length){(mll.pop())();}};var _59=0;d.addOnWindowUnload=function(obj,_5a){d._onto(d._windowUnloaders,obj,_5a);if(!_59){_59=1;_56("onunload",d.windowUnloaded);}};var _5b=0;d.addOnUnload=function(obj,_5c){d._onto(d._unloaders,obj,_5c);if(!_5b){_5b=1;_56("onbeforeunload",dojo.unloaded);}};})();dojo._initFired=false;dojo._loadInit=function(e){if(!dojo._initFired){dojo._initFired=true;if(!dojo.config.afterOnLoad&&window.detachEvent){window.detachEvent("onload",dojo._loadInit);}if(dojo._inFlightCount==0){dojo._modulesLoaded();}}};if(!dojo.config.afterOnLoad){if(document.addEventListener){document.addEventListener("DOMContentLoaded",dojo._loadInit,false);window.addEventListener("load",dojo._loadInit,false);}else{if(window.attachEvent){window.attachEvent("onload",dojo._loadInit);}}}if(dojo.isIE){if(!dojo.config.afterOnLoad&&!dojo.config.skipIeDomLoaded){document.write("<scr"+"ipt defer src=\"//:\" "+"onreadystatechange=\"if(this.readyState=='complete'){"+dojo._scopeName+"._loadInit();}\">"+"</scr"+"ipt>");}try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");var _5d=["*","group","roundrect","oval","shape","rect","imagedata"],i=0,l=1,s=document.createStyleSheet();if(dojo.isIE>=8){i=1;l=_5d.length;}for(;i<l;++i){s.addRule("v\\:"+_5d[i],"behavior:url(#default#VML); display:inline-block");}}catch(e){}}}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _5e in mp){dojo.registerModulePath(_5e,mp[_5e]);}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug");}if(dojo.config.debugAtAllCosts){dojo.config.useXDomain=true;dojo.require("dojo._base._loader.loader_xd");dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");(function(){var d=dojo,_5f=Object.prototype.toString;dojo.isString=function(it){return (typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=function(it){return _5f.call(it)==="[object Function]";};dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||d.isArray(it)||d.isFunction(it));};dojo.isArrayLike=function(it){return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));};dojo.isAlien=function(it){return it&&!d.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_60,_61){for(var i=1,l=arguments.length;i<l;i++){d._mixin(_60.prototype,arguments[i]);}return _60;};dojo._hitchArgs=function(_62,_63){var pre=d._toArray(arguments,2);var _64=d.isString(_63);return function(){var _65=d._toArray(arguments);var f=_64?(_62||d.global)[_63]:_63;return f&&f.apply(_62||this,pre.concat(_65));};};dojo.hitch=function(_66,_67){if(arguments.length>2){return d._hitchArgs.apply(d,arguments);}if(!_67){_67=_66;_66=null;}if(d.isString(_67)){_66=_66||d.global;if(!_66[_67]){throw (["dojo.hitch: scope[\"",_67,"\"] is null (scope=\"",_66,"\")"].join(""));}return function(){return _66[_67].apply(_66,arguments||[]);};}return !_66?_67:function(){return _67.apply(_66,arguments||[]);};};dojo.delegate=dojo._delegate=(function(){function TMP(){};return function(obj,_68){TMP.prototype=obj;var tmp=new TMP();TMP.prototype=null;if(_68){d._mixin(tmp,_68);}return tmp;};})();var _69=function(obj,_6a,_6b){return (_6b||[]).concat(Array.prototype.slice.call(obj,_6a||0));};var _6c=function(obj,_6d,_6e){var arr=_6e||[];for(var x=_6d||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};dojo._toArray=d.isIE?function(obj){return ((obj.item)?_6c:_69).apply(this,arguments);}:_69;dojo.partial=function(_6f){var arr=[null];return d.hitch.apply(d,arr.concat(d._toArray(arguments)));};var _70=d._extraNames,_71=_70.length,_72={};dojo.clone=function(o){if(!o||typeof o!="object"||d.isFunction(o)){return o;}if(o.nodeType&&o.cloneNode){return o.cloneNode(true);}if(o instanceof Date){return new Date(o.getTime());}var r,i,l,s,_73;if(d.isArray(o)){r=[];for(i=0,l=o.length;i<l;++i){if(i in o){r.push(d.clone(o[i]));}}}else{r=o.constructor?new o.constructor():{};}for(_73 in o){s=o[_73];if(!(_73 in r)||(r[_73]!==s&&(!(_73 in _72)||_72[_73]!==s))){r[_73]=d.clone(s);}}if(_71){for(i=0;i<_71;++i){_73=_70[i];s=o[_73];if(!(_73 in r)||(r[_73]!==s&&(!(_73 in _72)||_72[_73]!==s))){r[_73]=s;}}}return r;};dojo.trim=String.prototype.trim?function(str){return str.trim();}:function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};var _74=/\{([^\}]+)\}/g;dojo.replace=function(_75,map,_76){return _75.replace(_76||_74,d.isFunction(map)?map:function(_77,k){return d.getObject(k,false,map);});};})();}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _78=function(arr,obj,cb){return [(typeof arr=="string")?arr.split(""):arr,obj||dojo.global,(typeof cb=="string")?new Function("item","index","array",cb):cb];};var _79=function(_7a,arr,_7b,_7c){var _7d=_78(arr,_7c,_7b);arr=_7d[0];for(var i=0,l=arr.length;i<l;++i){var _7e=!!_7d[2].call(_7d[1],arr[i],i,arr);if(_7a^_7e){return _7e;}}return _7a;};dojo.mixin(dojo,{indexOf:function(_7f,_80,_81,_82){var _83=1,end=_7f.length||0,i=0;if(_82){i=end-1;_83=end=-1;}if(_81!=undefined){i=_81;}if((_82&&i>end)||i<end){for(;i!=end;i+=_83){if(_7f[i]==_80){return i;}}}return -1;},lastIndexOf:function(_84,_85,_86){return dojo.indexOf(_84,_85,_86,true);},forEach:function(arr,_87,_88){if(!arr||!arr.length){return;}var _89=_78(arr,_88,_87);arr=_89[0];for(var i=0,l=arr.length;i<l;++i){_89[2].call(_89[1],arr[i],i,arr);}},every:function(arr,_8a,_8b){return _79(true,arr,_8a,_8b);},some:function(arr,_8c,_8d){return _79(false,arr,_8c,_8d);},map:function(arr,_8e,_8f){var _90=_78(arr,_8f,_8e);arr=_90[0];var _91=(arguments[3]?(new arguments[3]()):[]);for(var i=0,l=arr.length;i<l;++i){_91.push(_90[2].call(_90[1],arr[i],i,arr));}return _91;},filter:function(arr,_92,_93){var _94=_78(arr,_93,_92);arr=_94[0];var _95=[];for(var i=0,l=arr.length;i<l;++i){if(_94[2].call(_94[1],arr[i],i,arr)){_95.push(arr[i]);}}return _95;}});})();}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");(function(){var d=dojo,mix=d._mixin,op=Object.prototype,_96=op.toString,_97=new Function,_98=0,_99="constructor";function err(msg){throw new Error("declare: "+msg);};function _9a(_9b){var _9c=[],_9d=[{cls:0,refs:[]}],_9e={},_9f=1,l=_9b.length,i=0,j,lin,_a0,top,_a1,rec,_a2,_a3;for(;i<l;++i){_a0=_9b[i];if(!_a0){err("mixin #"+i+" is null");}lin=_a0._meta?_a0._meta.bases:[_a0];top=0;for(j=lin.length-1;j>=0;--j){_a1=lin[j].prototype;if(!_a1.hasOwnProperty("declaredClass")){_a1.declaredClass="uniqName_"+(_98++);}_a2=_a1.declaredClass;if(!_9e.hasOwnProperty(_a2)){_9e[_a2]={count:0,refs:[],cls:lin[j]};++_9f;}rec=_9e[_a2];if(top&&top!==rec){rec.refs.push(top);++top.count;}top=rec;}++top.count;_9d[0].refs.push(top);}while(_9d.length){top=_9d.pop();_9c.push(top.cls);--_9f;while(_a3=top.refs,_a3.length==1){top=_a3[0];if(!top||--top.count){top=0;break;}_9c.push(top.cls);--_9f;}if(top){for(i=0,l=_a3.length;i<l;++i){top=_a3[i];if(!--top.count){_9d.push(top);}}}}if(_9f){err("can't build consistent linearization");}_a0=_9b[0];_9c[0]=_a0?_a0._meta&&_a0===_9c[_9c.length-_a0._meta.bases.length]?_a0._meta.bases.length:1:0;return _9c;};function _a4(_a5,a,f){var _a6,_a7,_a8,_a9,_aa,_ab,_ac,opf,pos,_ad=this._inherited=this._inherited||{};if(typeof _a5=="string"){_a6=_a5;_a5=a;a=f;}f=0;_a9=_a5.callee;_a6=_a6||_a9.nom;if(!_a6){err("can't deduce a name to call inherited()");}_aa=this.constructor._meta;_a8=_aa.bases;pos=_ad.p;if(_a6!=_99){if(_ad.c!==_a9){pos=0;_ab=_a8[0];_aa=_ab._meta;if(_aa.hidden[_a6]!==_a9){_a7=_aa.chains;if(_a7&&typeof _a7[_a6]=="string"){err("calling chained method with inherited: "+_a6);}do{_aa=_ab._meta;_ac=_ab.prototype;if(_aa&&(_ac[_a6]===_a9&&_ac.hasOwnProperty(_a6)||_aa.hidden[_a6]===_a9)){break;}}while(_ab=_a8[++pos]);pos=_ab?pos:-1;}}_ab=_a8[++pos];if(_ab){_ac=_ab.prototype;if(_ab._meta&&_ac.hasOwnProperty(_a6)){f=_ac[_a6];}else{opf=op[_a6];do{_ac=_ab.prototype;f=_ac[_a6];if(f&&(_ab._meta?_ac.hasOwnProperty(_a6):f!==opf)){break;}}while(_ab=_a8[++pos]);}}f=_ab&&f||op[_a6];}else{if(_ad.c!==_a9){pos=0;_aa=_a8[0]._meta;if(_aa&&_aa.ctor!==_a9){_a7=_aa.chains;if(!_a7||_a7.constructor!=="manual"){err("calling chained constructor with inherited");}while(_ab=_a8[++pos]){_aa=_ab._meta;if(_aa&&_aa.ctor===_a9){break;}}pos=_ab?pos:-1;}}while(_ab=_a8[++pos]){_aa=_ab._meta;f=_aa?_aa.ctor:_ab;if(f){break;}}f=_ab&&f;}_ad.c=f;_ad.p=pos;if(f){return a===true?f:f.apply(this,a||_a5);}};function _ae(_af,_b0){if(typeof _af=="string"){return this.inherited(_af,_b0,true);}return this.inherited(_af,true);};function _b1(cls){var _b2=this.constructor._meta.bases;for(var i=0,l=_b2.length;i<l;++i){if(_b2[i]===cls){return true;}}return this instanceof cls;};function _b3(_b4,_b5){var _b6,t,i=0,l=d._extraNames.length;for(_b6 in _b5){t=_b5[_b6];if((t!==op[_b6]||!(_b6 in op))&&_b6!=_99){if(_96.call(t)=="[object Function]"){t.nom=_b6;}_b4[_b6]=t;}}for(;i<l;++i){_b6=d._extraNames[i];t=_b5[_b6];if((t!==op[_b6]||!(_b6 in op))&&_b6!=_99){if(_96.call(t)=="[object Function]"){t.nom=_b6;}_b4[_b6]=t;}}return _b4;};function _b7(_b8){_b3(this.prototype,_b8);return this;};function _b9(_ba,_bb){return function(){var a=arguments,_bc=a,a0=a[0],f,i,m,l=_ba.length,_bd;if(_bb&&(a0&&a0.preamble||this.preamble)){_bd=new Array(_ba.length);_bd[0]=a;for(i=0;;){a0=a[0];if(a0){f=a0.preamble;if(f){a=f.apply(this,a)||a;}}f=_ba[i].prototype;f=f.hasOwnProperty("preamble")&&f.preamble;if(f){a=f.apply(this,a)||a;}if(++i==l){break;}_bd[i]=a;}}for(i=l-1;i>=0;--i){f=_ba[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_bd?_bd[i]:a);}}f=this.postscript;if(f){f.apply(this,_bc);}};};function _be(_bf,_c0){return function(){var a=arguments,t=a,a0=a[0],f;if(_c0){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(_bf){_bf.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _c1(_c2){return function(){var a=arguments,i=0,f;for(;f=_c2[i];++i){m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,a);break;}}f=this.postscript;if(f){f.apply(this,a);}};};function _c3(_c4,_c5,_c6){return function(){var b,m,f,i=0,_c7=1;if(_c6){i=_c5.length-1;_c7=-1;}for(;b=_c5[i];i+=_c7){m=b._meta;f=(m?m.hidden:b.prototype)[_c4];if(f){f.apply(this,arguments);}}};};d.declare=function(_c8,_c9,_ca){var _cb,i,t,_cc,_cd,_ce,_cf,_d0=1,_d1=_c9;if(typeof _c8!="string"){_ca=_c9;_c9=_c8;_c8="";}_ca=_ca||{};if(_96.call(_c9)=="[object Array]"){_ce=_9a(_c9);t=_ce[0];_d0=_ce.length-t;_c9=_ce[_d0];}else{_ce=[0];if(_c9){t=_c9._meta;_ce=_ce.concat(t?t.bases:_c9);}}if(_c9){for(i=_d0-1;;--i){_97.prototype=_c9.prototype;_cb=new _97;if(!i){break;}t=_ce[i];mix(_cb,t._meta?t._meta.hidden:t.prototype);_cc=new Function;_cc.superclass=_c9;_cc.prototype=_cb;_c9=_cb.constructor=_cc;}}else{_cb={};}_b3(_cb,_ca);t=_ca.constructor;if(t!==op.constructor){t.nom=_99;_cb.constructor=t;}_97.prototype=0;for(i=_d0-1;i;--i){t=_ce[i]._meta;if(t&&t.chains){_cf=mix(_cf||{},t.chains);}}if(_cb["-chains-"]){_cf=mix(_cf||{},_cb["-chains-"]);}t=!_cf||!_cf.hasOwnProperty(_99);_ce[0]=_cc=(_cf&&_cf.constructor==="manual")?_c1(_ce):(_ce.length==1?_be(_ca.constructor,t):_b9(_ce,t));_cc._meta={bases:_ce,hidden:_ca,chains:_cf,parents:_d1,ctor:_ca.constructor};_cc.superclass=_c9&&_c9.prototype;_cc.extend=_b7;_cc.prototype=_cb;_cb.constructor=_cc;_cb.getInherited=_ae;_cb.inherited=_a4;_cb.isInstanceOf=_b1;if(_c8){_cb.declaredClass=_c8;d.setObject(_c8,_cc);}if(_cf){for(_cd in _cf){if(_cb[_cd]&&typeof _cf[_cd]=="string"&&_cd!=_99){t=_cb[_cd]=_c3(_cd,_ce,_cf[_cd]==="after");t.nom=_cd;}}}return _cc;};d.safeMixin=_b3;})();}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var lls;lls=[].concat(ls);for(var i in lls){if(!(i in ap)){lls[i].apply(this,arguments);}}return r;};},add:function(_d2,_d3,_d4){_d2=_d2||dojo.global;var f=_d2[_d3];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=_d2[_d3]=d;}return f._listeners.push(_d4);},remove:function(_d5,_d6,_d7){var f=(_d5||dojo.global)[_d6];if(f&&f._listeners&&_d7--){delete f._listeners[_d7];}}};dojo.connect=function(obj,_d8,_d9,_da,_db){var a=arguments,_dc=[],i=0;_dc.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];_dc.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){_dc.push(a[i]);}return dojo._connect.apply(this,_dc);};dojo._connect=function(obj,_dd,_de,_df){var l=dojo._listener,h=l.add(obj,_dd,dojo.hitch(_de,_df));return [obj,_dd,h,l];};dojo.disconnect=function(_e0){if(_e0&&_e0[0]!==undefined){dojo._disconnect.apply(this,_e0);delete _e0[0];}};dojo._disconnect=function(obj,_e1,_e2,_e3){_e3.remove(obj,_e1,_e2);};dojo._topics={};dojo.subscribe=function(_e4,_e5,_e6){return [_e4,dojo._listener.add(dojo._topics,_e4,dojo.hitch(_e5,_e6))];};dojo.unsubscribe=function(_e7){if(_e7){dojo._listener.remove(dojo._topics,_e7[0],_e7[1]);}};dojo.publish=function(_e8,_e9){var f=dojo._topics[_e8];if(f){f.apply(this,_e9||[]);}};dojo.connectPublisher=function(_ea,obj,_eb){var pf=function(){dojo.publish(_ea,arguments);};return (_eb)?dojo.connect(obj,_eb,pf):dojo.connect(obj,pf);};}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");dojo.Deferred=function(_ec){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=_ec;this.silentlyCancelled=false;this.isFiring=false;};dojo.extend(dojo.Deferred,{_nextId:(function(){var n=1;return function(){return n++;};})(),cancel:function(){var err;if(this.fired==-1){if(this.canceller){err=this.canceller(this);}else{this.silentlyCancelled=true;}if(this.fired==-1){if(!(err instanceof Error)){var res=err;var msg="Deferred Cancelled";if(err&&err.toString){msg+=": "+err.toString();}err=new Error(msg);err.dojoType="cancel";err.cancelResult=res;}this.errback(err);}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel();}}},_resback:function(res){this.fired=((res instanceof Error)?1:0);this.results[this.fired]=res;this._fire();},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){throw new Error("already called!");}this.silentlyCancelled=false;return;}},callback:function(res){this._check();this._resback(res);},errback:function(res){this._check();if(!(res instanceof Error)){res=new Error(res);}this._resback(res);},addBoth:function(cb,_ed){var _ee=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(_ee,_ee);},addCallback:function(cb,_ef){return this.addCallbacks(dojo.hitch.apply(dojo,arguments));},addErrback:function(cb,_f0){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));},addCallbacks:function(cb,eb){this.chain.push([cb,eb]);if(this.fired>=0&&!this.isFiring){this._fire();}return this;},_fire:function(){this.isFiring=true;var _f1=this.chain;var _f2=this.fired;var res=this.results[_f2];var _f3=this;var cb=null;while((_f1.length>0)&&(this.paused==0)){var f=_f1.shift()[_f2];if(!f){continue;}var _f4=function(){var ret=f(res);if(typeof ret!="undefined"){res=ret;}_f2=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){_f3._resback(res);_f3.paused--;if((_f3.paused==0)&&(_f3.fired>=0)){_f3._fire();}};this.paused++;}};if(dojo.config.debugAtAllCosts){_f4.call(this);}else{try{_f4.call(this);}catch(err){_f2=1;res=err;}}}this.fired=_f2;this.results[_f2]=res;this.isFiring=false;if((cb)&&(this.paused)){res.addBoth(cb);}}});}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(_f5){return eval("("+_f5+")");};dojo._escapeString=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_f6,_f7){if(it===undefined){return "undefined";}var _f8=typeof it;if(_f8=="number"||_f8=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}var _f9=arguments.callee;var _fa;_f7=_f7||"";var _fb=_f6?_f7+dojo.toJsonIndentStr:"";var tf=it.__json__||it.json;if(dojo.isFunction(tf)){_fa=tf.call(it);if(it!==_fa){return _f9(_fa,_f6,_fb);}}if(it.nodeType&&it.cloneNode){throw new Error("Can't serialize DOM nodes");}var sep=_f6?" ":"";var _fc=_f6?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_f9(obj,_f6,_fb);if(typeof val!="string"){val="undefined";}return _fc+_fb+val;});return "["+res.join(","+sep)+_fc+_f7+"]";}if(_f8=="function"){return null;}var _fd=[],key;for(key in it){var _fe,val;if(typeof key=="number"){_fe="\""+key+"\"";}else{if(typeof key=="string"){_fe=dojo._escapeString(key);}else{continue;}}val=_f9(it[key],_f6,_fb);if(typeof val!="string"){continue;}_fd.push(_fc+_fb+_fe+":"+sep+val);}return "{"+_fd.join(","+sep)+_fc+_f7+"}";};}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");(function(){var d=dojo;dojo.Color=function(_ff){if(_ff){this.setColor(_ff);}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_100){if(d.isString(_100)){d.colorFromString(_100,this);}else{if(d.isArray(_100)){d.colorFromArray(_100,this);}else{this._set(_100.r,_100.g,_100.b,_100.a);if(!(_100 instanceof d.Color)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=d.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_101){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_101?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});dojo.blendColors=function(_102,end,_103,obj){var t=obj||new d.Color();d.forEach(["r","g","b","a"],function(x){t[x]=_102[x]+(end[x]-_102[x])*_103;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};dojo.colorFromRgb=function(_104,obj){var m=_104.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj);};dojo.colorFromHex=function(_105,obj){var t=obj||new d.Color(),bits=(_105.length==4)?4:8,mask=(1<<bits)-1;_105=Number("0x"+_105.substr(1));if(isNaN(_105)){return null;}d.forEach(["b","g","r"],function(x){var c=_105&mask;_105>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};dojo.colorFromArray=function(a,obj){var t=obj||new d.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};dojo.colorFromString=function(str,obj){var a=d.Color.named[str];return a&&d.colorFromArray(a,obj)||d.colorFromRgb(str,obj)||d.colorFromHex(str,obj);};})();}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base");}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo.doc=window["document"]||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.setContext=function(_106,_107){dojo.global=_106;dojo.doc=_107;};dojo.withGlobal=function(_108,_109,_10a,_10b){var _10c=dojo.global;try{dojo.global=_108;return dojo.withDoc.call(null,_108.document,_109,_10a,_10b);}finally{dojo.global=_10c;}};dojo.withDoc=function(_10d,_10e,_10f,_110){var _111=dojo.doc,_112=dojo._bodyLtr,oldQ=dojo.isQuirks;try{dojo.doc=_10d;delete dojo._bodyLtr;dojo.isQuirks=dojo.doc.compatMode=="BackCompat";if(_10f&&typeof _10e=="string"){_10e=_10f[_10e];}return _10e.apply(_10f,_110||[]);}finally{dojo.doc=_111;delete dojo._bodyLtr;if(_112!==undefined){dojo._bodyLtr=_112;}dojo.isQuirks=oldQ;}};}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return;}name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);var _113=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_114,_115){if(node){_114=del._normalizeEventName(_114);if(!dojo.isIE&&(_114=="mouseenter"||_114=="mouseleave")){_114=(_114=="mouseenter")?"mouseover":"mouseout";}node.removeEventListener(_114,_115,false);}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name;},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this));};},_fixEvent:function(evt,_116){switch(evt.type){case "keypress":del._setKeyChar(evt);break;}return evt;},_setKeyChar:function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";evt.charOrCode=evt.keyChar||evt.keyCode;},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}});dojo.fixEvent=function(evt,_117){return del._fixEvent(evt,_117);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _118=dojo._listener;dojo._connect=function(obj,_119,_11a,_11b,_11c){var _11d=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=_11d?(_11c?2:1):0,l=[dojo._listener,del,_118][lid];var h=l.add(obj,_119,dojo.hitch(_11a,_11b));return [obj,_119,h,lid];};dojo._disconnect=function(obj,_11e,_11f,_120){([dojo._listener,del,_118][_120]).remove(obj,_11e,_11f);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:dojo.isSafari?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:dojo.isMac&&!dojo.isAIR?(dojo.isSafari?91:224):17};var _121=dojo.isMac?"metaKey":"ctrlKey";dojo.isCopyKey=function(e){return e[_121];};if(dojo.isIE){dojo.mouseButtons={LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(e,_122){return e.button&_122;},isLeft:function(e){return e.button&1;},isMiddle:function(e){return e.button&4;},isRight:function(e){return e.button&2;}};}else{dojo.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(e,_123){return e.button==_123;},isLeft:function(e){return e.button==0;},isMiddle:function(e){return e.button==1;},isRight:function(e){return e.button==2;}};}if(dojo.isIE){var _124=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;var _125=(dojo._ieListenersName="_"+dojo._scopeName+"_listeners");if(!dojo.config._allow_leaks){_118=iel=dojo._ie_listener={handlers:[],add:function(_126,_127,_128){_126=_126||dojo.global;var f=_126[_127];if(!f||!f[_125]){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d[_125]=[];f=_126[_127]=d;}return f[_125].push(ieh.push(_128)-1);},remove:function(_129,_12a,_12b){var f=(_129||dojo.global)[_12a],l=f&&f[_125];if(f&&l&&_12b--){delete ieh[l[_12b]];delete l[_12b];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_12c,fp){if(!node){return;}_12c=del._normalizeEventName(_12c);if(_12c=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd[_125]||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1;}else{kd._stealthKeydownRefs++;}}return iel.add(node,_12c,del._fixCallback(fp));},remove:function(node,_12d,_12e){_12d=del._normalizeEventName(_12d);iel.remove(node,_12d,_12e);if(_12d=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_12f){return _12f.slice(0,2)!="on"?"on"+_12f:_12f;},_nop:function(){},_fixEvent:function(evt,_130){if(!evt){var w=_130&&(_130.ownerDocument||_130.document||_130).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_130||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _131=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _132=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_131.scrollLeft||0)-_132.x;evt.pageY=evt.clientY+(_131.scrollTop||0)-_132.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;return del._fixKeys(evt);},_fixKeys:function(evt){switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;del._setKeyChar(evt);break;}return evt;},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp[_125]){return;}var k=evt.keyCode;var _133=k!=13&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_133||evt.ctrlKey){var c=_133?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);evt.cancelBubble=faux.cancelBubble;evt.returnValue=faux.returnValue;_124(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_124(this,0);}this.returnValue=false;}});dojo.stopEvent=function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt);};}del._synthesizeEvent=function(evt,_134){var faux=dojo.mixin({},evt,_134);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_135){switch(evt.type){case "keypress":var c=evt.which;if(c==3){c=99;}c=c<41&&!evt.shiftKey?0:c;if(evt.ctrlKey&&!evt.shiftKey&&c>=65&&c<=90){c+=32;}return del._synthesizeEvent(evt,{charCode:c});}return evt;}});}if(dojo.isWebKit){del._add=del.add;del._remove=del.remove;dojo.mixin(del,{add:function(node,_136,fp){if(!node){return;}var _137=del._add(node,_136,fp);if(del._normalizeEventName(_136)=="keypress"){_137._stealthKeyDownHandle=del._add(node,"keydown",function(evt){var k=evt.keyCode;var _138=k!=13&&k!=32&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_138||evt.ctrlKey){var c=_138?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if(!evt.shiftKey&&c>=65&&c<=90){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});fp.call(evt.currentTarget,faux);}});}return _137;},remove:function(node,_139,_13a){if(node){if(_13a._stealthKeyDownHandle){del._remove(node,"keydown",_13a._stealthKeyDownHandle);}del._remove(node,_139,_13a);}},_fixEvent:function(evt,_13b){switch(evt.type){case "keypress":if(evt.faux){return evt;}var c=evt.charCode;c=c>=32?c:0;return del._synthesizeEvent(evt,{charCode:c,faux:true});}return evt;}});}})();if(dojo.isIE){dojo._ieDispatcher=function(args,_13c){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c[dojo._ieListenersName],t=h[c.target];var r=t&&t.apply(_13c,args);var lls=[].concat(ls);for(var i in lls){var f=h[lls[i]];if(!(i in ap)&&f){f.apply(_13c,args);}}return r;};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this));};};}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}if(dojo.isIE||dojo.isOpera){dojo.byId=function(id,doc){if(typeof id!="string"){return id;}var _13d=doc||dojo.doc,te=_13d.getElementById(id);if(te&&(te.attributes.id.value==id||te.id==id)){return te;}else{var eles=_13d.all[id];if(!eles||eles.nodeName){eles=[eles];}var i=0;while((te=eles[i++])){if((te.attributes&&te.attributes.id&&te.attributes.id.value==id)||te.id==id){return te;}}}};}else{dojo.byId=function(id,doc){return (typeof id=="string")?(doc||dojo.doc).getElementById(id):id;};}(function(){var d=dojo;var byId=d.byId;var _13e=null,_13f;d.addOnWindowUnload(function(){_13e=null;});dojo._destroyElement=dojo.destroy=function(node){node=byId(node);try{var doc=node.ownerDocument;if(!_13e||_13f!=doc){_13e=doc.createElement("div");_13f=doc;}_13e.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_13e.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_140){try{node=byId(node);_140=byId(_140);while(node){if(node==_140){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_141){node=byId(node);if(d.isMozilla){node.style.MozUserSelect=_141?"":"none";}else{if(d.isKhtml||d.isWebKit){node.style.KhtmlUserSelect=_141?"auto":"none";}else{if(d.isIE){var v=(node.unselectable=_141?"":"on");d.query("*",node).forEach("item.unselectable = '"+v+"'");}}}};var _142=function(node,ref){var _143=ref.parentNode;if(_143){_143.insertBefore(node,ref);}};var _144=function(node,ref){var _145=ref.parentNode;if(_145){if(_145.lastChild==ref){_145.appendChild(node);}else{_145.insertBefore(node,ref.nextSibling);}}};dojo.place=function(node,_146,_147){_146=byId(_146);if(typeof node=="string"){node=node.charAt(0)=="<"?d._toDom(node,_146.ownerDocument):byId(node);}if(typeof _147=="number"){var cn=_146.childNodes;if(!cn.length||cn.length<=_147){_146.appendChild(node);}else{_142(node,cn[_147<0?0:_147]);}}else{switch(_147){case "before":_142(node,_146);break;case "after":_144(node,_146);break;case "replace":_146.parentNode.replaceChild(node,_146);break;case "only":d.empty(_146);_146.appendChild(node);break;case "first":if(_146.firstChild){_142(node,_146.firstChild);break;}default:_146.appendChild(node);}}return node;};dojo.boxModel="content-box";if(d.isIE){d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";}var gcs;if(d.isWebKit){gcs=function(node){var s;if(node.nodeType==1){var dv=node.ownerDocument.defaultView;s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}}return s||{};};}else{if(d.isIE){gcs=function(node){return node.nodeType==1?node.currentStyle:{};};}else{gcs=function(node){return node.nodeType==1?node.ownerDocument.defaultView.getComputedStyle(node,null):{};};}}dojo.getComputedStyle=gcs;if(!d.isIE){d._toPixelValue=function(_148,_149){return parseFloat(_149)||0;};}else{d._toPixelValue=function(_14a,_14b){if(!_14b){return 0;}if(_14b=="medium"){return 4;}if(_14b.slice&&_14b.slice(-2)=="px"){return parseFloat(_14b);}with(_14a){var _14c=style.left;var _14d=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_14b;_14b=style.pixelLeft;}catch(e){_14b=0;}style.left=_14c;runtimeStyle.left=_14d;}return _14b;};}var px=d._toPixelValue;var astr="DXImageTransform.Microsoft.Alpha";var af=function(n,f){try{return n.filters.item(astr);}catch(e){return f?{}:null;}};dojo._getOpacity=d.isIE?function(node){try{return af(node).Opacity/100;}catch(e){return 1;}}:function(node){return gcs(node).opacity;};dojo._setOpacity=d.isIE?function(node,_14e){var ov=_14e*100;node.style.zoom=1;af(node,1).Enabled=!(_14e==1);if(!af(node)){node.style.filter+=" progid:"+astr+"(Opacity="+ov+")";}else{af(node,1).Opacity=ov;}if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){d._setOpacity(i,_14e);});}return _14e;}:function(node,_14f){return node.style.opacity=_14f;};var _150={left:true,top:true};var _151=/margin|padding|width|height|max|min|offset/;var _152=function(node,type,_153){type=type.toLowerCase();if(d.isIE){if(_153=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(type=="fontweight"){switch(_153){case 700:return "bold";case 400:default:return "normal";}}}if(!(type in _150)){_150[type]=_151.test(type);}return _150[type]?px(node,_153):_153;};var _154=d.isIE?"styleFloat":"cssFloat",_155={"cssFloat":_154,"styleFloat":_154,"float":_154};dojo.style=function(node,_156,_157){var n=byId(node),args=arguments.length,op=(_156=="opacity");_156=_155[_156]||_156;if(args==3){return op?d._setOpacity(n,_157):n.style[_156]=_157;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&typeof _156!="string"){for(var x in _156){d.style(node,x,_156[x]);}return s;}return (args==1)?s:_152(n,_156,s[_156]||n.style[_156]);};dojo._getPadExtents=function(n,_158){var s=_158||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};};dojo._getBorderExtents=function(n,_159){var ne="none",s=_159||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};};dojo._getPadBorderExtents=function(n,_15a){var s=_15a||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};};dojo._getMarginExtents=function(n,_15b){var s=_15b||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isWebKit&&(s.position!="absolute")){r=l;}return {l:l,t:t,w:l+r,h:t+b};};dojo._getMarginBox=function(node,_15c){var s=_15c||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t,p=node.parentNode;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else{if(d.isOpera||(d.isIE>7&&!d.isQuirks)){if(p){be=d._getBorderExtents(p);l-=be.l;t-=be.t;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getContentBox=function(node,_15d){var s=_15d||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight;}else{h=node.clientHeight,be.w=be.h=0;}if(d.isOpera){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};dojo._getBorderBox=function(node,_15e){var s=_15e||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};dojo._isButtonTag=function(node){return node.tagName=="BUTTON"||node.tagName=="INPUT"&&(node.getAttribute("type")||"").toUpperCase()=="BUTTON";};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||d._isButtonTag(node);};dojo._setContentSize=function(node,_15f,_160,_161){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_161);if(_15f>=0){_15f+=pb.w;}if(_160>=0){_160+=pb.h;}}d._setBox(node,NaN,NaN,_15f,_160);};dojo._setMarginBox=function(node,_162,_163,_164,_165,_166){var s=_166||gcs(node),bb=d._usesBorderBox(node),pb=bb?_167:d._getPadBorderExtents(node,s);if(d.isWebKit){if(d._isButtonTag(node)){var ns=node.style;if(_164>=0&&!ns.width){ns.width="4px";}if(_165>=0&&!ns.height){ns.height="4px";}}}var mb=d._getMarginExtents(node,s);if(_164>=0){_164=Math.max(_164-pb.w-mb.w,0);}if(_165>=0){_165=Math.max(_165-pb.h-mb.h,0);}d._setBox(node,_162,_163,_164,_165);};var _167={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);};dojo.contentBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _168=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_169=0,_16a=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_169+=val-0;if(node==_16a){break;}}node=node.parentNode;}return _169;};dojo._docScroll=function(){var n=d.global;return "pageXOffset" in n?{x:n.pageXOffset,y:n.pageYOffset}:(n=d.doc.documentElement,n.clientHeight?{x:d._fixIeBiDiScrollLeft(n.scrollLeft),y:n.scrollTop}:(n=d.body(),{x:n.scrollLeft||0,y:n.scrollTop||0}));};dojo._isBodyLtr=function(){return "_bodyLtr" in d?d._bodyLtr:d._bodyLtr=(d.body().dir||d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr";};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;if(d.isIE<8){var r=de.getBoundingClientRect();var l=r.left,t=r.top;if(d.isIE<7){l+=de.clientLeft;t+=de.clientTop;}return {x:l<0?0:l,y:t<0?0:t};}else{return {x:0,y:0};}};dojo._fixIeBiDiScrollLeft=function(_16b){var dd=d.doc;if(d.isIE<8&&!d._isBodyLtr()){var de=d.isQuirks?dd.body:dd.documentElement;return _16b+de.clientWidth-de.scrollWidth;}return _16b;};dojo._abs=dojo.position=function(node,_16c){var db=d.body(),dh=db.parentNode,ret;node=byId(node);if(node["getBoundingClientRect"]){ret=node.getBoundingClientRect();ret={x:ret.left,y:ret.top,w:ret.right-ret.left,h:ret.bottom-ret.top};if(d.isIE){var _16d=d._getIeDocumentElementOffset();ret.x-=_16d.x+(d.isQuirks?db.clientLeft+db.offsetLeft:0);ret.y-=_16d.y+(d.isQuirks?db.clientTop+db.offsetTop:0);}else{if(d.isFF==3){var cs=gcs(dh);ret.x-=px(dh,cs.marginLeft)+px(dh,cs.borderLeftWidth);ret.y-=px(dh,cs.marginTop)+px(dh,cs.borderTopWidth);}}}else{ret={x:0,y:0,w:node.offsetWidth,h:node.offsetHeight};if(node["offsetParent"]){ret.x-=_168(node,"scrollLeft");ret.y-=_168(node,"scrollTop");var _16e=node;do{var n=_16e.offsetLeft,t=_16e.offsetTop;ret.x+=isNaN(n)?0:n;ret.y+=isNaN(t)?0:t;cs=gcs(_16e);if(_16e!=node){if(d.isMoz){ret.x+=2*px(_16e,cs.borderLeftWidth);ret.y+=2*px(_16e,cs.borderTopWidth);}else{ret.x+=px(_16e,cs.borderLeftWidth);ret.y+=px(_16e,cs.borderTopWidth);}}if(d.isMoz&&cs.position=="static"){var _16f=_16e.parentNode;while(_16f!=_16e.offsetParent){var pcs=gcs(_16f);if(pcs.position=="static"){ret.x+=px(_16e,pcs.borderLeftWidth);ret.y+=px(_16e,pcs.borderTopWidth);}_16f=_16f.parentNode;}}_16e=_16e.offsetParent;}while((_16e!=dh)&&_16e);}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}}if(_16c){var _170=d._docScroll();ret.x+=_170.x;ret.y+=_170.y;}return ret;};dojo.coords=function(node,_171){var n=byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d.position(n,_171);mb.x=abs.x;mb.y=abs.y;return mb;};var _172={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},_173={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},_174={innerHTML:1,className:1,htmlFor:d.isIE,value:1};var _175=function(name){return _173[name.toLowerCase()]||name;};var _176=function(node,name){var attr=node.getAttributeNode&&node.getAttributeNode(name);return attr&&attr.specified;};dojo.hasAttr=function(node,name){var lc=name.toLowerCase();return _174[_172[lc]||name]||_176(byId(node),_173[lc]||name);};var _177={},_178=0,_179=dojo._scopeName+"attrid",_17a={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};dojo.attr=function(node,name,_17b){node=byId(node);var args=arguments.length,prop;if(args==2&&typeof name!="string"){for(var x in name){d.attr(node,x,name[x]);}return node;}var lc=name.toLowerCase(),_17c=_172[lc]||name,_17d=_174[_17c],_17e=_173[lc]||name;if(args==3){do{if(_17c=="style"&&typeof _17b!="string"){d.style(node,_17b);break;}if(_17c=="innerHTML"){if(d.isIE&&node.tagName.toLowerCase() in _17a){d.empty(node);node.appendChild(d._toDom(_17b,node.ownerDocument));}else{node[_17c]=_17b;}break;}if(d.isFunction(_17b)){var _17f=d.attr(node,_179);if(!_17f){_17f=_178++;d.attr(node,_179,_17f);}if(!_177[_17f]){_177[_17f]={};}var h=_177[_17f][_17c];if(h){d.disconnect(h);}else{try{delete node[_17c];}catch(e){}}_177[_17f][_17c]=d.connect(node,_17c,_17b);break;}if(_17d||typeof _17b=="boolean"){node[_17c]=_17b;break;}node.setAttribute(_17e,_17b);}while(false);return node;}_17b=node[_17c];if(_17d&&typeof _17b!="undefined"){return _17b;}if(_17c!="href"&&(typeof _17b=="boolean"||d.isFunction(_17b))){return _17b;}return _176(node,_17e)?node.getAttribute(_17e):null;};dojo.removeAttr=function(node,name){byId(node).removeAttribute(_175(name));};dojo.getNodeProp=function(node,name){node=byId(node);var lc=name.toLowerCase(),_180=_172[lc]||name;if((_180 in node)&&_180!="href"){return node[_180];}var _181=_173[lc]||name;return _176(node,_181)?node.getAttribute(_181):null;};dojo.create=function(tag,_182,_183,pos){var doc=d.doc;if(_183){_183=byId(_183);doc=_183.ownerDocument;}if(typeof tag=="string"){tag=doc.createElement(tag);}if(_182){d.attr(tag,_182);}if(_183){d.place(tag,_183,pos);}return tag;};d.empty=d.isIE?function(node){node=byId(node);for(var c;c=node.lastChild;){d.destroy(c);}}:function(node){byId(node).innerHTML="";};var _184={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},_185=/<\s*([\w\:]+)/,_186={},_187=0,_188="__"+d._scopeName+"ToDomId";for(var _189 in _184){var tw=_184[_189];tw.pre=_189=="option"?"<select multiple=\"multiple\">":"<"+tw.join("><")+">";tw.post="</"+tw.reverse().join("></")+">";}d._toDom=function(frag,doc){doc=doc||d.doc;var _18a=doc[_188];if(!_18a){doc[_188]=_18a=++_187+"";_186[_18a]=doc.createElement("div");}frag+="";var _18b=frag.match(_185),tag=_18b?_18b[1].toLowerCase():"",_18c=_186[_18a],wrap,i,fc,df;if(_18b&&_184[tag]){wrap=_184[tag];_18c.innerHTML=wrap.pre+frag+wrap.post;for(i=wrap.length;i;--i){_18c=_18c.firstChild;}}else{_18c.innerHTML=frag;}if(_18c.childNodes.length==1){return _18c.removeChild(_18c.firstChild);}df=doc.createDocumentFragment();while(fc=_18c.firstChild){df.appendChild(fc);}return df;};var _18d="className";dojo.hasClass=function(node,_18e){return ((" "+byId(node)[_18d]+" ").indexOf(" "+_18e+" ")>=0);};var _18f=/\s+/,a1=[""],_190=function(s){if(typeof s=="string"||s instanceof String){if(s.indexOf(" ")<0){a1[0]=s;return a1;}else{return s.split(_18f);}}return s;};dojo.addClass=function(node,_191){node=byId(node);_191=_190(_191);var cls=" "+node[_18d]+" ";for(var i=0,len=_191.length,c;i<len;++i){c=_191[i];if(c&&cls.indexOf(" "+c+" ")<0){cls+=c+" ";}}node[_18d]=d.trim(cls);};dojo.removeClass=function(node,_192){node=byId(node);var cls;if(_192!==undefined){_192=_190(_192);cls=" "+node[_18d]+" ";for(var i=0,len=_192.length;i<len;++i){cls=cls.replace(" "+_192[i]+" "," ");}cls=d.trim(cls);}else{cls="";}if(node[_18d]!=cls){node[_18d]=cls;}};dojo.toggleClass=function(node,_193,_194){if(_194===undefined){_194=!d.hasClass(node,_193);}d[_194?"addClass":"removeClass"](node,_193);};})();}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var ap=Array.prototype,aps=ap.slice,apc=ap.concat;var tnl=function(a,_195,_196){if(!a.sort){a=aps.call(a,0);}var ctor=_196||this._NodeListCtor||d._NodeListCtor;a.constructor=ctor;dojo._mixin(a,ctor.prototype);a._NodeListCtor=ctor;return _195?a._stash(_195):a;};var _197=function(f,a,o){a=[0].concat(aps.call(a,0));o=o||d.global;return function(node){a[0]=node;return f.apply(o,a);};};var _198=function(f,o){return function(){this.forEach(_197(f,arguments,o));return this;};};var _199=function(f,o){return function(){return this.map(_197(f,arguments,o));};};var _19a=function(f,o){return function(){return this.filter(_197(f,arguments,o));};};var _19b=function(f,g,o){return function(){var a=arguments,body=_197(f,a,o);if(g.call(o||d.global,a)){return this.map(body);}this.forEach(body);return this;};};var _19c=function(a){return a.length==1&&(typeof a[0]=="string");};var _19d=function(node){var p=node.parentNode;if(p){p.removeChild(node);}};dojo.NodeList=function(){return tnl(Array.apply(null,arguments));};d._NodeListCtor=d.NodeList;var nl=d.NodeList,nlp=nl.prototype;nl._wrap=nlp._wrap=tnl;nl._adaptAsMap=_199;nl._adaptAsForEach=_198;nl._adaptAsFilter=_19a;nl._adaptWithCondition=_19b;d.forEach(["slice","splice"],function(name){var f=ap[name];nlp[name]=function(){return this._wrap(f.apply(this,arguments),name=="slice"?this:null);};});d.forEach(["indexOf","lastIndexOf","every","some"],function(name){var f=d[name];nlp[name]=function(){return f.apply(d,[this].concat(aps.call(arguments,0)));};});d.forEach(["attr","style"],function(name){nlp[name]=_19b(d[name],_19c);});d.forEach(["connect","addClass","removeClass","toggleClass","empty","removeAttr"],function(name){nlp[name]=_198(d[name]);});dojo.extend(dojo.NodeList,{_normalize:function(_19e,_19f){var _1a0=_19e.parse===true?true:false;if(typeof _19e.template=="string"){var _1a1=_19e.templateFunc||(dojo.string&&dojo.string.substitute);_19e=_1a1?_1a1(_19e.template,_19e):_19e;}var type=(typeof _19e);if(type=="string"||type=="number"){_19e=dojo._toDom(_19e,(_19f&&_19f.ownerDocument));if(_19e.nodeType==11){_19e=dojo._toArray(_19e.childNodes);}else{_19e=[_19e];}}else{if(!dojo.isArrayLike(_19e)){_19e=[_19e];}else{if(!dojo.isArray(_19e)){_19e=dojo._toArray(_19e);}}}if(_1a0){_19e._runParse=true;}return _19e;},_cloneNode:function(node){return node.cloneNode(true);},_place:function(ary,_1a2,_1a3,_1a4){if(_1a2.nodeType!=1&&_1a3=="only"){return;}var _1a5=_1a2,_1a6;var _1a7=ary.length;for(var i=_1a7-1;i>=0;i--){var node=(_1a4?this._cloneNode(ary[i]):ary[i]);if(ary._runParse&&dojo.parser&&dojo.parser.parse){if(!_1a6){_1a6=_1a5.ownerDocument.createElement("div");}_1a6.appendChild(node);dojo.parser.parse(_1a6);node=_1a6.firstChild;while(_1a6.firstChild){_1a6.removeChild(_1a6.firstChild);}}if(i==_1a7-1){dojo.place(node,_1a5,_1a3);}else{_1a5.parentNode.insertBefore(node,_1a5);}_1a5=node;}},_stash:function(_1a8){this._parent=_1a8;return this;},end:function(){if(this._parent){return this._parent;}else{return new this._NodeListCtor();}},concat:function(item){var t=d.isArray(this)?this:aps.call(this,0),m=d.map(arguments,function(a){return a&&!d.isArray(a)&&(typeof NodeList!="undefined"&&a.constructor===NodeList||a.constructor===this._NodeListCtor)?aps.call(a,0):a;});return this._wrap(apc.apply(t,m),this);},map:function(func,obj){return this._wrap(d.map(this,func,obj),this);},forEach:function(_1a9,_1aa){d.forEach(this,_1a9,_1aa);return this;},coords:_199(d.coords),position:_199(d.position),place:function(_1ab,_1ac){var item=d.query(_1ab)[0];return this.forEach(function(node){d.place(node,item,_1ac);});},orphan:function(_1ad){return (_1ad?d._filterQueryResult(this,_1ad):this).forEach(_19d);},adopt:function(_1ae,_1af){return d.query(_1ae).place(this[0],_1af)._stash(this);},query:function(_1b0){if(!_1b0){return this;}var ret=this.map(function(node){return d.query(_1b0,node).filter(function(_1b1){return _1b1!==undefined;});});return this._wrap(apc.apply([],ret),this);},filter:function(_1b2){var a=arguments,_1b3=this,_1b4=0;if(typeof _1b2=="string"){_1b3=d._filterQueryResult(this,a[0]);if(a.length==1){return _1b3._stash(this);}_1b4=1;}return this._wrap(d.filter(_1b3,a[_1b4],a[_1b4+1]),this);},addContent:function(_1b5,_1b6){_1b5=this._normalize(_1b5,this[0]);for(var i=0,node;node=this[i];i++){this._place(_1b5,node,_1b6,i>0);}return this;},instantiate:function(_1b7,_1b8){var c=d.isFunction(_1b7)?_1b7:d.getObject(_1b7);_1b8=_1b8||{};return this.forEach(function(node){new c(_1b8,node);});},at:function(){var t=new this._NodeListCtor();d.forEach(arguments,function(i){if(this[i]){t.push(this[i]);}},this);return t._stash(this);}});nl.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","submit"];d.forEach(nl.events,function(evt){var _1b9="on"+evt;nlp[_1b9]=function(a,b){return this.connect(_1b9,a,b);};});})();}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;if(typeof dojo!="undefined"){dojo.provide("dojo._base.query");}(function(d){var trim=d.trim;var each=d.forEach;var qlc=d._NodeListCtor=d.NodeList;var _1ba=function(){return d.doc;};var _1bb=((d.isWebKit||d.isMozilla)&&((_1ba().compatMode)=="BackCompat"));var _1bc=!!_1ba().firstChild["children"]?"children":"childNodes";var _1bd=">~+";var _1be=false;var _1bf=function(){return true;};var _1c0=function(_1c1){if(_1bd.indexOf(_1c1.slice(-1))>=0){_1c1+=" * ";}else{_1c1+=" ";}var ts=function(s,e){return trim(_1c1.slice(s,e));};var _1c2=[];var _1c3=-1,_1c4=-1,_1c5=-1,_1c6=-1,_1c7=-1,inId=-1,_1c8=-1,lc="",cc="",_1c9;var x=0,ql=_1c1.length,_1ca=null,_1cb=null;var _1cc=function(){if(_1c8>=0){var tv=(_1c8==x)?null:ts(_1c8,x);_1ca[(_1bd.indexOf(tv)<0)?"tag":"oper"]=tv;_1c8=-1;}};var _1cd=function(){if(inId>=0){_1ca.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _1ce=function(){if(_1c7>=0){_1ca.classes.push(ts(_1c7+1,x).replace(/\\/g,""));_1c7=-1;}};var _1cf=function(){_1cd();_1cc();_1ce();};var _1d0=function(){_1cf();if(_1c6>=0){_1ca.pseudos.push({name:ts(_1c6+1,x)});}_1ca.loops=(_1ca.pseudos.length||_1ca.attrs.length||_1ca.classes.length);_1ca.oquery=_1ca.query=ts(_1c9,x);_1ca.otag=_1ca.tag=(_1ca["oper"])?null:(_1ca.tag||"*");if(_1ca.tag){_1ca.tag=_1ca.tag.toUpperCase();}if(_1c2.length&&(_1c2[_1c2.length-1].oper)){_1ca.infixOper=_1c2.pop();_1ca.query=_1ca.infixOper.query+" "+_1ca.query;}_1c2.push(_1ca);_1ca=null;};for(;lc=cc,cc=_1c1.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_1ca){_1c9=x;_1ca={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return (_1be)?this.otag:this.tag;}};_1c8=x;}if(_1c3>=0){if(cc=="]"){if(!_1cb.attr){_1cb.attr=ts(_1c3+1,x);}else{_1cb.matchFor=ts((_1c5||_1c3+1),x);}var cmf=_1cb.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_1cb.matchFor=cmf.slice(1,-1);}}_1ca.attrs.push(_1cb);_1cb=null;_1c3=_1c5=-1;}else{if(cc=="="){var _1d1=("|~^$*".indexOf(lc)>=0)?lc:"";_1cb.type=_1d1+cc;_1cb.attr=ts(_1c3+1,x-_1d1.length);_1c5=x+1;}}}else{if(_1c4>=0){if(cc==")"){if(_1c6>=0){_1cb.value=ts(_1c4+1,x);}_1c6=_1c4=-1;}}else{if(cc=="#"){_1cf();inId=x+1;}else{if(cc=="."){_1cf();_1c7=x;}else{if(cc==":"){_1cf();_1c6=x;}else{if(cc=="["){_1cf();_1c3=x;_1cb={};}else{if(cc=="("){if(_1c6>=0){_1cb={name:ts(_1c6+1,x),value:null};_1ca.pseudos.push(_1cb);}_1c4=x;}else{if((cc==" ")&&(lc!=cc)){_1d0();}}}}}}}}}return _1c2;};var _1d2=function(_1d3,_1d4){if(!_1d3){return _1d4;}if(!_1d4){return _1d3;}return function(){return _1d3.apply(window,arguments)&&_1d4.apply(window,arguments);};};var _1d5=function(i,arr){var r=arr||[];if(i){r.push(i);}return r;};var _1d6=function(n){return (1==n.nodeType);};var _1d7="";var _1d8=function(elem,attr){if(!elem){return _1d7;}if(attr=="class"){return elem.className||_1d7;}if(attr=="for"){return elem.htmlFor||_1d7;}if(attr=="style"){return elem.style.cssText||_1d7;}return (_1be?elem.getAttribute(attr):elem.getAttribute(attr,2))||_1d7;};var _1d9={"*=":function(attr,_1da){return function(elem){return (_1d8(elem,attr).indexOf(_1da)>=0);};},"^=":function(attr,_1db){return function(elem){return (_1d8(elem,attr).indexOf(_1db)==0);};},"$=":function(attr,_1dc){var tval=" "+_1dc;return function(elem){var ea=" "+_1d8(elem,attr);return (ea.lastIndexOf(_1dc)==(ea.length-_1dc.length));};},"~=":function(attr,_1dd){var tval=" "+_1dd+" ";return function(elem){var ea=" "+_1d8(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_1de){var _1df=" "+_1de+"-";return function(elem){var ea=" "+_1d8(elem,attr);return ((ea==_1de)||(ea.indexOf(_1df)==0));};},"=":function(attr,_1e0){return function(elem){return (_1d8(elem,attr)==_1e0);};}};var _1e1=(typeof _1ba().firstChild.nextElementSibling=="undefined");var _1e2=!_1e1?"nextElementSibling":"nextSibling";var _1e3=!_1e1?"previousElementSibling":"previousSibling";var _1e4=(_1e1?_1d6:_1bf);var _1e5=function(node){while(node=node[_1e3]){if(_1e4(node)){return false;}}return true;};var _1e6=function(node){while(node=node[_1e2]){if(_1e4(node)){return false;}}return true;};var _1e7=function(node){var root=node.parentNode;var i=0,tret=root[_1bc],ci=(node["_i"]||-1),cl=(root["_l"]||-1);if(!tret){return -1;}var l=tret.length;if(cl==l&&ci>=0&&cl>=0){return ci;}root["_l"]=l;ci=-1;for(var te=root["firstElementChild"]||root["firstChild"];te;te=te[_1e2]){if(_1e4(te)){te["_i"]=++i;if(node===te){ci=i;}}}return ci;};var _1e8=function(elem){return !((_1e7(elem))%2);};var _1e9=function(elem){return ((_1e7(elem))%2);};var _1ea={"checked":function(name,_1eb){return function(elem){return !!("checked" in elem?elem.checked:elem.selected);};},"first-child":function(){return _1e5;},"last-child":function(){return _1e6;},"only-child":function(name,_1ec){return function(node){if(!_1e5(node)){return false;}if(!_1e6(node)){return false;}return true;};},"empty":function(name,_1ed){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt===1)||(nt==3)){return false;}}return true;};},"contains":function(name,_1ee){var cz=_1ee.charAt(0);if(cz=="\""||cz=="'"){_1ee=_1ee.slice(1,-1);}return function(elem){return (elem.innerHTML.indexOf(_1ee)>=0);};},"not":function(name,_1ef){var p=_1c0(_1ef)[0];var _1f0={el:1};if(p.tag!="*"){_1f0.tag=1;}if(!p.classes.length){_1f0.classes=1;}var ntf=_1f1(p,_1f0);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_1f2){var pi=parseInt;if(_1f2=="odd"){return _1e9;}else{if(_1f2=="even"){return _1e8;}}if(_1f2.indexOf("n")!=-1){var _1f3=_1f2.split("n",2);var pred=_1f3[0]?((_1f3[0]=="-")?-1:pi(_1f3[0])):1;var idx=_1f3[1]?pi(_1f3[1]):0;var lb=0,ub=-1;if(pred>0){if(idx<0){idx=(idx%pred)&&(pred+(idx%pred));}else{if(idx>0){if(idx>=pred){lb=idx-idx%pred;}idx=idx%pred;}}}else{if(pred<0){pred*=-1;if(idx>0){ub=idx;idx=idx%pred;}}}if(pred>0){return function(elem){var i=_1e7(elem);return (i>=lb)&&(ub<0||i<=ub)&&((i%pred)==idx);};}else{_1f2=idx;}}var _1f4=pi(_1f2);return function(elem){return (_1e7(elem)==_1f4);};}};var _1f5=(d.isIE)?function(cond){var clc=cond.toLowerCase();if(clc=="class"){cond="className";}return function(elem){return (_1be?elem.getAttribute(cond):elem[cond]||elem[clc]);};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _1f1=function(_1f6,_1f7){if(!_1f6){return _1bf;}_1f7=_1f7||{};var ff=null;if(!("el" in _1f7)){ff=_1d2(ff,_1d6);}if(!("tag" in _1f7)){if(_1f6.tag!="*"){ff=_1d2(ff,function(elem){return (elem&&(elem.tagName==_1f6.getTag()));});}}if(!("classes" in _1f7)){each(_1f6.classes,function(_1f8,idx,arr){var re=new RegExp("(?:^|\\s)"+_1f8+"(?:\\s|$)");ff=_1d2(ff,function(elem){return re.test(elem.className);});ff.count=idx;});}if(!("pseudos" in _1f7)){each(_1f6.pseudos,function(_1f9){var pn=_1f9.name;if(_1ea[pn]){ff=_1d2(ff,_1ea[pn](pn,_1f9.value));}});}if(!("attrs" in _1f7)){each(_1f6.attrs,function(attr){var _1fa;var a=attr.attr;if(attr.type&&_1d9[attr.type]){_1fa=_1d9[attr.type](a,attr.matchFor);}else{if(a.length){_1fa=_1f5(a);}}if(_1fa){ff=_1d2(ff,_1fa);}});}if(!("id" in _1f7)){if(_1f6.id){ff=_1d2(ff,function(elem){return (!!elem&&(elem.id==_1f6.id));});}}if(!ff){if(!("default" in _1f7)){ff=_1bf;}}return ff;};var _1fb=function(_1fc){return function(node,ret,bag){while(node=node[_1e2]){if(_1e1&&(!_1d6(node))){continue;}if((!bag||_1fd(node,bag))&&_1fc(node)){ret.push(node);}break;}return ret;};};var _1fe=function(_1ff){return function(root,ret,bag){var te=root[_1e2];while(te){if(_1e4(te)){if(bag&&!_1fd(te,bag)){break;}if(_1ff(te)){ret.push(te);}}te=te[_1e2];}return ret;};};var _200=function(_201){_201=_201||_1bf;return function(root,ret,bag){var te,x=0,tret=root[_1bc];while(te=tret[x++]){if(_1e4(te)&&(!bag||_1fd(te,bag))&&(_201(te,x))){ret.push(te);}}return ret;};};var _202=function(node,root){var pn=node.parentNode;while(pn){if(pn==root){break;}pn=pn.parentNode;}return !!pn;};var _203={};var _204=function(_205){var _206=_203[_205.query];if(_206){return _206;}var io=_205.infixOper;var oper=(io?io.oper:"");var _207=_1f1(_205,{el:1});var qt=_205.tag;var _208=("*"==qt);var ecs=_1ba()["getElementsByClassName"];if(!oper){if(_205.id){_207=(!_205.loops&&_208)?_1bf:_1f1(_205,{el:1,id:1});_206=function(root,arr){var te=d.byId(_205.id,(root.ownerDocument||root));if(!te||!_207(te)){return;}if(9==root.nodeType){return _1d5(te,arr);}else{if(_202(te,root)){return _1d5(te,arr);}}};}else{if(ecs&&/\{\s*\[native code\]\s*\}/.test(String(ecs))&&_205.classes.length&&!_1bb){_207=_1f1(_205,{el:1,classes:1,id:1});var _209=_205.classes.join(" ");_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByClassName(_209);while((te=tret[x++])){if(_207(te,root)&&_1fd(te,bag)){ret.push(te);}}return ret;};}else{if(!_208&&!_205.loops){_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByTagName(_205.getTag());while((te=tret[x++])){if(_1fd(te,bag)){ret.push(te);}}return ret;};}else{_207=_1f1(_205,{el:1,tag:1,id:1});_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByTagName(_205.getTag());while((te=tret[x++])){if(_207(te,root)&&_1fd(te,bag)){ret.push(te);}}return ret;};}}}}else{var _20a={el:1};if(_208){_20a.tag=1;}_207=_1f1(_205,_20a);if("+"==oper){_206=_1fb(_207);}else{if("~"==oper){_206=_1fe(_207);}else{if(">"==oper){_206=_200(_207);}}}}return _203[_205.query]=_206;};var _20b=function(root,_20c){var _20d=_1d5(root),qp,x,te,qpl=_20c.length,bag,ret;for(var i=0;i<qpl;i++){ret=[];qp=_20c[i];x=_20d.length-1;if(x>0){bag={};ret.nozip=true;}var gef=_204(qp);for(var j=0;(te=_20d[j]);j++){gef(te,ret,bag);}if(!ret.length){break;}_20d=ret;}return ret;};var _20e={},_20f={};var _210=function(_211){var _212=_1c0(trim(_211));if(_212.length==1){var tef=_204(_212[0]);return function(root){var r=tef(root,new qlc());if(r){r.nozip=true;}return r;};}return function(root){return _20b(root,_212);};};var nua=navigator.userAgent;var wk="WebKit/";var _213=(d.isWebKit&&(nua.indexOf(wk)>0)&&(parseFloat(nua.split(wk)[1])>528));var _214=d.isIE?"commentStrip":"nozip";var qsa="querySelectorAll";var _215=(!!_1ba()[qsa]&&(!d.isSafari||(d.isSafari>3.1)||_213));var _216=/n\+\d|([^ ])?([>~+])([^ =])?/g;var _217=function(_218,pre,ch,post){return ch?(pre?pre+" ":"")+ch+(post?" "+post:""):_218;};var _219=function(_21a,_21b){_21a=_21a.replace(_216,_217);if(_215){var _21c=_20f[_21a];if(_21c&&!_21b){return _21c;}}var _21d=_20e[_21a];if(_21d){return _21d;}var qcz=_21a.charAt(0);var _21e=(-1==_21a.indexOf(" "));if((_21a.indexOf("#")>=0)&&(_21e)){_21b=true;}var _21f=(_215&&(!_21b)&&(_1bd.indexOf(qcz)==-1)&&(!d.isIE||(_21a.indexOf(":")==-1))&&(!(_1bb&&(_21a.indexOf(".")>=0)))&&(_21a.indexOf(":contains")==-1)&&(_21a.indexOf(":checked")==-1)&&(_21a.indexOf("|=")==-1));if(_21f){var tq=(_1bd.indexOf(_21a.charAt(_21a.length-1))>=0)?(_21a+" *"):_21a;return _20f[_21a]=function(root){try{if(!((9==root.nodeType)||_21e)){throw "";}var r=root[qsa](tq);r[_214]=true;return r;}catch(e){return _219(_21a,true)(root);}};}else{var _220=_21a.split(/\s*,\s*/);return _20e[_21a]=((_220.length<2)?_210(_21a):function(root){var _221=0,ret=[],tp;while((tp=_220[_221++])){ret=ret.concat(_210(tp)(root));}return ret;});}};var _222=0;var _223=d.isIE?function(node){if(_1be){return (node.getAttribute("_uid")||node.setAttribute("_uid",++_222)||_222);}else{return node.uniqueID;}}:function(node){return (node._uid||(node._uid=++_222));};var _1fd=function(node,bag){if(!bag){return 1;}var id=_223(node);if(!bag[id]){return bag[id]=1;}return 0;};var _224="_zipIdx";var _225=function(arr){if(arr&&arr.nozip){return (qlc._wrap)?qlc._wrap(arr):arr;}var ret=new qlc();if(!arr||!arr.length){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_222++;if(d.isIE&&_1be){var _226=_222+"";arr[0].setAttribute(_224,_226);for(var x=1,te;te=arr[x];x++){if(arr[x].getAttribute(_224)!=_226){ret.push(te);}te.setAttribute(_224,_226);}}else{if(d.isIE&&arr.commentStrip){try{for(var x=1,te;te=arr[x];x++){if(_1d6(te)){ret.push(te);}}}catch(e){}}else{if(arr[0]){arr[0][_224]=_222;}for(var x=1,te;te=arr[x];x++){if(arr[x][_224]!=_222){ret.push(te);}te[_224]=_222;}}}return ret;};d.query=function(_227,root){qlc=d._NodeListCtor;if(!_227){return new qlc();}if(_227.constructor==qlc){return _227;}if(typeof _227!="string"){return new qlc(_227);}if(typeof root=="string"){root=d.byId(root);if(!root){return new qlc();}}root=root||_1ba();var od=root.ownerDocument||root.documentElement;_1be=(root.contentType&&root.contentType=="application/xml")||(d.isOpera&&(root.doctype||od.toString()=="[object XMLDocument]"))||(!!od)&&(d.isIE?od.xml:(root.xmlVersion||od.xmlVersion));var r=_219(_227)(root);if(r&&r.nozip&&!qlc._wrap){return r;}return _225(r);};d.query.pseudos=_1ea;d._filterQueryResult=function(_228,_229){var _22a=new d._NodeListCtor();var _22b=_1f1(_1c0(_229)[0]);for(var x=0,te;te=_228[x];x++){if(_22b(te)){_22a.push(te);}}return _22a;};})(this["queryPortability"]||this["acme"]||dojo);}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _22c=dojo,cfg=_22c.config;function _22d(obj,name,_22e){if(_22e===null){return;}var val=obj[name];if(typeof val=="string"){obj[name]=[val,_22e];}else{if(_22c.isArray(val)){val.push(_22e);}else{obj[name]=_22e;}}};dojo.fieldToObject=function(_22f){var ret=null;var item=_22c.byId(_22f);if(item){var _230=item.name;var type=(item.type||"").toLowerCase();if(_230&&type&&!item.disabled){if(type=="radio"||type=="checkbox"){if(item.checked){ret=item.value;}}else{if(item.multiple){ret=[];_22c.query("option",item).forEach(function(opt){if(opt.selected){ret.push(opt.value);}});}else{ret=item.value;}}}}return ret;};dojo.formToObject=function(_231){var ret={};var _232="file|submit|image|reset|button|";_22c.forEach(dojo.byId(_231).elements,function(item){var _233=item.name;var type=(item.type||"").toLowerCase();if(_233&&type&&_232.indexOf(type)==-1&&!item.disabled){_22d(ret,_233,_22c.fieldToObject(item));if(type=="image"){ret[_233+".x"]=ret[_233+".y"]=ret[_233].x=ret[_233].y=0;}}});return ret;};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var _234=[];var _235={};for(var name in map){var _236=map[name];if(_236!=_235[name]){var _237=enc(name)+"=";if(_22c.isArray(_236)){for(var i=0;i<_236.length;i++){_234.push(_237+enc(_236[i]));}}else{_234.push(_237+enc(_236));}}}return _234.join("&");};dojo.formToQuery=function(_238){return _22c.objectToQuery(_22c.formToObject(_238));};dojo.formToJson=function(_239,_23a){return _22c.toJson(_22c.formToObject(_239),_23a);};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_22c.forEach(qp,function(item){if(item.length){var _23b=item.split("=");var name=dec(_23b.shift());var val=dec(_23b.join("="));if(typeof ret[name]=="string"){ret[name]=[ret[name]];}if(_22c.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}});return ret;};dojo._blockAsync=false;var _23c=_22c._contentHandlers=dojo.contentHandlers={text:function(xhr){return xhr.responseText;},json:function(xhr){return _22c.fromJson(xhr.responseText||null);},"json-comment-filtered":function(xhr){if(!dojo.config.useCommentedJson){console.warn("Consider using the standard mimetype:application/json."+" json-commenting can introduce security issues. To"+" decrease the chances of hijacking, use the standard the 'json' handler and"+" prefix your json with: {}&&\n"+"Use djConfig.useCommentedJson=true to turn off this message.");}var _23d=xhr.responseText;var _23e=_23d.indexOf("/*");var _23f=_23d.lastIndexOf("*/");if(_23e==-1||_23f==-1){throw new Error("JSON was not comment filtered");}return _22c.fromJson(_23d.substring(_23e+2,_23f));},javascript:function(xhr){return _22c.eval(xhr.responseText);},xml:function(xhr){var _240=xhr.responseXML;if(_22c.isIE&&(!_240||!_240.documentElement)){var ms=function(n){return "MSXML"+n+".DOMDocument";};var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];_22c.some(dp,function(p){try{var dom=new ActiveXObject(p);dom.async=false;dom.loadXML(xhr.responseText);_240=dom;}catch(e){return false;}return true;});}return _240;},"json-comment-optional":function(xhr){if(xhr.responseText&&/^[^{\[]*\/\*/.test(xhr.responseText)){return _23c["json-comment-filtered"](xhr);}else{return _23c["json"](xhr);}}};dojo._ioSetArgs=function(args,_241,_242,_243){var _244={args:args,url:args.url};var _245=null;if(args.form){var form=_22c.byId(args.form);var _246=form.getAttributeNode("action");_244.url=_244.url||(_246?_246.value:null);_245=_22c.formToObject(form);}var _247=[{}];if(_245){_247.push(_245);}if(args.content){_247.push(args.content);}if(args.preventCache){_247.push({"dojo.preventCache":new Date().valueOf()});}_244.query=_22c.objectToQuery(_22c.mixin.apply(null,_247));_244.handleAs=args.handleAs||"text";var d=new _22c.Deferred(_241);d.addCallbacks(_242,function(_248){return _243(_248,d);});var ld=args.load;if(ld&&_22c.isFunction(ld)){d.addCallback(function(_249){return ld.call(args,_249,_244);});}var err=args.error;if(err&&_22c.isFunction(err)){d.addErrback(function(_24a){return err.call(args,_24a,_244);});}var _24b=args.handle;if(_24b&&_22c.isFunction(_24b)){d.addBoth(function(_24c){return _24b.call(args,_24c,_244);});}if(cfg.ioPublish&&_22c.publish&&_244.args.ioPublish!==false){d.addCallbacks(function(res){_22c.publish("/dojo/io/load",[d,res]);return res;},function(res){_22c.publish("/dojo/io/error",[d,res]);return res;});d.addBoth(function(res){_22c.publish("/dojo/io/done",[d,res]);return res;});}d.ioArgs=_244;return d;};var _24d=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _24e=typeof xhr.abort;if(_24e=="function"||_24e=="object"||_24e=="unknown"){xhr.abort();}var err=dfd.ioArgs.error;if(!err){err=new Error("xhr cancelled");err.dojoType="cancel";}return err;};var _24f=function(dfd){var ret=_23c[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);return ret===undefined?null:ret;};var _250=function(_251,dfd){if(!dfd.ioArgs.args.failOk){console.error(_251);}return _251;};var _252=null;var _253=[];var _254=0;var _255=function(dfd){if(_254<=0){_254=0;if(cfg.ioPublish&&_22c.publish&&(!dfd||dfd&&dfd.ioArgs.args.ioPublish!==false)){_22c.publish("/dojo/io/stop");}}};var _256=function(){var now=(new Date()).getTime();if(!_22c._blockAsync){for(var i=0,tif;i<_253.length&&(tif=_253[i]);i++){var dfd=tif.dfd;var func=function(){if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_253.splice(i--,1);_254-=1;}else{if(tif.ioCheck(dfd)){_253.splice(i--,1);tif.resHandle(dfd);_254-=1;}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_253.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel();_254-=1;}}}}};if(dojo.config.debugAtAllCosts){func.call(this);}else{try{func.call(this);}catch(e){dfd.errback(e);}}}}_255(dfd);if(!_253.length){clearInterval(_252);_252=null;return;}};dojo._ioCancelAll=function(){try{_22c.forEach(_253,function(i){try{i.dfd.cancel();}catch(e){}});}catch(e){}};if(_22c.isIE){_22c.addOnWindowUnload(_22c._ioCancelAll);}_22c._ioNotifyStart=function(dfd){if(cfg.ioPublish&&_22c.publish&&dfd.ioArgs.args.ioPublish!==false){if(!_254){_22c.publish("/dojo/io/start");}_254+=1;_22c.publish("/dojo/io/send",[dfd]);}};_22c._ioWatch=function(dfd,_257,_258,_259){var args=dfd.ioArgs.args;if(args.timeout){dfd.startTime=(new Date()).getTime();}_253.push({dfd:dfd,validCheck:_257,ioCheck:_258,resHandle:_259});if(!_252){_252=setInterval(_256,50);}if(args.sync){_256();}};var _25a="application/x-www-form-urlencoded";var _25b=function(dfd){return dfd.ioArgs.xhr.readyState;};var _25c=function(dfd){return 4==dfd.ioArgs.xhr.readyState;};var _25d=function(dfd){var xhr=dfd.ioArgs.xhr;if(_22c._isDocumentOk(xhr)){dfd.callback(dfd);}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err);}};dojo._ioAddQueryToUrl=function(_25e){if(_25e.query.length){_25e.url+=(_25e.url.indexOf("?")==-1?"?":"&")+_25e.query;_25e.query=null;}};dojo.xhr=function(_25f,args,_260){var dfd=_22c._ioSetArgs(args,_24d,_24f,_250);var _261=dfd.ioArgs;var xhr=_261.xhr=_22c._xhrObj(_261.args);if(!xhr){dfd.cancel();return dfd;}if("postData" in args){_261.query=args.postData;}else{if("putData" in args){_261.query=args.putData;}else{if("rawBody" in args){_261.query=args.rawBody;}else{if((arguments.length>2&&!_260)||"POST|PUT".indexOf(_25f.toUpperCase())==-1){_22c._ioAddQueryToUrl(_261);}}}}xhr.open(_25f,_261.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr];}else{if(args.headers[hdr]){xhr.setRequestHeader(hdr,args.headers[hdr]);}}}}xhr.setRequestHeader("Content-Type",args.contentType||_25a);if(!args.headers||!("X-Requested-With" in args.headers)){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}_22c._ioNotifyStart(dfd);if(dojo.config.debugAtAllCosts){xhr.send(_261.query);}else{try{xhr.send(_261.query);}catch(e){_261.error=e;dfd.cancel();}}_22c._ioWatch(dfd,_25b,_25c,_25d);xhr=null;return dfd;};dojo.xhrGet=function(args){return _22c.xhr("GET",args);};dojo.rawXhrPost=dojo.xhrPost=function(args){return _22c.xhr("POST",args,true);};dojo.rawXhrPut=dojo.xhrPut=function(args){return _22c.xhr("PUT",args,true);};dojo.xhrDelete=function(args){return _22c.xhr("DELETE",args);};})();}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;var _262=d._mixin;dojo._Line=function(_263,end){this.start=_263;this.end=end;};dojo._Line.prototype.getValue=function(n){return ((this.end-this.start)*n)+this.start;};dojo.Animation=function(args){_262(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1]);}};d._Animation=d.Animation;d.extend(dojo.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,_getStep:function(){var _264=this._percent,_265=this.easing;return _265?_265(_264):_264;},_fire:function(evt,args){var a=args||[];if(this[evt]){if(d.config.debugAtAllCosts){this[evt].apply(this,a);}else{try{this[evt].apply(this,a);}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}}}return this;},play:function(_266,_267){var _268=this;if(_268._delayTimer){_268._clearTimer();}if(_267){_268._stopTimer();_268._active=_268._paused=false;_268._percent=0;}else{if(_268._active&&!_268._paused){return _268;}}_268._fire("beforeBegin",[_268.node]);var de=_266||_268.delay,_269=dojo.hitch(_268,"_play",_267);if(de>0){_268._delayTimer=setTimeout(_269,de);return _268;}_269();return _268;},_play:function(_26a){var _26b=this;if(_26b._delayTimer){_26b._clearTimer();}_26b._startTime=new Date().valueOf();if(_26b._paused){_26b._startTime-=_26b.duration*_26b._percent;}_26b._endTime=_26b._startTime+_26b.duration;_26b._active=true;_26b._paused=false;var _26c=_26b.curve.getValue(_26b._getStep());if(!_26b._percent){if(!_26b._startRepeatCount){_26b._startRepeatCount=_26b.repeat;}_26b._fire("onBegin",[_26c]);}_26b._fire("onPlay",[_26c]);_26b._cycle();return _26b;},pause:function(){var _26d=this;if(_26d._delayTimer){_26d._clearTimer();}_26d._stopTimer();if(!_26d._active){return _26d;}_26d._paused=true;_26d._fire("onPause",[_26d.curve.getValue(_26d._getStep())]);return _26d;},gotoPercent:function(_26e,_26f){var _270=this;_270._stopTimer();_270._active=_270._paused=true;_270._percent=_26e;if(_26f){_270.play();}return _270;},stop:function(_271){var _272=this;if(_272._delayTimer){_272._clearTimer();}if(!_272._timer){return _272;}_272._stopTimer();if(_271){_272._percent=1;}_272._fire("onStop",[_272.curve.getValue(_272._getStep())]);_272._active=_272._paused=false;return _272;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _273=this;if(_273._active){var curr=new Date().valueOf();var step=(curr-_273._startTime)/(_273._endTime-_273._startTime);if(step>=1){step=1;}_273._percent=step;if(_273.easing){step=_273.easing(step);}_273._fire("onAnimate",[_273.curve.getValue(step)]);if(_273._percent<1){_273._startTimer();}else{_273._active=false;if(_273.repeat>0){_273.repeat--;_273.play(null,true);}else{if(_273.repeat==-1){_273.play(null,true);}else{if(_273._startRepeatCount){_273.repeat=_273._startRepeatCount;_273._startRepeatCount=0;}}}_273._percent=0;_273._fire("onEnd",[_273.node]);!_273.repeat&&_273._stopTimer();}}return _273;},_clearTimer:function(){clearTimeout(this._delayTimer);delete this._delayTimer;}});var ctr=0,_274=[],_275=null,_276={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(_276,"run",this,"_cycle");ctr++;}if(!_275){_275=setInterval(d.hitch(_276,"run"),this.rate);}},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_275);_275=null;ctr=0;}}});var _277=d.isIE?function(node){var ns=node.style;if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto";}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var _278=_262({properties:{}},args),_279=(_278.properties.opacity={});_279.start=!("start" in _278)?function(){return +d.style(_278.node,"opacity")||0;}:_278.start;_279.end=_278.end;var anim=d.animateProperty(_278);d.connect(anim,"beforeBegin",d.partial(_277,_278.node));return anim;};dojo.fadeIn=function(args){return d._fade(_262({end:1},args));};dojo.fadeOut=function(args){return d._fade(_262({end:0},args));};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _27a=function(_27b){this._properties=_27b;for(var p in _27b){var prop=_27b[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color();}}};_27a.prototype.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p],_27c=prop.start;if(_27c instanceof d.Color){ret[p]=d.blendColors(_27c,prop.end,r,prop.tempColor).toCss();}else{if(!d.isArray(_27c)){ret[p]=((prop.end-_27c)*r)+_27c+(p!="opacity"?prop.units||"px":0);}}}return ret;};dojo.animateProperty=function(args){var n=args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];if(d.isFunction(prop)){prop=prop(n);}prop=pm[p]=_262({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start(n);}if(d.isFunction(prop.end)){prop.end=prop.end(n);}var _27d=(p.toLowerCase().indexOf("color")>=0);function _27e(node,p){var v={height:node.offsetHeight,width:node.offsetWidth}[p];if(v!==undefined){return v;}v=d.style(node,p);return (p=="opacity")?+v:(_27d?v:parseFloat(v));};if(!("end" in prop)){prop.end=_27e(n,p);}else{if(!("start" in prop)){prop.start=_27e(n,p);}}if(_27d){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end);}else{prop.start=(p=="opacity")?+prop.start:parseFloat(prop.start);}}this.curve=new _27a(pm);});d.connect(anim,"onAnimate",d.hitch(d,"style",anim.node));return anim;};dojo.anim=function(node,_27f,_280,_281,_282,_283){return d.animateProperty({node:node,duration:_280||d.Animation.prototype.duration,properties:_27f,easing:_281,onEnd:_282}).play(_283||0);};})();}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");dojo.forEach(dojo.config.require,function(i){dojo["require"](i);});}if(dojo.config.afterOnLoad&&dojo.isBrowser){window.setTimeout(dojo._loadInit,1000);}})();
diff --git a/ricoClient/js/baselibs/ext-core.js b/ricoClient/js/baselibs/ext-core.js
new file mode 100644 (file)
index 0000000..31ecb38
--- /dev/null
@@ -0,0 +1,9 @@
+/*\r
+ * Ext Core Library 3.0\r
+ * http://extjs.com/\r
+ * Copyright(c) 2006-2009, Ext JS, LLC.\r
+ * \r
+ * MIT Licensed - http://extjs.com/license/mit.txt\r
+ * \r
+ */\r
+window.undefined=window.undefined;Ext={version:"3.0"};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var d=0,r=navigator.userAgent.toLowerCase(),w=function(e){return e.test(r)},k=document.compatMode=="CSS1Compat",y=w(/opera/),g=w(/chrome/),s=w(/webkit/),v=!g&&w(/safari/),a=v&&w(/version\/3/),z=v&&w(/version\/4/),q=!y&&w(/msie/),o=q&&w(/msie 7/),n=q&&w(/msie 8/),p=q&&!o&&!n,m=!s&&w(/gecko/),b=m&&w(/rv:1\.9/),t=q&&!k,x=w(/windows|win32/),j=w(/macintosh|mac os x/),h=w(/adobeair/),l=w(/linux/),c=/^https/i.test(window.location.protocol);if(p){try{document.execCommand("BackgroundImageCache",false,true)}catch(u){}}Ext.apply(Ext,{isStrict:k,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,USE_NATIVE_JSON:false,applyIf:function(A,B){if(A){for(var e in B){if(Ext.isEmpty(A[e])){A[e]=B[e]}}}return A},id:function(e,A){return(e=Ext.getDom(e)||{}).id=e.id||(A||"ext-gen")+(++d)},extend:function(){var A=function(C){for(var B in C){this[B]=C[B]}};var e=Object.prototype.constructor;return function(H,D,G){if(Ext.isObject(D)){G=D;D=H;H=G.constructor!=e?G.constructor:function(){D.apply(this,arguments)}}var C=function(){},E,B=D.prototype;C.prototype=B;E=H.prototype=new C();E.constructor=H;H.superclass=B;if(B.constructor==e){B.constructor=D}H.override=function(F){Ext.override(H,F)};E.superclass=E.supr=(function(){return B});E.override=A;Ext.override(H,G);H.extend=function(F){Ext.extend(H,F)};return H}}(),override:function(e,B){if(B){var A=e.prototype;Ext.apply(A,B);if(Ext.isIE&&B.toString!=e.toString){A.toString=B.toString}}},namespace:function(){var A,e;Ext.each(arguments,function(B){e=B.split(".");A=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(C){A=A[C]=A[C]||{}})});return A},urlEncode:function(F,E){var C,A=[],B,D=encodeURIComponent;for(B in F){C=typeof F[B]=="undefined";Ext.each(C?B:F[B],function(G,e){A.push("&",D(B),"=",(G!=B||!C)?D(G):"")})}if(!E){A.shift();E=""}return E+A.join("")},urlDecode:function(B,A){var E={},D=B.split("&"),F=decodeURIComponent,e,C;Ext.each(D,function(G){G=G.split("=");e=F(G[0]);C=F(G[1]);E[e]=A||!E[e]?C:[].concat(E[e]).concat(C)});return E},toArray:function(){return q?function(e,C,A,B){B=[];Ext.each(e,function(D){B.push(D)});return B.slice(C||0,A||B.length)}:function(e,B,A){return Array.prototype.slice.call(e,B||0,A||e.length)}}(),each:function(D,C,B){if(Ext.isEmpty(D,true)){return}if(typeof D.length=="undefined"||Ext.isPrimitive(D)){D=[D]}for(var A=0,e=D.length;A<e;A++){if(C.call(B||D[A],D[A],A,D)===false){return A}}},getDom:function(e){if(!e||!document){return null}return e.dom?e.dom:(typeof e=="string"?document.getElementById(e):e)},getBody:function(){return Ext.get(document.body||document.documentElement)},removeNode:q?function(){var e;return function(A){if(A&&A.tagName!="BODY"){e=e||document.createElement("div");e.appendChild(A);e.innerHTML=""}}}():function(e){if(e&&e.parentNode&&e.tagName!="BODY"){e.parentNode.removeChild(e)}},isEmpty:function(A,e){return A===null||A===undefined||((Ext.isArray(A)&&!A.length))||(!e?A==="":false)},isArray:function(e){return Object.prototype.toString.apply(e)==="[object Array]"},isObject:function(e){return e&&typeof e=="object"},isPrimitive:function(e){var A=typeof e;return A=="string"||A=="number"||A=="boolean"},isFunction:function(e){return typeof e=="function"},isOpera:y,isWebKit:s,isChrome:g,isSafari:v,isSafari3:a,isSafari4:z,isSafari2:v&&!(a||z),isIE:q,isIE6:p,isIE7:o,isIE8:n,isGecko:m,isGecko2:m&&!b,isGecko3:b,isBorderBox:t,isLinux:l,isWindows:x,isMac:j,isAir:h});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.lib","Ext.data");Ext.apply(Function.prototype,{createInterceptor:function(b,a){var c=this;return !Ext.isFunction(b)?this:function(){var e=this,d=arguments;b.target=e;b.method=c;return(b.apply(a||e||window,d)!==false)?c.apply(e||window,d):null}},createCallback:function(){var a=arguments,b=this;return function(){return b.apply(window,a)}},createDelegate:function(c,b,a){var d=this;return function(){var g=b||arguments;if(a===true){g=Array.prototype.slice.call(arguments,0);g=g.concat(b)}else{if(typeof a=="number"){g=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(g,e)}}return d.apply(c||window,g)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c>0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}});Ext.util.TaskRunner=function(e){e=e||10;var g=[],a=[],b=0,h=false,d=function(){h=false;clearInterval(b);b=0},j=function(){if(!h){h=true;b=setInterval(k,e)}},c=function(l){a.push(l);if(l.onStop){l.onStop.apply(l.scope||l)}},k=function(){var n=a.length,p=new Date().getTime();if(n>0){for(var r=0;r<n;r++){g.remove(a[r])}a=[];if(g.length<1){d();return}}for(var r=0,q,m,o,l=g.length;r<l;++r){q=g[r];m=p-q.taskRunTime;if(q.interval<=m){o=q.run.apply(q.scope||q,q.args||[++q.taskRunCount]);q.taskRunTime=p;if(o===false||q.taskRunCount===q.repeat){c(q);return}}if(q.duration&&q.duration<=(p-q.taskStartTime)){c(q)}}};this.start=function(l){g.push(l);l.taskStartTime=new Date().getTime();l.taskRunTime=0;l.taskRunCount=0;j();return l};this.stop=function(l){c(l);return l};this.stopAll=function(){d();for(var m=0,l=g.length;m<l;m++){if(g[m].onStop){g[m].onStop()}}g=[];a=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();(function(){var b;function c(d){if(!b){b=new Ext.Element.Flyweight()}b.dom=d;return b}(function(){var g=document,d=g.compatMode=="CSS1Compat",e=Math.max,h=parseInt;Ext.lib.Dom={isAncestor:function(k,l){var j=false;k=Ext.getDom(k);l=Ext.getDom(l);if(k&&l){if(k.contains){return k.contains(l)}else{if(k.compareDocumentPosition){return !!(k.compareDocumentPosition(l)&16)}else{while(l=l.parentNode){j=l==k||j}}}}return j},getViewWidth:function(j){return j?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(j){return j?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){return e(!d?g.body.scrollHeight:g.documentElement.scrollHeight,this.getViewportHeight())},getDocumentWidth:function(){return e(!d?g.body.scrollWidth:g.documentElement.scrollWidth,this.getViewportWidth())},getViewportHeight:function(){return Ext.isIE?(Ext.isStrict?g.documentElement.clientHeight:g.body.clientHeight):self.innerHeight},getViewportWidth:function(){return !Ext.isStrict&&!Ext.isOpera?g.body.clientWidth:Ext.isIE?g.documentElement.clientWidth:self.innerWidth},getY:function(j){return this.getXY(j)[1]},getX:function(j){return this.getXY(j)[0]},getXY:function(l){var k,r,t,w,m,n,v=0,s=0,u,j,o=(g.body||g.documentElement),q=[0,0];l=Ext.getDom(l);if(l!=o){if(l.getBoundingClientRect){t=l.getBoundingClientRect();u=c(document).getScroll();q=[t.left+u.left,t.top+u.top]}else{k=l;j=c(l).isStyle("position","absolute");while(k){r=c(k);v+=k.offsetLeft;s+=k.offsetTop;j=j||r.isStyle("position","absolute");if(Ext.isGecko){s+=w=h(r.getStyle("borderTopWidth"),10)||0;v+=m=h(r.getStyle("borderLeftWidth"),10)||0;if(k!=l&&!r.isStyle("overflow","visible")){v+=m;s+=w}}k=k.offsetParent}if(Ext.isSafari&&j){v-=o.offsetLeft;s-=o.offsetTop}if(Ext.isGecko&&!j){n=c(o);v+=h(n.getStyle("borderLeftWidth"),10)||0;s+=h(n.getStyle("borderTopWidth"),10)||0}k=l.parentNode;while(k&&k!=o){if(!Ext.isOpera||(k.tagName!="TR"&&!c(k).isStyle("display","inline"))){v-=k.scrollLeft;s-=k.scrollTop}k=k.parentNode}q=[v,s]}}return q},setXY:function(k,l){(k=Ext.fly(k,"_setXY")).position();var m=k.translatePoints(l),j=k.dom.style,n;for(n in m){if(!isNaN(m[n])){j[n]=m[n]+"px"}}},setX:function(k,j){this.setXY(k,[j,false])},setY:function(j,k){this.setXY(j,[false,k])}}})();Ext.lib.Event=function(){var x=false,v=[],g=[],B=0,r=[],d,E=false,l=window,H=document,m=200,t=20,C=0,s=1,j=2,n=3,u=3,y=4,e=function(){var I;if(l.addEventListener){I=function(M,K,L,J){if(K=="mouseenter"){L=L.createInterceptor(p);M.addEventListener("mouseover",L,(J))}else{if(K=="mouseleave"){L=L.createInterceptor(p);M.addEventListener("mouseout",L,(J))}else{M.addEventListener(K,L,(J))}}return L}}else{if(l.attachEvent){I=function(M,K,L,J){M.attachEvent("on"+K,L);return L}}else{I=function(){}}}return I}(),h=function(){var I;if(l.removeEventListener){I=function(M,K,L,J){if(K=="mouseenter"){K="mouseover"}else{if(K=="mouseleave"){K="mouseout"}}M.removeEventListener(K,L,(J))}}else{if(l.detachEvent){I=function(L,J,K){L.detachEvent("on"+J,K)}}else{I=function(){}}}return I}();var D=Ext.isGecko?function(I){return Object.prototype.toString.call(I)=="[object XULElement]"}:function(){};var q=Ext.isGecko?function(I){try{return I.nodeType==3}catch(J){return false}}:function(I){return I.nodeType==3};function p(J){var I=z.getRelatedTarget(J);return !(D(I)||w(J.currentTarget,I))}function w(I,K){if(I&&I.firstChild){while(K){if(K===I){return true}try{K=K.parentNode}catch(J){return false}if(K&&(K.nodeType!=1)){K=null}}}return false}function A(L,I,K){var J=-1;Ext.each(v,function(M,N){if(M&&M[j]==K&&M[C]==L&&M[s]==I){J=N}});return J}function F(){var I=false,L=[],J,K=!x||(B>0);if(!E){E=true;Ext.each(r,function(N,O,M){if(N&&(J=H.getElementById(N.id))){if(!N.checkReady||x||J.nextSibling||(H&&H.body)){J=N.override?(N.override===true?N.obj:N.override):J;N.fn.call(J,N.obj);r[O]=null}else{L.push(item)}}});B=(L.length==0)?0:B-1;if(K){o()}else{clearInterval(d);d=null}I=!(E=false)}return I}function o(){if(!d){var I=function(){F()};d=setInterval(I,t)}}function G(){var I=Ext.fly(H).getScroll();return[I.top,I.top]}function k(I,J){I=I.browserEvent||I;var K=I["page"+J];if(!K&&0!=K){K=I["client"+J]||0;if(Ext.isIE){K+=G()[J=="X"?0:1]}}return K}var z={onAvailable:function(K,I,L,J){r.push({id:K,fn:I,obj:L,override:J,checkReady:false});B=m;o()},addListener:function(L,I,K){var J;L=Ext.getDom(L);if(L&&K){if("unload"==I){J=!!(g[g.length]=[L,I,K])}else{v.push([L,I,K,J=e(L,I,K,false)])}}return !!J},removeListener:function(N,J,M){var L=false,K,I;N=Ext.getDom(N);if(!M){L=this.purgeElement(N,false,J)}else{if("unload"==J){Ext.each(g,function(P,Q,O){if(P&&P[0]==N&&P[1]==J&&P[2]==M){g.splice(Q,1);L=true}})}else{K=arguments[3]||A(N,J,M);I=v[K];if(N&&I){h(N,J,I[n],false);I[n]=I[j]=null;v.splice(K,1);L=true}}}return L},getTarget:function(I){I=I.browserEvent||I;return this.resolveTextNode(I.target||I.srcElement)},resolveTextNode:function(I){return I&&!D(I)&&q(I)?I.parentNode:I},getRelatedTarget:function(I){I=I.browserEvent||I;return this.resolveTextNode(I.relatedTarget||(I.type=="mouseout"?I.toElement:I.type=="mouseover"?I.fromElement:null))},getPageX:function(I){return k(I,"X")},getPageY:function(I){return k(I,"Y")},getXY:function(I){return[this.getPageX(I),this.getPageY(I)]},stopEvent:function(I){this.stopPropagation(I);this.preventDefault(I)},stopPropagation:function(I){I=I.browserEvent||I;if(I.stopPropagation){I.stopPropagation()}else{I.cancelBubble=true}},preventDefault:function(I){I=I.browserEvent||I;if(I.preventDefault){I.preventDefault()}else{I.returnValue=false}},getEvent:function(I){I=I||l.event;if(!I){var J=this.getEvent.caller;while(J){I=J.arguments[0];if(I&&Event==I.constructor){break}J=J.caller}}return I},getCharCode:function(I){I=I.browserEvent||I;return I.charCode||I.keyCode||0},_load:function(J){x=true;var I=Ext.lib.Event;if(Ext.isIE&&J!==true){h(l,"load",arguments.callee)}},purgeElement:function(J,L,I){var K=this;Ext.each(K.getListeners(J,I),function(M){if(M){K.removeListener(J,M.type,M.fn)}});if(L&&J&&J.childNodes){Ext.each(J.childNodes,function(M){K.purgeElement(M,L,I)})}},getListeners:function(L,J){var M=this,K=[],I;if(J){I=J=="unload"?g:v}else{I=v.concat(g)}Ext.each(I,function(N,O){if(N&&N[C]==L&&(!J||J==N[s])){K.push({type:N[s],fn:N[j],obj:N[u],adjust:N[y],index:O})}});return K.length?K:null},_unload:function(P){var O=Ext.lib.Event,M,L,J,I,K,N;Ext.each(g,function(Q){if(Q){try{N=Q[y]?(Q[y]===true?Q[u]:Q[y]):l;Q[j].call(N,O.getEvent(R),Q[u])}catch(R){}}});g=null;if(v&&(L=v.length)){while(L){if(J=v[K=--L]){O.removeListener(J[C],J[s],J[j],K)}}}h(l,"unload",O._unload)}};z.on=z.addListener;z.un=z.removeListener;if(H&&H.body){z._load(true)}else{e(l,"load",z._load)}e(l,"unload",z._unload);F();return z}();Ext.lib.Ajax=function(){var g=["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];function h(t){var s=t.conn,u;function r(v,w){for(u in w){if(w.hasOwnProperty(u)){v.setRequestHeader(u,w[u])}}}if(l.defaultHeaders){r(s,l.defaultHeaders)}if(l.headers){r(s,l.headers);l.headers=null}}function d(u,t,s,r){return{tId:u,status:s?-1:0,statusText:s?"transaction aborted":"communication failure",isAbort:true,isTimeout:true,argument:t}}function k(r,s){(l.headers=l.headers||{})[r]=s}function p(w,u){var r={},s,t=w.conn;try{s=w.conn.getAllResponseHeaders();Ext.each(s.split("\n"),function(x){var y=x.indexOf(":");r[x.substr(0,y)]=x.substr(y+1)})}catch(v){}return{tId:w.tId,status:t.status,statusText:t.statusText,getResponseHeader:function(x){return r[x]},getAllResponseHeaders:function(){return s},responseText:t.responseText,responseXML:t.responseXML,argument:u}}function o(r){r.conn=null;r=null}function e(w,x,s,r){if(!x){o(w);return}var u,t;try{if(w.conn.status!==undefined&&w.conn.status!=0){u=w.conn.status}else{u=13030}}catch(v){u=13030}if((u>=200&&u<300)||(Ext.isIE&&u==1223)){t=p(w,x.argument);if(x.success){if(!x.scope){x.success(t)}else{x.success.apply(x.scope,[t])}}}else{switch(u){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:t=d(w.tId,x.argument,(s?s:false),r);if(x.failure){if(!x.scope){x.failure(t)}else{x.failure.apply(x.scope,[t])}}break;default:t=p(w,x.argument);if(x.failure){if(!x.scope){x.failure(t)}else{x.failure.apply(x.scope,[t])}}}}o(w);t=null}function n(t,w){w=w||{};var r=t.conn,v=t.tId,s=l.poll,u=w.timeout||null;if(u){l.timeout[v]=setTimeout(function(){l.abort(t,w,true)},u)}s[v]=setInterval(function(){if(r&&r.readyState==4){clearInterval(s[v]);s[v]=null;if(u){clearTimeout(l.timeout[v]);l.timeout[v]=null}e(t,w)}},l.pollInterval)}function j(v,s,u,r){var t=m()||null;if(t){t.conn.open(v,s,true);if(l.useDefaultXhrHeader){k("X-Requested-With",l.defaultXhrHeader)}if(r&&l.useDefaultHeader&&(!l.headers||!l.headers["Content-Type"])){k("Content-Type",l.defaultPostHeader)}if(l.defaultHeaders||l.headers){h(t)}n(t,u);t.conn.send(r||null)}return t}function m(){var s;try{if(s=q(l.transactionId)){l.transactionId++}}catch(r){}finally{return s}}function q(u){var r;try{r=new XMLHttpRequest()}catch(t){for(var s=0;s<g.length;++s){try{r=new ActiveXObject(g[s]);break}catch(t){}}}finally{return{conn:r,tId:u}}}var l={request:function(y,w,r,x,s){if(s){var v=this,u=s.xmlData,t=s.jsonData;Ext.applyIf(v,s);if(u||t){k("Content-Type",u?"text/xml":"application/json");x=u||(Ext.isObject(t)?Ext.encode(t):t)}}return j(y||s.method||"POST",w,r,x)},serializeForm:function(s){var t=s.elements||(document.forms[s]||Ext.getDom(s)).elements,z=false,y=encodeURIComponent,w,A,r,u,v="",x;Ext.each(t,function(B){r=B.name;x=B.type;if(!B.disabled&&r){if(/select-(one|multiple)/i.test(x)){Ext.each(B.options,function(C){if(C.selected){v+=String.format("{0}={1}&",y(r),(C.hasAttribute?C.hasAttribute("value"):C.getAttribute("value")!==null)?C.value:C.text)}})}else{if(!/file|undefined|reset|button/i.test(x)){if(!(/radio|checkbox/i.test(x)&&!B.checked)&&!(x=="submit"&&z)){v+=y(r)+"="+y(B.value)+"&";z=/submit/i.test(x)}}}}});return v.substr(0,v.length-1)},useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",poll:{},timeout:{},pollInterval:50,transactionId:0,abort:function(u,w,r){var t=this,v=u.tId,s=false;if(t.isCallInProgress(u)){u.conn.abort();clearInterval(t.poll[v]);t.poll[v]=null;if(r){t.timeout[v]=null}e(u,w,(s=true),r)}return s},isCallInProgress:function(r){return r.conn&&!{0:true,4:true}[r.conn.readyState]}};return l}();(function(){var h=Ext.lib,k=/width|height|opacity|padding/i,g=/^((width|height)|(top|left))$/,d=/width|height|top$|bottom$|left$|right$/i,j=/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,l=function(m){return typeof m!=="undefined"},e=function(){return new Date()};h.Anim={motion:function(p,n,q,r,m,o){return this.run(p,n,q,r,m,o,Ext.lib.Motion)},run:function(q,n,s,t,m,p,o){o=o||Ext.lib.AnimBase;if(typeof t=="string"){t=Ext.lib.Easing[t]}var r=new o(q,n,s,t);r.animateX(function(){if(Ext.isFunction(m)){m.call(p)}});return r}};h.AnimBase=function(n,m,o,p){if(n){this.init(n,m,o,p)}};h.AnimBase.prototype={doMethod:function(m,p,n){var o=this;return o.method(o.curFrame,p,n-p,o.totalFrames)},setAttr:function(m,o,n){if(k.test(m)&&o<0){o=0}Ext.fly(this.el,"_anim").setStyle(m,o+n)},getAttr:function(m){var o=Ext.fly(this.el),p=o.getStyle(m),n=g.exec(m)||[];if(p!=="auto"&&!j.test(p)){return parseFloat(p)}return(!!(n[2])||(o.getStyle("position")=="absolute"&&!!(n[3])))?o.dom["offset"+n[0].charAt(0).toUpperCase()+n[0].substr(1)]:0},getDefaultUnit:function(m){return d.test(m)?"px":""},animateX:function(p,m){var n=this,o=function(){n.onComplete.removeListener(o);if(Ext.isFunction(p)){p.call(m||n,n)}};n.onComplete.addListener(o,n);n.animate()},setRunAttr:function(p){var r=this,s=this.attributes[p],t=s.to,q=s.by,u=s.from,v=s.unit,n=(this.runAttrs[p]={}),o;if(!l(t)&&!l(q)){return false}var m=l(u)?u:r.getAttr(p);if(l(t)){o=t}else{if(l(q)){if(Ext.isArray(m)){o=[];Ext.each(m,function(w,x){o[x]=w+q[x]})}else{o=m+q}}}Ext.apply(n,{start:m,end:o,unit:l(v)?v:r.getDefaultUnit(p)})},init:function(n,r,q,m){var t=this,p=0,u=h.AnimMgr;Ext.apply(t,{isAnimated:false,startTime:null,el:Ext.getDom(n),attributes:r||{},duration:q||1,method:m||h.Easing.easeNone,useSec:true,curFrame:0,totalFrames:u.fps,runAttrs:{},animate:function(){var w=this,x=w.duration;if(w.isAnimated){return false}w.curFrame=0;w.totalFrames=w.useSec?Math.ceil(u.fps*x):x;u.registerElement(w)},stop:function(w){var x=this;if(w){x.curFrame=x.totalFrames;x._onTween.fire()}u.stop(x)}});var v=function(){var x=this,w;x.onStart.fire();x.runAttrs={};for(w in this.attributes){this.setRunAttr(w)}x.isAnimated=true;x.startTime=e();p=0};var s=function(){var x=this;x.onTween.fire({duration:e()-x.startTime,curFrame:x.curFrame});var y=x.runAttrs;for(var w in y){this.setAttr(w,x.doMethod(w,y[w].start,y[w].end),y[w].unit)}++p};var o=function(){var w=this,y=(e()-w.startTime)/1000,x={duration:y,frames:p,fps:p/y};w.isAnimated=false;p=0;w.onComplete.fire(x)};t.onStart=new Ext.util.Event(t);t.onTween=new Ext.util.Event(t);t.onComplete=new Ext.util.Event(t);(t._onStart=new Ext.util.Event(t)).addListener(v);(t._onTween=new Ext.util.Event(t)).addListener(s);(t._onComplete=new Ext.util.Event(t)).addListener(o)}};Ext.lib.AnimMgr=new function(){var q=this,o=null,n=[],m=0;Ext.apply(q,{fps:1000,delay:1,registerElement:function(s){n.push(s);++m;s._onStart.fire();q.start()},unRegister:function(t,s){t._onComplete.fire();s=s||r(t);if(s!=-1){n.splice(s,1)}if(--m<=0){q.stop()}},start:function(){if(o===null){o=setInterval(q.run,q.delay)}},stop:function(u){if(!u){clearInterval(o);for(var t=0,s=n.length;t<s;++t){if(n[0].isAnimated){q.unRegister(n[0],0)}}n=[];o=null;m=0}else{q.unRegister(u)}},run:function(){var s;Ext.each(n,function(t){if(t&&t.isAnimated){s=t.totalFrames;if(t.curFrame<s||s===null){++t.curFrame;if(t.useSec){p(t)}t._onTween.fire()}else{q.stop(t)}}},q)}});var r=function(t){var s=-1;Ext.each(n,function(v,u){if(v==t){s=u;return false}});return s};var p=function(t){var x=t.totalFrames,w=t.curFrame,v=t.duration,u=(w*v*1000/x),s=(e()-t.startTime),y=0;if(s<v*1000){y=Math.round((s/u-1)*w)}else{y=x-(w+1)}if(y>0&&isFinite(y)){if(t.curFrame+y>=x){y=x-(w+1)}t.curFrame+=y}}};h.Bezier=new function(){this.getPosition=function(r,q){var u=r.length,p=[],s=1-q,o,m;for(o=0;o<u;++o){p[o]=[r[o][0],r[o][1]]}for(m=1;m<u;++m){for(o=0;o<u-m;++o){p[o][0]=s*p[o][0]+q*p[parseInt(o+1,10)][0];p[o][1]=s*p[o][1]+q*p[parseInt(o+1,10)][1]}}return[p[0][0],p[0][1]]}};h.Easing={easeNone:function(n,m,p,o){return p*n/o+m},easeIn:function(n,m,p,o){return p*(n/=o)*n+m},easeOut:function(n,m,p,o){return -p*(n/=o)*(n-2)+m}};(function(){h.Motion=function(r,q,s,t){if(r){h.Motion.superclass.constructor.call(this,r,q,s,t)}};Ext.extend(h.Motion,Ext.lib.AnimBase);var p=h.Motion.superclass,o=h.Motion.prototype,n=/^points$/i;Ext.apply(h.Motion.prototype,{setAttr:function(q,u,t){var s=this,r=p.setAttr;if(n.test(q)){t=t||"px";r.call(s,"left",u[0],t);r.call(s,"top",u[1],t)}else{r.call(s,q,u,t)}},getAttr:function(q){var s=this,r=p.getAttr;return n.test(q)?[r.call(s,"left"),r.call(s,"top")]:r.call(s,q)},doMethod:function(q,t,r){var s=this;return n.test(q)?h.Bezier.getPosition(s.runAttrs[q],s.method(s.curFrame,0,100,s.totalFrames)/100):p.doMethod.call(s,q,t,r)},setRunAttr:function(x){if(n.test(x)){var z=this,s=this.el,C=this.attributes.points,v=C.control||[],A=C.from,B=C.to,y=C.by,D=h.Dom,r,u,t,w,q;if(v.length>0&&!Ext.isArray(v[0])){v=[v]}else{}Ext.fly(s,"_anim").position();D.setXY(s,l(A)?A:D.getXY(s));r=z.getAttr("points");if(l(B)){t=m.call(z,B,r);for(u=0,w=v.length;u<w;++u){v[u]=m.call(z,v[u],r)}}else{if(l(y)){t=[r[0]+y[0],r[1]+y[1]];for(u=0,w=v.length;u<w;++u){v[u]=[r[0]+v[u][0],r[1]+v[u][1]]}}}q=this.runAttrs[x]=[r];if(v.length>0){q=q.concat(v)}q[q.length]=t}else{p.setRunAttr.call(this,x)}}});var m=function(q,s){var r=h.Dom.getXY(this.el);return[q[0]-r[0]+s[0],q[1]-r[1]+s[1]]}})()})();(function(){var d=Math.abs,k=Math.PI,j=Math.asin,h=Math.pow,e=Math.sin,g=Ext.lib;Ext.apply(g.Easing,{easeBoth:function(m,l,o,n){return((m/=n/2)<1)?o/2*m*m+l:-o/2*((--m)*(m-2)-1)+l},easeInStrong:function(m,l,o,n){return o*(m/=n)*m*m*m+l},easeOutStrong:function(m,l,o,n){return -o*((m=m/n-1)*m*m*m-1)+l},easeBothStrong:function(m,l,o,n){return((m/=n/2)<1)?o/2*m*m*m*m+l:-o/2*((m-=2)*m*m*m-2)+l},elasticIn:function(n,l,u,r,m,q){if(n==0||(n/=r)==1){return n==0?l:l+u}q=q||(r*0.3);var o;if(m>=d(u)){o=q/(2*k)*j(u/m)}else{m=u;o=q/4}return -(m*h(2,10*(n-=1))*e((n*r-o)*(2*k)/q))+l},elasticOut:function(n,l,u,r,m,q){if(n==0||(n/=r)==1){return n==0?l:l+u}q=q||(r*0.3);var o;if(m>=d(u)){o=q/(2*k)*j(u/m)}else{m=u;o=q/4}return m*h(2,-10*n)*e((n*r-o)*(2*k)/q)+u+l},elasticBoth:function(n,l,u,r,m,q){if(n==0||(n/=r/2)==2){return n==0?l:l+u}q=q||(r*(0.3*1.5));var o;if(m>=d(u)){o=q/(2*k)*j(u/m)}else{m=u;o=q/4}return n<1?-0.5*(m*h(2,10*(n-=1))*e((n*r-o)*(2*k)/q))+l:m*h(2,-10*(n-=1))*e((n*r-o)*(2*k)/q)*0.5+u+l},backIn:function(m,l,p,o,n){n=n||1.70158;return p*(m/=o)*m*((n+1)*m-n)+l},backOut:function(m,l,p,o,n){if(!n){n=1.70158}return p*((m=m/o-1)*m*((n+1)*m+n)+1)+l},backBoth:function(m,l,p,o,n){n=n||1.70158;return((m/=o/2)<1)?p/2*(m*m*(((n*=(1.525))+1)*m-n))+l:p/2*((m-=2)*m*(((n*=(1.525))+1)*m+n)+2)+l},bounceIn:function(m,l,o,n){return o-g.Easing.bounceOut(n-m,0,o,n)+l},bounceOut:function(m,l,o,n){if((m/=n)<(1/2.75)){return o*(7.5625*m*m)+l}else{if(m<(2/2.75)){return o*(7.5625*(m-=(1.5/2.75))*m+0.75)+l}else{if(m<(2.5/2.75)){return o*(7.5625*(m-=(2.25/2.75))*m+0.9375)+l}}}return o*(7.5625*(m-=(2.625/2.75))*m+0.984375)+l},bounceBoth:function(m,l,o,n){return(m<n/2)?g.Easing.bounceIn(m*2,0,o,n)*0.5+l:g.Easing.bounceOut(m*2-n,0,o,n)*0.5+o*0.5+l}})})();(function(){var j=Ext.lib;j.Anim.color=function(r,p,s,t,o,q){return j.Anim.run(r,p,s,t,o,q,j.ColorAnim)};j.ColorAnim=function(p,o,q,r){j.ColorAnim.superclass.constructor.call(this,p,o,q,r)};Ext.extend(j.ColorAnim,j.AnimBase);var l=j.ColorAnim.superclass,k=/color$/i,g=/^transparent|rgba\(0, 0, 0, 0\)$/,n=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,d=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,e=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,h=function(o){return typeof o!=="undefined"};function m(p){var r=parseInt,q,o=null,t;if(p.length==3){return p}Ext.each([d,n,e],function(u,s){q=(s%2==0)?16:10;t=u.exec(p);if(t&&t.length==4){o=[r(t[1],q),r(t[2],q),r(t[3],q)];return false}});return o}Ext.apply(j.ColorAnim.prototype,{getAttr:function(o){var q=this,p=q.el,r;if(k.test(o)){while(p&&g.test(r=Ext.fly(p).getStyle(o))){p=p.parentNode;r="fff"}}else{r=l.getAttr.call(q,o)}return r},doMethod:function(o,t,p){var r=this,s,q=Math.floor;if(k.test(o)){s=[];Ext.each(t,function(u,w){s[w]=l.doMethod.call(r,o,u,p[w])});s="rgb("+q(s[0])+","+q(s[1])+","+q(s[2])+")"}else{s=l.doMethod.call(r,o,t,p)}return s},setRunAttr:function(o){var r=this,q=r.attributes[o],v=q.to,s=q.by,t;l.setRunAttr.call(r,o);t=r.runAttrs[o];if(k.test(o)){var u=m(t.start),p=m(t.end);if(!h(v)&&h(s)){p=m(s);Ext.each(u,function(x,w){p[i]=x+p[i]})}t.start=u;t.end=p}}})})();(function(){var d=Ext.lib;d.Anim.scroll=function(l,j,m,n,h,k){return d.Anim.run(l,j,m,n,h,k,d.Scroll)};d.Scroll=function(j,h,k,l){if(j){d.Scroll.superclass.constructor.call(this,j,h,k,l)}};Ext.extend(d.Scroll,d.ColorAnim);var g=d.Scroll.superclass,e="scroll";Ext.apply(d.Scroll.prototype,{doMethod:function(h,o,j){var m,l=this,n=l.curFrame,k=l.totalFrames;if(h==e){m=[l.method(n,o[0],j[0]-o[0],k),l.method(n,o[1],j[1]-o[1],k)]}else{m=g.doMethod.call(l,h,o,j)}return m},getAttr:function(h){var j=this;if(h==e){return[j.el.scrollLeft,j.el.scrollTop]}else{return g.getAttr.call(j,h)}},setAttr:function(h,l,k){var j=this;if(h==e){j.el.scrollLeft=l[0];j.el.scrollTop=l[1]}else{g.setAttr.call(j,h,l,k)}}})})();if(Ext.isIE){function a(){var d=Function.prototype;delete d.createSequence;delete d.defer;delete d.createDelegate;delete d.createCallback;delete d.createInterceptor;window.detachEvent("onunload",a)}window.attachEvent("onunload",a)}})();(function(){var j=Ext.util,m=Ext.toArray,l=Ext.each,a=Ext.isObject,h=true,k=false;j.Observable=function(){var n=this,o=n.events;if(n.listeners){n.on(n.listeners);delete n.listeners}n.events=o||{}};j.Observable.prototype=function(){var o=/^(?:scope|delay|buffer|single)$/,n=function(p){return p.toLowerCase()};return{fireEvent:function(){var p=m(arguments),s=n(p[0]),t=this,r=h,v=t.events[s],u,w;if(t.eventsSuspended===h){if(u=t.suspendedEventsQueue){u.push(p)}}else{if(a(v)&&v.bubble){if(v.fire.apply(v,p.slice(1))===k){return k}w=t.getBubbleTarget&&t.getBubbleTarget();if(w&&w.enableBubble){w.enableBubble(s);return w.fireEvent.apply(w,p)}}else{if(a(v)){p.shift();r=v.fire.apply(v,p)}}}return r},addListener:function(r,u,w,q){var t=this,s,x,v,p;if(a(r)){q=r;for(s in q){x=q[s];if(!o.test(s)){t.addListener(s,x.fn||x,x.scope||q.scope,x.fn?x:q)}}}else{r=n(r);p=t.events[r]||h;if(typeof p=="boolean"){t.events[r]=p=new j.Event(t,r)}p.addListener(u,w,a(q)?q:{})}},removeListener:function(p,r,q){var s=this.events[n(p)];if(a(s)){s.removeListener(r,q)}},purgeListeners:function(){var r=this.events,p,q;for(q in r){p=r[q];if(a(p)){p.clearListeners()}}},addEvents:function(q){var p=this;p.events=p.events||{};if(typeof q=="string"){l(arguments,function(r){p.events[r]=p.events[r]||h})}else{Ext.applyIf(p.events,q)}},hasListener:function(p){var q=this.events[p];return a(q)&&q.listeners.length>0},suspendEvents:function(p){this.eventsSuspended=h;if(p){this.suspendedEventsQueue=[]}},resumeEvents:function(){var p=this;p.eventsSuspended=!delete p.suspendedEventQueue;l(p.suspendedEventsQueue,function(q){p.fireEvent.apply(p,q)})}}}();var e=j.Observable.prototype;e.on=e.addListener;e.un=e.removeListener;j.Observable.releaseCapture=function(n){n.fireEvent=e.fireEvent};function g(p,q,n){return function(){if(q.target==arguments[0]){p.apply(n,m(arguments))}}}function c(q,r,p){var n=new j.DelayedTask();return function(){n.delay(r.buffer,q,p,m(arguments))}}function d(p,q,o,n){return function(){q.removeListener(o,n);return p.apply(n,arguments)}}function b(p,q,n){return function(){var o=m(arguments);(function(){p.apply(n,o)}).defer(q.delay||10)}}j.Event=function(o,n){this.name=n;this.obj=o;this.listeners=[]};j.Event.prototype={addListener:function(q,p,o){var r=this,n;p=p||r.obj;if(!r.isListening(q,p)){n=r.createListener(q,p,o);if(r.firing){r.listeners=r.listeners.slice(0)}r.listeners.push(n)}},createListener:function(r,q,s){s=s||{},q=q||this.obj;var n={fn:r,scope:q,options:s},p=r;if(s.target){p=g(p,s,q)}if(s.delay){p=b(p,s,q)}if(s.single){p=d(p,this,r,q)}if(s.buffer){p=c(p,s,q)}n.fireFn=p;return n},findListener:function(q,p){var o,n=-1;l(this.listeners,function(r,s){o=r.scope;if(r.fn==q&&(o==p||o==this.obj)){n=s;return k}},this);return n},isListening:function(o,n){return this.findListener(o,n)!=-1},removeListener:function(q,p){var o,r=this,n=k;if((o=r.findListener(q,p))!=-1){if(r.firing){r.listeners=r.listeners.slice(0)}r.listeners.splice(o,1);n=h}return n},clearListeners:function(){this.listeners=[]},fire:function(){var p=this,o=m(arguments),n=h;l(p.listeners,function(q){p.firing=h;if(q.fireFn.apply(q.scope||p.obj||window,o)===k){return n=p.firing=k}});p.firing=k;return n}}})();Ext.DomHelper=function(){var t=null,k=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,m=/^table|tbody|tr|td$/i,q,n="afterbegin",o="afterend",c="beforebegin",p="beforeend",a="<table>",h="</table>",b=a+"<tbody>",j="</tbody>"+h,l=b+"<tr>",s="</tr>"+j;function g(x,z,y,A,w,u){var v=q.insertHtml(A,Ext.getDom(x),r(z));return y?Ext.get(v,true):v}function r(z){var w="",v,y,x,u,A;if(typeof z=="string"){w=z}else{if(Ext.isArray(z)){Ext.each(z,function(B){w+=r(B)})}else{w+="<"+(z.tag=z.tag||"div");for(v in z){y=z[v];if(!/tag|children|cn|html$/i.test(v)&&!Ext.isFunction(y)){if(Ext.isObject(y)){w+=" "+v+"='";for(x in y){u=y[x];w+=!Ext.isFunction(u)?x+":"+u+";":""}w+="'"}else{w+=" "+({cls:"class",htmlFor:"for"}[v]||v)+"='"+y+"'"}}}if(k.test(z.tag)){w+="/>"}else{w+=">";if(A=z.children||z.cn){w+=r(A)}else{if(z.html){w+=z.html}}w+="</"+z.tag+">"}}}return w}function e(z,x,w,y){t.innerHTML=[x,w,y].join("");var u=-1,v=t;while(++u<z){v=v.firstChild}return v}function d(u,v,x,w){var y,z;t=t||document.createElement("div");if(u=="td"&&(v==n||v==p)||!/td|tr|tbody/i.test(u)&&(v==c||v==o)){return}z=v==c?x:v==o?x.nextSibling:v==n?x.firstChild:null;if(v==c||v==o){x=x.parentNode}if(u=="td"||(u=="tr"&&(v==p||v==n))){y=e(4,l,w,s)}else{if((u=="tbody"&&(v==p||v==n))||(u=="tr"&&(v==c||v==o))){y=e(3,b,w,j)}else{y=e(2,a,w,h)}}x.insertBefore(y,z);return y}q={markup:function(u){return r(u)},insertHtml:function(z,u,A){var y={},w,C,B,D,x,v;z=z.toLowerCase();y[c]=["BeforeBegin","previousSibling"];y[o]=["AfterEnd","nextSibling"];if(u.insertAdjacentHTML){if(m.test(u.tagName)&&(v=d(u.tagName.toLowerCase(),z,u,A))){return v}y[n]=["AfterBegin","firstChild"];y[p]=["BeforeEnd","lastChild"];if(w=y[z]){u.insertAdjacentHTML(w[0],A);return u[w[1]]}}else{B=u.ownerDocument.createRange();C="setStart"+(/end/i.test(z)?"After":"Before");if(y[z]){B[C](u);D=B.createContextualFragment(A);u.parentNode.insertBefore(D,z==c?u:u.nextSibling);return u[(z==c?"previous":"next")+"Sibling"]}else{x=(z==n?"first":"last")+"Child";if(u.firstChild){B[C](u[x]);D=B.createContextualFragment(A);z==n?u.insertBefore(D,u.firstChild):u.appendChild(D)}else{u.innerHTML=A}return u[x]}}throw'Illegal insertion point -> "'+z+'"'},insertBefore:function(u,w,v){return g(u,w,v,c)},insertAfter:function(u,w,v){return g(u,w,v,o,"nextSibling")},insertFirst:function(u,w,v){return g(u,w,v,n,"firstChild")},append:function(u,w,v){return g(u,w,v,p,"",true)},overwrite:function(u,w,v){u=Ext.getDom(u);u.innerHTML=r(w);return v?Ext.get(u.firstChild):u.firstChild},createHtml:r};return q}();Ext.Template=function(d){var e=this,b=arguments,c=[];if(Ext.isArray(d)){d=d.join("")}else{if(b.length>1){Ext.each(b,function(a){if(Ext.isObject(a)){Ext.apply(e,a)}else{c.push(a)}});d=c.join("")}}e.html=d;if(e.compiled){e.compile()}};Ext.Template.prototype={applyTemplate:function(a){var b=this;return b.compiled?b.compiled(a):b.html.replace(b.re,function(c,d){return a[d]!==undefined?a[d]:""})},set:function(a,c){var b=this;b.html=a;b.compiled=null;return c?b.compile():b},re:/\{([\w-]+)\}/g,compile:function(){var me=this,sep=Ext.isGecko?"+":",";function fn(m,name){name="values['"+name+"']";return"'"+sep+"("+name+" == undefined ? '' : "+name+")"+sep+"'"}eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};"));return me},insertFirst:function(b,a,c){return this.doInsert("afterBegin",b,a,c)},insertBefore:function(b,a,c){return this.doInsert("beforeBegin",b,a,c)},insertAfter:function(b,a,c){return this.doInsert("afterEnd",b,a,c)},append:function(b,a,c){return this.doInsert("beforeEnd",b,a,c)},doInsert:function(c,e,b,a){e=Ext.getDom(e);var d=Ext.DomHelper.insertHtml(c,e,this.applyTemplate(b));return a?Ext.get(d,true):d},overwrite:function(b,a,c){b=Ext.getDom(b);b.innerHTML=this.applyTemplate(a);return c?Ext.get(b.firstChild,true):b.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(b,a){b=Ext.getDom(b);return new Ext.Template(b.value||b.innerHTML,a||"")};Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,isOpera=Ext.isOpera,key=30803;eval("var batch = 30803;");function child(p,index){var i=0,n=p.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(d){var n=d.firstChild,ni=-1,nx;while(n){nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=isOpera?ni.childNodes:(ni.children||ni.childNodes);for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var r=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){r[++ri]=ci}}return r}function byId(cs,attr,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,attr,value,op,custom){var r=[],ri=-1,st=custom=="{",f=Ext.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType!=1){continue}var a;if(st){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}if((f&&f(a,value))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}function nodupIEXml(cs){var d=++key,r;cs[0].setAttribute("_nodup",d);r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key,r=[];for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length,d=++key,r=[];if(!len1){return c2}if(isIE&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}for(var i=0;i<len1;i++){c1[i]._qdiff=d}for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,null,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],q=path,mode,lq,tk=Ext.DomQuery.matchers,tklen=tk.length,mm,lmode=q.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';q=q.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(tagTokenRe);if(type=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(modeRe))){var matched=false;for(var j=0;j<tklen;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});q=q.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(trimRe,"")+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(path,root,type){if(!root||root==document){root=document}if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(","),results=[];for(var i=0,len=paths.length;i<len;i++){var p=paths[i].replace(trimRe,"");if(!cache[p]){cache[p]=Ext.DomQuery.compile(p);if(!cache[p]){throw p+" is not a valid selector"}}var result=cache[p](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.EventManager=function(){var u,n,k=false,m=Ext.lib.Event,o=Ext.lib.Dom,b=document,v=window,g="ie-deferred-loader",p="DOMContentLoaded",e={},h=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;function l(B,x,A,z,y){var D=Ext.id(B),C=e[D]=e[D]||{};(C[x]=C[x]||[]).push([A,z,y]);m.on(B,x,z);if(x=="mousewheel"&&B.addEventListener){var w=["DOMMouseScroll",z,false];B.addEventListener.apply(B,w);m.on(window,"unload",function(){B.removeEventListener.apply(B,w)})}if(x=="mousedown"&&B==document){Ext.EventManager.stoppedMouseDownEvent.addListener(z)}}function c(){if(!k){Ext.isReady=k=true;if(n){clearInterval(n)}if(Ext.isGecko||Ext.isOpera){b.removeEventListener(p,c,false)}if(Ext.isIE){var w=b.getElementById(g);if(w){w.onreadystatechange=null;w.parentNode.removeChild(w)}}if(u){u.fire();u.clearListeners()}}}function a(){var w="complete";u=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){b.addEventListener(p,c,false)}else{if(Ext.isIE){b.write("<script id="+g+' defer="defer" src="//:"><\/script>');b.getElementById(g).onreadystatechange=function(){if(this.readyState==w){c()}}}else{if(Ext.isWebKit){n=setInterval(function(){if(b.readyState==w){c()}},10)}}}m.on(v,"load",c)}function s(w,x){return function(){var y=Ext.toArray(arguments);if(x.target==Ext.EventObject.setEvent(y[0]).target){w.apply(this,y)}}}function t(x,y){var w=new Ext.util.DelayedTask(x);return function(z){w.delay(y.buffer,x,null,[new Ext.EventObjectImpl(z)])}}function q(A,z,w,y,x){return function(B){Ext.EventManager.removeListener(z,w,y,x);A(B)}}function d(w,x){return function(y){y=new Ext.EventObjectImpl(y);setTimeout(function(){w(y)},x.delay||10)}}function j(y,x,w,C,B){var D=!Ext.isObject(w)?{}:w,A=Ext.getDom(y);C=C||D.fn;B=B||D.scope;if(!A){throw'Error listening for "'+x+'". Element "'+y+"\" doesn't exist."}function z(F){if(!Ext){return}F=Ext.EventObject.setEvent(F);var E;if(D.delegate){if(!(E=F.getTarget(D.delegate,A))){return}}else{E=F.target}if(D.stopEvent){F.stopEvent()}if(D.preventDefault){F.preventDefault()}if(D.stopPropagation){F.stopPropagation()}if(D.normalized){F=F.browserEvent}C.call(B||A,F,E,D)}if(D.target){z=s(z,D)}if(D.delay){z=d(z,D)}if(D.single){z=q(z,A,x,C,B)}if(D.buffer){z=t(z,D)}l(A,x,C,z,B);return z}var r={addListener:function(y,w,A,z,x){if(Ext.isObject(w)){var D=w,B,C;for(B in D){C=D[B];if(!h.test(B)){if(Ext.isFunction(C)){j(y,B,D,C,D.scope)}else{j(y,B,C)}}}}else{j(y,w,x,A,z)}},removeListener:function(x,w,B,A){var z=Ext.getDom(x),C=Ext.id(z),y;Ext.each((e[C]||{})[w],function(E,F,D){if(Ext.isArray(E)&&E[0]==B&&(!A||E[2]==A)){m.un(z,w,y=E[1]);D.splice(F,1);return false}});if(w=="mousewheel"&&z.addEventListener&&y){z.removeEventListener("DOMMouseScroll",y,false)}if(w=="mousedown"&&z==b&&y){Ext.EventManager.stoppedMouseDownEvent.removeListener(y)}},removeAll:function(x){var z=Ext.id(x=Ext.getDom(x)),y=e[z],w;for(w in y){if(y.hasOwnProperty(w)){Ext.each(y[w],function(A){m.un(x,w,A.wrap)})}}e[z]=null},onDocumentReady:function(y,x,w){if(k){u.addListener(y,x,w);u.fire();u.clearListeners()}else{if(!u){a()}w=w||{};w.delay=w.delay||1;u.addListener(y,x,w)}},elHash:e};r.on=r.addListener;r.un=r.removeListener;r.stoppedMouseDownEvent=new Ext.util.Event();return r}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var a=function(){var c=document.body||document.getElementsByTagName("body")[0];if(!c){return false}var b=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":(Ext.isIE7?"ext-ie7":"ext-ie8")):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isWebKit?"ext-webkit":""];if(Ext.isSafari){b.push("ext-safari "+(Ext.isSafari2?"ext-safari2":(Ext.isSafari3?"ext-safari3":"ext-safari4")))}else{if(Ext.isChrome){b.push("ext-chrome")}}if(Ext.isMac){b.push("ext-mac")}if(Ext.isLinux){b.push("ext-linux")}if(Ext.isBorderBox){b.push("ext-border-box")}if(Ext.isStrict){var d=c.parentNode;if(d){d.className+=" ext-strict"}}c.className+=b.join(" ");return true};if(!a()){Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event,a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},c=Ext.isIE?{1:0,4:1,2:2}:(Ext.isWebKit?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(d){if(d){this.setEvent(d.browserEvent||d)}};Ext.EventObjectImpl.prototype={setEvent:function(g){var d=this;if(g==d||(g&&g.browserEvent)){return g}d.browserEvent=g;if(g){d.button=g.button?c[g.button]:(g.which?g.which-1:-1);if(g.type=="click"&&d.button==-1){d.button=0}d.type=g.type;d.shiftKey=g.shiftKey;d.ctrlKey=g.ctrlKey||g.metaKey||false;d.altKey=g.altKey;d.keyCode=g.keyCode;d.charCode=g.charCode;d.target=b.getTarget(g);d.xy=b.getXY(g)}else{d.button=-1;d.shiftKey=false;d.ctrlKey=false;d.altKey=false;d.keyCode=0;d.charCode=0;d.target=null;d.xy=[0,0]}return d},stopEvent:function(){var d=this;if(d.browserEvent){if(d.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(d)}b.stopEvent(d.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},stopPropagation:function(){var d=this;if(d.browserEvent){if(d.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(d)}b.stopPropagation(d.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(d){return Ext.isSafari?(a[d]||d):d},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(e,g,d){return e?Ext.fly(this.target).findParent(e,g,d):(d?Ext.get(this.target):this.target)},getRelatedTarget:function(){return this.browserEvent?b.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var d=this.browserEvent;var g=0;if(d.wheelDelta){g=d.wheelDelta/120}else{if(d.detail){g=-d.detail/3}}return g},within:function(g,h,d){if(g){var e=this[h?"getRelatedTarget":"getTarget"]();return e&&((d?(e==Ext.getDom(g)):false)||Ext.fly(g).contains(e))}return false}};return new Ext.EventObjectImpl()}();(function(){var j=document;Ext.Element=function(o,p){var q=typeof o=="string"?j.getElementById(o):o,r;if(!q){return null}r=q.id;if(!p&&r&&Ext.Element.cache[r]){return Ext.Element.cache[r]}this.dom=q;this.id=r||Ext.id(q)};var a=Ext.lib.Dom,e=Ext.DomHelper,m=Ext.lib.Event,d=Ext.lib.Anim,g=Ext.Element;g.prototype={set:function(t,q){var r=this.dom,p,s;for(p in t){s=t[p];if(p!="style"&&!Ext.isFunction(s)){if(p=="cls"){r.className=s}else{if(t.hasOwnProperty(p)){if(q||!!r.setAttribute){r.setAttribute(p,s)}else{r[p]=s}}}}}if(t.style){Ext.DomHelper.applyStyles(r,t.style)}return this},defaultUnit:"px",is:function(o){return Ext.DomQuery.is(this.dom,o)},focus:function(r,q){var o=this,q=q||o.dom;try{if(Number(r)){o.focus.defer(r,null,[null,q])}else{q.focus()}}catch(p){}return o},blur:function(){try{this.dom.blur()}catch(o){}return this},getValue:function(o){var p=this.dom.value;return o?parseInt(p,10):p},addListener:function(o,r,q,p){Ext.EventManager.on(this.dom,o,r,q||this,p);return this},removeListener:function(o,q,p){Ext.EventManager.removeListener(this.dom,o,q,p||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},addUnits:function(o){if(o===""||o=="auto"||o===undefined){o=o||""}else{if(!isNaN(o)||!k.test(o)){o=o+(this.defaultUnit||"px")}}return o},load:function(p,q,o){Ext.Ajax.request(Ext.apply({params:q,url:p.url||p,callback:o,el:this.dom,indicatorText:p.indicatorText||""},Ext.isObject(p)?p:{}));return this},isBorderBox:function(){return h[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var o=this,p=o.dom;o.removeAllListeners();delete g.cache[p.id];delete g.dataCache[p.id];Ext.removeNode(p)},hover:function(p,o,r,q){var s=this;s.on("mouseenter",p,r||s.dom,q);s.on("mouseleave",o,r||s.dom,q);return s},contains:function(o){return !o?false:Ext.lib.Dom.isAncestor(this.dom,o.dom?o.dom:o)},getAttributeNS:function(p,o){return this.getAttribute(o,p)},getAttribute:Ext.isIE?function(o,q){var r=this.dom,p=typeof r[q+":"+o];if(["undefined","unknown"].indexOf(p)==-1){return r[q+":"+o]}return r[o]}:function(o,p){var q=this.dom;return q.getAttributeNS(p,o)||q.getAttribute(p+":"+o)||q.getAttribute(o)||q[o]},update:function(o){this.dom.innerHTML=o}};var n=g.prototype;g.addMethods=function(p){Ext.apply(n,p)};n.on=n.addListener;n.un=n.removeListener;n.autoBoxAdjust=true;var k=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,c;g.cache={};g.dataCache={};g.get=function(p){var o,s,r;if(!p){return null}if(typeof p=="string"){if(!(s=j.getElementById(p))){return null}if(o=g.cache[p]){o.dom=s}else{o=g.cache[p]=new g(s)}return o}else{if(p.tagName){if(!(r=p.id)){r=Ext.id(p)}if(o=g.cache[r]){o.dom=p}else{o=g.cache[r]=new g(p)}return o}else{if(p instanceof g){if(p!=c){p.dom=j.getElementById(p.id)||p.dom;g.cache[p.id]=p}return p}else{if(p.isComposite){return p}else{if(Ext.isArray(p)){return g.select(p)}else{if(p==j){if(!c){var q=function(){};q.prototype=g.prototype;c=new q();c.dom=j}return c}}}}}}return null};g.data=function(p,o,q){var r=g.dataCache[p.id];if(!r){r=g.dataCache[p.id]={}}if(arguments.length==2){return r[o]}else{r[o]=q}};function l(){if(!Ext.enableGarbageCollector){clearInterval(g.collectorThread)}else{var o,p,q;for(o in g.cache){p=g.cache[o];q=p.dom;if(!q||!q.parentNode||(!q.offsetParent&&!j.getElementById(o))){delete g.cache[o];if(q&&Ext.enableListenerCollection){Ext.EventManager.removeAll(q)}}}}}g.collectorThreadId=setInterval(l,30000);var b=function(){};b.prototype=g.prototype;g.Flyweight=function(o){this.dom=o};g.Flyweight.prototype=new b();g.Flyweight.prototype.isFlyweight=true;g._flyweights={};g.fly=function(q,o){var p=null;o=o||"_global";if(q=Ext.getDom(q)){(g._flyweights[o]=g._flyweights[o]||new g.Flyweight()).dom=q;p=g._flyweights[o]}return p};Ext.get=g.get;Ext.fly=g.fly;var h=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){h.button=1}Ext.EventManager.on(window,"unload",function(){delete g.cache;delete g.dataCache;delete g._flyweights})})();Ext.Element.addMethods(function(){var d="parentNode",b="nextSibling",c="previousSibling",e=Ext.DomQuery,a=Ext.get;return{findParent:function(n,m,h){var k=this.dom,g=document.body,l=0,j;if(Ext.isGecko&&Object.prototype.toString.call(k)=="[object XULElement]"){return null}m=m||50;if(isNaN(m)){j=Ext.getDom(m);m=10}while(k&&k.nodeType==1&&l<m&&k!=g&&k!=j){if(e.is(k,n)){return h?a(k):k}l++;k=k.parentNode}return null},findParentNode:function(k,j,g){var h=Ext.fly(this.dom.parentNode,"_internal");return h?h.findParent(k,j,g):null},up:function(h,g){return this.findParentNode(h,g,true)},select:function(g,h){return Ext.Element.select(g,h,this.dom)},query:function(g,h){return e.select(g,this.dom)},child:function(g,h){var j=e.selectNode(g,this.dom);return h?j:a(j)},down:function(g,h){var j=e.selectNode(" > "+g,this.dom);return h?j:a(j)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,l,g,j){var k=this.dom[l];while(k){if(k.nodeType==1&&(!g||e.is(k,g))){return !j?a(k):k}k=k[h]}return null}}}());Ext.Element.addMethods(function(){var d=Ext.getDom,a=Ext.get,c=Ext.DomHelper,b=function(e){return(e.nodeType||e.dom||typeof e=="string")};return{appendChild:function(e){return a(e).appendTo(this)},appendTo:function(e){d(e).appendChild(this.dom);return this},insertBefore:function(e){(e=d(e)).parentNode.insertBefore(this.dom,e);return this},insertAfter:function(e){(e=d(e)).parentNode.insertBefore(this.dom,e.nextSibling);return this},insertFirst:function(g,e){g=g||{};if(b(g)){g=d(g);this.dom.insertBefore(g,this.dom.firstChild);return !e?a(g):g}else{return this.createChild(g,this.dom.firstChild,e)}},replace:function(e){e=a(e);this.insertBefore(e);e.remove();return this},replaceWith:function(g){var h=this,e=Ext.Element;if(b(g)){g=d(g);h.dom.parentNode.insertBefore(g,h.dom)}else{g=c.insertBefore(h.dom,g)}delete e.cache[h.id];Ext.removeNode(h.dom);h.id=Ext.id(h.dom=g);return e.cache[h.id]=h},createChild:function(g,e,h){g=g||{tag:"div"};return e?c.insertBefore(e,g,h!==true):c[!this.dom.firstChild?"overwrite":"append"](this.dom,g,h!==true)},wrap:function(e,g){var h=c.insertBefore(this.dom,e||{tag:"div"},!g);h.dom?h.dom.appendChild(this.dom):h.appendChild(this.dom);return h},insertHtml:function(g,h,e){var j=c.insertHtml(g,this.dom,h);return e?Ext.get(j):j}}}());Ext.Element.addMethods(function(){var g={},u=/(-[a-z])/gi,b={},p=document.defaultView,r=Ext.isIE?"styleFloat":"cssFloat",x=/alpha\(opacity=(.*)\)/i,k=/^\s+|\s+$/g,w=Ext.Element,d="padding",c="margin",v="border",q="-left",o="-right",t="-top",l="-bottom",h="-width",j={l:v+q+h,r:v+o+h,t:v+t+h,b:v+l+h},e={l:d+q,r:d+o,t:d+t,b:d+l},a={l:c+q,r:c+o,t:c+t,b:c+l},y=Ext.Element.data;function n(z,A){return A.charAt(1).toUpperCase()}function m(A,z){var B=0;Ext.each(A.match(/\w/g),function(C){if(C=parseInt(this.getStyle(z[C]),10)){B+=Math.abs(C)}},this);return B}function s(z){return g[z]||(g[z]=z=="float"?r:z.replace(u,n))}return{adjustWidth:function(z){var A=this;if(typeof z=="number"&&A.autoBoxAdjust&&!A.isBorderBox()){z-=(A.getBorderWidth("lr")+A.getPadding("lr"));z=z<0?0:z}return z},adjustHeight:function(z){var A=this;if(typeof z=="number"&&A.autoBoxAdjust&&!A.isBorderBox()){z-=(A.getBorderWidth("tb")+A.getPadding("tb"));z=z<0?0:z}return z},addClass:function(z){var A=this;Ext.each(z,function(B){A.dom.className+=(!A.hasClass(B)&&B?" "+B:"")});return A},radioClass:function(z){Ext.each(this.dom.parentNode.childNodes,function(A){if(A.nodeType==1){Ext.fly(A).removeClass(z)}});return this.addClass(z)},removeClass:function(z){var A=this;if(A.dom.className){Ext.each(z,function(B){A.dom.className=A.dom.className.replace(b[B]=b[B]||new RegExp("(?:^|\\s+)"+B+"(?:\\s+|$)","g")," ")})}return A},toggleClass:function(z){return this.hasClass(z)?this.removeClass(z):this.addClass(z)},hasClass:function(z){return z&&(" "+this.dom.className+" ").indexOf(" "+z+" ")!=-1},replaceClass:function(A,z){return this.removeClass(A).addClass(z)},isStyle:function(z,A){return this.getStyle(z)==A},getStyle:function(){return p&&p.getComputedStyle?function(C){var B=this.dom,z,A;if(B==document){return null}C=s(C);return(z=B.style[C])?z:(A=p.getComputedStyle(B,""))?A[C]:null}:function(D){var B=this.dom,z,A;if(B==document){return null}if(D=="opacity"){if(B.style.filter.match){if(z=B.style.filter.match(x)){var C=parseFloat(z[1]);if(!isNaN(C)){return C?C/100:0}}}return 1}D=s(D);return B.style[D]||((A=B.currentStyle)?A[D]:null)}}(),getColor:function(z,A,E){var D,C=this.getStyle(z),B=E||"#";if(!C||C=="transparent"||C=="inherit"){return A}if(/^r/.test(C)){Ext.each(C.slice(4,C.length-1).split(","),function(F){D=(F*1).toString(16);B+=D<16?"0"+D:D})}else{B+=C.replace("#","").replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3")}return B.length>5?B.toLowerCase():A},setStyle:function(D,C){var A,B,z;if(!Ext.isObject(D)){A={};A[D]=C;D=A}for(B in D){C=D[B];B=="opacity"?this.setOpacity(C):this.dom.style[s(B)]=C}return this},setOpacity:function(A,z){var D=this,B=D.dom.style;if(!z||!D.anim){if(Ext.isIE){var C=A<1?"alpha(opacity="+A*100+")":"",E=B.filter.replace(x,"").replace(k,"");B.zoom=1;B.filter=E+(E.length>0?" ":"")+C}else{B.opacity=A}}else{D.anim({opacity:{to:A}},D.preanim(arguments,1),null,0.35,"easeIn")}return D},clearOpacity:function(){var z=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(z.filter)){z.filter=z.filter.replace(x,"").replace(k,"")}}else{z.opacity=z["-moz-opacity"]=z["-khtml-opacity"]=""}return this},getHeight:function(A){var z=this.dom.offsetHeight||0;z=!A?z:z-this.getBorderWidth("tb")-this.getPadding("tb");return z<0?0:z},getWidth:function(A){var z=this.dom.offsetWidth||0;z=!A?z:z-this.getBorderWidth("lr")-this.getPadding("lr");return z<0?0:z},setWidth:function(A,z){var B=this;A=B.adjustWidth(A);!z||!B.anim?B.dom.style.width=B.addUnits(A):B.anim({width:{to:A}},B.preanim(arguments,1));return B},setHeight:function(z,A){var B=this;z=B.adjustHeight(z);!A||!B.anim?B.dom.style.height=B.addUnits(z):B.anim({height:{to:z}},B.preanim(arguments,1));return B},getBorderWidth:function(z){return m.call(this,z,j)},getPadding:function(z){return m.call(this,z,e)},clip:function(){var z=this;dom=z.dom;if(!y(dom,"isClipped")){y(dom,"isClipped",true);y(dom,"originalClip,",{o:z.getStyle("overflow"),x:z.getStyle("overflow-x"),y:z.getStyle("overflow-y")});z.setStyle("overflow","hidden");z.setStyle("overflow-x","hidden");z.setStyle("overflow-y","hidden")}return z},unclip:function(){var z=this,B=z.dom;if(y(B,"isClipped")){y(B,"isClipped",false);var A=y(B,"originalClip");if(A.o){z.setStyle("overflow",A.o)}if(A.x){z.setStyle("overflow-x",A.x)}if(A.y){z.setStyle("overflow-y",A.y)}}return z},addStyles:m,margins:a}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",j="bottom",h="position",c="static",e="relative",k="auto",l="z-index";function m(o,n,p){return this.preanim&&!!n?this.preanim(o,p):false}Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(n){var q=this.getXY(),p=Ext.fly(n,"_internal").getXY();return[q[0]-p[0],q[1]-p[1]]},setX:function(n,o){return this.setXY([n,this.getY()],m.call(this,arguments,o,1))},setY:function(o,n){return this.setXY([this.getX(),o],m.call(this,arguments,n,1))},setLeft:function(n){this.setStyle(b,this.addUnits(n));return this},setTop:function(n){this.setStyle(d,this.addUnits(n));return this},setRight:function(n){this.setStyle(g,this.addUnits(n));return this},setBottom:function(n){this.setStyle(j,this.addUnits(n));return this},setXY:function(p,n){var o=this;if(!n||!o.anim){a.setXY(o.dom,p)}else{o.anim({points:{to:p}},o.preanim(arguments,1),"motion")}return o},setLocation:function(n,p,o){return this.setXY([n,p],m.call(this,arguments,o,2))},moveTo:function(n,p,o){return this.setXY([n,p],m.call(this,arguments,o,2))},getLeft:function(n){return !n?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(n){var o=this;return !n?o.getX()+o.getWidth():(o.getLeft(true)+o.getWidth())||0},getTop:function(n){return !n?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(n){var o=this;return !n?o.getY()+o.getHeight():(o.getTop(true)+o.getHeight())||0},position:function(r,q,n,p){var o=this;if(!r&&o.isStyle(h,c)){o.setStyle(h,e)}else{if(r){o.setStyle(h,r)}}if(q){o.setStyle(l,q)}if(n||p){o.setXY([n||false,p||false])}},clearPositioning:function(n){n=n||"";this.setStyle({left:n,right:n,top:n,bottom:n,"z-index":"",position:c});return this},getPositioning:function(){var n=this.getStyle(b);var o=this.getStyle(d);return{position:this.getStyle(h),left:n,right:n?"":this.getStyle(g),top:o,bottom:o?"":this.getStyle(j),"z-index":this.getStyle(l)}},setPositioning:function(n){var p=this,o=p.dom.style;p.setStyle(n);if(n.right==k){o.right=""}if(n.bottom==k){o.bottom=""}return p},translatePoints:function(n,v){v=isNaN(n[1])?v:n[1];n=isNaN(n[0])?n:n[0];var r=this,s=r.isStyle(h,e),u=r.getXY(),p=parseInt(r.getStyle(b),10),q=parseInt(r.getStyle(d),10);p=!isNaN(p)?p:(s?0:r.dom.offsetLeft);q=!isNaN(q)?q:(s?0:r.dom.offsetTop);return{left:(n-u[0]+p),top:(v-u[1]+q)}},animTest:m})})();Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var j=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(j==h||j==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:j.scrollLeft,top:j.scrollTop}}return e}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.addMethods(function(){var h="visibility",d="display",b="hidden",k="none",a="originalDisplay",c="visibilityMode",e=Ext.Element.DISPLAY,g=Ext.Element.data,j=function(n){var m=g(n,a);if(m===undefined){g(n,a,m="")}return m},l=function(o){var n=g(o,c);if(n===undefined){g(o,c,n=1)}return n};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(m){g(this.dom,c,m);return this},animate:function(n,p,o,q,m){this.anim(n,{duration:p,callback:o,easing:q},m);return this},anim:function(p,q,n,s,o,m){n=n||"run";q=q||{};var r=this,t=Ext.lib.Anim[n](r.dom,p,(q.duration||s)||0.35,(q.easing||o)||"easeOut",function(){if(m){m.call(r)}if(q.callback){q.callback.call(q.scope||r,r,q)}},r);q.anim=t;return t},preanim:function(m,n){return !m[n]?false:(Ext.isObject(m[n])?m[n]:{duration:m[n+1],callback:m[n+2],easing:m[n+3]})},isVisible:function(){return !this.isStyle(h,b)&&!this.isStyle(d,k)},setVisible:function(q,n){var o=this,p=o.dom,m=l(this.dom)==e;if(!n||!o.anim){if(m){o.setDisplayed(q)}else{o.fixDisplay();p.style.visibility=q?"visible":b}}else{if(q){o.setOpacity(0.01);o.setVisible(true)}o.anim({opacity:{to:(q?1:0)}},o.preanim(arguments,1),null,0.35,"easeIn",function(){if(!q){p.style[m?d:h]=(m)?k:b;Ext.fly(p).setOpacity(1)}})}return o},toggle:function(m){var n=this;n.setVisible(!n.isVisible(),n.preanim(arguments,0));return n},setDisplayed:function(m){if(typeof m=="boolean"){m=m?j(this.dom):k}this.setStyle(d,m);return this},fixDisplay:function(){var m=this;if(m.isStyle(d,k)){m.setStyle(h,b);m.setStyle(d,j(this.dom));if(m.isStyle(d,k)){m.setStyle(d,"block")}}},hide:function(m){this.setVisible(false,this.preanim(arguments,0));return this},show:function(m){this.setVisible(true,this.preanim(arguments,0));return this}}}());(function(){var z=null,B=undefined,l=true,u=false,k="setX",h="setY",a="setXY",o="left",m="bottom",t="top",n="right",r="height",g="width",j="points",x="hidden",A="absolute",v="visible",e="motion",p="position",s="easeOut",d=new Ext.Element.Flyweight(),w={},y=function(C){return C||{}},q=function(C){d.dom=C;d.id=Ext.id(C);return d},c=function(C){if(!w[C]){w[C]=[]}return w[C]},b=function(D,C){w[D]=C};Ext.enableFx=l;Ext.Fx={switchStatements:function(D,E,C){return E.apply(this,C[D])},slideIn:function(I,F){F=y(F);var K=this,H=K.dom,N=H.style,P,C,M,E,D,N,J,O,L,G;I=I||"t";K.queueFx(F,function(){P=q(H).getXY();q(H).fixDisplay();C=q(H).getFxRestore();M={x:P[0],y:P[1],0:P[0],1:P[1],width:H.offsetWidth,height:H.offsetHeight};M.right=M.x+M.width;M.bottom=M.y+M.height;q(H).setWidth(M.width).setHeight(M.height);E=q(H).fxWrap(C.pos,F,x);N.visibility=v;N.position=A;function Q(){q(H).fxUnwrap(E,C.pos,F);N.width=C.width;N.height=C.height;q(H).afterFx(F)}O={to:[M.x,M.y]};L={to:M.width};G={to:M.height};function R(V,S,W,T,Y,aa,ad,ac,ab,X,U){var Z={};q(V).setWidth(W).setHeight(T);if(q(V)[Y]){q(V)[Y](aa)}S[ad]=S[ac]="0";if(ab){Z.width=ab}if(X){Z.height=X}if(U){Z.points=U}return Z}J=q(H).switchStatements(I.toLowerCase(),R,{t:[E,N,M.width,0,z,z,o,m,z,G,z],l:[E,N,0,M.height,z,z,n,t,L,z,z],r:[E,N,M.width,M.height,k,M.right,o,t,z,z,O],b:[E,N,M.width,M.height,h,M.bottom,o,t,z,G,O],tl:[E,N,0,0,z,z,n,m,L,G,O],bl:[E,N,0,0,h,M.y+M.height,n,t,L,G,O],br:[E,N,0,0,a,[M.right,M.bottom],o,t,L,G,O],tr:[E,N,0,0,k,M.x+M.width,o,m,L,G,O]});N.visibility=v;q(E).show();arguments.callee.anim=q(E).fxanim(J,F,e,0.5,s,Q)});return K},slideOut:function(G,E){E=y(E);var I=this,F=I.dom,L=F.style,M=I.getXY(),D,C,J,K,H={to:0};G=G||"t";I.queueFx(E,function(){C=q(F).getFxRestore();J={x:M[0],y:M[1],0:M[0],1:M[1],width:F.offsetWidth,height:F.offsetHeight};J.right=J.x+J.width;J.bottom=J.y+J.height;q(F).setWidth(J.width).setHeight(J.height);D=q(F).fxWrap(C.pos,E,v);L.visibility=v;L.position=A;q(D).setWidth(J.width).setHeight(J.height);function N(){E.useDisplay?q(F).setDisplayed(u):q(F).hide();q(F).fxUnwrap(D,C.pos,E);L.width=C.width;L.height=C.height;q(F).afterFx(E)}function O(P,X,V,Y,T,W,S,U,R){var Q={};P[X]=P[V]="0";Q[Y]=T;if(W){Q[W]=S}if(U){Q[U]=R}return Q}K=q(F).switchStatements(G.toLowerCase(),O,{t:[L,o,m,r,H],l:[L,n,t,g,H],r:[L,o,t,g,H,j,{to:[J.right,J.y]}],b:[L,o,t,r,H,j,{to:[J.x,J.bottom]}],tl:[L,n,m,g,H,r,H],bl:[L,n,t,g,H,r,H,j,{to:[J.x,J.bottom]}],br:[L,o,t,g,H,r,H,j,{to:[J.x+J.width,J.bottom]}],tr:[L,o,m,g,H,r,H,j,{to:[J.right,J.y]}]});arguments.callee.anim=q(D).fxanim(K,E,e,0.5,s,N)});return I},puff:function(I){I=y(I);var G=this,H=G.dom,D=H.style,E,C,F;G.queueFx(I,function(){E=q(H).getWidth();C=q(H).getHeight();q(H).clearOpacity();q(H).show();F=q(H).getFxRestore();function J(){I.useDisplay?q(H).setDisplayed(u):q(H).hide();q(H).clearOpacity();q(H).setPositioning(F.pos);D.width=F.width;D.height=F.height;D.fontSize="";q(H).afterFx(I)}arguments.callee.anim=q(H).fxanim({width:{to:q(H).adjustWidth(E*2)},height:{to:q(H).adjustHeight(C*2)},points:{by:[-E*0.5,-C*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},I,e,0.5,s,J)});return G},switchOff:function(G){G=y(G);var E=this,F=E.dom,C=F.style,D;E.queueFx(G,function(){q(F).clearOpacity();q(F).clip();D=q(F).getFxRestore();function H(){G.useDisplay?q(F).setDisplayed(u):q(F).hide();q(F).clearOpacity();q(F).setPositioning(D.pos);C.width=D.width;C.height=D.height;q(F).afterFx(G)}q(F).fxanim({opacity:{to:0.3}},z,z,0.1,z,function(){q(F).clearOpacity();(function(){q(F).fxanim({height:{to:1},points:{by:[0,q(F).getHeight()*0.5]}},G,e,0.3,"easeIn",H)}).defer(100)})});return E},highlight:function(E,I){I=y(I);var G=this,H=G.dom,C=I.attr||"backgroundColor",D={},F;G.queueFx(I,function(){q(H).clearOpacity();q(H).show();function J(){H.style[C]=F;q(H).afterFx(I)}F=H.style[C];D[C]={from:E||"ffff9c",to:I.endColor||q(H).getColor(C)||"ffffff"};arguments.callee.anim=q(H).fxanim(D,I,"color",1,"easeIn",J)});return G},frame:function(C,F,I){I=y(I);var E=this,H=E.dom,D,G;E.queueFx(I,function(){C=C||"#C3DAF9";if(C.length==6){C="#"+C}F=F||1;q(H).show();var M=q(H).getXY(),K={x:M[0],y:M[1],0:M[0],1:M[1],width:H.offsetWidth,height:H.offsetHeight},J=function(){D=q(document.body||document.documentElement).createChild({style:{visbility:x,position:A,"z-index":35000,border:"0px solid "+C}});return D.queueFx({},L)};arguments.callee.anim={isAnimated:true,stop:function(){F=0;D.stopFx()}};function L(){var N=Ext.isBorderBox?2:1;G=D.anim({top:{from:K.y,to:K.y-20},left:{from:K.x,to:K.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:K.height,to:K.height+20*N},width:{from:K.width,to:K.width+20*N}},{duration:I.duration||1,callback:function(){D.remove();--F>0?J():q(H).afterFx(I)}});arguments.callee.anim={isAnimated:true,stop:function(){G.stop()}}}J()});return E},pause:function(E){var D=this.dom,C;this.queueFx({},function(){C=setTimeout(function(){q(D).afterFx({})},E*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(C);q(D).afterFx({})}}});return this},fadeIn:function(E){E=y(E);var C=this,D=C.dom,F=E.endOpacity||1;C.queueFx(E,function(){q(D).setOpacity(0);q(D).fixDisplay();D.style.visibility=v;arguments.callee.anim=q(D).fxanim({opacity:{to:F}},E,z,0.5,s,function(){if(F==1){q(D).clearOpacity()}q(D).afterFx(E)})});return C},fadeOut:function(F){F=y(F);var D=this,E=D.dom,C=E.style,G=F.endOpacity||0;D.queueFx(F,function(){arguments.callee.anim=q(E).fxanim({opacity:{to:G}},F,z,0.5,s,function(){if(G==0){Ext.Element.data(E,"visibilityMode")==Ext.Element.DISPLAY||F.useDisplay?C.display="none":C.visibility=x;q(E).clearOpacity()}q(E).afterFx(F)})});return D},scale:function(C,D,E){this.shift(Ext.apply({},E,{width:C,height:D}));return this},shift:function(E){E=y(E);var D=this.dom,C={};this.queueFx(E,function(){for(var F in E){if(E[F]!=B){C[F]={to:E[F]}}}C.width?C.width.to=q(D).adjustWidth(E.width):C;C.height?C.height.to=q(D).adjustWidth(E.height):C;if(C.x||C.y||C.xy){C.points=C.xy||{to:[C.x?C.x.to:q(D).getX(),C.y?C.y.to:q(D).getY()]}}arguments.callee.anim=q(D).fxanim(C,E,e,0.35,s,function(){q(D).afterFx(E)})});return this},ghost:function(F,D){D=y(D);var H=this,E=H.dom,K=E.style,I={opacity:{to:0},points:{}},L=I.points,C,J,G;F=F||"b";H.queueFx(D,function(){C=q(E).getFxRestore();J=q(E).getWidth();G=q(E).getHeight();function M(){D.useDisplay?q(E).setDisplayed(u):q(E).hide();q(E).clearOpacity();q(E).setPositioning(C.pos);K.width=C.width;K.height=C.height;q(E).afterFx(D)}L.by=q(E).switchStatements(F.toLowerCase(),function(O,N){return[O,N]},{t:[0,-G],l:[-J,0],r:[J,0],b:[0,G],tl:[-J,-G],bl:[-J,G],br:[J,G],tr:[J,-G]});arguments.callee.anim=q(E).fxanim(I,D,e,0.5,s,M)});return H},syncFx:function(){var C=this;C.fxDefaults=Ext.apply(C.fxDefaults||{},{block:u,concurrent:l,stopFx:u});return C},sequenceFx:function(){var C=this;C.fxDefaults=Ext.apply(C.fxDefaults||{},{block:u,concurrent:u,stopFx:u});return C},nextFx:function(){var C=c(this.dom.id)[0];if(C){C.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(C){var D=this,F=D.dom.id;if(D.hasActiveFx()){var E=c(F)[0];if(E&&E.anim){if(E.anim.isAnimated){b(F,[E]);E.anim.stop(C!==undefined?C:l)}else{b(F,[])}}}return D},beforeFx:function(C){if(this.hasActiveFx()&&!C.concurrent){if(C.stopFx){this.stopFx();return l}return u}return l},hasFxBlock:function(){var C=c(this.dom.id);return C&&C[0]&&C[0].block},queueFx:function(F,C){var D=this;if(!D.hasFxBlock()){Ext.applyIf(F,D.fxDefaults);if(!F.concurrent){var E=D.beforeFx(F);C.block=F.block;c(D.dom.id).push(C);if(E){D.nextFx()}}else{C.call(D)}}return D},fxWrap:function(I,G,E){var F=this.dom,D,C;if(!G.wrap||!(D=Ext.getDom(G.wrap))){if(G.fixPosition){C=q(F).getXY()}var H=document.createElement("div");H.style.visibility=E;D=F.parentNode.insertBefore(H,F);q(D).setPositioning(I);if(q(D).isStyle(p,"static")){q(D).position("relative")}q(F).clearPositioning("auto");q(D).clip();D.appendChild(F);if(C){q(D).setXY(C)}}return D},fxUnwrap:function(C,F,E){var D=this.dom;q(D).clearPositioning();q(D).setPositioning(F);if(!E.wrap){C.parentNode.insertBefore(D,C);q(C).remove()}},getFxRestore:function(){var C=this.dom.style;return{pos:this.getPositioning(),width:C.width,height:C.height}},afterFx:function(D){var C=this.dom,E=C.id;if(D.afterStyle){q(C).setStyle(D.afterStyle)}if(D.afterCls){q(C).addClass(D.afterCls)}if(D.remove==l){q(C).remove()}if(D.callback){D.callback.call(D.scope,q(C))}if(!D.concurrent){c(E).shift();q(C).nextFx()}},fxanim:function(F,G,D,H,E,C){D=D||"run";G=G||{};var I=Ext.lib.Anim[D](this.dom,F,(G.duration||H)||0.35,(G.easing||E)||s,C,this);G.anim=I;return I}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getCount:function(){return this.elements.length},add:function(b){if(b){if(Ext.isArray(b)){this.elements=this.elements.concat(b)}else{var a=this.elements;Ext.each(b,function(c){a.push(c)})}}return this},invoke:function(d,a){var b=this.elements,c=this.el;Ext.each(b,function(g){c.dom=g;Ext.Element.prototype[d].apply(c,a)});return this},item:function(a){var b=this;if(!b.elements[a]){return null}b.el.dom=b.elements[a];return b.el},addListener:function(a,d,c,b){Ext.each(this.elements,function(g){Ext.EventManager.on(g,a,d,c||g,b)});return this},each:function(c,b){var d=this,a=d.el;Ext.each(d.elements,function(h,g){a.dom=h;return c.call(b||a,a,d,g)});return d},indexOf:function(a){return this.elements.indexOf(Ext.getDom(a))},replaceElement:function(e,c,a){var b=!isNaN(e)?e:this.indexOf(e),g;if(b>-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;(function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(var c in b){if(Ext.isFunction(b[c])){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}})();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var c="beforerequest",m="requestcomplete",l="requestexception",e=undefined,j="load",h="POST",k="GET",g=window;Ext.data.Connection=function(n){Ext.apply(this,n);this.addEvents(c,m,l);Ext.data.Connection.superclass.constructor.call(this)};function b(n){this.transId=false;var o=n.argument.options;n.argument=o?o.argument:null;this.fireEvent(m,this,n,o);if(o.success){o.success.call(o.scope,n,o)}if(o.callback){o.callback.call(o.scope,o,true,n)}}function d(n,p){this.transId=false;var o=n.argument.options;n.argument=o?o.argument:null;this.fireEvent(l,this,n,o,p);if(o.failure){o.failure.call(o.scope,n,o)}if(o.callback){o.callback.call(o.scope,o,false,n)}}function a(s,n,p){var q=Ext.id(),y=document,t=y.createElement("iframe"),r=Ext.getDom(s.form),x=[],w;t.id=t.name=q;t.className="x-hidden";t.src=Ext.SSL_SECURE_URL;y.body.appendChild(t);if(Ext.isIE){y.frames[q].name=q}r.target=q;r.method=h;r.enctype=r.encoding="multipart/form-data";r.action=p||"";n=Ext.urlDecode(n,false);for(var v in n){if(n.hasOwnProperty(v)){w=y.createElement("input");w.type="hidden";w.value=n[w.name=v];r.appendChild(w);x.push(w)}}function u(){var z=this,o={responseText:"",responseXML:null,argument:s.argument},C,B;try{C=t.contentWindow.document||t.contentDocument||g.frames[q].document;if(C){if(C.body){if(/textarea/i.test((B=C.body.firstChild||{}).tagName)){o.responseText=B.value}else{o.responseText=C.body.innerHTML}}else{o.responseXML=C.XMLDocument||C}}}catch(A){}Ext.EventManager.removeListener(t,j,u,z);z.fireEvent(m,z,o,s);Ext.callback(s.success,s.scope,[o,s]);Ext.callback(s.callback,s.scope,[s,true,o]);if(!z.debugUploads){setTimeout(function(){Ext.removeNode(t)},100)}}Ext.EventManager.on(t,j,u,this);r.submit();Ext.each(x,function(o){Ext.removeNode(o)})}Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(t){var w=this;if(w.fireEvent(c,w,t)){if(t.el){if(!Ext.isEmpty(t.indicatorText)){w.indicatorText='<div class="loading-indicator">'+t.indicatorText+"</div>"}if(w.indicatorText){Ext.getDom(t.el).innerHTML=w.indicatorText}t.success=(Ext.isFunction(t.success)?t.success:function(){}).createInterceptor(function(o){Ext.getDom(t.el).innerHTML=o.responseText})}var r=t.params,q=t.url||w.url,n,u={success:b,failure:d,scope:w,argument:{options:t},timeout:t.timeout||w.timeout},s,x;if(Ext.isFunction(r)){r=r.call(t.scope||g,t)}r=Ext.urlEncode(w.extraParams,typeof r=="object"?Ext.urlEncode(r):r);if(Ext.isFunction(q)){q=q.call(t.scope||g,t)}if(s=Ext.getDom(t.form)){q=q||s.action;if(t.isUpload||/multipart\/form-data/i.test(s.getAttribute("enctype"))){return a.call(w,t,r,q)}x=Ext.lib.Ajax.serializeForm(s);r=r?(r+"&"+x):x}n=t.method||w.method||((r||t.xmlData||t.jsonData)?h:k);if(n===k&&(w.disableCaching&&t.disableCaching!==false)||t.disableCaching===true){var v=t.disableCachingParam||w.disableCachingParam;q+=(q.indexOf("?")!=-1?"&":"?")+v+"="+(new Date().getTime())}t.headers=Ext.apply(t.headers||{},w.defaultHeaders||{});if(t.autoAbort===true||w.autoAbort){w.abort()}if((n==k||t.xmlData||t.jsonData)&&r){q+=(/\?/.test(q)?"&":"?")+r;r=""}return w.transId=Ext.lib.Ajax.request(n,q,u,r,t)}else{return t.callback?t.callback.apply(t.scope,[t,e,e]):null}},isLoading:function(n){return n?Ext.lib.Ajax.isCallInProgress(n):!!this.transId},abort:function(n){if(n||this.isLoading()){Ext.lib.Ajax.abort(n||this.transId)}}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(j,l,k,h){e.cancel();d=l||d;c=k||c;a=h||a;g=setInterval(b,j)};e.cancel=function(){if(g){clearInterval(g);g=null}}};Ext.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,isNative=Ext.USE_NATIVE_JSON&&JSON&&JSON.toString()=="[object JSON]";var pad=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'};var encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};this.encode=isNative?JSON.stringify:function(o){if(typeof o=="undefined"||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Object.prototype.toString.apply(o)==="[object Date]"){return Ext.util.JSON.encodeDate(o)}else{if(typeof o=="string"){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=isNative?JSON.parse:function(json){return eval("("+json+")")}})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;
\ No newline at end of file
diff --git a/ricoClient/js/baselibs/glow.core.debug.js b/ricoClient/js/baselibs/glow.core.debug.js
new file mode 100644 (file)
index 0000000..8874467
--- /dev/null
@@ -0,0 +1,12705 @@
+/*     
+       Copyright 2009 British Broadcasting Corporation
+
+       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.
+*/
+/**
+@name glow
+@namespace
+@version 1.7.0 (2008-09-22)
+@description The glow namespace and core library.
+
+    Includes common methods for running scripts onDomReady and user agent sniffing.
+*/
+(function() {
+       /*
+       PrivateVar: moduleRegister
+               Holds info on which modules are registered {name:true}
+       */
+       var moduleRegister = {glow: true},
+               /*
+               PrivateVar: regexEscape
+                       For escaping strings to go in regex
+               */
+               regexEscape = /([$^\\\/()|?+*\[\]{}.-])/g,
+               /*
+               PrivateVar: ua
+                       A lowercase representation of the user's useragent string
+               */
+               ua = navigator.userAgent.toLowerCase(),
+               //glow version
+               version = "1.7.0",
+               // number of blockers blocking (when it's zero, we're ready)
+               blockersActive = 0,
+               /*
+               PrivateMethod: domReadyQueue
+                       array of functions to call when dom is ready
+               */
+               domReadyQueue = [],
+               domReadyQueueLen = 0,
+               /*
+               PrivateMethod: readyQueue
+                       array of functions to call when all ready blockers are unblocked
+               */
+               //we want to set isReady to true when this is first run
+               readyQueue = [],
+               readyQueueLen = 0,
+               // stops two instances of 'runReadyQueue' fighting on the call stack
+               processingReadyQueue = false,
+               glow = {
+                       /**
+                       @name glow.VERSION
+                       @description Version of glow
+                               This is in the format 1.2.3
+
+                       @type String
+
+                       @see <a href="/glow/docs/previous_versions.shtml#versionScheme">Glow's versioning scheme</a>
+                       */
+                       VERSION: version,
+
+                       /**
+                       @name glow.UID
+                       @description A unique ID for this instance of Glow
+
+                               This will be used in glow-specific property names
+                               that need to be unique to this instance of glow.
+
+                       @type String
+                       */
+                       UID: "glow" + Math.floor(Math.random() * (1<<30)),
+
+                       /**
+                       @name glow.isDomReady
+                       @description Is the DOM ready?
+
+                               If glow is loaded after the page has loaded (by means other than Gloader)
+                               this value should be set manually.
+
+                       @type Boolean
+                       */
+                       //check gloader to see if dom is already ready
+                       isDomReady: window.gloader && gloader.isReady,
+                       
+                       /**
+                       @name glow.isReady
+                       @description Is Glow ready?
+
+                               Set to true when Glow is ready. This includes DOM ready,
+                               a supported browser and any additional requirements. For example
+                               Glow widgets will add the loading of their CSS file as a requirement.
+
+                       @type Boolean
+                       */
+                       //check gloader to see if dom is already ready
+                       isReady: window.gloader && gloader.isReady,
+
+                       /**
+                       @name glow.env
+                       @description Information about the browser / platform
+                       @type Object
+
+                       @example
+                               if (glow.env.ie < 7) {
+                                       //this only runs in IE 6 and below
+                               }
+                               if (glow.env.gecko < 1.9) {
+                                       //this only runs in Gecko versions less than 1.9
+                                       //Wikipedia can be used to link engine versions to browser versions
+                               }
+                       */
+                       /**
+                       @name glow.env.gecko
+                       @description Gecko version number to one decimal place (eg 1.9) or NaN
+                       @type Number
+                       */
+                       /**
+                       @name glow.env.ie
+                       @description IE version number or NaN
+                       @type Number
+                       */
+                       /**
+                       @name glow.env.opera
+                       @description Opera version (eg 8.02) or NaN
+                       @type Number
+                       */
+                       /**
+                       @name glow.env.webkit
+                       @description Webkit version number to one decimal place (eg 419.3) or NaN
+                       @type Number
+                       */
+                       /**
+                       @name glow.env.khtml
+                       @description KHTML version number to one decimal place or NaN
+                       @type Number
+                       */
+                       /**
+                       @name glow.env.standardsMode
+                       @description True if the browser reports itself to be in 'standards mode'
+                       @type Boolean
+                       */
+                       /**
+                       @name glow.env.version
+                       @description Browser version as a string. Includes non-numerical data, eg "1.8.1" or "7b"
+                       @type String
+                       */
+                       env: function(){
+                               var nanArray = [0, NaN],
+                                       opera = (/opera[\s\/]([\w\.]+)/.exec(ua) || nanArray)[1],
+                                       ie = opera ? NaN : (/msie ([\w\.]+)/.exec(ua) || nanArray)[1],
+                                       gecko = (/rv:([\w\.]+).*gecko\//.exec(ua) || nanArray)[1],
+                                       webkit = (/applewebkit\/([\w\.]+)/.exec(ua) || nanArray)[1],
+                                       khtml = (/khtml\/([\w\.]+)/.exec(ua) || nanArray)[1],
+                                       toNum = parseFloat;
+
+                               return {
+                                       gecko   : toNum(gecko),
+                                       ie      : toNum(ie),
+                                       opera   : toNum(opera),
+                                       webkit  : toNum(webkit),
+                                       khtml   : toNum(khtml),
+                                       version : ie || gecko || webkit || opera || khtml,
+                                       standardsMode : document.compatMode != "BackCompat" && (!ie || ie >= 6)
+                               }
+                       }(),
+
+                       /**
+                       @name glow.module
+                       @private
+                       @function
+                       @description Registers a new module with the library, checking version numbers &amp; dependencies.
+
+                       @param {Object} meta
+                               Object containing all of the following. This object is
+                               compatible with gloader.module, hence some properties which seem
+                               unnecessary here. This is all simplified by glow's module pattern.
+
+                       @param {String} meta.name Name of the module.
+                               Eg. "glow.dom" or "glow.widgets.Panel"
+
+                       @param {String[]} meta.library Information about Glow.
+                               This must be ["glow", "1.7.0"]. 1.7.0 should be
+                               the version number of glow expected.
+
+                       @param {String[]} meta.depends The module's dependencies.
+                               This must start ["glow", "1.7.0"], followed by modules
+                               such as "glow.dom". 1.7.0 should be the version number
+                               of glow expected.
+
+                       @param {Function} meta.builder The module's implementation.
+                               A reference to glow will be passed in as the first parameter
+                               to this function. Add to that object to create publicly
+                               accessabile properties. Anything else in this function
+                               will be private.
+
+                       @returns {Object} Glow
+
+                       @example
+                               glow.module({
+                                       name: "glow.anim",
+                                       library: ["glow", "1.0.0"],
+                                       depends: ["glow", "1.0.0", "glow.dom"],
+                                       builder: function(glow) {
+                                               glow.anim = {
+                                                       //...
+                                               };
+                                       }
+                               });
+                       */
+                       module: function(meta) {
+                               var i = 2,
+                                       depends = meta.depends[0] || [],
+                                       dependsLen = depends.length,
+                                       name = meta.name,
+                                       objRef = window.glow; //holds the parent object for the new module
+
+                               //check version number match core version
+                               if (meta.library[1] != glow.VERSION) {
+                                       throw new Error("Cannot register " + name + ": Version mismatch");
+                               }
+
+                               //check dependencies loaded
+                               if (depends[2]) {
+                                       for (; i < dependsLen; i++) {
+                                               //check exists
+                                               if (!moduleRegister[depends[i]]) {
+                                                       //check again ondomready to detect if modules are being included in wrong order
+                                                       throw new Error("Module " + depends[i] + " required before " + name);
+                                               }
+                                       }
+                               }
+
+                               //create module
+                               meta.builder(glow);
+                               //register it as built
+                               moduleRegister[name] = true;
+                               return glow;
+                       },
+
+                       /**
+                       @name glow.ready
+                       @function
+                       @description Calls a function when the DOM had loaded and the browser is supported
+                       
+                               "ready" also waits for glow's CSS file to load if it has been
+                               requested.
+
+                       @param {Function} callback Function to call
+
+                       @returns {glow}
+
+                       @example
+                               glow.ready(function() {
+                                       alert("DOM Ready!");
+                               });
+                       */
+                       ready: function(f) {
+                               //just run function if already ready
+                               if (this.isReady) {
+                                       f();
+                               } else {
+                                       readyQueue[readyQueueLen++] = f;
+                               }
+                               return this;
+                       },
+                       
+                       /**
+                       @name glow._readyBlockers
+                       @private
+                       @object
+                       @description A hash (by name) of blockers.
+                               True if they are blocking, false if they've since unblocked
+                       */
+                       _readyBlockers: {},
+                       
+                       /**
+                       @name glow._addReadyBlock
+                       @private
+                       @function
+                       @description Adds a blocker to anything added via glow.ready.
+                               Uncalled callbacks added via glow.ready will not fire until
+                               this block is removed
+
+                       @param {String} name Name of blocker
+
+                       @returns {glow}
+
+                       @example
+                               glow._addReadyBlock("widgetsCss");
+                               
+                               // when CSS is ready...
+                               glow._removeReadyBlock("widgetsCss");
+                       */
+                       _addReadyBlock: function(name) {
+                               if (name in glow._readyBlockers) {
+                                       throw new Error("Blocker '" + name +"' already exists");
+                               }
+                               glow._readyBlockers[name] = true;
+                               glow.isReady = false;
+                               blockersActive++;
+                               return glow;
+                       },
+                       
+                       /**
+                       @name glow._removeReadyBlock
+                       @private
+                       @function
+                       @description Removes a ready blocker added via glow._addReadyBlock
+
+                       @param {String} name Name of blocker
+
+                       @returns {glow}
+
+                       @example
+                               glow._addReadyBlock("widgetsCss");
+                               
+                               // when CSS is ready...
+                               glow._removeReadyBlock("widgetsCss");
+                       */
+                       _removeReadyBlock: function(name) {
+                               if (glow._readyBlockers[name]) {
+                                       glow._readyBlockers[name] = false;
+                                       blockersActive--;
+                                       // if we're out of blockers
+                                       if (!blockersActive) {
+                                               // call our queue
+                                               glow.isReady = true;
+                                               runReadyQueue();
+                                       }
+                               }
+                               return glow;
+                       },
+
+                       /**
+                       @name glow.onDomReady
+                       @function
+                       @description Calls a function when / if the DOM is ready.
+
+                               This function does not wait for glow's CSS to load, nor
+                               does it block unsupported browsers. If you want these features,
+                               use {@link glow.ready}
+
+                       @param {Function} callback Function to call
+
+                       @returns {glow}
+
+                       @exmaple
+                               glow.onDomReady(function() {
+                                       alert("DOM Ready!");
+                               });
+                       */
+                       onDomReady: function(f) {
+                               //just run function if already ready
+                               if (this.isDomReady) {
+                                       f();
+                               } else {
+                                       domReadyQueue[domReadyQueueLen++] = f;
+                               }
+                       },
+
+                       /**
+                       @name glow.lang
+                       @namespace
+                       @description Useful language functions.
+                       @see <a href="../furtherinfo/glow/glow.lang.shtml">Using glow.lang.clone</a>
+                       */
+                       lang: {
+                               /**
+                               @name glow.lang.trim
+                               @function
+                               @description Removes leading and trailing whitespace from a string
+
+                               @param {String} str String to trim
+
+                               @returns {String}
+
+                                       String without leading and trailing whitespace
+
+                               @example
+                                       glow.lang.trim("  Hello World  "); // "Hello World"
+                               */
+                               trim: function(sStr) {
+                                       //this optimisation from http://blog.stevenlevithan.com/archives/faster-trim-javascript
+                                       return sStr.replace(/^\s*((?:[\S\s]*\S)?)\s*$/, '$1');
+                               },
+
+                               /**
+                               @name glow.lang.toArray
+                               @function
+                               @description Converts an array-like object to a real array
+
+                               @param {Object} arrayLike Any array-like object
+
+                               @returns {Array}
+
+                               @example
+                                       var a = glow.lang.toArray(glow.dom.get("a"));
+                               */
+                               toArray: function(aArrayLike) {
+                                       if (aArrayLike.constructor == Array) {
+                                               return aArrayLike;
+                                       }
+                                       //use array.slice if not IE? Could be faster
+                                       var r = [], i=0, len = aArrayLike.length;
+                                       for (; i < len; i++) {
+                                               r[i] = aArrayLike[i];
+                                       }
+                                       return r;
+                               },
+
+                               /**
+                               @name glow.lang.apply
+                               @function
+                               @description Copies properties from one object to another
+
+                               @param {Object} destination Destination object
+
+                               @param {Object} source Properties of this object will be copied onto the destination
+
+                               @returns {Object}
+
+                               @example
+                                       var obj = glow.lang.apply({foo: "hello", bar: "world"}, {bar: "everyone"});
+                                       //results in {foo: "hello", bar: "everyone"}
+                               */
+                               apply: function(destination, source) {
+                                       for (var i in source) {
+                                               destination[i] = source[i];
+                                       }
+                                       return destination;
+                               },
+
+                               /**
+                               @name glow.lang.map
+                               @function
+                               @description Runs a function for each element of an array and returns an array of the results
+
+                               @param {Array} array Array to loop over
+                               @param {Function} callback The function to run on each element. This function is passed three params, the array item, its index and the source array.
+                               @param {Object} [context] The context for the callback function (the array is used if not specified)
+
+                               @returns {Array}
+
+                                       Array containing one element for each value returned from the callback
+
+                               @example
+                                       var weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
+                                       var weekdaysAbbr = glow.lang.map(weekdays, function (day) {
+                                               return day.slice(0, 3).toLowerCase();
+                                       });
+                                       // returns ["mon", "tue", "wed", "thu", "fri"]
+                               */
+                               map: function (arr, callback, context) {
+                                       if (Array.prototype.map) { return Array.prototype.map.call(arr, callback, context || arr); }
+                                       if (! callback.call) { throw new TypeError(); }
+
+                                       var len = arr.length,
+                                               res = [],
+                                               thisp = context || arr,
+                                               i = 0;
+
+                                       for (; i < len; i++) {
+                                               if (i in arr) {
+                                                       res[i] = callback.call(thisp, arr[i], i, arr);
+                                               }
+                                       }
+                                       return res;
+                               },
+
+                               /**
+                               @name glow.lang.replace
+                               @function
+                               @description Makes a replacement in a string.
+
+                                       Has the same interface as the builtin
+                                       String.prototype.replace method, but takes the input
+                                       string as the first parameter. In general the native string
+                                       method should be used unless you need to pass a function as the
+                                       second parameter, as this method will work accross our
+                                       supported browsers.
+
+                               @param {String} str Input string
+
+                               @param {String | RegExp} pattern String or regular expression to match against
+
+                               @param {String | Function} replacement String to make replacements with, or a function to generate the replacements
+
+                               @returns {String}
+                                       A new string with the replacement(s) made
+
+                               @example
+                                       var myDays = '1 3 6';
+                                       var dayNames = glow.lang.replace(myDays, /(\d)/, function (day) {
+                                               return " MTWTFSS".charAt(day - 1);
+                                       });
+                                       // dayNames now contains "M W S"
+                               */
+                               replace: (function () {
+                                       var replaceBroken = "g".replace(/g/, function () { return 'l'; }) != 'l',
+                                               def = String.prototype.replace;
+                                       return function (inputString, re, replaceWith) {
+                                               var pos, match, last, buf;
+                                               if (! replaceBroken || typeof(replaceWith) != 'function') {
+                                                       return def.call(inputString, re, replaceWith);
+                                               }
+                                               if (! (re instanceof RegExp)) {
+                                                       pos = inputString.indexOf(re);
+                                                       return pos == -1 ?
+                                                               inputString :
+                                                               def.call(inputString, re, replaceWith.call(null, re, pos, inputString));
+                                               }
+                                               buf = [];
+                                               last = re.lastIndex = 0;
+                                               while ((match = re.exec(inputString)) != null) {
+                                                       pos = match.index;
+                                                       buf[buf.length] = inputString.slice(last, pos);
+                                                       buf[buf.length] = replaceWith.apply(null, match);
+                                                       if (re.global) {
+                                                               last = re.lastIndex;
+                                                       } else {
+                                                               last = pos + match[0].length;
+                                                               break;
+                                                       }
+                                               }
+                                               buf[buf.length] = inputString.slice(last);
+                                               return buf.join("");
+                                       };
+                               })(),
+
+                               /**
+                               @name glow.lang.interpolate
+                               @function
+                               @description Replaces placeholders in a string with data from an object
+
+                               @param {String} template The string containing {placeholders}
+                               @param {Object} data Object containing the data to be merged in to the template
+                                       <p>The object can contain nested data objects and arrays, with nested object properties and array elements are accessed using dot notation. eg foo.bar or foo.0.</p>
+                                       <p>The data labels in the object cannot contain characters used in the template delimiters, so if the data must be allowed to contain the default { and } delimiters, the delimters must be changed using the option below.</p>
+                               @param {Object} opts Options object
+                                       @param {String} [opts.delimiter="{}"] Alternative label delimiter(s) for the template
+                                               The first character supplied will be the opening delimiter, and the second the closing. If only one character is supplied, it will be used for both ends.
+                                       @param {Boolean} [opts.escapeHtml=false] Escape any special html characters found in the data object
+                                               Use this to safely inject data from the user into an HTML template. The glow.dom module
+                                               must be present for this feature to work (an error will be thrown otherwise).
+
+                               @returns {String}
+
+                               @example
+                                       var data = {
+                                               name: "Domino",
+                                               colours: ["black", "white"],
+                                               family: {
+                                                       mum: "Spot",
+                                                       dad: "Patch",
+                                                       siblings: []
+                                               }
+                                       };
+                                       var template = "My cat's name is {name}. His colours are {colours.0} & {colours.1}. His mum is {family.mum}, his dad is {family.dad} and he has {family.siblings.length} brothers or sisters.";
+                                       var result = glow.lang.interpolate(template, data);
+                                       // result == "My cat's name is Domino. His colours are black & white. His mum is Spot, his dad is Patch and he has 0 brothers or sisters."
+                               
+                               @example
+                                       var data = {
+                                               name: 'Haxors!!1 <script src="hackhackhack.js"></script>'
+                                       }
+                                       var template = '<p>Hello, my name is {name}</p>';
+                                       var result = glow.lang.interpolate(template, data, {
+                                               escapeHtml: true
+                                       });
+                                       // result == '<p>Hello, my name is Haxors!!1 &lt;script src="hackhackhack.js"&gt;&lt;/script&gt;</p>'
+                               */
+                               interpolate : function (template, data, opts) {
+                                       var placeHolderRx,
+                                               leftDelimiter,
+                                               rightDelimiter,
+                                               // div used for html escaping
+                                               div;
+
+                                       opts = opts || {};
+                                       
+                                       // make sure the dom module is around
+                                       if (opts.escapeHtml) {
+                                               if (!glow.dom) { throw new Error('glow.lang.interpolate - glow.dom is needed for escapeHtml'); }
+                                               div = glow.dom.create('<div></div>');
+                                       }
+
+                                       if (opts.delimiter == undefined) {
+                                               placeHolderRx = /\{[^{}]+\}/g;
+                                       } else {
+                                               leftDelimiter = opts.delimiter.substr(0, 1).replace(regexEscape, "\\$1");
+                                               rightDelimiter = opts.delimiter.substr(1, 1).replace(regexEscape, "\\$1") || leftDelimiter;
+                                               placeHolderRx = new RegExp(leftDelimiter + "[^" + leftDelimiter + rightDelimiter + "]+" + rightDelimiter, "g");
+                                       }
+
+                                       return template.replace(placeHolderRx, function (placeholder) {
+
+                                               var key = placeholder.slice(1, -1),
+                                                       keyParts = key.split("."),
+                                                       val,
+                                                       i = 0,
+                                                       len = keyParts.length;
+                                               
+                                               if (key in data) {
+                                                       // need to be backwards compatible with "flattened" data.
+                                                       val = data[key]; 
+                                               } else {
+                                                       // look up the chain
+                                                       val = data;
+                                                       for (; i < len; i++) {
+                                                               if (keyParts[i] in val) {
+                                                                       val = val[ keyParts[i] ];
+                                                               } else {
+                                                                       return placeholder;
+                                                               }
+                                                       }
+                                               }
+                                               
+                                               if (opts.escapeHtml) {
+                                                       val = div.text(val).html();
+                                               }
+                                               return val;
+                                       });
+                               },
+                               /**
+                               @name glow.lang.hasOwnProperty
+                               @function
+                               @description Cross-browser implementation
+                               @deprecated
+
+                                 Safari 1.3 doesn't support
+                                 <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object:hasOwnProperty">
+                                   Object.hasOwnProperty
+                                 </a>, use this method instead.
+
+                               @param {Object} obj The object to check
+
+                               @param {String} property Property name
+
+                               @returns {Boolean}
+
+                                       Returns false if a property doesn't exist in an object, or it
+                                       was inherited from the object's prototype. Otherwise, returns
+                                       true
+                               */
+                               hasOwnProperty: {}.hasOwnProperty ? //not supported in Safari 1.3
+                                       function(obj, prop) {
+                                               return obj.hasOwnProperty(prop);
+                                       } :
+                                       function(obj, prop) {
+                                               var propVal = obj[prop], //value of the property
+                                                       objProto = obj.__proto__, //prototype of obj
+                                                       protoVal = objProto ? objProto[prop] : {}; //prototype val
+                                               if (propVal !== protoVal) {
+                                                       return true;
+                                               }
+                                               //try changing prototype and see if obj reacts
+                                               var restoreProtoVal = glow.lang.hasOwnProperty(objProto, prop),
+                                                       tempObjProtoVal = objProto[prop] = {},
+                                                       hasOwn = (obj[prop] !== tempObjProtoVal);
+
+                                               delete objProto[prop];
+                                               if (restoreProtoVal) {
+                                                       objProto[name] = tempObjProtoVal;
+                                               }
+                                               return hasOwn;
+                                       },
+
+                               /**
+                               @name glow.lang.extend
+                               @function
+                               @description Copies the prototype of one object to another.
+
+                                       The 'subclass' can also access the 'base class' via subclass.base
+
+                               @param {Function} sub Class which inherits properties.
+
+                               @param {Function} base Class to inherit from.
+
+                               @param {Object} additionalProperties An object of properties and methods to add to the subclass.
+
+                               @example
+                                       function MyClass(arg) {
+                                               this.prop = arg;
+                                       }
+                                       MyClass.prototype = {
+                                               showProp: function() { alert(this.prop); }
+                                       };
+                                       function MyOtherClass(arg) {
+                                               //call the base class's constructor
+                                               arguments.callee.base.apply(this, arguments);
+                                       }
+                                       glow.lang.extend(MyOtherClass, MyClass, {
+                                               setProp: function(newProp) { this.prop = newProp; }
+                                       });
+
+                                       var test = new MyOtherClass("hello");
+                                       test.showProp(); // alerts "hello"
+                                       test.setProp("world");
+                                       test.showProp(); // alerts "world"
+                                *
+                                */
+                               extend: function(sub, base, additionalProperties) {
+                                       var f = function () {}, p;
+                                       f.prototype = base.prototype;
+                                       p = new f();
+                                       sub.prototype = p;
+                                       p.constructor = sub;
+                                       sub.base = base;
+                                       if (additionalProperties) {
+                                               glow.lang.apply(sub.prototype, additionalProperties);
+                                       }
+                               },
+
+                               /**
+                               @name glow.lang.clone
+                               @function
+                               @description Deep clones an object / array
+
+                               @param {Object} Data Object to clone
+
+                               @returns {Object}
+
+                               @example
+                                       var firstObj = { name: "Bob", secondNames: ["is","your","uncle"] };
+                                       var clonedObj = glow.lang.clone( firstObj );
+                               */
+                               clone: function( obj ) {
+                                       var index, _index, tmp;
+                                       obj = obj.valueOf();
+                                       if ( typeof obj !== 'object' ) {
+                                               return obj;
+                                       } else {
+                                               if ( obj[0] || obj.concat ) {
+                                                       tmp = [ ];
+                                                       index = obj.length;
+                                                       while(index--) {
+                                                               tmp[index] = arguments.callee( obj[index] );
+                                                       }
+                                       } else {
+                                                       tmp = { };
+                                                       for ( index in obj ) {
+                                                               tmp[index] = arguments.callee( obj[index] );
+                                                       }
+                                               }
+                                       return tmp;
+                                       }
+
+                               }
+                       }
+               },
+               env = glow.env,
+               d = document;
+       
+       //dom ready stuff
+       //run queued ready functions when DOM is ready
+       
+       function runDomReadyQueue() {
+               glow.isDomReady = true;
+               // run all functions in the array
+               for (var i = 0; i < domReadyQueueLen; i++) {
+                       domReadyQueue[i]();
+               }
+       }
+       
+       function runReadyQueue() {
+               // if we're already processing the queue, just exit, the other instance will take care of it
+               if (processingReadyQueue) return;
+               processingReadyQueue = true;
+               for (var i = 0; i < readyQueueLen;) {
+                       readyQueue[i]();
+                       i++;
+                       // check if the previous function has created a blocker
+                       if (blockersActive) {
+                               break;
+                       }
+               }
+               // take items off the ready queue that have processed
+               readyQueue = readyQueue.slice(i);
+               // update len
+               readyQueueLen = readyQueueLen - i;
+               processingReadyQueue = false;
+       }
+       
+       (function(){
+               //don't do this stuff if the dom is already ready
+               if (glow.isDomReady) { return; }
+               
+               glow._addReadyBlock("glow_domReady");
+               if (env.ie) {
+                       if (typeof window.frameElement != 'undefined') {
+                               // we can't use doScroll if we're in an iframe...
+                               d.attachEvent("onreadystatechange", function(){
+                                       if (d.readyState == "complete") {
+                                               d.detachEvent("onreadystatechange", arguments.callee);
+                                               runDomReadyQueue();
+                                               glow._removeReadyBlock("glow_domReady");
+                                       }
+                               });
+                       } else {
+                               // polling for no errors
+                               (function () {
+                                       try {
+                                               // throws errors until after ondocumentready
+                                               d.documentElement.doScroll('left');
+                                       } catch (e) {
+                                               setTimeout(arguments.callee, 0);
+                                               return;
+                                       }
+                                       // no errors, fire
+                                       runDomReadyQueue();
+                                       glow._removeReadyBlock("glow_domReady");
+                               })();
+                       }
+               } else if (glow.env.webkit < 525.13 && typeof d.readyState != 'undefined') {
+                       var f = function(){
+                               if ( /loaded|complete/.test(d.readyState) ) {
+                                       runDomReadyQueue();
+                                       glow._removeReadyBlock("glow_domReady");
+                               } else {
+                                       setTimeout(f, 0);
+                               }
+                       };
+                       f();
+               } else {
+                       var callback = function () {
+                               if (callback.fired) { return; }
+                               callback.fired = true;
+                               runDomReadyQueue();
+                               glow._removeReadyBlock("glow_domReady");
+                       };
+                       if (d.addEventListener) {
+                               d.addEventListener("DOMContentLoaded", callback, false);
+                       }
+                       var oldOnload = window.onload;
+                       window.onload = function () {
+                               if (oldOnload) { oldOnload(); }
+                               callback();
+                       };
+               }
+       })();
+
+       /**
+       @name glow.isSupported
+       @description Set to true in supported user agents
+               This will read false in 'level 2' browsers in BBC's Browser Support Guidelines
+       @type Boolean
+
+       @see <a href="http://www.bbc.co.uk/guidelines/newmedia/technical/browser_support.shtml">BBC's Browser Support Guidelines</a>
+       */
+       // TODO: for v2 we should switch this to 'notSupported' as it's a blacklist
+       glow.isSupported = !(
+               //here are the browsers we don't support
+               env.ie < 6 ||
+               (env.gecko < 1.9 && !/^1\.8\.1/.test(env.version)) ||
+               env.opera < 9 ||
+               env.webkit < 412
+       );
+       // block 'ready' if browser isn't supported
+       if (!glow.isSupported) {
+               glow._addReadyBlock("glow_browserSupport");
+       }
+
+       if (window.gloader) {
+               gloader.library({
+                       name: "glow",
+                       version: "1.7.0",
+                       builder: function () {
+                               return glow;
+                       }
+               });
+       } else if (window.glow) {
+               throw new Error("Glow global object already exists");
+       } else {
+               window.glow = glow;
+       }
+
+       // this helps IE cache background images
+       if (glow.ie) {
+               try {
+                       document.execCommand("BackgroundImageCache", false, true);
+               } catch(e) {}
+       }
+})();
+/*@cc_on @*/
+/*@if (@_jscript_version > 5.5)@*/
+/**
+@name glow.i18n
+@namespace
+@description Internationalisation Module.
+@requires glow
+@see <a href="../furtherinfo/i18n/index.shtml">Using glow.i18n</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.i18n",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0"]],
+       builder: function(glow) {
+               var self;
+               
+               // Regexes for judging subtag types in the 'L'anguage, 'S'cript, 'R'egion, 'V'ariant form
+               // lv is a match for a subtag that can be either 'L'anguage or 'V'ariant
+               // See full explanation of tags and subtags at the end of the file
+               var subtagRegexes = {
+                               l  : /^[a-z]$/,
+                               lv : /^[a-z]{2,3}$/,
+                               s  : /^[A-Z][a-z]{3}$/,
+                               r  : /^[A-Z]{2}|[0-9]{3}$/,
+                               v  : /^[a-z0-9]{4,}$/
+                       };
+
+               // Bit masks for tag signature in the 'L'anguage, 'S'cript, 'R'egion, 'V'ariant form
+               // See full explanation of tags and subtags at the end of the file
+               var L    = 1,
+                       S    = 2,
+                       R    = 4,
+                       V    = 8,
+                       LSRV = L + S + R + V,
+                       LRV  = L     + R + V,
+                       LSV  = L + S     + V,
+                       LV   = L         + V,
+                       LSR  = L + S + R    ,
+                       LR   = L     + R    ,
+                       LS   = L + S;
+       
+               // Base structures for tag parsing using 'L'anguage, 'S'cript, 'R'egion, 'V'ariant form
+               // See full explanation of tags and subtags at the end of the file
+               var masks   = {l: L, s: S, r: R, v: V}, // map subtag types to masks
+                       subtags = ['l', 's', 'r', 'v'],         // in order
+                       labels  = {l: 0, s: 1, r: 2, v: 3}; // reverse look up for subtags
+
+               // holds the actual local pack data
+               var localePacks = {};
+
+               // holds the main index of the pack / module structure
+               var moduleStructure = {};
+
+               // the currently selected locale
+               // comes from html lang if it exists and is valid, defaults to 'en'
+               var currentLocale = parseTag(document.documentElement.lang || 'en') || parseTag('en');
+               
+               // Determine what, if any, type of subtag this is by regex matching
+               function getSubtagPattern( subtag ) {
+                       for (var pattern in subtagRegexes) { // These regexes are mutually exclusive, so order is immaterial
+                               if (subtagRegexes[pattern].test(subtag)) {
+                                       return pattern;
+                               }
+                       }
+       
+                       return "";
+               }
+
+               // Parse the given tag and return a queryable data set using 'L'anguage, 'S'cript, 'R'egion, 'V'ariant form
+               // See full explanation of tags and subtags at the end of the file
+               // if the tag is valid, returns the internal representation of a parsed locale tag
+               // canonical is the valid canonical form of the tag eg "en-GB", mask is a bitmask indicating which subtag types are present and subtags is an object containing the actual subtags
+               function parseTag( tag ) {
+                       if (!tag.split) {
+                               tag = "";
+                       }
+               
+                       var parts = tag.split("-"), // get the subtags
+                               len = parts.length,
+                               canon = [],                             // will hold the subtags of the canonical tag
+                               matchedSubtags = {l: "", s:"", r:"", v:""},
+                               start = 0,
+                               i = start,
+                               mask = 0,
+                               subtag,
+                               label;
+               
+                       for (var j = 0, jlen = subtags.length; j < jlen; j++) { // order of subtag match is important
+                               i = start;
+                               subtag = subtags[j];
+                               label = labels[subtag];
+       
+                               while ((getSubtagPattern(parts[i]).indexOf(subtag) == -1) && (i < len)) { // indexOf allows for partial match of 'lv' regex
+                                       i++; // if no match, move on
+                               }
+                               
+                               if (i < len) { // if a match is found, store it and continue with the next subtag from this point
+                                       canon[label] = parts[i];
+                                       mask += masks[subtag];
+                                       matchedSubtags[subtag] = parts[i];
+                                       parts[i] = "*";
+                                       start = i;
+                               }
+                       }
+                       
+                       // put it all back together as a string
+                       var canonical = canon.join("-").replace(/-+/g, "-");
+                       
+                       if ((canonical == "") || (canonical.substring(0, 1) == "-")) { // this means there is no language subtag, so we must fail the parse
+                               return false;
+                       }
+                       else {
+                               return {canonical: canonical, mask: mask, subtags: matchedSubtags};
+                       }
+               }               
+               
+               // For a given tag, and mask for a subset of it, return the subset tag using 'L'anguage, 'S'cript, 'R'egion, 'V'ariant form
+               // eg for 'en-GB-scouse' and an LR mask, return 'en-GB'
+               // See full explanation of tags and subtags at the end of the file
+               // ** note the bitwise operations **
+               function getSubsetTag( parsed, test, mask ) {
+                       var subset;
+                       
+                       // this test (bitwise because the operands are bitmasks) determines that mask has no bits set that parsed.mask does not
+                       // this is to make sure that the tag being generated is genuinely a subset of the main tag
+                       if ((mask & ~parsed.mask) == 0) {
+                               subset = parsed.subtags["l"]; // there must be a language subtag, because this tags passed the parse
+                               
+                               if (S & mask) {
+                                       subset = subset + "-" + parsed.subtags["s"];
+                               }
+                               if (R & mask) {
+                                       subset = subset + "-" + parsed.subtags["r"];
+                               }
+                               if (V & mask) {
+                                       subset = subset + "-" + parsed.subtags["v"];
+                               }
+       
+                               if (test(subset)) {
+                                       return subset;
+                               }
+                       }
+               
+                       return false;
+               }
+
+               // Performs the generic tag negotiation process
+               // The test is a function that performs an additional check to see if the subset tag currently being
+               // checked should be used, normally based on the presence of appropriate data in the locale packs
+               // parsed is the parsed locale tag, as returned by parseTag
+               // testFn is the function passed to getSubsetTag, used to determine if a given subste tag is a negotiated hit
+               // successFn, failFn are the functions to be run when the negotiation result is known
+               function negotiate( parsed, testFn, successFn, failFn ) {
+                       var subset;
+                                       
+                       switch(parsed.mask) { // NOTE the breaks are conditional because it might be OK for all the cases to execute - need to move on to the next case if the "if" fails
+                               case LRV:
+                                       if ((subset = getSubsetTag(parsed, testFn, LRV ))) {
+                                               break;
+                                       }
+                               case LR:
+                                       if ((subset = getSubsetTag(parsed, testFn, LR  ))) {
+                                               break;
+                                       }
+                               case LSRV:
+                                       if ((subset = getSubsetTag(parsed, testFn, LSRV))) {
+                                               break;
+                                       }
+                               case LSR:
+                                       if ((subset = getSubsetTag(parsed, testFn, LSR ))) {
+                                               break;
+                                       }
+                               case LSV:
+                                       if ((subset = getSubsetTag(parsed, testFn, LSV ))) {
+                                               break;
+                                       }
+                               case LS:
+                                       if ((subset = getSubsetTag(parsed, testFn, LS  ))) {
+                                               break;
+                                       }
+                               case LV:
+                                       if ((subset = getSubsetTag(parsed, testFn, LV  ))) {
+                                               break;
+                                       }
+                               case L:
+                                       if ((subset = getSubsetTag(parsed, testFn, L   ))) {
+                                               break;
+                                       }
+                               default:
+                                       if (testFn('en')) {
+                                               subset = 'en';
+                                       }
+                                       else {
+                                               subset = null;
+                                       }
+                       }
+
+                       if (subset == null) {
+                               failFn();
+                       } 
+                       else {
+                               successFn(subset);
+                       }
+               }
+       
+               /**
+               @name glow.i18n.setLocale
+               @function
+               @description Sets the locale to a new one, stacking up the old one for later retreival.
+               
+                       Has no effect if the newLocaleTag is invalid.
+               
+               @param {String} newLocaleTag The new locale tag to be set.
+
+               @returns this
+               
+               @example
+                       // assume locale is "en-GB" first
+                       glow.i18n.setLocale("cy-GB");
+                       // locale is now "cy-GB" with "en-GB" stacked up
+               */
+               function setLocale( newLocaleTag ) {
+                       var old = currentLocale,
+                               parsed = parseTag(newLocaleTag);
+
+                       if (parsed) {
+                               currentLocale = parsed;
+                               currentLocale.next = old;
+                       }
+                       
+                       return self;
+               }
+       
+               /**
+               @name glow.i18n.revertLocale
+               @function
+               @description Reverts the locale to the one used immediately prior to the current one.
+               
+                       Has no effect if the current locale was the first set (ie if no new locales have been set,
+                       or if the locale has been reverted all the way back to the beginning).
+
+               @returns this
+               
+               @example
+                       // assume locale is "en-GB" first
+                       glow.i18n.setLocale("cy-GB");
+                       // locale is now "cy-GB" with "en-GB" stacked up
+                       glow.i18n.revertLocale();
+                       // locale is now back to "en-GB"
+               */
+               function revertLocale() {
+                       currentLocale = currentLocale.next || currentLocale;
+                       
+                       return self;            
+               }
+               
+               /**
+               @name glow.i18n.getLocale
+               @function
+               @description Returns the tag of the current locale in canonical form.
+
+               @returns {String}
+
+               @example
+                       loc = glow.i18n.getLocale(); // returns the current locale eg "en-GB"
+
+                       glow.i18n.setLocale("cy-GB");
+                       loc = glow.i18n.getLocale(); // now returns "cy
+
+                       glow.i18n.setLocale("en-ignoredsubtag-US");
+                       loc = glow.i18n.getLocale(); // now returns "en-US", which is the canonical form
+               */
+               function getLocale() {
+                       return currentLocale.canonical;
+               }
+               
+               /**
+               @name glow.i18n.addLocaleModule
+               @function
+               @description Stores the given data against the given module on the given locale.
+                       Creates any local packs and / or moduels that dio not already exist.
+                       Adds the given data to any that do.
+
+               @param {String} moduleName The name of the module to be created/added to.
+               @param {String} localeTag The locale tag to add the module to.
+               @param {Object} data The data of the module in key : value form.
+
+               @returns this
+               
+               @example
+                       // assume locale is "en-GB" first
+                       glow.i18n.setLocale("cy-nonsense-GB");
+                       var newLocale = glow.i18n.getLocale(); // returns "cy-GB"
+               */
+               function addLocaleModule( moduleName, localeTag, data ) {
+                       var tag = parseTag(localeTag),
+                               pack,
+                               module,
+                               structure;
+                       
+                       if (tag) {
+                               pack      = localePacks[tag.canonical]  = localePacks[tag.canonical]  || {};
+                               module    = pack[moduleName]            = pack[moduleName]            || {};
+                               structure = moduleStructure[moduleName] = moduleStructure[moduleName] || {};
+                               
+                               for (var key in data) { // not using glow.lang.apply to avoid two loops
+                                       module[key] = data[key];
+                                       structure[key] = 1;
+                               }
+                       }
+                       
+                       return self;
+               }
+       
+               /**
+               @name glow.i18n.getLocaleModule
+               @function
+               @description Retreives an object whose keys are every label that can have a value (via tag negotiation) associated with it, and whose values are the associated label values.
+
+               @param {String} moduleName The name of the module retreived.
+               @param {Object} [opts] Options object
+                       @param {String} [opts.locale] On override locale to use instaed of the system locale.
+
+               @returns {Object}
+               */
+               function getLocaleModule( moduleName, opts ) {
+                       var module = {},
+                               options = opts || {},
+                               structure = moduleStructure[moduleName] || {},
+                               localeTag = currentLocale,
+                               tag,
+                               label;
+
+                       // define the customisers for negotiate outside the loop
+                       // oddly, the loop control variable *is* correclty accessed, becasue of var scoping and the synchronous function calls
+                       function test( nTag ) {
+                               if (localePacks[nTag] && localePacks[nTag][moduleName] && localePacks[nTag][moduleName][label]) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
+                       }
+                       
+                       function success( sTag ) {
+                               module[label] = localePacks[sTag][moduleName][label];
+                       }
+                       
+                       function fail() {
+                               module[label] = "[Error! No " + moduleName + "." + label + " on " + localeTag.canonical + "]";
+                       }
+                       
+                       if (options.locale != undefined) {
+                               tag = parseTag(options.locale);
+                               
+                               if (tag) {
+                                       localeTag = tag;
+                               }
+                       }
+
+                       for (label in structure) {
+                               negotiate(localeTag, test, success, fail);
+                       }
+
+                       return module;
+               }
+               
+               /**
+               @name glow.i18n.addLocalePack
+               @function
+               @description Shortcut for creating many locale modules on one locale (ie a brand new entire locale pack)
+
+               @param {String} localeTag The name of the module retreived.
+               @param {Object} data The data of the module in MODULE : key : value form.
+
+               @returns this
+               */
+               function addLocalePack( localeTag, data ) {
+                       for (var moduleName in data) {
+                               addLocaleModule(moduleName, localeTag, data[moduleName]);
+                       }
+                       
+                       return self;
+               }
+       
+               /**
+               @name glow.i18n.checkLocale
+               @function
+               @description Developer focused checker for getting the locale tag(s) returned by tag negotiation
+                       if no options passed it returns a structured data object of the entire data set for the given locale
+                       if just a module name is passed, the result set is limited to that module
+                       if a module name and a label are passed it returns a string for just that label
+       
+               @param {String} localeTag The name of the module retreived.
+               @param {Object} [opts] Options object
+                       @param {String} [opts.module] If set, restricts the results to that module.
+                       @param {String} [opts.label] If set alongside opts.module, restricts the results to that label on that module.
+
+               @returns {Object}
+               */
+               function checkLocale( localeTag, opts ) {
+                       var options = opts || {},
+                               parsed = parseTag(localeTag);
+       
+                       if (options.module) {
+                               if (options.label) {
+                                       return checkLocaleByModuleAndLabel(parsed, options.module, options.label);
+                               }
+                               else {
+                                       return checkLocaleByModule(parsed, options.module);
+                               }
+                       }
+                       else {
+                               return checkLocaleByEverything(parsed);
+                       }
+                       
+                       return null;
+               }
+
+               // helper for checkLocale
+               function checkLocaleByModuleAndLabel( parsed, module, label ) {
+                       var result;
+                       
+                       // Define the customisers for negotiate outside the function call to be consistent with other checkLocaleBy* helpers
+                       function test( nTag ) {
+                               if (localePacks[nTag] && localePacks[nTag][module] && localePacks[nTag][module][label]) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
+                       }
+                       
+                       function success( sTag ) {
+                               result = sTag;
+                       }
+                       
+                       function fail() {
+                               result = "**error** - no negotiated value exists";
+                       }
+
+                       negotiate(parsed, test, success, fail);
+                       
+                       return result;
+               }
+               
+               // helper for checkLocale
+               function checkLocaleByModule( parsed, module ) {
+                       var structure = moduleStructure[module] || {},
+                               results = {},
+                               label;
+
+                       // Define the customisers for negotiate outside the loop
+                       // Oddly, the loop control variable *is* correclty accessed, becasue of var scoping and the synchronous function calls
+                       function test( nTag ) {
+                               if (localePacks[nTag] && localePacks[nTag][module] && localePacks[nTag][module][label]) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
+                       }
+                       
+                       function success( sTag ) {
+                               results[label] = sTag;
+                       }
+                       
+                       function fail() {
+                               results[label] = "**error** - no negotiated value exists";
+                       }
+                       
+                       for (label in structure) {
+                               negotiate(parsed, test, success, fail);
+                       }
+                       
+                       return results;                 
+               }
+               
+               // helper for checkLocale
+               function checkLocaleByEverything( parsed ) {
+                       var results = {},
+                               module,
+                               label;
+                       
+                       // Define the customisers for negotiate outside the loop
+                       // Oddly, the loop control variable *is* correclty accessed, becasue of var scoping and the synchronous function calls
+                       function test( nTag ) {
+                               if (localePacks[nTag] && localePacks[nTag][module] && localePacks[nTag][module][label]) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
+                       }
+                       
+                       function success( sTag ) {
+                               results[module][label] = sTag;
+                       }
+                       
+                       function fail() {
+                               results[module][label] = "**error** - no negotiated value exists";
+                       }
+
+                       for (module in moduleStructure) {
+                               results[module] = {};
+                               
+                               for (label in moduleStructure[module]) {
+                                       negotiate(parsed, test, success, fail);
+                               }
+                       }
+                       
+                       return results;
+               }
+
+               
+               // make the module
+               glow.i18n = self = {
+                       setLocale : setLocale,
+                       revertLocale : revertLocale,
+                       getLocale : getLocale,
+                       addLocaleModule : addLocaleModule,
+                       getLocaleModule : getLocaleModule,
+                       addLocalePack : addLocalePack,
+                       checkLocale : checkLocale
+               }
+               
+               // define the basic 'en' locale pack
+               // just the properties - widgets and modules will add their own locale modules
+               addLocalePack("en", {
+                       PROPERTIES : {
+                               LANGUAGE : "English",
+                               DIR : "ltr"
+                       }
+               });
+       }
+});
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+       About Locale Tags and Tag Negotiation
+       =====================================
+       
+       Locale Tag negotiation is the process Glow uses to find the most specific
+       match for a given tag given the context.
+       
+       
+       
+       Locale Tag Structure
+       ~~~~~~~~~~~~~~~~~~~~
+       
+       First, let's look at the anatomy of locale tags in Glow.
+       
+       According to the IANA spec, locale tags have this structure
+       
+               language-script-region-variant-extension-privateuse
+       
+       There are also "grandfathered" and "redundant" tags that existed before
+       this structure was implemented and continue for backwards compatibility.
+       
+       Glow only supports the following subset of that structure. Subtags are
+       separated by "-" and must appear in the correct order.
+       
+               language-script-region-variant
+       
+       These are the IANA formats of these subtags
+       
+       language : /[a-z]{2,3}/          - 2 or 3 lowercase letters.
+       script   : /[A-Z][a-z]{3}/       - an uppercase letter followed by
+                                                                          3 lowercase letters
+       region   : /[A-Z]{2}|[0-9]{3}/   - 2 upper case letters or a 3 digit number
+       variant  : /[a-z0-9]{4,}/        - lower case letters or numbers,
+                                                                          4 or more characters
+       
+       eg (yes, these are all official IANA tags, even the last one...)
+       
+       en                        language                  generic English
+       en-GB             language-region               British English
+       en-Runr           language-script           English written in Runic script
+       en-Runr-GB        language-script-region    British English written in Runic
+       en-GB-scouse  language-region-variant   Scouse variant of British English
+       
+       While Glow does not support grandfathered or redundant tags or extension or
+       private use subtags, it does not enforce compliance with the IANA registry.
+       
+       This means that if the subtag formats can be relaxed a little, variation
+       from the standard could be used to fill these gaps with a tag that Glow can
+       parse.
+       
+       As a result Glow applies theses formats to subtags
+       
+       language : /[a-z]{1,3}/        - 1, 2 or 3 lowercase letters
+                                                                               > allowing shorter subtag than IANA
+       script   : /[A-Z][a-z]{3}/     - an uppercase letter
+                                                                        followed by 3 lowercase letters
+                                                                               > same as IANA
+       region   : /[A-Z]{2}|[0-9]{3}/ - 2 upper case letters or a 3 digit number
+                                                                               > same as IANA
+       variant  : /[a-z0-9]{2,}/      - lower case letters or numbers,
+                                                                        2 or more characters
+                                                                               > allowing shorter subtag than IANA
+       
+       This does mean that there is now potential conflict between the language
+       and the variant subtags; a subtag that is 2 or 3 lowercase letters could be
+       either. Glow's insistence on strict subtag order solves this. If a subtag
+       that falls in this overlap zone is encountered, it is a language subtag
+       first, a variant if a language has already be found, and ignored as a last
+       resort.
+       
+       Now, even though according to IANA, en-GB-oed is grandfathered (the variant
+       is too short), it can be directly supported by Glow.
+       
+       (If you're interested, en-GB-oed is British English, but with Oxford
+       English Dictionary spellings. These basically -ize rather than -ise but all
+       other spellings as en-GB, so the OED lists "colourize")
+       
+       
+       
+       Tag Negotiation Process
+       ~~~~~~~~~~~~~~~~~~~~~~~
+       
+       When parsing a tag, Glow will look for each subtag in the expected order.
+       If a subtag is encountered out of order, or when that item has already been
+       parsed, it will be ignored. If a subtag's type cannot be identified, it
+       will be ignored.
+       
+       GB-cy-1-en-US will be parsed as cy-US.
+               'GB' is out of order,
+               'en' is a duplicated language subtag and
+               '1' is not a recognised subtag type.
+       
+       Given all this, Locale negotiation occurs in the following order.
+       
+                                                               script present?
+                                                                       /      \
+                                                        (yes) /        \ (no)
+                                                                 /          \
+               language-script-region-variant    language-region-variant
+                               language-script-region    language-region
+                          language-script-variant       /
+                                          language-script      /
+                                                                       \      /
+                                                               language-variant
+                                                                       language
+                                                                          en
+       
+       It starts at the specificity of the given tag, and skips steps which have a
+       subtag that isn't present. eg
+       
+       xx-YY, which will be parsed as language-region, will negotiate as
+               language-region
+               language
+               en
+       
+       xx-Yyyy-ZZ, will be parsed as language-script-region, and negotiate as
+               language-script-region
+               language-script
+               language
+               en
+       
+       When Locale packs are created, the tag will be checked to see if it can
+       be negotiated. A valid tag must have at least a language, so "en-GB" and
+       "cy" are valid, but "GB" is not.
+       
+       
+       How this Module handles all this
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       
+       The code has a number of variables, objects and arrays whose names or
+       values make reference to some variant or combination of l, s, r or v. These
+       match to the 'L'anguage, 'S'cript, 'R'egion or 'V'ariant subtag.
+
+       So, for instance, the variable LSRV is a bitmask for a tag structure with
+       all four subtags.
+       
+       
+       
+       Useful URLs
+       ~~~~~~~~~~~
+       
+       http://www.w3.org/International/articles/language-tags/
+       http://www.w3.org/International/articles/bcp47/
+       http://www.iana.org/assignments/language-subtag-registry
+
+
+
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+@name glow.dom
+@namespace
+@description Accessing and manipulating the DOM
+@see <a href="../furtherinfo/creatingnodelists/">Creating NodeLists</a>
+@see <a href="../furtherinfo/workingwithnodelists/">Working with NodeLists</a>
+@see <a href="../furtherinfo/xmlnodelists/">XML NodeLists</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.dom",
+       library: ["glow", "1.7.0"],
+       depends: [],
+       builder: function(glow) {
+               //private
+               var env = glow.env,
+                       lang = glow.lang,
+               /*
+               PrivateVar: cssRegex
+                       For matching CSS selectors
+               */
+                       cssRegex = {
+                               tagName: /^(\w+|\*)/,
+                               combinator: /^\s*([>]?)\s*/,
+                               //safari 1.3 is a bit dim when it comes to unicode stuff, only dot matches them (not even \S), so some negative lookalheads are needed
+                               classNameOrId: (env.webkit < 417) ? new RegExp("^([\\.#])((?:(?![\\.#\\[:\\s\\\\]).|\\\\.)+)") : /^([\.#])((?:[^\.#\[:\\\s]+|\\.)+)/
+                       },
+                       //for escaping strings in regex
+                       regexEscape = /([$^\\\/()|?+*\[\]{}.-])/g,
+
+               /*
+               PrivateVar: cssCache
+                       Cache of arrays representing an execution path for css selectors
+               */
+                       cssCache = {},
+
+               /*
+               PrivateVar: dom0PropertyMapping
+                       Mapping of HTML attribute names to DOM0 property names.
+               */
+                       dom0PropertyMapping = {
+                               checked    : "checked",
+                               "class"    : "className",
+                               "disabled" : "disabled",
+                               "for"      : "htmlFor",
+                               maxlength  : "maxLength"
+                       },
+
+               /*
+               PrivateVar: dom0BooleanAttribute
+                       The HTML attributes names that should be converted from true/false
+                       to ATTRIBUTENAME/undefined (i.e. boolean attributes like checked="checked").
+               */
+                       dom0BooleanAttribute = {
+                               checked  : true,
+                               disabled : true
+                       },
+
+               /*
+               PrivateVar: dom0AttributeMappings
+                       Functions that map dom0 values to sane ones.
+               */
+                       dom0AttributeMappings = {
+                               maxlength : function (val) { return val.toString() == "2147483647" ? undefined : val; }
+                       },
+               /*
+               PrivateVar: ucheck
+                       Used by unique(), increased by 1 on each use
+               */
+                       ucheck = 1,
+               /*
+               PrivateVar: ucheckPropName
+                       This is the property name used by unique checks
+               */
+                       ucheckPropName = "_unique" + glow.UID,
+                       
+               /**
+                       @name glow.dom-dataPropName
+                       @private
+                       @type String
+                       @description The property name added to the DomElement by the NodeList#data method.
+               */
+                       dataPropName = "_uniqueData" + glow.UID,
+               
+               /**
+                       @name glow.dom-dataIndex
+                       @private
+                       @type String
+                       @description The value of the dataPropName added by the NodeList#data method.
+               */
+                       dataIndex = 1, // must be a truthy value
+                       
+               /**
+                       @name glow.dom-dataCache
+                       @private
+                       @type Object
+                       @description Holds the data used by the NodeList#data method.
+                       
+                       The structure is like:
+                       [
+                               {
+                                       myKey: "my data"
+                               }
+                       ]
+               */
+                       dataCache = [],
+               
+               /*
+               PrivateVar: htmlColorNames
+                       Mapping of colour names to hex values
+               */
+                       htmlColorNames = {
+                               black: 0,
+                               silver: 0xc0c0c0,
+                               gray: 0x808080,
+                               white: 0xffffff,
+                               maroon: 0x800000,
+                               red: 0xff0000,
+                               purple: 0x800080,
+                               fuchsia: 0xff00ff,
+                               green: 0x8000,
+                               lime: 0xff00,
+                               olive: 0x808000,
+                               yellow: 0xffff00,
+                               navy: 128,
+                               blue: 255,
+                               teal: 0x8080,
+                               aqua: 0xffff,
+                               orange: 0xffa500
+                       },
+               /*
+               PrivateVar: usesYAxis
+                       regex for detecting which css properties need to be calculated relative to the y axis
+               */
+                       usesYAxis = /height|top/,
+                       colorRegex = /^rgb\(([\d\.]+)(%?),\s*([\d\.]+)(%?),\s*([\d\.]+)(%?)/i,
+                       cssPropRegex = /^(?:(width|height)|(border-(top|bottom|left|right)-width))$/,
+                       hasUnits = /width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,
+                       //append gets set to a function below
+                       append,
+                       //unique gets set to a function below
+                       unique,
+                       //we set this up at the end of the module
+                       placeholderElm,
+                       //getByTagName gets get to a function below
+                       getByTagName,
+                       win = window,
+                       doc = document,
+                       docBody,
+                       docElm,
+                       // true if properties of a dom node are cloned when the node is cloned (eg, true in IE)
+                       nodePropertiesCloned,
+                       // used to convert divs to strings
+                       tmpDiv = doc.createElement("div"),
+                       /*
+                       PrivateVars: tableArray, elmFilter
+                               Used in private function stringToNodes to capture any 
+                               elements that cannot be a childNode of <div>.
+                                       Each entry in JSON responds to an element.
+                                       First array value is how deep the element will be created in a node tree.
+                                       Second array value is the beginning of the node tree.
+                                       Third array value is the end of the node tree.
+                       */
+                       tableArray = [1, '<table>', '</table>'],
+                       emptyArray = [0, '', ''],
+                       // webkit won't accept <link> elms to be the only child of an element,
+                       // it steals them and hides them in the head for some reason. Using
+                       // broken html fixes it for some reason
+                       paddingElmArray = env.webkit < 526 ? [0, '', '</div>', true] : [1, 'b<div>', '</div>'],
+                       trArray = [3, '<table><tbody><tr>', '</tr></tbody></table>'],
+                       elmWraps = {
+                               caption: tableArray,
+                               thead: tableArray,
+                               th: trArray,
+                               colgroup: tableArray,
+                               tbody: tableArray,
+                               tr: [2, '<table><tbody>', '</tbody></table>'],
+                               td: trArray,
+                               tfoot: tableArray,
+                               option: [1, '<select>', '</select>'],
+                               legend: [1, '<fieldset>', '</fieldset>'],
+                               link: paddingElmArray,
+                               script: paddingElmArray,
+                               style: paddingElmArray
+                       };
+               
+               // clean up IE's mess
+               if (env.ie) {
+                       window.attachEvent("onunload", function() {
+                               tmpDiv = null;
+                       });
+               }
+               
+               glow.ready(function() {
+                       docBody = doc.body;
+                       docElm = doc.documentElement;
+               });
+               
+               
+               // test for nodePropertiesCloned
+               (function() {
+                       var div = doc.createElement("div");
+                       div.a = 1;
+                       nodePropertiesCloned = !!div.cloneNode(true).a;
+               })();
+               
+               /**
+                @name glow.dom-getFirstChildElm
+                @private
+                @description Returns the first leaf of a NodeList
+                @param {NodeList} 
+               */
+               function getFirstChildElm(parent) {                                     
+                       for (var child = parent.firstChild; child; child = child.nextSibling) {
+                               if (child.nodeType == 1) {
+                                       return child;
+                               }                       
+                       }                       
+                       return null;                    
+               }
+
+               /*
+               PrivateMethod: removeClassRegex
+                       Get a regex that can be used to remove a class from a space separated list of classes.
+
+               Arguments:
+                       name - (string) the name of the class.
+
+               Returns:
+                       The regex.
+               */
+               function removeClassRegex (name) {
+                       return new RegExp(["(^|\\s)", name.replace(regexEscape, "\\$1"), "($|\\s)"].join(""), "g");
+               }
+
+
+               /*
+               PrivateMethod: stringToNodes
+                       Creates an array of nodes from a string
+               */
+               function stringToNodes(str) {
+                       var r = [],
+                               tagName = (/^\s*<([^\s>]+)/.exec(str) || [,'div'])[1],
+                               // This matches str content with potential elements that cannot
+                               // be a child of <div>.  elmFilter declared at top of page.
+                               elmWrap = elmWraps[tagName] || emptyArray, 
+                               nodeDepth,
+                               childElm,
+                               rLen = 0;
+                       
+                       // Create the new element using the node tree contents available in filteredElm.
+                       tmpDiv.innerHTML = (elmWrap[1] + str + elmWrap[2]);
+                       
+                       childElm = tmpDiv;
+                       
+                       // Strip newElement down to just the required element and its parent
+                       nodeDepth = elmWrap[0];
+                       while(nodeDepth--) {
+                               childElm = childElm.lastChild;
+                       }
+
+                       // pull nodes out of child
+                       while (childElm.firstChild) {
+                               r[rLen++] = childElm.removeChild(childElm.firstChild);
+                       }
+                       
+                       childElm = null;
+                       
+                       return r;
+               }
+
+               /*
+               PrivateMethod: nodelistToArray
+                       Converts a w3 NodeList to an array
+               */
+               function nodelistToArray(nodelist) {
+                       var r = [], i = 0;
+                       for (; nodelist[i]; i++) {
+                               r[i] = nodelist[i];
+                       }
+                       return r;
+               }
+
+               /*
+               PrivateMethod: setAttribute
+                       Sets the attribute in the nodelist using the supplied function.
+
+               Arguments:
+                       value - (String|Function) the value/value generator.
+                       attributeSetter - (Function) a function that can be called to actually set the attribute.
+
+               Returns:
+                       The <NodeList> object.
+               */
+               // is marginal having this separated out as it is only used twice and call is almost as big
+               // leaving it separate for now for once and only once, as well as in case attr does some more mutating stuff
+               // could be merged back with attr later
+               function setAttribute (value, attributeSetter) {
+                       for (var that = this, i = 0, length = that.length; i < length; i++) {
+                               attributeSetter.call(
+                                       that[i],
+                                       value.call ?
+                                               value.call(that[i], i) :
+                                               value
+                               );
+                       }
+                       return that;
+               }
+
+
+               /*
+               PrivateMethod: append
+                       append the nodes in "b" to the array / list "a"
+               */
+               //return different function for IE & Opera to deal with their stupid bloody expandos. Pah.
+               if (document.all) {
+                       append = function(a, b) {
+                               var i = 0,
+                                       ai = a.length,
+                                       length = b.length;
+                               if (typeof b.length == "number") {
+                                       for (; i < length; i++) {
+                                               a[ai++] = b[i];
+                                       }
+                               } else {
+                                       for (; b[i]; i++) {
+                                               a[ai++] = b[i];
+                                       }
+                               }
+                       };
+               } else {
+                       append = function(a, b) {
+                               var i = 0, ai = a.length;
+                               for (; b[i]; i++) {
+                                       a[ai++] = b[i];
+                               }
+                       };
+               }
+
+               /*
+               PrivateMethod: isXml
+                       Is this node an XML Document node or within an XML Document node
+
+               Arguments:
+                       node
+
+               Returns:
+                       Bool
+               */
+               function isXml(node) {
+                       //test for nodes within xml element
+                       return  (node.ownerDocument && !node.ownerDocument.body) ||
+                                       //test for xml document elements
+                                       (node.documentElement && !node.documentElement.body);
+               }
+
+               /*
+               PrivateMethod: unique
+                       Get an array of nodes without duplicate nodes from an array of nodes.
+
+               Arguments:
+                       aNodes - (Array|<NodeList>)
+
+               Returns:
+                       An array of nodes without duplicates.
+               */
+               //worth checking if it's an XML document?
+               if (env.ie) {
+                       unique = function(aNodes) {
+                               if (aNodes.length == 1) { return aNodes; }
+
+                               //remove duplicates
+                               var r = [],
+                                       ri = 0,
+                                       i = 0;
+
+                               for (; aNodes[i]; i++) {
+                                       if (aNodes[i].getAttribute(ucheckPropName) != ucheck && aNodes[i].nodeType == 1) {
+                                               r[ri++] = aNodes[i];
+                                       }
+                                       aNodes[i].setAttribute(ucheckPropName, ucheck);
+                               }
+                               for (i=0; aNodes[i]; i++) {
+                                       aNodes[i].removeAttribute(ucheckPropName);
+                               }
+                               ucheck++;
+                               return r;
+                       }
+               } else {
+                       unique = function(aNodes) {
+                               if (aNodes.length == 1) { return aNodes; }
+
+                               //remove duplicates
+                               var r = [],
+                                       ri = 0,
+                                       i = 0;
+
+                               for (; aNodes[i]; i++) {
+                                       if (aNodes[i][ucheckPropName] != ucheck && aNodes[i].nodeType == 1) {
+                                               r[ri++] = aNodes[i];
+                                       }
+                                       aNodes[i][ucheckPropName] = ucheck;
+                               }
+                               ucheck++;
+                               return r;
+                       }
+               }
+
+               /*
+               PrivateMethod: getElementsByTag
+                       Get elements by a specified tag name from a set of context objects. If multiple
+                       context objects are passed, then the resulting array may contain duplicates. See
+                       <unique> to remove duplicate nodes.
+
+               Arguments:
+                       tag - (string) Tag name. "*" for all.
+                       contexts - (array) DOM Documents and/or DOM Elements to search in.
+
+               Returns:
+                       An array(like) collection of elements with the specified tag name.
+               */
+               if (document.all) { //go the long way around for IE (and Opera)
+                       getByTagName = function(tag, context) {
+                               var r = [], i = 0;
+                               for (; context[i]; i++) {
+                                       //need to check .all incase data is XML
+                                       //TODO: Drop IE5.5
+                                       if (tag == "*" && context[i].all && !isXml(context[i])) { // IE 5.5 doesn't support getElementsByTagName("*")
+                                               append(r, context[i].all);
+                                       } else {
+                                               append(r, context[i].getElementsByTagName(tag));
+                                       }
+                               }
+                               return r;
+                       };
+               } else {
+                       getByTagName = function(tag, context) {
+                               var r = [], i = 0, len = context.length;
+                               for (; i < len; i++) {
+                                       append(r, context[i].getElementsByTagName(tag));
+                               }
+                               return r;
+                       };
+               }
+               
+               /*
+                       Get the child elements for an html node
+               */
+               function getChildElms(node) {
+                       var r = [],
+                               childNodes = node.childNodes,
+                               i = 0,
+                               ri = 0;
+                       
+                       for (; childNodes[i]; i++) {
+                               if (childNodes[i].nodeType == 1 && childNodes[i].nodeName != "!") {
+                                       r[ri++] = childNodes[i];
+                               }
+                       }
+                       return r;
+               }
+               
+               
+               var horizontalBorderPadding = [
+                               'border-left-width',
+                               'border-right-width',
+                               'padding-left',
+                               'padding-right'
+                       ],
+                       verticalBorderPadding = [
+                               'border-top-width',
+                               'border-bottom-width',
+                               'padding-top',
+                               'padding-bottom'
+                       ];
+               
+               /*
+               PrivateMethod: getElmDimension
+                       Gets the size of an element as an integer, not including padding or border
+               */              
+               function getElmDimension(elm, cssProp /* (width|height) */) {
+                       var r, // val to return
+                               docElmOrBody = env.standardsMode ? docElm : docBody,
+                               isWidth = (cssProp == "width"),
+                               cssPropCaps = isWidth ? "Width" : "Height",
+                               cssBorderPadding;
+
+                       if (elm.window) { // is window
+                               r = env.webkit < 522.11 ? (isWidth ? elm.innerWidth                             : elm.innerHeight) :
+                                       env.webkit                      ? (isWidth ? docBody.clientWidth                : elm.innerHeight) :
+                                       env.opera < 9.5         ? (isWidth ? docBody.clientWidth                : docBody.clientHeight) :
+                                       /* else */                        (isWidth ? docElmOrBody.clientWidth   : docElmOrBody.clientHeight);
+
+                       }
+                       else if (elm.getElementById) { // is document
+                               // we previously checked offsetWidth & clientWidth here
+                               // but they returned values too large in IE6 scrollWidth seems enough
+                               r = Math.max(
+                                       docBody["scroll" + cssPropCaps],
+                                       docElm["scroll" + cssPropCaps]
+                               )
+                       }
+                       else {
+                               // get an array of css borders & padding
+                               cssBorderPadding = isWidth ? horizontalBorderPadding : verticalBorderPadding;
+                               r = elm['offset' + cssPropCaps] - parseInt( getCssValue(elm, cssBorderPadding) );
+                       }
+                       return r;
+               }
+
+               /*
+               PrivateMethod: getBodyElm
+                       Gets the body elm for a given element. Gets around IE5.5 nonsense. do getBodyElm(elm).parentNode to get documentElement
+               */
+               function getBodyElm(elm) {
+                       if (env.ie < 6) {
+                               return elm.document.body;
+                       } else {
+                               return elm.ownerDocument.body;
+                       }
+               }
+
+               /*
+               PrivateMethod: setElmsSize
+                       Set element's size
+
+               Arguments:
+                       elms - (<NodeList>) Elements
+                       val - (Mixed) Set element height / width. In px unless stated
+                       type - (String) "height" or "width"
+
+               Returns:
+                       Nowt.
+               */
+               function setElmsSize(elms, val, type) {
+                       if (typeof val == "number" || /\d$/.test(val)) {
+                               val += "px";
+                       }
+                       for (var i = 0, len = elms.length; i < len; i++) {
+                               elms[i].style[type] = val;
+                       }
+               }
+
+               /*
+               PrivateMethod: toStyleProp
+                       Converts a css property name into its javascript name, such as "background-color" to "backgroundColor".
+
+               Arguments:
+                       prop - (String) CSS Property name
+
+               Returns:
+                       String, javascript style property name
+               */
+               function toStyleProp(prop) {
+                       if (prop == "float") {
+                               return env.ie ? "styleFloat" : "cssFloat";
+                       }
+                       return lang.replace(prop, /-(\w)/g, function(match, p1) {
+                               return p1.toUpperCase();
+                       });
+               }
+
+               /*
+               PrivateMethod: tempBlock
+                       Gives an element display:block (but keeps it hidden) and runs a function, then sets the element back how it was
+
+               Arguments:
+                       elm - element
+                       func - function to run
+
+               Returns:
+                       Return value of the function
+               */
+               function tempBlock(elm, func) {
+                       //TODO: rather than recording individual style properties, just cache cssText? This was faster for getting the element size
+                       var r,
+                               elmStyle = elm.style,
+                               oldDisp = elmStyle.display,
+                               oldVis = elmStyle.visibility,
+                               oldPos = elmStyle.position;
+
+                       elmStyle.visibility = "hidden";
+                       elmStyle.position = "absolute";
+                       elmStyle.display = "block";
+                       if (!isVisible(elm)) {
+                               elmStyle.position = oldPos;
+                               r = tempBlock(elm.parentNode, func);
+                               elmStyle.display = oldDisp;
+                               elmStyle.visibility = oldVis;
+                       } else {
+                               r = func();
+                               elmStyle.display = oldDisp;
+                               elmStyle.position = oldPos;
+                               elmStyle.visibility = oldVis;
+                       }
+                       return r;
+               }
+
+               /*
+               PrivateMethod: isVisible
+                       Is the element visible?
+               */
+               function isVisible(elm) {
+                       //this is a bit of a guess, if there's a better way to do this I'm interested!
+                       return elm.offsetWidth ||
+                               elm.offsetHeight;
+               }
+
+               /*
+               PrivateMethod: getCssValue
+                       Get a computed css property
+
+               Arguments:
+                       elm - element
+                       prop - css property or array of properties to add together
+
+               Returns:
+                       String, value
+               */
+               function getCssValue(elm, prop) {
+                       var r, //return value
+                               total = 0,
+                               i = 0,
+                               propLen = prop.length,
+                               compStyle = doc.defaultView && (doc.defaultView.getComputedStyle(elm, null) || doc.defaultView.getComputedStyle),
+                               elmCurrentStyle = elm.currentStyle,
+                               oldDisplay,
+                               match,
+                               propTest = prop.push || cssPropRegex.exec(prop) || [];
+
+
+                       if (prop.push) { //multiple properties, add them up
+                               for (; i < propLen; i++) {
+                                       total += parseInt( getCssValue(elm, prop[i]), 10 ) || 0;
+                               }
+                               return total + "px";
+                       }
+                       
+                       if (propTest[1]) { // is width / height
+                               if (!isVisible(elm)) { //element may be display: none
+                                       return tempBlock(elm, function() {
+                                               return getElmDimension(elm, propTest[1]) + "px";
+                                       });
+                               }
+                               return getElmDimension(elm, propTest[1]) + "px";
+                       }
+                       else if (propTest[2] //is border-*-width
+                               && glow.env.ie
+                               && getCssValue(elm, "border-" + propTest[3] + "-style") == "none"
+                       ) {
+                               return "0";
+                       }
+                       else if (compStyle) { //W3 Method
+                               //this returns computed values
+                               if (typeof compStyle == "function") {
+                                       //safari returns null for compStyle when element is display:none
+
+                                       oldDisplay = elm.style.display;
+                                       r = tempBlock(elm, function() {
+                                               if (prop == "display") { //get true value for display, since we've just fudged it
+                                                       elm.style.display = oldDisplay;
+                                                       if (!doc.defaultView.getComputedStyle(elm, null)) {
+                                                               return "none";
+                                                       }
+                                                       elm.style.display = "block";
+                                               }
+                                               return getCssValue(elm, prop);
+                                       });
+                               } else {
+                                       // assume equal horizontal margins in safari 3
+                                       // http://bugs.webkit.org/show_bug.cgi?id=13343
+                                       // The above bug doesn't appear to be closed, but it works fine in Safari 4
+                                       if (env.webkit > 500 && env.webkit < 526 && prop == 'margin-right' && compStyle.getPropertyValue('position') != 'absolute') {
+                                               prop = 'margin-left';
+                                       }
+                                       r = compStyle.getPropertyValue(prop);
+                               }
+                       } else if (elmCurrentStyle) { //IE method
+                               if (prop == "opacity") {
+                                       match = /alpha\(opacity=([^\)]+)\)/.exec(elmCurrentStyle.filter);
+                                       return match ? String(parseInt(match[1], 10) / 100) : "1";
+                               }
+                               //this returns cascaded values so needs fixing
+                               r = String(elmCurrentStyle[toStyleProp(prop)]);
+                               if (/^-?[\d\.]+(?!px)[%a-z]+$/i.test(r) && prop != "font-size") {
+                                       r = getPixelValue(elm, r, usesYAxis.test(prop)) + "px";
+                               }
+                       }
+                       //some results need post processing
+                       if (prop.indexOf("color") != -1) { //deal with colour values
+                               r = normaliseCssColor(r).toString();
+                       } else if (r.indexOf("url") == 0) { //some browsers put quotes around the url, get rid
+                               r = r.replace(/\"/g,"");
+                       }
+                       return r;
+               }
+
+               /*
+               PrivateMethod: getPixelValue
+                       Converts a relative value into an absolute pixel value. Only works in IE with Dimension value (not stuff like relative font-size).
+                       Based on some Dean Edwards' code
+
+               Arguments:
+                       element - element used to calculate relative values
+                       value - (string) relative value
+                       useYAxis - (string) calulate relative values to the y axis rather than x
+
+               Returns:
+                       Number
+               */
+               function getPixelValue(element, value, useYAxis) {
+                       // Remember the original values
+                       var axisPos = useYAxis ? "top" : "left",
+                               axisPosUpper = useYAxis ? "Top" : "Left",
+                               elmStyle = element.style,
+                               positionVal = elmStyle[axisPos],
+                               runtimePositionVal = element.runtimeStyle[axisPos],
+                               r;
+                       
+                       // copy to the runtime type to prevent changes to the display
+                       element.runtimeStyle[axisPos] = element.currentStyle[axisPos];
+                       // set value to left / top
+                       elmStyle[axisPos] = value;
+                       // get the pixel value
+                       r = elmStyle["pixel" + axisPosUpper];
+                       
+                       // revert values
+                       elmStyle[axisPos] = positionVal;
+                       element.runtimeStyle[axisPos] = runtimePositionVal;
+                       
+                       return r;
+               }
+
+               /*
+               PrivateMethod: normaliseCssColor
+                       Converts a CSS colour into "rgb(255, 255, 255)" or "transparent" format
+               */
+
+               function normaliseCssColor(val) {
+                       if (/^(transparent|rgba\(0, ?0, ?0, ?0\))$/.test(val)) { return 'transparent'; }
+                       var match, //tmp regex match holder
+                               r, g, b, //final colour vals
+                               hex, //tmp hex holder
+                               mathRound = Math.round,
+                               parseIntFunc = parseInt,
+                               parseFloatFunc = parseFloat;
+
+                       if (match = colorRegex.exec(val)) { //rgb() format, cater for percentages
+                               r = match[2] ? mathRound(((parseFloatFunc(match[1]) / 100) * 255)) : parseIntFunc(match[1]);
+                               g = match[4] ? mathRound(((parseFloatFunc(match[3]) / 100) * 255)) : parseIntFunc(match[3]);
+                               b = match[6] ? mathRound(((parseFloatFunc(match[5]) / 100) * 255)) : parseIntFunc(match[5]);
+                       } else {
+                               if (typeof val == "number") {
+                                       hex = val;
+                               } else if (val.charAt(0) == "#") {
+                                       if (val.length == "4") { //deal with #fff shortcut
+                                               val = "#" + val.charAt(1) + val.charAt(1) + val.charAt(2) + val.charAt(2) + val.charAt(3) + val.charAt(3);
+                                       }
+                                       hex = parseIntFunc(val.slice(1), 16);
+                               } else {
+                                       hex = htmlColorNames[val];
+                               }
+
+                               r = (hex) >> 16;
+                               g = (hex & 0x00ff00) >> 8;
+                               b = (hex & 0x0000ff);
+                       }
+
+                       val = new String("rgb(" + r + ", " + g + ", " + b + ")");
+                       val.r = r;
+                       val.g = g;
+                       val.b = b;
+                       return val;
+               }
+
+               /*
+               PrivateMethod: getTextNodeConcat
+                       Take an element and returns a string of its text nodes combined. This is useful when a browser (Safari 2) goes mad and doesn't return anything for innerText or textContent
+               */
+               function getTextNodeConcat(elm) {
+                       var r = "",
+                               nodes = elm.childNodes,
+                               i = 0,
+                               len = nodes.length;
+                       for (; i < len; i++) {
+                               if (nodes[i].nodeType == 3) { //text
+                                       //this function is used in safari only, string concatination is faster
+                                       r += nodes[i].nodeValue;
+                               } else if (nodes[i].nodeType == 1) { //element
+                                       r += getTextNodeConcat(nodes[i]);
+                               }
+                       }
+                       return r;
+               }
+
+               /*
+               PrivateMethod: getNextOrPrev
+                       This gets the next / previous sibling element of each node in a nodeset
+                       and returns the new nodeset.
+               */
+               function getNextOrPrev(nodelist, dir /* "next" or "previous" */) {
+                       var ret = [],
+                               ri = 0,
+                               nextTmp,
+                               i = 0,
+                               length = nodelist.length;
+
+                       for (; i < length; i++) {
+                               nextTmp = nodelist[i];
+                               while (nextTmp = nextTmp[dir + "Sibling"]) {
+                                       if (nextTmp.nodeType == 1 && nextTmp.nodeName != "!") {
+                                               ret[ri++] = nextTmp;
+                                               break;
+                                       }
+                               }
+                       }
+                       return r.get(ret);
+               }
+               
+               /*
+                Get the 'real' positioned parent for an element, otherwise return null.
+               */
+               function getPositionedParent(elm) {
+                       var offsetParent = elm.offsetParent;
+                       
+                       // get the real positioned parent
+                       // IE places elements with hasLayout in the offsetParent chain even if they're position:static
+                       // Also, <body> and <html> can appear in the offsetParent chain, but we don't want to return them if they're position:static
+                       while (offsetParent && r.get(offsetParent).css("position") == "static") {       
+                               offsetParent = offsetParent.offsetParent;
+                       }
+                       
+                       // sometimes the <html> element doesn't appear in the offsetParent chain, even if it has position:relative
+                       if (!offsetParent && r.get(docElm).css("position") != "static") {
+                               offsetParent = docElm;
+                       }
+                       
+                       return offsetParent || null;
+               }
+               
+               /**
+                @name glow.dom-getScrollOffset
+                @private
+                @description Get the scrollTop / scrollLeft of a particular element
+                @param {Element} elm Element (or window object) to get the scroll position of
+                @param {Boolean} isLeft True if we're dealing with left scrolling, otherwise top
+               */
+               function getScrollOffset(elm, isLeft) {
+                       var r,                  
+                               scrollProp = 'scroll' + (isLeft ? "Left" : "Top");
+                       
+                       // are we dealing with the window object or the document object?
+                       if (elm.window) {
+                               // get the scroll of the documentElement or the pageX/Yoffset
+                               // - some browsers use one but not the other
+                               r = elm.document.documentElement[scrollProp]
+                                       || (isLeft ? elm.pageXOffset : elm.pageYOffset)
+                                       || 0;
+                       }
+                       else {
+                               r = elm[scrollProp];
+                       }
+                       return r;
+               }
+               
+               /**
+                @name glow.dom-setScrollOffset
+                @private
+                @description Set the scrollTop / scrollLeft of a particular element
+                @param {Element} elm Element (or window object) to get the scroll position of
+                @param {Boolean} isLeft True if we're dealing with left scrolling, otherwise top
+                @param {Number} newVal New scroll value
+               */
+               function setScrollOffset(elm, isLeft, newVal) {
+                       
+                       // are we dealing with the window object or the document object?
+                       if (elm.window) {
+                               // we need to get whichever value we're not setting
+                               elm.scrollTo(
+                                       isLeft  ? newVal : getScrollOffset(elm, true),
+                                       !isLeft ? newVal : getScrollOffset(elm, false)
+                               );
+                       }
+                       else {
+                               elm['scroll' + (isLeft ? "Left" : "Top")] = newVal;
+                       }
+               }
+               
+               /**
+                @name glow.dom-scrollOffset
+                @private
+                @description Set/get the scrollTop / scrollLeft of a NodeList
+                @param {glow.dom.NodeList} nodeList Elements to get / set the position of
+                @param {Boolean} isLeft True if we're dealing with left scrolling, otherwise top
+                @param {Number} [val] Val to set (if not provided, we'll get the value)
+                
+                @returns NodeList for sets, Number for gets
+               */
+               function scrollOffset(nodeList, isLeft, val) {
+                       var i = nodeList.length;
+                       
+                       if (val !== undefined) {
+                               while (i--) {
+                                       setScrollOffset(nodeList[i], isLeft, val);
+                               }
+                               return nodeList;
+                       } else {
+                               return getScrollOffset(nodeList[0], isLeft);
+                       }
+               }
+
+               //public
+               var r = {}; //object to be returned
+
+               /**
+               @name glow.dom.get
+               @function
+               @description Returns a {@link glow.dom.NodeList NodeList} from CSS selectors and/or Elements.
+
+               @param {String | String[] | Element | Element[] | glow.dom.NodeList} nodespec+ One or more CSS selector strings, Elements or {@link glow.dom.NodeList NodeLists}.
+
+                       Will also accept arrays of these types, or any combinations thereof.
+
+                       Supported CSS selectors:
+
+                       <ul>
+                               <li>Universal selector "*".</li>
+                               <li>Type selector "div"</li>
+                               <li>Class selector ".myClass"</li>
+                               <li>ID selector "#myDiv"</li>
+                               <li>Child selector "ul > li"</li>
+                               <li>Grouping "div, p"</li>
+                       </ul>
+
+               @returns {glow.dom.NodeList}
+
+               @example
+                       // Nodelist with all links in element with id "nav"
+                       var myNodeList = glow.dom.get("#nav a");
+
+               @example
+                       // NodeList containing the nodes passed in
+                       var myNodeList = glow.dom.get(someNode, anotherNode);
+
+               @example
+                       // NodeList containing elements in the first form
+                       var myNodeList = glow.dom.get(document.forms[0].elements);
+               */
+               r.get = function() {
+                       var r = new glow.dom.NodeList(),
+                               i = 0,
+                               args = arguments,
+                               argsLen = args.length;
+
+                       for (; i < argsLen; i++) {
+                               if (typeof args[i] == "string") {
+                                       r.push(new glow.dom.NodeList().push(doc).get(args[i]));
+                               } else {
+                                       r.push(args[i]);
+                               }
+                       }
+                       return r;
+               };
+
+               /**
+               @name glow.dom.create
+               @function
+               @description Returns a {@link glow.dom.NodeList NodeList} from an HTML fragment.
+
+               @param {String} html An HTML string.
+
+                       All top-level nodes must be elements (i.e. text content in the
+                       HTML must be wrapped in HTML tags).
+
+               @param {Object} [opts] An optional options object
+                       @param {Object} [opts.interpolate] Data for a call to {@link glow.lang.interpolate}
+                               If this option is set, the String html parameter will be passed through glow.lang.interpolate with this as the data and no options
+                               If glow.lang.interpolates options are required, an explicit call must be made
+                       @param {Boolean} [opts.escapeHtml] Escape HTML in the interpolate data object.
+                               See {@link glow.lang.interpolate}
+
+               @returns {glow.dom.NodeList}
+
+               @example
+                       // NodeList of two elements
+                       var myNodeList = glow.dom.create("<div>Hello</div><div>World</div>");
+                       
+               @example
+                       // Nodelist of one list item
+                       var listItem = glow.dom.create('<li>{content}</li>', {
+                               interpolate: {content: textFromUser},
+                               escapeHtml: true
+                       });
+                       // if testFromUser contains HTML, it will be correctly escaped
+                       // before being inserted into the li
+               */
+               r.create = function(sHtml, opts) {
+                       var ret = [],
+                               i = 0,
+                               rLen = 0,
+                               toCheck;
+                       
+                       // set default options
+                       opts = glow.lang.apply({
+                               interpolate: null,
+                               escapeHtml: false
+                       }, opts || {});
+                       
+                       if (opts.interpolate) {
+                               sHtml = lang.interpolate(sHtml, opts.interpolate, {
+                                       escapeHtml: opts.escapeHtml
+                               });
+                       }
+                       
+                       toCheck = stringToNodes(sHtml);
+                       
+                       for (; toCheck[i]; i++) {
+                               if (toCheck[i].nodeType == 1 && toCheck[i].nodeName != "!") {
+                                       ret[rLen++] = toCheck[i];
+                               } else if (toCheck[i].nodeType == 3 && lang.trim(toCheck[i].nodeValue) !== "") {
+                                       throw new Error("glow.dom.create - Text must be wrapped in an element");
+                               }
+                       }
+                       return new r.NodeList().push(ret);
+               };
+
+               /**
+               @name glow.dom.parseCssColor
+               @function
+               @description Returns an object representing a CSS colour string.
+
+               @param {String} color A CSS colour.
+
+                       Examples of valid values are "red", "#f00", "#ff0000",
+                       "rgb(255,0,0)", "rgb(100%, 0%, 0%)"
+
+               @returns {Object}
+
+                       An object with properties named "r", "g" and "b", each will have
+                       an integer value between 0 and 255.
+
+               @example
+                       glow.dom.parseCssColor("#ff0000");
+                       // returns {r:255, g:0, b:0}
+               */
+               r.parseCssColor = function(cssColor) {
+                       var normal = normaliseCssColor(cssColor);
+                       return {r: normal.r, g: normal.g, b: normal.b};
+               }
+
+               /**
+               @name glow.dom.NodeList
+               @class
+               @description An array-like collection of DOM Elements.
+
+                       It is recommended you create a NodeList using {@link glow.dom.get glow.dom.get},
+                       or {@link glow.dom.create glow.dom.create}, but you can also use
+                       the constructor to create an empty NodeList.
+
+                       Unless otherwise specified, all methods of NodeList return the
+                       NodeList itself, allowing you to chain methods calls together.
+
+               @example
+                       // empty NodeList
+                       var nodes = new glow.dom.NodeList();
+
+               @example
+                       // using get to return a NodeList then chaining methods
+                       glow.dom.get("p").addClass("eg").append("<b>Hello!</b>");
+
+               @see <a href="../furtherinfo/creatingnodelists/">Creating NodeLists</a>
+               @see <a href="../furtherinfo/workingwithnodelists/">Working with NodeLists</a>
+               @see <a href="../furtherinfo/xmlnodelists/">XML NodeLists</a>
+               */
+               r.NodeList = function() {
+
+                       /**
+                       @name glow.dom.NodeList#length
+                       @type Number
+                       @description Number of nodes in the NodeList
+                       @example
+                               // get the number of paragraphs on the page
+                               glow.dom.get("p").length;
+                       */
+                       this.length = 0; //number of elements in NodeList
+               };
+
+               /*
+                       Group: Methods
+               */
+               r.NodeList.prototype = {
+
+                       /**
+                       @name glow.dom.NodeList#item
+                       @function
+                       @description Returns a node from the NodeList.
+
+                       @param {Number} index The numeric index of the node to return.
+
+                       @returns {Element}
+
+                       @example
+                               // get the fourth node
+                               var node = myNodeList.item(3);
+
+                       @example
+                               // another way to get the fourth node
+                               var node = myNodeList[3];
+                       */
+                       item: function (nIndex) {
+                               return this[nIndex];
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#push
+                       @function
+                       @description Adds Elements to the NodeList.
+
+                       @param {Element | Element[] | glow.dom.NodeList} nodespec+ One or more Elements, Arrays of Elements or NodeLists.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               var myNodeList = glow.dom.create("<div>Hello world</div>");
+                               myNodeList.push("<div>Foo</div>", glow.dom.get("#myList li"));
+                       */
+                       push: function() {
+                               var args = arguments,
+                                       argsLen = args.length,
+                                       i = 0,
+                                       n,
+                                       nNodeListLength,
+                                       that = this,
+                                       arrayPush = Array.prototype.push;
+
+                               for (; i < argsLen; i++) {
+                                       if (!args[i]) {
+                                               continue;
+                                       } else if (args[i].nodeType == 1 || args[i].nodeType == 9 || args[i].document) { //is Node
+                                               arrayPush.call(that, args[i]);
+                                       } else if (args[i][0]) { //is array or array like
+                                               for (n = 0, nNodeListLength = args[i].length; n < nNodeListLength; n++) {
+                                                       arrayPush.call(that, args[i][n]);
+                                               }
+                                       }
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#each
+                       @function
+                       @description Calls a function for each node.
+
+                               The supplied function will be called for each node in the NodeList.
+                               
+                               The index of the node will be provided as the first parameter, and
+                               'this' will refer to the node.
+
+                       @param {Function} callback The function to run for each node.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               var myNodeList = glow.dom.get("a");
+                               myNodeList.each(function(i){
+                                       // in this function: this == myNodeList[i]
+                               });
+                       */
+                       each: function (callback) {
+                               for (var i = 0, that = this, length = that.length; i < length; i++) {
+                                       callback.call(that[i], i, that);
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#eq
+                       @function
+                       @description Compares the NodeList to an element, array of elements or another NodeList
+
+                                       Returns true if the items are the same and are in the same
+                                       order.
+
+                       @param {Element | Element[] | glow.dom.NodeList} nodespec The element, array or NodeList the NodeList is being compared to.
+
+                       @returns {Boolean}
+
+                       @example
+                               // the following returns true
+                               glow.dom.get('#blah').eq( document.getElementById('blah') );
+                       */
+                       eq: function (nodelist) {
+                               var that = this, i = 0, length = that.length;
+
+                               if (! nodelist.push) { nodelist = [nodelist]; }
+                               if (nodelist.length != that.length) { return false; }
+                               for (; i < length; i++) {
+                                       if (that[i] != nodelist[i]) { return false; }
+                               }
+                               return true;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#isWithin
+                       @function
+                       @description Tests if all the nodes are decendents of an element.
+
+                       @param {Element | glow.dom.NodeList} nodespec The element or NodeList that the NodeList is being tested against.
+
+                               If nodespec is a NodeList, then the its first node will be used.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               var myNodeList = glow.dom.get("input");
+                               if (myNodeList.isWithin(glow.dom.get("form")) {
+                                       // do something
+                               }
+                       */
+                       isWithin: function (node) {
+                               if (node.push) { node = node[0]; }
+                               
+                               // missing some nodes? Return false
+                               if ( !node || !this.length ) { return false; }
+                               
+                               var that = this,
+                                       i = 0,
+                                       length = that.length,
+                                       toTest; //node to test in manual method
+
+                               if (node.contains && env.webkit >= 521) { //proprietary method, safari 2 has a wonky implementation of this, avoid, avoid, avoid
+                                       //loop through
+                                       for (; i < length; i++) {
+                                               // myNode.contains(myNode) returns true in most browsers
+                                               if (!(node.contains(that[i]) && that[i] != node)) { return false; }
+                                       }
+                               } else if (that[0].compareDocumentPosition) { //w3 method
+                                       //loop through
+                                       for (; i < length; i++) {
+                                               //compare against bitmask
+                                               if (!(that[i].compareDocumentPosition(node) & 8)) { return false; }
+                                       }
+                               } else { //manual method
+                                       for (; i < length; i++) {
+                                               toTest = that[i];
+                                               while (toTest = toTest.parentNode) {
+                                                       if (toTest == node) { break; }
+                                               }
+                                               if (!toTest) { return false; }
+                                       }
+                               }
+                               return true;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#attr
+                       @function
+                       @description Gets or sets attributes
+
+                               When getting an attribute, it is retrieved from the first
+                               node in the NodeList. Setting attributes applies the change
+                               to each element in the NodeList.
+
+                               To set an attribute, pass in the name as the first
+                               parameter and the value as a second parameter.
+
+                               To set multiple attributes in one call, pass in an object of
+                               name/value pairs as a single parameter.
+
+                               For browsers that don't support manipulating attributes
+                               using the DOM, this method will try to do the right thing
+                               (i.e. don't expect the semantics of this method to be
+                               consistent across browsers as this is not possible with
+                               currently supported browsers).
+
+                       @param {String | Object} name The name of the attribute, or an object of name/value pairs
+                       @param {String} [value] The value to set the attribute to.
+
+                       @returns {String | glow.dom.NodeList}
+
+                               When setting attributes it returns the NodeList, otherwise
+                               returns the attribute value.
+
+                       @example
+                               var myNodeList = glow.dom.get(".myImgClass");
+
+                               // get an attribute
+                               myNodeList.attr("class");
+
+                               // set an attribute
+                               myNodeList.attr("class", "anotherImgClass");
+
+                               // set multiple attributes
+                               myNodeList.attr({
+                                 src: "a.png",
+                                 alt: "Cat jumping through a field"
+                               });
+                       */
+                       attr: function (name /* , val */) {
+                               var that = this,
+                                       args = arguments,
+                                       argsLen = args.length,
+                                       i,
+                                       value;
+
+                               if (that.length === 0) {
+                                       return argsLen > 1 ? that : undefined;
+                               }
+                               if (typeof name == 'object') {
+                                       for (i in name) {
+                                               if (lang.hasOwnProperty(name, i)) {
+                                                       that.attr(i, name[i]);
+                                               }
+                                       }
+                                       return that;
+                               }
+                               if (env.ie && dom0PropertyMapping[name]) {
+                                       if (argsLen > 1) {
+                                               setAttribute.call(
+                                                       that,
+                                                       args[1],
+                                                       // in the callback this is the dom node
+                                                       function (val) { this[dom0PropertyMapping[name]] = val; }
+                                               );
+                                               return that;
+                                       }
+                                       value = that[0][dom0PropertyMapping[name]];
+                                       if (dom0BooleanAttribute[name]) {
+                                               return value ? name : undefined;
+                                       }
+                                       else if (dom0AttributeMappings[name]) {
+                                               return dom0AttributeMappings[name](value);
+                                       }
+                                       return value;
+                               }
+                               if (argsLen > 1) {
+                                       setAttribute.call(
+                                               that,
+                                               args[1],
+                                               // in the callback this is the dom node
+                                               function (val) { this.setAttribute(name, val); }
+                                       );
+                                       return that;
+                               }
+                               //2nd parameter makes IE behave, but errors for XML nodes (and isn't needed for xml nodes)
+                               return isXml(that[0]) ? that[0].getAttribute(name) : that[0].getAttribute(name, 2);
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#removeAttr
+                       @function
+                       @description Removes an attribute from each node.
+
+                       @param {String} name The name of the attribute to remove.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               glow.dom.get("a").removeAttr("target");
+                       */
+                       removeAttr: function (name) {
+                               var mapping = env.ie && dom0PropertyMapping[name],
+                                       that = this,
+                                       i = 0,
+                                       length = that.length;
+
+                               for (; i < length; i++) {
+                                       if (mapping) {
+                                               that[i][mapping] = "";
+                                       } else {
+                                               that[i].removeAttribute(name);
+                                       }
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#hasAttr
+                       @function
+                       @description Does the node have a particular attribute?
+                               
+                               The first node in the NodeList is tested
+                               
+                       @param {String} name The name of the attribute to test for.
+
+                       @returns {Boolean}
+
+                       @example
+                               if ( glow.dom.get("#myImg").hasAttr("alt") ){
+                                       // ...
+                               }
+                       */
+                       hasAttr: function (name) {
+                               var firstNode = this[0],
+                                       attributes = firstNode.attributes;
+
+                               if (isXml(firstNode) && env.ie) { //getAttributeNode not supported for XML
+                                       var attributes = firstNode.attributes,
+                                               i = 0,
+                                               len = attributes.length;
+
+                                       //named node map doesn't seem to work properly, so need to go by index
+                                       for (; i < len; i++) {
+                                               if (attributes[i].nodeName == name) {
+                                                       return attributes[i].specified;
+                                               }
+                                       }
+                                       return false;
+                               } else if (this[0].getAttributeNode) {
+                                       var attr = this[0].getAttributeNode(name);
+                                       return attr ? attr.specified : false;
+                               }
+
+                               return typeof attributes[attr] != "undefined";
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#prop
+                       @function
+                       @description Gets or sets node peropties
+                       
+                               This function gets / sets node properties, to get attributes,
+                               see {@link glow.dom.NodeList#attr NodeList#attr}.
+                               
+                               When getting a property, it is retrieved from the first
+                               node in the NodeList. Setting properties to each element in
+                               the NodeList.
+                               
+                               To set multiple properties in one call, pass in an object of
+                               name/value pairs.
+                               
+                       @param {String | Object} name The name of the property, or an object of name/value pairs
+                       @param {String} [value] The value to set the property to.
+
+                       @returns {String | glow.dom.NodeList}
+
+                               When setting properties it returns the NodeList, otherwise
+                               returns the property value.
+
+                       @example
+                               var myNodeList = glow.dom.get("#formElement");
+
+                               // get the node name
+                               myNodeList.prop("nodeName");
+
+                               // set a property
+                               myNodeList.prop("_secretValue", 10);
+
+                               // set multiple properties
+                               myNodeList.prop({
+                                       checked: true,
+                                       _secretValue: 10
+                               });
+                       */
+                       prop: function(name, val) {
+                               
+                               // setting multiple
+                               if (name.constructor === Object) {
+                                       var hash = name,
+                                               key;
+                                       
+                                       // loop through hash
+                                       for (key in hash) {
+                                               this.prop(key, hash[key]);
+                                       }
+                                       return this;
+                               }
+                               
+                               // setting single (to all in the NodeList)
+                               if (val !== undefined) {
+                                       var i = this.length;
+                                       while (i--) {
+                                               this[i][name] = val;
+                                       }
+                                       return this;
+                               }
+                               
+                               // getting
+                               if (!this[0]) { return undefined; }
+                               return this[0][name];
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#hasClass
+                       @function
+                       @description Tests if a node has a given class.
+
+                               Will return true if any node in the NodeList has the supplied class
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                       @param {String} name The name of the class to test for.
+
+                       @returns {Boolean}
+
+                       @example
+                               if (glow.dom.get("a").hasClass("termsLink")){
+                                       // ...
+                               }
+                       */
+                       hasClass: function (name) {
+                               for (var i = 0, length = this.length; i < length; i++) {
+                                       if ((" " + this[i].className + " ").indexOf(" " + name + " ") != -1) {
+                                               return true;
+                                       }
+                               }
+                               return false;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#addClass
+                       @function
+                       @description Adds a class to each node.
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                       @param {String} name The name of the class to add.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               glow.dom.get("#login a").addClass("highlight");
+                       */
+                       addClass: function (name) {
+                               for (var i = 0, length = this.length; i < length; i++) {
+                                       if ((" " + this[i].className + " ").indexOf(" " + name + " ") == -1) {
+                                               this[i].className += ((this[i].className)? " " : "") + name;
+                                       }
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#removeClass
+                       @function
+                       @description Removes a class from each node.
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                       @param {String} name The name of the class to remove.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               glow.dom.get("#footer #login a").removeClass("highlight");
+                       */
+                       removeClass: function (name) {
+                               var re = removeClassRegex(name),
+                                       that = this,
+                                       i = 0,
+                                       length = that.length;
+
+                               for (; i < length; i++) {
+                                       that[i].className = that[i].className.replace(re, " ");
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#toggleClass
+                       @function
+                       @description Toggles a class on each node.
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                       @param {String} name The name of the class to toggle.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               glow.dom.get(".onOffSwitch").toggleClass("on");
+                        */
+                       toggleClass: function (name) {
+                               var i = this.length,
+                                       paddedClassName,
+                                       paddedName = " " + name + " ";
+                                       
+                               while (i--) {
+                                       paddedClassName = " " + this[i].className + " ";
+                                       
+                                       if (paddedClassName.indexOf(paddedName) != -1) {
+                                               this[i].className = paddedClassName.replace(paddedName, " ");
+                                       } else {
+                                               this[i].className += " " + name;
+                                       }
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#val
+                       @function
+                       @description Gets or sets form values for the first node.
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                               <p><em>Getting values from form elements</em></p>
+
+                               The returned value depends on the type of element, see below:
+
+                               <dl>
+                               <dt>Radio button or checkbox</dt>
+                               <dd>If checked, then the contents of the value attribute, otherwise an empty string.</dd>
+                               <dt>Select</dt>
+                               <dd>The contents of value attribute of the selected option</dd>
+                               <dt>Select (multiple)</dt>
+                               <dd>An array of selected option values.</dd>
+                               <dt>Other form element</dt>
+                               <dd>The value of the input.</dd>
+                               </dl>
+
+                               <p><em>Getting values from a form</em></p>
+
+                               If the first element in the NodeList is a form, then an
+                               object is returned containing the form data. Each item
+                               property of the object is a value as above, apart from when
+                               multiple elements of the same name exist, in which case the
+                               it will contain an array of values.
+
+                               <p><em>Setting values for form elements</em></p>
+
+                               If a value is passed and the first element of the NodeList
+                               is a form element, then the form element is given that value.
+                               For select elements, this means that the first option that
+                               matches the value will be selected. For selects that allow
+                               multiple selection, the options which have a value that
+                               exists in the array of values/match the value will be
+                               selected and others will be deselected.
+
+                               Currently checkboxes and radio buttons are not checked or
+                               unchecked, just their value is changed. This does mean that
+                               this does not do exactly the reverse of getting the value
+                               from the element (see above) and as such may be subject to
+                               change
+
+                               <p><em>Setting values for forms</em></p>
+
+                               If the first element in the NodeList is a form and the
+                               value is an object, then each element of the form has its
+                               value set to the corresponding property of the object, using
+                               the method described above.
+
+                       @param {String | Object} [value] The value to set the form element/elements to.
+
+                       @returns {glow.dom.NodeList | String | Object}
+
+                               When used to set a value it returns the NodeList, otherwise
+                               returns the value as described above.
+
+                       @example
+                               // get a value
+                               var username = glow.dom.get("input#username").val();
+
+                       @example
+                               // get values from a form
+                               var userDetails = glow.dom.get("form").val();
+
+                       @example
+                               // set a value
+                               glow.dom.get("input#username").val("example username");
+
+                       @example
+                               // set values in a form
+                               glow.dom.get("form").val({
+                                       username : "another",
+                                       name     : "A N Other"
+                               });
+                       */
+                       val: function () {
+
+                               /*
+                               PrivateFunction: elementValue
+                                       Get a value for a form element.
+                               */
+                               function elementValue (el) {
+                                       var elType = el.type,
+                                               elChecked = el.checked,
+                                               elValue = el.value,
+                                               vals = [],
+                                               i = 0;
+
+                                       if (elType == "radio") {
+                                               return elChecked ? elValue : "";
+                                       } else if (elType == "checkbox") {
+                                               return elChecked ? elValue : "";
+
+                                       } else if (elType == "select-one") {
+                                               return el.selectedIndex > -1 ?
+                                                       el.options[el.selectedIndex].value : "";
+
+                                       } else if (elType == "select-multiple") {
+                                               for (var length = el.options.length; i < length; i++) {
+                                                       if (el.options[i].selected) {
+                                                               vals[vals.length] = el.options[i].value;
+                                                       }
+                                               }
+                                               return vals;
+                                       } else {
+                                               return elValue;
+                                       }
+                               }
+
+                               /*
+                               PrivateMethod: formValues
+                                       Get an object containing form data.
+                               */
+                               function formValues (form) {
+                                       var vals = {},
+                                               radios = {},
+                                               formElements = form.elements,
+                                               i = 0,
+                                               length = formElements.length,
+                                               name,
+                                               formElement,
+                                               j,
+                                               radio,
+                                               nodeName;
+
+                                       for (; i < length; i++) {
+                                               formElement = formElements[i];
+                                               nodeName = formElement.nodeName.toLowerCase();
+                                               name = formElement.name;
+                                               
+                                               // fieldsets & objects come back as form elements, but we don't care about these
+                                               // we don't bother with fields that don't have a name
+                                               // switch to whitelist?
+                                               if (
+                                                       nodeName == "fieldset" ||
+                                                       nodeName == "object" ||
+                                                       !name
+                                               ) { continue; }
+
+                                               if (formElement.type == "checkbox" && ! formElement.checked) {
+                                                       if (! name in vals) {
+                                                               vals[name] = undefined;
+                                                       }
+                                               } else if (formElement.type == "radio") {
+                                                       if (radios[name]) {
+                                                               radios[name][radios[name].length] = formElement;
+                                                       } else {
+                                                               radios[name] = [formElement];
+                                                       }
+                                               } else {
+                                                       var value = elementValue(formElement);
+                                                       if (name in vals) {
+                                                               if (vals[name].push) {
+                                                                       vals[name][vals[name].length] = value;
+                                                               } else {
+                                                                       vals[name] = [vals[name], value];
+                                                               }
+                                                       } else {
+                                                               vals[name] = value;
+                                                       }
+                                               }
+                                       }
+                                       for (i in radios) {
+                                               j = 0;
+                                               for (length = radios[i].length; j < length; j++) {
+                                                       radio = radios[i][j];
+                                                       name = radio.name;
+                                                       if (radio.checked) {
+                                                               vals[radio.name] = radio.value;
+                                                               break;
+                                                       }
+                                               }
+                                               if (! name in vals) { vals[name] = undefined; }
+                                       }
+                                       return vals;
+                               }
+
+                               /*
+                               PrivateFunction: setFormValues
+                                       Set values of a form to those in passed in object.
+                               */
+                               function setFormValues (form, vals) {
+                                       var prop, currentField,
+                                               fields = {},
+                                               storeType, i = 0, n, len, foundOne, currentFieldType;
+
+                                       for (prop in vals) {
+                                               currentField = form[prop];
+                                               if (currentField && currentField[0] && !currentField.options) { // is array of fields
+                                                       //normalise values to array of vals
+                                                       vals[prop] = vals[prop] && vals[prop].push ? vals[prop] : [vals[prop]];
+                                                       //order the fields by types that matter
+                                                       fields.radios = [];
+                                                       fields.checkboxesSelects = [];
+                                                       fields.multiSelects = [];
+                                                       fields.other = [];
+
+                                                       for (i = 0; currentField[i]; i++) {
+                                                               currentFieldType = currentField[i].type;
+                                                               if (currentFieldType == "radio") {
+                                                                       storeType = "radios";
+                                                               } else if (currentFieldType == "select-one" || currentFieldType == "checkbox") {
+                                                                       storeType = "checkboxesSelects";
+                                                               } else if (currentFieldType == "select-multiple") {
+                                                                       storeType = "multiSelects";
+                                                               } else {
+                                                                       storeType = "other";
+                                                               }
+                                                               //add it to the correct array
+                                                               fields[storeType][fields[storeType].length] = currentField[i];
+                                                       }
+
+                                                       for (i = 0; fields.multiSelects[i]; i++) {
+                                                               vals[prop] = setValue(fields.multiSelects[i], vals[prop]);
+                                                       }
+                                                       for (i = 0; fields.checkboxesSelects[i]; i++) {
+                                                               setValue(fields.checkboxesSelects[i], "");
+                                                               for (n = 0, len = vals[prop].length; n < len; n++) {
+                                                                       if (setValue(fields.checkboxesSelects[i], vals[prop][n])) {
+                                                                               vals[prop].slice(n, 1);
+                                                                               break;
+                                                                       }
+                                                               }
+                                                       }
+                                                       for (i = 0; fields.radios[i]; i++) {
+                                                               fields.radios[i].checked = false;
+                                                               foundOne = false;
+                                                               for (n = 0, len = vals[prop].length; n < len; n++) {
+                                                                       if (setValue(fields.radios[i], vals[prop][n])) {
+                                                                               vals[prop].slice(n, 1);
+                                                                               foundOne = true;
+                                                                               break;
+                                                                       }
+                                                                       if (foundOne) { break; }
+                                                               }
+                                                       }
+                                                       for (i = 0; fields.other[i] && vals[prop][i] !== undefined; i++) {
+                                                               setValue(fields.other[i], vals[prop][i]);
+                                                       }
+                                               } else if (currentField && currentField.nodeName) { // is single field, easy
+                                                       setValue(currentField, vals[prop]);
+                                               }
+                                       }
+                               }
+
+                               /*
+                               PrivateFunction: setValue
+                                       Set the value of a form element.
+
+                               Returns:
+                                       values that weren't able to set if array of vals passed (for multi select). Otherwise true if val set, false if not
+                               */
+                               function setValue (el, val) {
+                                       var i = 0,
+                                               length,
+                                               n = 0,
+                                               nlen,
+                                               elOption,
+                                               optionVal;
+
+                                       if (el.type == "select-one") {
+                                               for (length = el.options.length; i < length; i++) {
+                                                       if (el.options[i].value == val) {
+                                                               el.selectedIndex = i;
+                                                               return true;
+                                                       }
+                                               }
+                                               return false;
+                                       } else if (el.type == "select-multiple") {
+                                               var isArray = !!val.push;
+                                               for (i = 0, length = el.options.length; i < length; i++) {
+                                                       elOption = el.options[i];
+                                                       optionVal = elOption.value;
+                                                       if (isArray) {
+                                                               elOption.selected = false;
+                                                               for (nlen = val.length; n < nlen; n++) {
+                                                                       if (optionVal == val[n]) {
+                                                                               elOption.selected = true;
+                                                                               val.splice(n, 1);
+                                                                               break;
+                                                                       }
+                                                               }
+                                                       } else {
+                                                               return elOption.selected = val == optionVal;
+                                                       }
+                                               }
+                                               return false;
+                                       } else if (el.type == "radio" || el.type == "checkbox") {
+                                               el.checked = val == el.value;
+                                               return val == el.value;
+                                       } else {
+                                               el.value = val;
+                                               return true;
+                                       }
+                               }
+
+                               // toplevel implementation
+                               return function (/* [value] */) {
+                                       var args = arguments,
+                                               val = args[0],
+                                               that = this,
+                                               i = 0,
+                                               length = that.length;
+
+                                       if (args.length === 0) {
+                                               return that[0].nodeName == 'FORM' ?
+                                                       formValues(that[0]) :
+                                                       elementValue(that[0]);
+                                       }
+                                       if (that[0].nodeName == 'FORM') {
+                                               if (! typeof val == 'object') {
+                                                       throw 'value for FORM must be object';
+                                               }
+                                               setFormValues(that[0], val);
+                                       } else {
+                                               for (; i < length; i++) {
+                                                       setValue(that[i], val);
+                                               }
+                                       }
+                                       return that;
+                               };
+                       }(),
+
+                       /**
+                       @name glow.dom.NodeList#slice
+                       @function
+                       @description Extracts nodes from a NodeList and returns them as a new NodeList.
+
+                       @param {Number} start The NodeList index at which to begin extraction.
+
+                               If negative, this param specifies a position measured from
+                               the end of the NodeList
+
+                       @param {Number} [end] The NodeList index immediately after the end of the extraction.
+
+                               If not specified the extraction includes all nodes from the
+                               start to the end of the NodeList. A Negative end specifies
+                               an position measured from the end of the NodeList.
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns a new NodeList containing the extracted nodes
+
+                       @example
+                               var myNodeList = glow.dom.create("<div></div><div></div>");
+                               myNodeList = myNodeList.slice(1, 2); // just second div
+                        */
+                       slice: function (/* start, end */) {
+                               return new r.NodeList().push(Array.prototype.slice.apply(this, arguments));
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#sort
+                       @function
+                       @description Returns a new NodeList containing the same nodes in order.
+
+                               Sort order defaults to document order if no sort function is passed in.
+
+                       @param {Function} [func] Function to determine sort order
+
+                               This function will be passed 2 nodes (a, b). The function
+                               should return a number less than 0 to sort a lower than b
+                               and greater than 0 to sort a higher than b.
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns a new NodeList containing the sorted nodes
+
+                       @example
+                               // heading elements in document order
+                               var headings = glow.dom.get("h1, h2, h3, h4, h5, h6").sort();
+
+                               //get links in alphabetical (well, lexicographical) order
+                               var links = glow.dom.get("a").sort(function(a, b) {
+                                       return ((a.textContent || a.innerText) < (b.textContent || b.innerText)) ? -1 : 1;
+                               })
+                       */
+                       sort: function(func) {
+                               var that = this, i=0, aNodes;
+
+                               if (!that.length) { return that; }
+                               if (!func) {
+                                       if (typeof that[0].sourceIndex == "number") {
+                                               // sourceIndex is IE proprietary (but Opera supports)
+                                               func = function(a, b) {
+                                                       return a.sourceIndex - b.sourceIndex;
+                                               };
+                                       } else if (that[0].compareDocumentPosition) {
+                                               // DOM3 method
+                                               func = function(a, b) {
+                                                       return 3 - (a.compareDocumentPosition(b) & 6);
+                                               };
+                                       } else {
+                                               // js emulation of sourceIndex
+                                               aNodes = getByTagName("*", [doc]);
+                                               for (; aNodes[i]; i++) {
+                                                       aNodes[i]._sourceIndex = i;
+                                               }
+                                               func = function(a, b) {
+                                                       return a._sourceIndex - b._sourceIndex;
+                                               };
+                                       }
+                               }
+
+                               return r.get([].sort.call(that, func));
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#filter
+                       @function
+                       @description Filter the NodeList using a function
+
+                               The supplied function will be called for each node in the NodeList.
+                               
+                               The index of the node will be provided as the first parameter, and
+                               'this' will refer to the node.
+                               
+                               Return true to keep the node, or false to remove it.
+
+                       @param {Function} func Function to test each node
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns a new NodeList containing the filtered nodes
+
+                       @example
+                               // return images with a width greater than 320
+                               glow.dom.get("img").filter(function (i) {
+                                       return this.width > 320;
+                               });
+                        */
+                       filter: function(callback) {
+                               var ret = [], //result
+                                       ri = 0,
+                                       i = 0,
+                                       length = this.length;
+                               for (; i < length; i++) {
+                                       if (callback.apply(this[i], [i])) {
+                                               ret[ri++] = this[i];
+                                       }
+                               }
+                               return r.get(ret);
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#children
+                       @function
+                       @description Gets the child elements of each node as a new NodeList.
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns a new NodeList containing all the child nodes
+
+                       @example
+                               // get all list items
+                               var items = glow.dom.get("ul, ol").children();
+                        */
+                       children: function() {
+                               var ret = [],
+                                       ri = 0,
+                                       i = 0,
+                                       n = 0,
+                                       length = this.length,
+                                       childTmp;
+                               
+                               for (; i < length; i++) {
+                                       ret = ret.concat( getChildElms(this[i]) );
+                               }
+                               return r.get(ret);
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#parent
+                       @function
+                       @description Gets the unique parent nodes of each node as a new NodeList.
+                       The given nodelist will always be placed in the first element with no child elements.
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns a new NodeList containing the parent nodes, with
+                               duplicates removed
+
+                       @example
+                               // elements which contain links
+                               var parents = glow.dom.get("a").parent();
+                       */
+                       parent: function() {
+                               var ret = [],
+                                       ri = 0,
+                                       i = 0,
+                                       length = this.length;
+
+                               for (; i < length; i++) {
+                                       ret[ri++] = this[i].parentNode;
+                               }
+                               
+                               return r.get(unique(ret));
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#ancestors
+                       @function
+                       @description Gets the unique ancestor nodes of each node as a new NodeList.
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns NodeList
+
+                       @example
+                               // get ancestor elements for anchor elements 
+                               var ancestors = glow.dom.get("a").ancestors();
+                       */
+                       ancestors: function() {
+                               var ret = [],
+                                       ri = 0,
+                                       i = 0,
+                                       length = this.length,
+                                       elm;
+                                       
+                               while (i < length) {
+                                       elm = this[i].parentNode;
+                                       
+                                       while (elm && elm.nodeType == 1) {                                                      
+                                               ret[ri++] = elm;
+                                               elm = elm.parentNode;
+                                       }                                                               
+                                       i++;
+                               }
+                               
+                               return r.get(unique(ret));
+                       },
+                       
+                       
+                       /**
+                       @name glow.dom.NodeList#wrap
+                       @function
+                       @description Wraps the given NodeList with the specified element(s).
+                       
+                               The given NodeList items will always be placed in the first child node that contains no further element nodes.
+                               
+                               Each item in a given NodeList will be wrapped individually.
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns the NodeList with new wrapper parents
+
+                       @example
+                               // wrap the given element 
+                               glow.dom.get("p").wrap("<div></div>");
+                               // <div><p></p></div>
+                       */
+                       wrap: function(wrapper) {
+                               var length = this.length,
+                                       childElm,
+                                       parent,
+                                       wrappingNodes;
+                                       
+                               if (typeof wrapper == 'string') {
+                                       wrappingNodes = r.create(wrapper);
+                               }
+                               else {
+                                       wrappingNodes = r.get(wrapper);
+                               }
+                                               
+                               for (i=0; i < length; i++) {                                    
+                                       parent = wrappingNodes[0];
+                                       
+                                       while (parent) {                                        
+                                               childElm = getFirstChildElm(parent);
+                                                       
+                                               if (childElm) {                                 
+                                                       parent = childElm;
+                                               }
+                                               else {
+                                                       break;
+                                               }
+                                       }                                                       
+                                       
+                                       if (this[i].parentNode) {                                               
+                                               wrappingNodes.insertBefore(this[i]);                                                                                                    
+                                       }
+                                       // If wrapping multiple nodes, we need to take a clean copy of the wrapping nodes
+                                       if (i != length-1) {
+                                               wrappingNodes = wrappingNodes.clone();
+                                       }
+                                       
+                                       parent.appendChild(this[i]);
+
+                               }
+                               
+                               return this;
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#unwrap
+                       @function
+                       @description Removes the first unique parent for each item of a supplied NodeList
+
+                       @returns {glow.dom.NodeList}
+
+                               Returns the unwrapped NodeList
+
+                       @example
+                               // Before: <div><div><p></p></div></div>
+                               // unwrap the given element
+                               glow.dom.get("p").unwrap();
+                               // After: <div><p></p></div>
+                       */
+                       unwrap: function() {
+                               var toRemove,
+                                       nodesToRemove = this.parent(),
+                                       length = nodesToRemove.length;
+                               
+                               for (i=0; i < length; i++) {                            
+                                       toRemove = nodesToRemove.slice(i, i+1);
+                                       // if the item we're removing has no new parent (i.e. is not in document), then we just remove the child and destroy the old parent
+                                       if (!toRemove[0].parentNode){
+                                               toRemove.children().remove();
+                                               toRemove.destroy();
+                                       }
+                                       else {
+                                               toRemove.children().insertBefore(toRemove);
+                                               toRemove.destroy();                                                     
+                                       }                                               
+
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#next
+                       @function
+                       @description Gets the next sibling element for each node as a new NodeList.
+
+                       @returns {glow.dom.NodeList}
+
+                               A new NodeList containing the next sibling elements.
+
+                       @example
+                               // gets the element following #myLink (if there is one)
+                               var next = glow.dom.get("#myLink").next();
+                       */
+                       next: function() {
+                               return getNextOrPrev(this, "next");
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#prev
+                       @function
+                       @description Gets the previous sibling element for each node as a new NodeList.
+
+                       @returns {glow.dom.NodeList}
+
+                               A new NodeList containing the previous sibling elements.
+
+                       @example
+                               // gets the elements before #myLink (if there is one)
+                               var previous = glow.dom.get("#myLink").previous();
+                       */
+                       prev: function() {
+                               return getNextOrPrev(this, "previous");
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#is
+                       @function
+                       @description Tests if all the nodes match a CSS selector.
+                       
+                               Jake: I'm deprecating this until we have time to make it faster (probably when we change our CSS selector engine)
+                       
+                       @deprecated
+                       @param {String} selector A CSS selector string
+
+                       @returns {Boolean}
+
+                       @example
+                               var bigHeadings = glow.dom.get("h1, h2, h3");
+
+                               // true
+                               if (bigHeadings.is("h1, h2, h3, h4, h5, h6")) ...
+
+                               // false
+                               if (bigHeadings.is("a")) ...
+                       */
+                       is: function (selector) {
+                               // TODO - this implementation needs to be optimized
+                               var nodes = glow.dom.get(selector),
+                                       i = 0,
+                                       iLen = this.length,
+                                       j,
+                                       jLen;
+
+                               node:
+                               for (; i < iLen; i++) {
+                                       for (j = 0, jLen = nodes.length; j < jLen; j++) {
+                                               if (this[i] == nodes[j]) {
+                                                       continue node;
+                                               }
+                                       }
+                                       return false;
+                               }
+                               return true;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#text
+                       @function
+                       @description Gets the inner text of the first node, or set the inner text of all matched nodes.
+
+                       @param {String} [text] String to set as inner text of nodes
+
+                       @returns {glow.dom.NodeList | String}
+
+                               If the text argument is passed then the NodeList is
+                               returned, otherwise the text is returned.
+
+                       @example
+                               // set text
+                               var div = glow.dom.create("<div></div>").text("Hello World!");
+
+                               // get text
+                               var greeting = div.text();
+                       */
+                       text: function (/* text */) {
+                               var args = arguments,
+                                       i = 0,
+                                       that = this,
+                                       length = that.length;
+
+                               if (args.length > 0) {
+                                       for (; i < length; i++) {
+                                               that[i].innerHTML = "";
+                                               that[i].appendChild(doc.createTextNode(args[0]));
+                                       }
+                                       return that;
+                               }
+                               //innerText (empty) and textContent (undefined) don't work in safari 2 for hidden elements
+                               return that[0].innerText || that[0].textContent == undefined ? getTextNodeConcat(that[0]) : that[0].textContent;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#empty
+                       @function
+                       @description Removes the contents of all the nodes.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // remove the contents of all textareas
+                               glow.dom.get("textarea").empty();
+                       */
+                       empty: function () {
+                               /*
+                                 NOTE: I changed this to destroy all nodes within the parent, but
+                                 seemed backwards incompatible with our own timetable demo
+                                 so we best hadn't do it until Glow 2
+                               */
+                               var i = 0,
+                                       len = this.length;
+                                       
+                               for (; i < len; i++) {
+                                       while(this[i].firstChild) {
+                                               this[i].removeChild(this[i].firstChild);
+                                       }
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#remove
+                       @function
+                       @description Removes each node from its parent node.
+                               If you no longer need the nodes, consider using
+                               {@link glow.dom.NodeList#destroy destroy}
+                               
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // take all the links out of a document
+                               glow.dom.get("a").remove();
+                       */
+                       remove: function () {
+                               for (var that = this, i = 0, length = that.length, parentNode; i < length; i++) {
+                                       if (parentNode = that[i].parentNode) {
+                                               parentNode.removeChild(that[i]);
+                                       }
+                               }
+                               return that;
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#destroy
+                       @function
+                       @description Removes each node from the DOM
+                               The node will actually be destroyed to free up memory
+
+                       @returns {glow.dom.NodeList} An empty NodeList
+
+                       @example
+                               // destroy all links in the document
+                               glow.dom.get("a").destroy();
+                       */
+                       destroy: function () {
+                               // remove any data attached to this NodeList
+                               this.get("*").push(this).removeData();
+                               
+                               this.appendTo(tmpDiv);
+                               // destroy nodes
+                               tmpDiv.innerHTML = "";
+                               // empty the nodelist
+                               
+                               Array.prototype.splice.call(this, 0, this.length);
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#clone
+                       @function
+                       @description Gets a new NodeList containing a clone of each node.
+                       
+                       @param {Boolean} [cloneListeners=false] Also clone any event listeners assigned using Glow
+                       
+                       @returns {glow.dom.NodeList}
+
+                               Returns a new NodeList containing clones of all the nodes in
+                               the NodeList
+
+                       @example
+                               // get a copy of all heading elements
+                               var myClones = glow.dom.get("h1, h2, h3, h4, h5, h6").clone();
+                               
+                       @example
+                               // get a copy of all anchor elements with 
+                               var myAnchors = glow.dom.get("a").clone(true);
+                       */
+                       clone: function (cloneListeners) {
+                               var ret = [],
+                                       i = this.length,
+                                       allCloneElms,
+                                       allBaseElms
+                                       eventIdProp = '__eventId' + glow.UID;
+
+                               while (i--) {
+                                       ret[i] = this[i].cloneNode(true);
+                               }
+                               
+                               // some browsers (ie) also clone node properties as attributes
+                               // we need to get rid of the eventId.
+                               allCloneElms = r.get( ret ).get("*").push( ret );
+                               if (nodePropertiesCloned && !isXml(ret[0])) {
+                                       i = allCloneElms.length;
+                                       while(i--) {
+                                               allCloneElms[i][eventIdProp] = null;
+                                       }
+                               }
+                               
+                               // copy data from base elements to clone elements
+                               allBaseElms = this.get("*").push( this );
+                               i = allCloneElms.length;
+                               while (i--) {
+                                       allCloneElms[i].removeAttribute(dataPropName);
+                                       glow.dom.get(allCloneElms[i]).data(
+                                               glow.dom.get(allBaseElms[i]).data()
+                                       );
+                               }
+                               
+                               // shall we clone events too?
+                               if (cloneListeners) {
+                                       // check the stuff we need is hanging around, we don't want
+                                       // glow.dom to be dependant on glow.events as it's a circular
+                                       // dependency
+                                       if ( !glow.events ) {
+                                               throw "glow.events required to clone event listeners";
+                                       }
+                                       
+                                       glow.events._copyListeners(
+                                               this.get("*").push( this ),
+                                               allCloneElms || r.get( ret ).get("*").push( ret )
+                                       );
+                               }
+                               
+                               return r.get(ret);
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#html
+                       @function
+                       @description Gets the HTML content of the first node, or set the HTML content of all nodes.
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                       @param {String} [html] String to set as inner HTML of nodes
+
+                       @returns {glow.dom.NodeList | String}
+
+                               If the html argument is passed, then the NodeList is
+                               returned, otherwise the inner HTML of the first node is returned.
+
+                       @example
+                               // get the html in #footer
+                               var footerContents = glow.dom.get("#footer").html();
+
+                       @example
+                               // set a new footer
+                               glow.dom.get("#footer").html("<strong>Hello World!</strong>");
+                       */
+                       html: function (newHtml) {
+                               var i = 0,
+                                       length = this.length;
+
+                               if (newHtml !== undefined) {
+                                       // not setting innerHTML, doesn't work in IE for elements like <table>
+                                       return this.empty().append(newHtml);
+                               }
+                               return this[0] ? this[0].innerHTML : "";
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#width
+                       @function
+                       @description Gets the width of the first node in pixels or sets the width of all nodes
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                               Return value does not include the padding or border of the
+                               element in browsers supporting the correct box model.
+
+                               You can use this to easily get the width of the document or
+                               window, see example below.
+
+                       @param {Number} [width] New width in pixels.
+
+                       @returns {glow.dom.NodeList | Number}
+
+                               Width of first element in pixels, or NodeList when setting widths
+
+                       @example
+                               // get the width of #myDiv
+                               glow.dom.get("#myDiv").width();
+
+                       @example
+                               // set the width of list items in #myDiv to 200 pixels
+                               glow.dom.get("#myDiv li").width(200);
+
+                       @example
+                               // get the height of the document
+                               glow.dom.get(document).width()
+
+                       @example
+                               // get the height of the window
+                               glow.dom.get(window).width()
+                       */
+                       width: function(width) {
+                               if (width == undefined) {
+                                       return getElmDimension(this[0], "width");
+                               }
+                               setElmsSize(this, width, "width");
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#height
+                       @function
+                       @description Gets the height of the first element in pixels or sets the height of all nodes
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                                Return value does not include the padding or border of the element in
+                                browsers supporting the correct box model.
+
+                                You can use this to easily get the height of the document or
+                                window, see example below.
+
+                       @param {Number} [height] New height in pixels.
+
+                       @returns {glow.dom.NodeList | Number}
+
+                               Height of first element in pixels, or NodeList when setting heights.
+
+                       @example
+                               // get the height of #myDiv
+                               glow.dom.get("#myDiv").height();
+
+                       @example
+                               // set the height of list items in #myDiv to 200 pixels
+                               glow.dom.get("#myDiv li").height(200);
+
+                       @example
+                               // get the height of the document
+                               glow.dom.get(document).height()
+
+                       @example
+                               // get the height of the window
+                               glow.dom.get(window).height()
+                       */
+                       height: function(height) {
+                               if (height == undefined) {
+                                       return getElmDimension(this[0], "height");
+                               }
+                               setElmsSize(this, height, "height");
+                               return this;
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#scrollLeft
+                       @function
+                       @description Gets/sets the number of pixels the element has scrolled horizontally
+                               
+                               Get the value by calling without arguments, set by providing a new
+                               value.
+                               
+                               To get/set the scroll position of the window, use this method on
+                               a nodelist containing the window object.
+
+                       @param {Number} [val] New left scroll position
+
+                       @returns {glow.dom.NodeList | Number}
+
+                               Current scrollLeft value, or NodeList when setting scroll position.
+
+                       @example
+                               // get the scroll left value of #myDiv
+                               var scrollPos = glow.dom.get("#myDiv").scrollLeft();
+                               // scrollPos is a number, eg: 45
+
+                       @example
+                               // set the scroll left value of #myDiv to 20
+                               glow.dom.get("#myDiv").scrollLeft(20);
+
+                       @example
+                               // get the scrollLeft of the window
+                               var scrollPos = glow.dom.get(window).scrollLeft();
+                               // scrollPos is a number, eg: 45
+                       */
+                       scrollLeft: function(val) {
+                               return scrollOffset(this, true, val);
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#scrollTop
+                       @function
+                       @description Gets/sets the number of pixels the element has scrolled vertically
+                               
+                               Get the value by calling without arguments, set by providing a new
+                               value.
+                               
+                               To get/set the scroll position of the window, use this method on
+                               a nodelist containing the window object.
+
+                       @param {Number} [val] New top scroll position
+
+                       @returns {glow.dom.NodeList | Number}
+
+                               Current scrollTop value, or NodeList when setting scroll position.
+
+                       @example
+                               // get the scroll top value of #myDiv
+                               var scrollPos = glow.dom.get("#myDiv").scrollTop();
+                               // scrollPos is a number, eg: 45
+
+                       @example
+                               // set the scroll top value of #myDiv to 20
+                               glow.dom.get("#myDiv").scrollTop(20);
+
+                       @example
+                               // get the scrollTop of the window
+                               var scrollPos = glow.dom.get(window).scrollTop();
+                               // scrollPos is a number, eg: 45
+                       */
+                       scrollTop: function(val) {
+                               return scrollOffset(this, false, val);
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#show
+                       @function
+                       @description Shows all hidden items in the NodeList.
+                       @returns {glow.dom.NodeList}
+                       @example
+                               // Show element with ID myDiv
+                               glow.dom.get("#myDiv").show();
+                       @example
+                               // Show all list items within #myDiv
+                               glow.dom.get("#myDiv li").show();
+                       */
+                       show: function() {
+                               var i = 0,
+                                       len = this.length,
+                                       currItem,
+                                       itemStyle;
+                               for (; i < len; i++) {
+                                       /* Create a NodeList for the current item */
+                                       currItem = r.get(this[i]);
+                                       itemStyle = currItem[0].style;
+                                       if (currItem.css("display") == "none") {
+                                               itemStyle.display = "";
+                                               itemStyle.visibility = "visible";
+                                               /* If display is still none, set to block */
+                                               if (currItem.css("display") == "none") {
+                                                       itemStyle.display = "block";
+                                               }
+                                       }
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#hide
+                       @function
+                       @description Hides all items in the NodeList.
+                       @returns {glow.dom.NodeList}
+                       @example
+                               // Hides all list items within #myDiv
+                               glow.dom.get("#myDiv li").hide();
+                       */
+                       hide: function() {
+                               return this.css("display", "none").css("visibility", "hidden");
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#css
+                       @function
+                       @description Gets a CSS property for the first node or sets a CSS property on all nodes.
+
+                               <p><em>This method is not applicable to XML NodeLists.</em></p>
+
+                               If a single property name is passed, the corresponding value
+                               from the first node will be returned.
+
+                               If a single property name is passed with a value, that value
+                               will be set on all nodes on the NodeList.
+
+                               If an array of properties name is passed with no value, the return
+                               value is the sum of those values from the first node in the NodeList.
+                               This can be useful for getting the total of left and right padding,
+                               for example.
+
+                               Return values are strings. For instance, "height" will return
+                               "25px" for an element 25 pixels high. You may want to use
+                               parseInt to convert these values.
+
+                               Here are the compatible properties you can get, if you use one
+                               which isn't on this list the return value may differ between browsers.
+
+                               <dl>
+                               <dt>width</dt><dd>Returns pixel width, eg "25px". Can be used even if width has not been set with CSS.</dd>
+                               <dt>height</dt><dd>Returns pixel height, eg "25px". Can be used even if height has not been set with CSS.</dd>
+                               <dt>top, right, bottom, left</dt><dd>Pixel position relative to positioned parent, or original location if position:relative, eg "10px". These can be used even if position:static.</dd>
+                               <dt>padding-top</dt><dd>Pixel size of top padding, eg "5px"</dd>
+                               <dt>padding-right</dt><dd>Pixel size of right padding, eg "5px"</dd>
+                               <dt>padding-bottom</dt><dd>Pixel size of bottom padding, eg "5px"</dd>
+                               <dt>padding-left</dt><dd>Pixel size of left padding, eg "5px"</dd>
+                               <dt>margin-top</dt><dd>Pixel size of top margin, eg "5px"</dd>
+                               <dt>margin-right</dt><dd>Pixel size of right margin, eg "5px"</dd>
+                               <dt>margin-bottom</dt><dd>Pixel size of bottom margin, eg "5px"</dd>
+                               <dt>margin-left</dt><dd>Pixel size of left margin, eg "5px"</dd>
+                               <dt>border-top-width</dt><dd>Pixel size of top border, eg "5px"</dd>
+                               <dt>border-right-width</dt><dd>Pixel size of right border, eg "5px"</dd>
+                               <dt>border-bottom-width</dt><dd>Pixel size of bottom border, eg "5px"</dd>
+                               <dt>border-left-width</dt><dd>Pixel size of left border, eg "5px"</dd>
+                               <dt>border-*-style</dt><dd>eg "dotted"</dd>
+                               <dt>border-*-color</dt><dd>returns colour in format "rgb(255, 255, 255)", return value also has properties r, g & b to get individual values as integers</dd>
+                               <dt>color</dt><dd>returns colour in format "rgb(255, 255, 255)", return value also has properties r, g & b to get individual values as integers</dd>
+                               <dt>list-style-position</dt><dd>eg "outside"</dd>
+                               <dt>list-style-type</dt><dd>eg "square"</dd>
+                               <dt>list-style-image</dt><dd>Returns full image path, eg "url(http://www.bbc.co.uk/lifestyle/images/bullets/1.gif)" or "none"</dd>
+                               <dt>background-image</dt><dd>Returns full image path, eg "url(http://www.bbc.co.uk/lifestyle/images/bgs/1.gif)" or "none"</dd>
+                               <dt>background-attachment</dt><dd>eg "scroll"</dd>
+                               <dt>background-repeat</dt><dd>eg "repeat-x"</dd>
+                               <dt>direction</dt><dd>eg "ltr"</dd>
+                               <dt>font-style</dt><dd>eg "italic"</dd>
+                               <dt>font-variant</dt><dd>eg "small-caps"</dd>
+                               <dt>line-height</dt><dd>Pixel height, eg "30px". Note, Opera may return value with 2 decimal places, eg "30.00px"</dd>
+                               <dt>letter-spacing</dt><dd>Pixel spacing, eg "10px"</dd>
+                               <dt>text-align</dt><dd>eg "right"</dd>
+                               <dt>text-decoration</dt><dd>eg "underline"</dd>
+                               <dt>text-indent</dt><dd>Pixel indent, eg "10px"</dd>
+                               <dt>white-space</dt><dd>eg "nowrap"</dd>
+                               <dt>word-spacing</dt><dd>Pixel spacing, eg "5px"</dd>
+                               <dt>float</dt><dd>eg "left"</dd>
+                               <dt>clear</dt><dd>eg "right"</dd>
+                               <dt>opacity</dt><dd>Value between 0 & 1. In IE, this value comes from the filter property (/100)</dd>
+                               <dt>position</dt><dd>eg "relative"</dd>
+                               <dt>z-index</dt><dd>eg "32"</dd>
+                               <dt>display</dt><dd>eg "block"</dd>
+                               <dt>text-transform</dt><dd>eg "uppercase"</dd>
+                               </dl>
+
+                               The following return values that may be usable but have differences in browsers
+
+                               <dl>
+                               <dt>font-family</dt><dd>Some browsers return the font used ("Verdana"), others return the full list found in the declaration ("madeup, verdana, sans-serif")</dd>
+                               <dt>font-size</dt><dd>Returns size as pixels except in IE, which will return the value in the same units it was set in ("0.9em")</dd>
+                               <dt>font-weight</dt><dd>Returns named values in some browsers ("bold"), returns computed weight in others ("700")</dd>
+                               </dl>
+
+                       @param {String | String[] | Object} property The CSS property name, array of names to sum, or object of key-value pairs
+
+                       @param {String} [value] The value to apply
+
+                       @returns {glow.dom.NodeList | String}
+
+                               Returns the CSS value from the first node, or NodeList when setting values
+
+                       @example
+                               // get value from first node
+                               glow.dom.get("#myDiv").css("display");
+
+                       @example
+                               // set left padding to 10px on all nodes
+                               glow.dom.get("#myDiv").css("padding-left", "10px");
+
+                       @example
+                               // "30px", total of left & right padding
+                               glow.dom.get("#myDiv").css(["padding-left", "padding-right"]);
+
+                       @example
+                               // where appropriate, px is assumed when no unit is passed
+                               glow.dom.get("#myDiv").css("height", 300);
+               
+                       @example
+                               // set multiple CSS values at once
+                               // NOTE: Property names containing a hyphen such as font-weight must be quoted
+                               glow.dom.get("#myDiv").css({
+                                       "font-weight": "bold",
+                                       padding: "10px",
+                                       color: "#00cc99"
+                               })
+                       */
+                       css: function(prop, val) {
+                               var that = this,
+                                       thisStyle,
+                                       i = 0,
+                                       len = that.length,
+                                       originalProp = prop;
+
+                               if (prop.constructor === Object) { // set multiple values
+                                       for (style in prop) {
+                                               this.css(style, prop[style]);
+                                       }
+                                       return that;
+                               }
+                               else if (val != undefined) { //set one CSS value
+                                       prop = toStyleProp(prop);
+                                       for (; i < len; i++) {
+                                               thisStyle = that[i].style;
+                                               
+                                               if (typeof val == "number" && hasUnits.test(originalProp)) {
+                                                       val = val.toString() + "px";
+                                               }
+                                               if (prop == "opacity" && env.ie) {
+                                                       //in IE the element needs hasLayout for opacity to work
+                                                       thisStyle.zoom = "1";
+                                                       if (val === "") {
+                                                               thisStyle.filter = "";
+                                                       } else {
+                                                               thisStyle.filter = "alpha(opacity=" + Math.round(Number(val, 10) * 100) + ")";
+                                                       }
+                                               } else {
+                                                       thisStyle[prop] = val;
+                                               }
+                                       }
+                                       return that;
+                               } else { //getting stuff
+                                       if (!len) { return; }
+                                       return getCssValue(that[0], prop);
+                               }
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#offset
+                       @function
+                       @description Gets the offset from the top left of the document.
+                       
+                               If the NodeList contains multiple items, the offset of the
+                               first item is returned.
+
+                       @returns {Object}
+                               Returns an object with "top" & "left" properties in pixels
+
+                       @example
+                               glow.dom.get("#myDiv").offset().top
+                       */
+                       offset: function () {
+                               // http://weblogs.asp.net/bleroy/archive/2008/01/29/getting-absolute-coordinates-from-a-dom-element.aspx - great bit of research, most bugfixes identified here (and also jquery trac)
+                               var elm = this[0],
+                                       docScrollPos = {
+                                               x: getScrollOffset(window, true),
+                                               y: getScrollOffset(window, false)
+                                       }
+
+                               //this is simple(r) if we can use 'getBoundingClientRect'
+                               // Sorry but the sooper dooper simple(r) way is not accurate in Safari 4
+                               if (!glow.env.webkit && elm.getBoundingClientRect) {
+                                       var rect = elm.getBoundingClientRect();
+                                       return {
+                                               top: rect.top
+                                                       /*
+                                                        getBoundingClientRect is realive to top left of
+                                                        the viewport, so we need to sort out scrolling offset
+                                                       */
+                                                       + docScrollPos.y
+                                                       /*
+                                                        IE adds the html element's border to the value. We can
+                                                        deduct this value using client(Top|Left). However, if
+                                                        the user has done html{border:0} clientTop will still
+                                                        report a 2px border in IE quirksmode so offset will be off by 2.
+                                                        Hopefully this is an edge case but we may have to revisit this
+                                                        in future
+                                                       */
+                                                       - docElm.clientTop,
+
+                                               left: rect.left //see above for docs on all this stuff
+                                                       + docScrollPos.x
+                                                       - docElm.clientLeft
+                                       };
+                               } else { //damnit, let's go the long way around
+                                       var top = elm.offsetTop,
+                                               left = elm.offsetLeft,
+                                               originalElm = elm,
+                                               nodeNameLower,
+                                               //does the parent chain contain a position:fixed element
+                                               involvesFixedElement = false,
+                                               offsetParentBeforeBody = elm;
+
+                                       //add up all the offset positions
+                                       while (elm = elm.offsetParent) {
+                                               left += elm.offsetLeft;
+                                               top += elm.offsetTop;
+
+                                               //if css position is fixed, we need to add in the scroll offset too, catch it here
+                                               if (getCssValue(elm, "position") == "fixed") {
+                                                       involvesFixedElement = true;
+                                               }
+
+                                               //gecko & webkit (safari 3) don't add on the border for positioned items
+                                               if (env.gecko || env.webkit > 500) {
+                                                       left += parseInt(getCssValue(elm, "border-left-width")) || 0;
+                                                       top  += parseInt(getCssValue(elm, "border-top-width"))  || 0;
+                                               }
+
+                                               //we need the offset parent (before body) later
+                                               if (elm.nodeName.toLowerCase() != "body") {
+                                                       offsetParentBeforeBody = elm;
+                                               }
+                                       }
+
+                                       //deduct all the scroll offsets
+                                       elm = originalElm;
+                                       while ((elm = elm.parentNode) && (elm != docBody) && (elm != docElm)) {
+                                               left -= elm.scrollLeft;
+                                               top -= elm.scrollTop;
+
+                                               //FIXES
+                                               //gecko doesn't add the border of contained elements to the offset (overflow!=visible)
+                                               if (env.gecko && getCssValue(elm, "overflow") != "visible") {
+                                                       left += parseInt(getCssValue(elm, "border-left-width"));
+                                                       top += parseInt(getCssValue(elm, "border-top-width"));
+                                               }
+                                       }
+
+                                       //if we found a fixed position element we need to add the scroll offsets
+                                       if (involvesFixedElement) {
+                                               left += docScrollPos.x;
+                                               top += docScrollPos.y;
+                                       }
+
+                                       //FIXES
+                                       // Webkit < 500 body's offset gets counted twice for absolutely-positioned elements (or if there's a fixed element)
+                                       // Gecko - non-absolutely positioned elements that are direct children of body get the body offset counted twice
+                                       if (
+                                               (env.webkit < 500 && (involvesFixedElement || getCssValue(offsetParentBeforeBody, "position") == "absolute")) ||
+                                               (env.gecko && getCssValue(offsetParentBeforeBody, "position") != "absolute")
+                                       ) {
+                                               left -= docBody.offsetLeft;
+                                               top -= docBody.offsetTop;
+                                       }
+
+                                       return {left:left, top:top};
+                               }
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#position
+                       @function
+                       @description Get the top & left position of an element relative to its positioned parent
+                               
+                               This is useful if you want to make a position:static element position:absolute
+                               and retain the original position of the element
+                               
+                       @returns {Object} An object with 'top' and 'left' number properties
+
+                       @example
+                               // get the top distance from the positioned parent
+                               glow.dom.get("#elm").position().top
+                       */
+                       position: function() {
+                               var positionedParent = r.get( getPositionedParent(this[0]) ),
+                                       hasPositionedParent = !!positionedParent[0],
+                                       
+                                       // element margins to deduct
+                                       marginLeft = parseInt( this.css("margin-left") ) || 0,
+                                       marginTop  = parseInt( this.css("margin-top")  ) || 0,
+                                       
+                                       // offset parent borders to deduct, set to zero if there's no positioned parent
+                                       positionedParentBorderLeft = ( hasPositionedParent && parseInt( positionedParent.css("border-left-width") ) ) || 0,
+                                       positionedParentBorderTop  = ( hasPositionedParent && parseInt( positionedParent.css("border-top-width")  ) ) || 0,
+                                       
+                                       // element offsets
+                                       elOffset = this.offset(),
+                                       positionedParentOffset = hasPositionedParent ? positionedParent.offset() : {top: 0, left: 0};
+                               
+                               return {
+                                       left: elOffset.left - positionedParentOffset.left - marginLeft - positionedParentBorderLeft,
+                                       top:  elOffset.top  - positionedParentOffset.top  - marginTop  - positionedParentBorderTop
+                               }
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#append
+                       @function
+                       @description Appends the given elements to each node.
+
+                               If there is more than one node in the NodeList, then the given elements
+                               are appended to the first node and clones are appended to the other
+                               nodes.
+
+                               <p><em>String nodespecs cannot be used with XML NodeLists</em></p>
+
+                       @param {String | Element | glow.dom.NodeList} nodespec HTML string, Element or NodeList to append to each node.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // ends every paragraph with '...'
+                               glow.dom.get('p').append(
+                                       '<span>...</span>'
+                               );
+                       */
+                       append: function (nodeSpec) {
+                               var that = this,
+                                       j = 0,
+                                       i = 1,
+                                       length = that.length,
+                                       nodes;
+
+                               if (length == 0) { return that; }
+                               nodes = typeof nodeSpec == "string" ? nodelistToArray(stringToNodes(nodeSpec)) :
+                                               nodeSpec.nodeType ? [nodeSpec] : nodelistToArray(nodeSpec);
+
+                               for (; nodes[j]; j++) {
+                                       that[0].appendChild(nodes[j]);
+                               }
+                               for (; i < length; i++) {
+                                       for (j = 0; nodes[j]; j++) {
+                                               that[i].appendChild(nodes[j].cloneNode(true));
+                                       }
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#prepend
+                       @function
+                       @description Prepends the given elements to each node.
+
+                               If there is more than one node in the NodeList, then the given elements
+                               are prepended to the first node and clones are prepended to the other
+                               nodes.
+
+                               <p><em>String nodespecs cannot be used with XML NodeLists</em></p>
+
+                       @param {String | Element | glow.dom.NodeList} nodespec HTML string, Element or NodeList to prepend to each node.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // prepends every paragraph with 'Paragraph: '
+                               glow.dom.get('p').prepend(
+                                       '<span>Paragraph: </span>'
+                               );
+                       */
+                       prepend: function (nodeSpec) {
+                               var that = this,
+                                       j = 0,
+                                       i = 1,
+                                       length = that.length,
+                                       nodes,
+                                       first;
+
+                               if (length == 0) { return that; }
+
+                               nodes = typeof nodeSpec == "string" ? nodelistToArray(stringToNodes(nodeSpec)) :
+                                               nodeSpec.nodeType ? [nodeSpec] : nodelistToArray(nodeSpec);
+
+                               first = that[0].firstChild;
+
+                               for (; nodes[j]; j++) {
+                                       that[0].insertBefore(nodes[j], first);
+                               }
+
+                               for (; i < length; i++) {
+                                       first = that[i].firstChild;
+                                       for (j = 0; nodes[j]; j++) {
+                                               that[i].insertBefore(nodes[j].cloneNode(true), first);
+                                       }
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#appendTo
+                       @function
+                       @description Appends the NodeList to elements.
+
+                               If more than one element is given (i.e. if the nodespec argument
+                               is an array of nodes or a NodeList) the NodeList will be
+                               appended to the first element and clones to each subsequent
+                               element.
+
+                       @param {String | Element | glow.dom.NodeList} nodespec CSS selector string, Element or NodeList to append the NodeList to.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // appends '...' to every paragraph
+                               glow.dom.create('<span>...</span>').appendTo('p');
+                       */
+                       appendTo: function (nodes) {
+                               if (! (nodes instanceof r.NodeList)) { nodes = r.get(nodes); }
+                               nodes.append(this);
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#prependTo
+                       @function
+                       @description Prepends the NodeList to elements.
+
+                               If more than one element is given (i.e. if the nodespec argument
+                               is an array of nodes or a NodeList) the NodeList will be
+                               prepended to the first element and clones to each subsequent
+                               element.
+
+                       @param {String | Element | glow.dom.NodeList} nodespec CSS selector string, Element or NodeList to prepend the NodeList to.
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // prepends 'Paragraph: ' to every paragraph
+                               glow.dom.create('<span>Paragraph: </span>').prependTo('p');
+                       */
+                       prependTo: function (nodes) {
+                               if (! (nodes instanceof r.NodeList)) { nodes = r.get(nodes); }
+                               nodes.prepend(this);
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#after
+                       @function
+                       @description Inserts elements after each node.
+
+                               If there is more than one node in the NodeList, the elements
+                               will be inserted after the first node and clones inserted
+                               after each subsequent node.
+
+                       @param {String | Element | glow.dom.NodeList} nodespec HTML string, Element or NodeList to insert after each node
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // adds a paragraph after each heading
+                               glow.dom.get('h1, h2, h3').after('<p>...</p>');
+                       */
+                       after: function (nodeSpec) {
+                               var that = this,
+                                       length = that.length,
+                                       nodes,
+                                       nodesLen,
+                                       j,
+                                       i = 1,
+                                       cloned;
+
+                               if (length == 0) { return that; }
+
+                               nodes = typeof nodeSpec == "string" ? r.create(nodeSpec) :
+                                       nodeSpec instanceof r.NodeList ? nodeSpec :
+                                       r.get(nodeSpec);
+
+                               nodesLen = nodes.length;
+
+                               for (j = nodesLen - 1; j >= 0; j--) {
+                                       that[0].parentNode.insertBefore(nodes[j], that[0].nextSibling);
+                               }
+                               for (; i < length; i++) {
+                                       cloned = nodes.clone();
+
+                                       for (j = nodesLen - 1; j >= 0; j--) {
+                                               that[i].parentNode.insertBefore(cloned[j], that[i].nextSibling);
+                                       }
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#before
+                       @function
+                       @description Inserts elements before each node.
+
+                               If there is more than one node in the NodeList, the elements
+                               will be inserted before the first node and clones inserted
+                               before each subsequent node.
+
+                       @param {String | Element | glow.dom.NodeList} nodespec HTML string, Element or NodeList to insert before each node
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // adds a heading before each
+                               glow.dom.get('p').before('<h1>Paragraph:</h1>');
+                       */
+                       before: function (nodeSpec) {
+                               var that = this,
+                                       length = that.length,
+                                       j = 0,
+                                       i = 1,
+                                       nodes,
+                                       nodesLen,
+                                       cloned;
+
+                               if (length == 0) { return that; }
+
+                               nodes = typeof nodeSpec == "string" ? r.create(nodeSpec) :
+                                       nodeSpec instanceof r.NodeList ? nodeSpec :
+                                       r.get(nodeSpec);
+
+                               nodesLen = nodes.length;
+
+                               for (; j < nodesLen; j++) {
+                                       that[0].parentNode.insertBefore(nodes[j], that[0]);
+                               }
+                               for (; i < length; i++) {
+                                       cloned = nodes.clone();
+                                       for (j = 0; j < nodesLen; j++) {
+                                               that[i].parentNode.insertBefore(cloned[j], that[i]);
+                                       }
+                               }
+                               return that;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#insertAfter
+                       @function
+                       @description Insert the NodeList after each of the given elements.
+
+                               If more than one element is passed in, the NodeList will be
+                               inserted after the first element and clones inserted after each
+                               subsequent element.
+
+                       @param {String | Element | glow.dom.NodeList} nodespec CSS selector string, Element or NodeList to insert the NodeList after
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // adds a paragraph after each heading
+                               glow.dom.create('<p>HAI!</p>').insertAfter('h1, h2, h3');
+                       */
+                       insertAfter: function (nodes) {
+                               if (! (nodes instanceof r.NodeList)) { nodes = r.get(nodes); }
+                               nodes.after(this);
+                               return this;
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#insertBefore
+                       @function
+                       @description Insert the NodeList before each of the given elements.
+
+                               If more than one element is passed in, the NodeList will be
+                               inserted before the first element and clones inserted before each
+                               subsequent element.
+
+                       @param {String | Element | glow.dom.NodeList} nodespec CSS selector string, Element or NodeList to insert the NodeList before
+
+                       @returns {glow.dom.NodeList}
+
+                       @example
+                               // adds a heading before each paragraph
+                               glow.dom.create('<h1>Paragraph:</h1>').insertBefore('p');
+                       */
+                       insertBefore: function (nodes) {
+                               if (! (nodes instanceof r.NodeList)) { nodes = r.get(nodes); }
+                               nodes.before(this);
+                               return this;
+                       },
+
+
+                       /**
+                       @name glow.dom.NodeList#replaceWith
+                       @function
+                       @description Replace nodes on the page with given elements.
+
+                       @param {glow.dom.NodeList | String} nodespec Elements to insert into the document.
+
+                               If more than one node is to be replaced then nodespec will be
+                               cloned for additional elements. If a string is provided it will
+                               be treated as HTML and converted into elements.
+
+                       @returns {glow.dom.NodeList}
+                               Returns a new NodeList containing the nodes which have been removed
+                       */
+                       replaceWith: function (nodeSpec) {
+                               /*
+                                we need to put a placeholder in first in case the new stuff
+                                has the same ids as stuff being replaced. This causes issues
+                                in safari 2, the new element can't be picked up with getElementById
+                               */
+                               if (env.webkit < 500) {
+                                       this.after(placeholderElm).remove();
+                                       r.get("u.glow-placeholder").after(nodeSpec).remove();
+                               } else {
+                                       this.after(nodeSpec).remove()
+                               }
+                               return this;
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#data
+                       @function
+                       @description Use this to safely attach arbitrary data to any DOM Element.
+                       
+                       This method is useful when you wish to avoid memory leaks that are possible when adding your own data directly to DOM Elements.
+                       
+                       When called with no arguments, will return glow's entire data store for the first item in the NodeList.
+                       
+                       Otherwise, when given a stringy key, will return the associated value from the first item in the NodeList.
+                       
+                       When given both a key and a value, will store that data on every item in the NodeList.
+                       
+                       Optionally you can pass in a single object composed of multiple key, value pairs.
+                       
+                       @param {String|Object} [key] The name of the value in glow's data store for the NodeList item.
+                       @param {Object} [val] The the value you wish to associate with the given key.
+                       @see glow.dom.NodeList#removeData
+                       @example
+                       
+                       glow.dom.get("p").data("tea", "milky");
+                       var colour = glow.dom.get("p").data("tea"); // milky
+                       @returns {Object} When setting a value this method can be chained, as in that case it will return itself.
+                       */
+                       data: function (key, val) { /*debug*///console.log("data("+key+", "+val+")");
+                               if (typeof key === "object") { // setting many values
+                                       for (var prop in key) { this.data(prop, key[prop]); }
+                                       return this; // chainable with ({key: val}) signature
+                               }
+                               
+                               var index,
+                                       elm;
+                                       // uses private class-scoped variables: dataCache, dataPropName, dataIndex
+                               
+                               switch (arguments.length) {
+                                       case 0: // getting entire cache from first node
+                                               if (this[0] === undefined) { return undefined; }
+                                               index = this[0][dataPropName] || dataIndex++;
+                                               return dataCache[index] || (dataCache[index] = {}); // create a new cache when reading entire cache
+                                       case 1:  // getting val from first node
+                                               if (this[0] === undefined) { return undefined; }
+                                               index = this[0][dataPropName]; // don't create a new cache when reading just a specific val
+                                               return index? dataCache[index][key] : undefined;
+                                       case 2: // setting key:val on every node
+                                               // TODO - need to defend against reserved words being used as keys?
+                                               for (var i = this.length; i--;) {
+                                                       elm = this[i];
+                                                       
+                                                       if ( !(index = elm[dataPropName]) ) { // assumes index is always > 0
+                                                               index = dataIndex++;
+                                                               
+                                                               elm[dataPropName] = index;
+                                                               dataCache[index] = {};
+                                                       }
+                                                       dataCache[index][key] = val;
+                                               }
+                                               
+                                               return this; // chainable with (key, val) signature
+                                       default:
+                                               throw new Error("glow.dom.NodeList#data expects 2 or less arguments, not "+arguments.length+".");
+                               }
+                       },
+                       
+                       /**
+                       @name glow.dom.NodeList#removeData
+                       @function
+                       @description Removes data previously added by {@link glow.dom.NodeList#data} from items in a NodeList.
+                       
+                       When called with no arguments, will delete glow's entire data store for every item in the NodeList.
+                       
+                       Otherwise, when given a key, will delete the associated value from every item in the NodeList.
+                       
+                       @param {String} [key] The name of the value in glow's data store for the NodeList item.
+                       */
+                       removeData: function (key) { /*debug*///console.log("removeData("+key+")");
+                               var elm,
+                                       i = this.length,
+                                       index;
+                                       // uses private class-scoped variables: dataCache, dataPropName
+                               
+                               while (i--) {
+                                       elm = this[i];
+                                       index = elm[dataPropName];
+                                       
+                                       if (index !== undefined) {
+                                               switch (arguments.length) {
+                                                       case 0:
+                                                               dataCache[index] = undefined;
+                                                               elm[dataPropName] = undefined;
+                                                               try {
+                                                                       delete elm[dataPropName]; // IE 6 goes wobbly here
+                                                               }
+                                                               catch(e) { // remove expando from IE 6
+                                                                       elm.removeAttribute && elm.removeAttribute(dataPropName);
+                                                               }
+                                                               break;
+                                                       case 1:
+                                                               dataCache[index][key] = undefined;
+                                                               delete dataCache[index][key];
+                                                               break;
+                                                       default:
+                                                               throw new Error("glow.dom.NodeList#removeData expects 1 or less arguments, not "+arguments.length+".");
+                                               }
+                                       }
+                               }
+                               
+                               return this; // chainable
+                       },
+
+                       /**
+                       @name glow.dom.NodeList#get
+                       @function
+                       @description Gets decendents of nodes that match a CSS selector.
+
+                       @param {String} selector CSS selector
+
+                       @returns {glow.dom.NodeList}
+                               Returns a new NodeList containing matched elements
+
+                       @example
+                               // create a new NodeList
+                               var myNodeList = glow.dom.create("<div><a href='s.html'>Link</a></div>");
+
+                               // get 'a' tags that are decendants of the NodeList nodes
+                               myNewNodeList = myNodeList.get("a");
+                       */
+                       get: function() {
+
+                               /*
+                               PrivateFunction: compileSelector
+                                       Compile a CSS selector to an AST.
+
+                               Arguments:
+                                       sSelector - A string containing the CSS selector (or comma separated group of selectors).
+
+                               Returns:
+                                       An array containing an AST for each selector in the group.
+                               */
+                               function compileSelector(sSelector) {
+                                       //return from cache if possible
+                                       if (cssCache[sSelector]) {
+                                               return cssCache[sSelector];
+                                       }
+
+                                       var r = [], //array of result objects
+                                               ri = 0, //results index
+                                               comb, //current combinator
+                                               tagTmp,
+                                               idTmp,
+                                               aRx, //temp regex result
+                                               matchedCondition, //have we matched a condition?
+                                               sLastSelector, //holds last copy of selector to prevent infinite loop
+                                               firstLoop = true,
+                                               originalSelector = sSelector;
+
+                                       while (sSelector && sSelector != sLastSelector) {
+                                               tagTmp = "";
+                                               idTmp = "";
+                                               //protect us from infinite loop
+                                               sLastSelector = sSelector;
+
+                                               //start by getting the scope (combinator)
+                                               if (aRx = cssRegex.combinator.exec(sSelector)) {
+                                                       comb = aRx[1];
+                                                       sSelector = sSelector.slice(aRx[0].length);
+                                               }
+                                               //look for optimal id & tag searching
+                                               if (aRx = cssRegex.tagName.exec(sSelector)) {
+                                                       tagTmp = aRx[1];
+                                                       sSelector = sSelector.slice(aRx[0].length);
+                                               }
+                                               if (aRx = cssRegex.classNameOrId.exec(sSelector)) {
+                                                       if (aRx[1] == "#") {
+                                                               idTmp = aRx[2];
+                                                               sSelector = sSelector.slice(aRx[0].length);
+                                                       }
+                                               }
+                                               if (!comb) { //use native stuff
+                                                       if (idTmp && firstLoop) {
+                                                               r[ri++] = [getByIdQuick, [idTmp.replace(/\\/g, ""), tagTmp || "*", null]];
+                                                       } else {
+                                                               r[ri++] = [getByTagName, [tagTmp || "*", null]];
+                                                               if (idTmp) {
+                                                                       r[ri++] = [hasId, [idTmp.replace(/\\/g, ""), null]];
+                                                               }
+                                                       }
+                                               } else if (comb == ">") {
+                                                       r[ri++] = [getChildren, [null]];
+                                                       if (idTmp) {
+                                                               r[ri++] = [hasId, [idTmp.replace(/\\/g, ""), null]];
+                                                       }
+                                                       if (tagTmp && tagTmp != "*") { //uses tag
+                                                               r[ri++] = [isTag, [tagTmp, null]];
+                                                       }
+                                               }
+
+                                               //other conditions can appear in any order, so here we go:
+                                               matchedCondition = true;
+                                               while (matchedCondition) {
+                                                       //look for class or ID
+                                                       if (sSelector.charAt(0) == "#" || sSelector.charAt(0) == ".") {
+                                                               if (aRx = cssRegex.classNameOrId.exec(sSelector)) {
+                                                                       if (sSelector.charAt(0) == "#") { //is ID
+                                                                               //define ID, remove escape chars
+                                                                               r[ri++] = [hasId, [aRx[2].replace(/\\/g, ""), null]];
+                                                                       } else { //is class
+                                                                               r[ri++] = [hasClassName, [aRx[2].replace(/\\/g, ""), null]];
+                                                                       }
+                                                                       sSelector = sSelector.slice(aRx[0].length);
+                                                               } else {
+                                                                       throw new Error("Invalid Selector " + originalSelector);
+                                                               }
+                                                       } else {
+                                                               matchedCondition = false;
+                                                       }
+                                               }
+
+                                               firstLoop = false;
+                                       }
+
+                                       if (sSelector !== "") {
+                                               throw new Error("Invalid Selector " + originalSelector);
+                                       }
+
+                                       //add to cache and return
+                                       return cssCache[sSelector] = r;
+                               }
+
+                               /*
+                               PrivateFunction: fetchElements
+                                       Get elements which match array of compiled conditions based on
+                                       an initial context.
+
+                               Arguments:
+                                       a - (object) CSS selector AST object.
+                                       initialContext - DOM Element or DOM Document to search within.
+
+                               Returns:
+                                       An array of matching elements.
+                               */
+                               function fetchElements(a, initialContext) {
+                                       var context = initialContext; //elements to look within
+
+                                       for (var i = 0, al = a.length; i < al; i++) {
+                                               a[i][1][a[i][1].length - 1] = context;
+                                               context = a[i][0].apply(this, a[i][1]);
+                                       }
+                                       return context;
+                               }
+
+                               /*
+                               PrivateFunction: getByIdQuick
+                                       Get an element with a specific tag name, within a context.
+
+                               Arguments:
+                                       id - (string) the id of the element.
+                                       tagName - (string) the name of the element.
+                                       context - DOM Element or DOM Document in which to find the element.
+
+                               Returns:
+                                       A DOM Element matching the specified criteria.
+                               */
+                               function getByIdQuick(id, tagName, context) {
+                                       var r = [], ri = 0, notQuick = [], notQuicki = 0, tmpNode;
+                                       for (var i = 0, length = context.length; i < length; i++) {
+                                               if (context[i].getElementById) {
+                                                       tmpNode = context[i].getElementById(id);
+                                                       if (tmpNode && (tmpNode.tagName == tagName.toUpperCase() || tagName == "*" || tmpNode.tagName == tagName)) {
+                                                               r[ri++] = tmpNode;
+                                                       }
+                                               } else {
+                                                       notQuick[notQuicki++] = context[i];
+                                               }
+                                       }
+                                       //deal with the ones we couldn't do quick
+                                       if (notQuick[0]) {
+                                               notQuick = getByTagName(tagName, notQuick);
+                                               notQuick = hasId(id, notQuick);
+                                       }
+                                       return r.concat(notQuick);
+                               }
+
+                               function getChildren(context) {
+                                       var r = [],
+                                               i = 0,
+                                               len = context.length;
+                                               
+                                       for (; i < len; i++) {
+                                               append( r, getChildElms(context[i]) );
+                                       }
+                                       return r;
+                               }
+
+                               function hasId(id, context) {
+                                       for (var i = 0, length = context.length; i < length; i++) {
+                                               if (context[i].id == id) {
+                                                       //is this a safe optimisation?
+                                                       return [context[i]];
+                                               }
+                                       }
+                                       return [];
+                               }
+
+                               /*
+                               PrivateFunction: isTag
+                                       Get an array of elements within an array that have a given tag name.
+
+                               Arguments:
+                                       tagName - (string) the name of the element.
+                                       context - (array) elements to match.
+
+                               Returns:
+                                       An array of matching elements.
+                               */
+                               function isTag(tagName, context) {
+                                       var r = [], ri = 0;
+                                       for (var i = 0, length = context.length; i < length; i++) {
+                                               if (context[i].tagName == tagName.toUpperCase() || context[i].tagName == tagName) {
+                                                       r[ri++] = context[i];
+                                               }
+                                       }
+                                       return r;
+                               }
+
+                               /*
+                               PrivateFunction: hasClassName
+                                       Get elements that have a given class name from a provided array of elements.
+
+                               Arguments:
+                                       className - (string) the name of the class.
+                                       context - (array) the DOM Elements to match.
+
+                               Returns:
+                                       An array of matching DOM Elements.
+                               */
+                               function hasClassName(className, context) {
+                                       var r = [], ri = 0;
+                                       for (var i = 0, length = context.length; i < length; i++) {
+                                               if ((" " + context[i].className + " ").indexOf(" " + className + " ") != -1) {
+                                                       r[ri++] = context[i];
+                                               }
+                                       }
+                                       return r;
+                               }
+
+                               /*
+                               PrivateFunction: getBySelector
+                                       Get elements within a context by a CSS selector.
+
+                               Arugments:
+                                       sSelector - (string) CSS selector.
+                                       context - DOM Document or DOM Element to search within.
+
+                               Returns:
+                                       An array of DOM Elements.
+                               */
+                               function getBySelector(sSelector, context) {
+                                       var aCompiledCSS; // holds current compiled css statement
+                                       var r = [];
+                                       //split multiple selectors up
+                                       var aSelectors = sSelector.split(",");
+                                       //process each
+                                       for (var i = 0, nSelLen = aSelectors.length; i < nSelLen; i++) {
+                                               aCompiledCSS = compileSelector(glow.lang.trim(aSelectors[i]));
+                                               //get elements from DOM
+                                               r = r.concat(fetchElements(aCompiledCSS, context));
+                                       }
+                                       return r;
+                               }
+
+                               /*
+                               PrivateFunction: getIfWithinContext
+                                       Get elements from a set of elements that are within at least one of another
+                                       set of DOM Elements.
+
+                               Arguments:
+                                       nodes - DOM Elements to take the results from.
+                                       context - DOM Elements that returned elements must be within.
+
+                               Returns:
+                                       An array of DOM Elements.
+                               */
+                               function getIfWithinContext(nodes, context) {
+                                       nodes = nodes.length ? nodes : [nodes];
+                                       var r = []; //to return
+                                       var nl;
+
+                                       //loop through nodes
+                                       for (var i = 0; nodes[i]; i++) {
+                                               nl = glow.dom.get(nodes[i]);
+                                               //loop through context nodes
+                                               for (var n = 0; context[n]; n++) {
+                                                       if (nl.isWithin(context[n])) {
+                                                               r[r.length] = nl[0];
+                                                               break;
+                                                       }
+                                               }
+                                       }
+                                       return r;
+                               }
+                               
+                               // main implementation
+                               return function(sSelector) {
+                                       // no point trying if there's no current context
+                                       if (!this.length) { return this; }
+
+                                       var r = []; //nodes to return
+                                       // decide what to do by arg
+                                       for (var i = 0, argLen = arguments.length; i < argLen; i++) {
+                                               if (typeof arguments[i] == "string") { // css selector string
+                                                       r = r.concat(getBySelector(arguments[i], this));
+                                                       // append(r, getBySelector(arguments[i], this));
+                                               } else { // nodelist, array, node
+                                                       r = r.concat(getIfWithinContext(arguments[i], this));
+                                                       // append(r, getIfWithinContext(arguments[i], this));
+                                               }
+                                       }
+
+                                       // strip out duplicates, wrap in nodelist
+                                       return glow.dom.get(unique(r));
+                               };
+                       }()
+               };
+
+               //some init stuff. Using u to make it quicker to get by tag name :)
+               placeholderElm = r.create('<u class="glow-placeholder"></u>');
+               //set up glow.dom
+               glow.dom = r;
+
+       }
+});
+/**
+@name glow.events
+@namespace
+@description Native browser and custom events
+@see <a href="../furtherinfo/events/">Using event listeners</a>
+@see <a href="../furtherinfo/events/firing_events.shtml">Firing event listeners</a>
+@see <a href="../furtherinfo/events/removing_event_listeners.shtml">Removing event listeners</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.events",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", 'glow.dom']],
+       builder: function(glow) {
+               
+               var $ = glow.dom.get;
+               var r = {};
+               var eventid = 1;
+               var objid = 1;
+               // object (keyed by obj id), containing object (keyed by event name), containing arrays of listeners
+               var listenersByObjId = {};
+               // object (keyed by ident) containing listeners
+               var listenersByEventId = {};
+               var domListeners = {};
+               var psuedoPrivateEventKey = '__eventId' + glow.UID;
+               var psuedoPreventDefaultKey = psuedoPrivateEventKey + 'PreventDefault';
+               var psuedoStopPropagationKey = psuedoPrivateEventKey + 'StopPropagation';
+
+               var topKeyListeners = {};
+               var keyListenerId = 1;
+               var keyListeners = {};
+               var keyTypes = {};
+
+               var CTRL = 1;
+               var ALT = 2;
+               var SHIFT = 4;
+
+               var specialPrintables = {
+                       TAB      : '\t',
+                       SPACE    : ' ',
+                       ENTER    : '\n',
+                       BACKTICK : '`'
+               };
+
+               var keyNameAliases = {
+                       '96' : 223
+               };
+
+               var keyNameToCode = {
+                       CAPSLOCK : 20, NUMLOCK : 144, SCROLLLOCK : 145, BREAK : 19,
+                       BACKTICK : 223, BACKSPACE : 8, PRINTSCREEN : 44, MENU : 93, SPACE : 32,
+                       SHIFT : 16,  CTRL : 17,  ALT : 18,
+                       ESC   : 27,  TAB  : 9,   META     : 91,  RIGHTMETA : 92, ENTER : 13,
+                       F1    : 112, F2   : 113, F3       : 114, F4        : 115,
+                       F5    : 116, F6   : 117, F7       : 118, F8        : 119,
+                       F9    : 120, F10  : 121, F11      : 122, F12       : 123,
+                       INS   : 45,  HOME : 36,  PAGEUP   : 33,
+                       DEL   : 46,  END  : 35,  PAGEDOWN : 34,
+                       LEFT  : 37,  UP   : 38,  RIGHT    : 39,  DOWN      : 40
+               };
+               var codeToKeyName = {};
+               for (var i in keyNameToCode) {
+                       codeToKeyName['' + keyNameToCode[i]] = i;
+               }
+
+               var operaBrokenChars = '0123456789=;\'\\\/#,.-';
+
+               /*
+               PrivateMethod: removeKeyListener
+                       Removes a listener for a key combination.
+               
+               Arguments:
+                       ident - identifier returned from addKeyListener.
+               */
+
+               function removeKeyListener (ident) {
+                       var keyType = keyTypes[ident];
+                       if (! keyType) { return false; }
+                       var listeners = keyListeners[keyType];
+                       if (! listeners) { return false; }
+                       for (var i = 0, len = listeners.length; i < len; i++) {
+                               if (listeners[i][0] == ident) {
+                                       listeners.splice(i, 1);
+                                       return true;
+                               }
+                       }
+                       return false;
+               }
+
+               /*
+               PrivateMethod: initTopKeyListner
+                       Adds an event listener for keyboard events, for key listeners added by addKeyListener.
+
+               Arguments:
+                       type - press|down|up - the type of key event.
+               */
+
+               function initTopKeyListener (type) {
+                       topKeyListeners[type] = r.addListener(document, 'key' + type, function (e) {
+                               var mods = 0;
+                               if (e.ctrlKey) { mods += CTRL; }
+                               if (e.altKey) { mods += ALT; }
+                               if (e.shiftKey) { mods += SHIFT; }
+                               var keyType = e.chr ? e.chr.toLowerCase() : e.key ? e.key.toLowerCase() : e.keyCode;
+                               var eventType = mods + ':' + keyType + ':' + type;
+                               var listeners = keyListeners[eventType] ? keyListeners[eventType].slice(0) : [];
+                               // if the user pressed shift, but event didn't specify that, include it
+                               if (e.shiftKey) { // upper-case letter, should match regardless of shift
+                                       var shiftEventType = (mods & ~ SHIFT) + ':' + keyType + ':' + type;
+                                       if (keyListeners[shiftEventType]) {
+                                               for (var i = 0, len = keyListeners[shiftEventType].length; i < len; i++) {
+                                                       listeners[listeners.length] = keyListeners[shiftEventType][i];
+                                               }
+                                       }
+                               }
+                               
+                               if (! listeners) { return; }
+                               
+                               for (var i = 0, len = listeners.length; i < len; i++) {
+                                       //call listener and look out for preventing the default
+                                       if (listeners[i][2].call(listeners[i][3] || this, e) === false) {
+                                               e.preventDefault();
+                                       }
+                               }
+                               return !e.defaultPrevented();
+                       });
+               }
+               
+               /*
+               PrivateMethod: clearEvents
+                       Removes all current listeners to avoid IE mem leakage
+               */
+               function clearEvents() {
+                       var ident;
+                       for (ident in listenersByEventId) {
+                               r.removeListener(ident);
+                       }
+               }
+
+               // for opera madness
+               var previousKeyDownKeyCode;
+
+               var operaResizeListener,
+                       operaDocScrollListener;
+
+               /*
+               PrivateMethod: addDomListener
+                       Adds an event listener to a browser object. Manages differences with certain events.
+
+               Arguments:
+                       attachTo - the browser object to attach the event to.
+                       name - the generic name of the event (inc. mousewheel)
+               */
+               function addDomListener (attachTo, name, capturingMode) {
+                       var wheelEventName;
+
+                       capturingMode = !!capturingMode;
+                       
+                       if (glow.env.opera) {
+                               if (name.toLowerCase() == 'resize' && !operaResizeListener && attachTo == window) {
+                                       operaResizeListener = r.addListener(window.document.body, 'resize', function (e) { r.fire(window, 'resize', e); });
+                               } else if (name.toLowerCase() == 'scroll' && !operaDocScrollListener && attachTo == window) {
+                                       operaDocScrollListener = r.addListener(window.document, 'scroll', function (e) { r.fire(window, 'scroll', e); });
+                               }
+                       }
+                       
+                       var callback = function (e) {
+                               if (! e) { e = window.event; }
+                               var event = new r.Event(),
+                                       lowerCaseName = name.toLowerCase();
+                               event.nativeEvent = e;
+                               event.source = e.target || e.srcElement;
+
+                               event.relatedTarget = e.relatedTarget || (lowerCaseName == "mouseover" ? e.fromElement : e.toElement);
+                           event.button = glow.env.ie ? (e.button & 1 ? 0 : e.button & 2 ? 2 : 1) : e.button;
+                               if (e.pageX || e.pageY) {
+                                       event.pageX = e.pageX;
+                                       event.pageY = e.pageY;
+                               } else if (e.clientX || e.clientY)      {
+                                       event.pageX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
+                                       event.pageY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
+                               }
+                               if (lowerCaseName == 'mousewheel') {
+                                       // this works in latest opera, but have read that it needs to be switched in direction
+                                       // if there was an opera bug, I can't find which version it was fixed in
+                                       event.wheelDelta =
+                                               e.wheelDelta ? e.wheelDelta / 120 :
+                                               e.detail ? - e.detail / 3 :
+                                                       0;
+                                       if (event.wheelDelta == 0) { return; }
+                               }
+                               if (lowerCaseName.indexOf("key") != -1) {
+                                       event.altKey = !! e.altKey;
+                                       event.ctrlKey = !! e.ctrlKey;
+                                       event.shiftKey = !! e.shiftKey;
+
+                                       if (name == 'keydown') {
+                                               previousKeyDownKeyCode = e.keyCode;
+                                       }
+
+                                       event.charCode = e.keyCode && e.charCode !== 0 ? undefined : e.charCode;
+
+                                       if (lowerCaseName == 'keypress') {
+                                               if (typeof(event.charCode) == 'undefined') {
+                                                       event.charCode = e.keyCode;
+                                               }
+
+                                               if (glow.env.opera && event.charCode && event.charCode == previousKeyDownKeyCode &&
+                                                       operaBrokenChars.indexOf(String.fromCharCode(event.charCode)) == -1
+                                               ) {
+                                                       event.charCode = undefined;
+                                                       event.keyCode = previousKeyDownKeyCode;
+                                               }
+                                       }
+                                       
+                                       // make things a little more sane in opera
+                                       if (event.charCode && event.charCode <= 49) { event.charCode = undefined; }
+
+                                       if (event.charCode) {
+                                               event.chr = String.fromCharCode(event.charCode);
+                                       }
+                                       else if (e.keyCode) {
+                                               event.charCode = undefined;
+                                               event.keyCode = keyNameAliases[e.keyCode.toString()] || e.keyCode;
+                                               event.key = codeToKeyName[event.keyCode];
+                                               if (specialPrintables[event.key]) {
+                                                       event.chr = specialPrintables[event.key];
+                                                       event.charCode = event.chr.charCodeAt(0);
+                                               }
+                                       }
+
+                                       if (event.chr) {
+                                               event.capsLock =
+                                                       event.chr.toUpperCase() != event.chr ? // is lower case
+                                                               event.shiftKey :
+                                                       event.chr.toLowerCase() != event.chr ? // is upper case
+                                                               ! event.shiftKey :
+                                                               undefined; // can only tell for keys with case
+                                       }
+                               }
+
+                               r.fire(this, name, event);
+                               if (event.defaultPrevented()) {
+                                       return false;
+                               }
+                       };
+
+
+                       if (attachTo.addEventListener && (!glow.env.webkit || glow.env.webkit > 418)) {
+
+                               // This is to fix an issue between Opera and everything else.
+                               // Opera needs to have an empty eventListener attached to the parent
+                               // in order to fire a captured event (in our case we are using capture if
+                               // the event is focus/blur) on an element when the element is the eventTarget.
+                               //
+                               // It is only happening in Opera 9, Opera 10 doesn't show this behaviour.
+                               // It looks like Opera has a bug, but according to the W3C Opera is correct...
+                               //
+                               // "A capturing EventListener will not be triggered by events dispatched 
+                               // directly to the EventTarget upon which it is registered."
+                               // http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture
+                               if (
+                                       ( name == 'focus' || name == 'blur' )
+                                       && (glow.env.opera)
+                               ) {
+                                       attachTo.parentNode.addEventListener(name, function(){}, true);
+                               }
+
+                               attachTo.addEventListener(name.toLowerCase() == 'mousewheel' && glow.env.gecko ? 'DOMMouseScroll' : name, callback, capturingMode);
+
+                       } else {
+
+                               var onName = 'on' + name;
+                               var existing = attachTo[onName];
+                               if (existing) {
+                                       attachTo[onName] = function () {
+                                               // we still need to return false if either the existing or new callback returns false
+                                               var existingReturn = existing.apply(this, arguments),
+                                                       callbackReturn = callback.apply(this, arguments);
+                                               
+                                               return (existingReturn !== false) && (callbackReturn !== false);
+                                       };
+                               } else {
+                                       attachTo[onName] = callback;
+                               }
+
+                       }
+
+                       attachTo = null;
+
+               }
+               
+               /**
+               Add mouseEnter or mouseLeave 'event' to an element
+               @private
+               @param {HTMLElement} attachTo Element to create mouseenter / mouseleave for
+               @param {Boolean} isLeave Create mouseleave or mouseenter?
+               */
+               function addMouseEnterLeaveEvent(attachTo, isLeave) {
+                       var elm = $(attachTo),
+                               listenFor = isLeave ? "mouseout" : "mouseover",
+                               toFire = isLeave ? "mouseleave" : "mouseenter";
+                       
+                       r.addListener(attachTo, listenFor, function(e) {
+                               var relatedTarget = $(e.relatedTarget);
+                               // if the mouse has come from outside elm...
+                               if ( !relatedTarget.eq(elm) && !relatedTarget.isWithin(elm) ) {
+                                       // return false if default is prevented by mouseEnter event
+                                       return !r.fire(elm[0], toFire, e).defaultPrevented();
+                               }
+                       })
+               }
+               
+               /**
+               @name glow.events._copyListeners 
+               @function
+               @private
+               @description Maps event listeners from one set of nodes to another in the order they appear in each NodeList.
+                       Note, it doesn't copy events from a node's children.
+               
+               
+               @param {NodeList} from NodeList to copy events from
+               @param {NodeList} to NodeList to copy events to
+       
+               @returns {Boolean}
+               
+               @example
+                       var listener = glow.events.addListener(...);
+                       glow.events.removeListener(listener);
+               */
+               r._copyListeners = function(from, to) {
+                       // grab all the elements (including children)
+                       var i = from.length,
+                               // events attached to a particular element
+                               elementEvents,
+                               // name of the current event we're looking at
+                               eventName,
+                               // current listener index
+                               listenerIndex,
+                               // number of listeners to an event
+                               listenersLen,
+                               // listener definition from listenersByObjId
+                               listener;
+                       
+                       // loop through all items
+                       while(i--) {
+                               // has a glow event been assigned to this node?
+                               if ( from[i][psuedoPrivateEventKey] ) {
+                                       // get listeners for that event
+                                       elementEvents = listenersByObjId[ from[i][psuedoPrivateEventKey] ];
+                                       // loop through event names
+                                       for (eventName in elementEvents) {
+                                               listenerIndex = 0;
+                                               listenersLen = elementEvents[eventName].length;
+                                               // loop through listeners to that event
+                                               for (; listenerIndex < listenersLen; listenerIndex++) {
+                                                       listener = elementEvents[eventName][listenerIndex];
+                                                       // listen to them on the clone
+                                                       r.addListener(to[i], eventName, listener[2], listener[3]);
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               /**
+               @name glow.events.addListener
+               @function
+               @description Adds an event listener to an object (e.g. a DOM Element or Glow widget).
+               
+                       Some non-standard dom events are available:
+                       
+                       <dl>
+                               <dt>mouseenter</dt>
+                               <dd>Fires when the mouse enters this element specifically, does not bubble</dd>
+                               <dt>mouseleave/dt>
+                               <dd>Fires when the mouse leaves this element specifically, does not bubble</dd>
+                       </dl>
+               
+               @param {String | NodeList | Object} attachTo The object to attach the event listener to.
+               
+                       If the parameter is a string, then it is treated as a CSS selector 
+                       and the listener is attached to all matching elements.
+                       
+                       If the parameter is a {@link glow.dom.NodeList}, then the listener 
+                       is attached to all elements in the NodeList.
+               
+               @param {String} name The event name. 
+               
+                       Listeners for DOM events should not begin with 'on' (i.e. 'click' 
+                       rather than 'onclick')
+                                  
+               @param {Function} callback The function to be called when the event fires.
+                       
+               @param {Object} [context] The execution scope of the callback.
+               
+                       If this parameter is not passed then the attachTo object will be the 
+                       scope of the callback.
+               
+               @returns {Number | Undefined}
+               
+                       A unique identifier for the event suitable for passing to 
+                       {@link glow.events.removeListener}. If an empty NodeList or CSS 
+                       selector that returns no elements is passed, then undefined is returned.
+               
+               @example
+                       glow.events.addListener('#nav', 'click', function () {
+                               alert('nav clicked');
+                       });
+
+                       glow.events.addListener(myLightBox, 'close', this.showSurvey, this);
+               */
+               r.addListener = function (attachTo, name, callback, context) {
+                       var capturingMode = false;
+                       if (! attachTo) { throw 'no attachTo paramter passed to addListener'; }
+
+                       if (typeof attachTo == 'string') {
+                               if (! glow.dom) { throw "glow.dom must be loaded to use a selector as the first argument to glow.events.addListener"; }
+                               attachTo = $(attachTo);
+                       }
+                       
+                       if (glow.dom && attachTo instanceof glow.dom.NodeList) {
+                               var listenerIds = [],
+                                       i = attachTo.length;
+
+                               //attach the event for each element, return an array of listener ids
+                               while (i--) {
+                                       listenerIds[i] = r.addListener(attachTo[i], name, callback, context);
+                               }
+                               
+                               return listenerIds;
+                       }
+       
+                       var objIdent;
+                       if (! (objIdent = attachTo[psuedoPrivateEventKey])) {
+                               objIdent = attachTo[psuedoPrivateEventKey] = objid++;
+                       }
+                       var ident = eventid++;
+                       var listener = [ objIdent, name, callback, context, ident ];
+                       listenersByEventId[ident] = listener;
+
+                       var objListeners = listenersByObjId[objIdent];
+                       if (! objListeners) { objListeners = listenersByObjId[objIdent] = {}; }
+                       var objEventListeners = objListeners[name];
+                       if (! objEventListeners) { objEventListeners = objListeners[name] = []; }
+                       objEventListeners[objEventListeners.length] = listener;
+                       
+                       if ((attachTo.addEventListener || attachTo.attachEvent) && ! domListeners[objIdent + ':' + name]) {
+                               // handle 'special' dom events (ie, ones that aren't directly mapped to real dom events)
+                               // we don't actually add a dom listener for these event names
+                               switch (name) {
+                                       case "mouseenter":
+                                               addMouseEnterLeaveEvent(attachTo, false);
+                                               return ident;
+                                       case "mouseleave":
+                                               addMouseEnterLeaveEvent(attachTo, true);
+                                               return ident;
+
+                                       // Focus and blur events:
+                                       // Convert focus/blur events to use capturing.
+                                       // This allows form elements to be used with event delegation.
+
+                                       case "focus":
+                                               // IE
+                                               // If IE then change focus/blur events to focusin/focusout events.
+                                               // This allows input elements to bubble, so form elements work with event delegation.
+                                               if (glow.env.ie) {
+                                                       addFocusInOutEvent(attachTo, true);
+                                                       return ident;
+                                               }
+                                               // Everything else
+                                               else {
+                                                       capturingMode = true
+                                               }
+                                               break;
+
+                                       case "blur":
+                                               // IE
+                                               // If IE then change focus/blur events to focusin/focusout events.
+                                               // This allows input elements to bubble, so form elements work with event delegation.
+                                               if (glow.env.ie) {
+                                                       addFocusInOutEvent(attachTo, false);
+                                                       return ident;
+                                               }
+                                               // Everything else
+                                               else {
+                                                       capturingMode = true
+                                               }
+                                               break;
+
+                               }
+                               
+                               addDomListener(attachTo, name, capturingMode);
+                               domListeners[objIdent + ':' + name] = true;
+                       }
+                       return ident;
+               };
+
+               /**
+               Add focusIn or focusOut 'event' to an element
+               @private
+               @param {HTMLElement} attachTo Element to create focusIn / focusOut for
+               @param {Boolean} event Create focusIn or focusOut?
+               */
+               function addFocusInOutEvent(attachTo, event) {
+                       var listenFor = event ? 'focusin' : 'focusout',
+                               toFire    = event ? 'focus'   : 'blur';
+                       r.addListener(attachTo, listenFor, function(e) {
+                               return !r.fire(attachTo, toFire, e).defaultPrevented();
+                       });
+               }
+
+               /**
+               @name glow.events.removeListener 
+               @function
+               @description Removes a listener created with addListener
+
+               @param {Number} ident An identifier returned from {@link glow.events.addListener}.
+       
+               @returns {Boolean}
+               
+               @example
+                       var listener = glow.events.addListener(...);
+                       glow.events.removeListener(listener);
+               */
+               r.removeListener = function (ident) {
+                       if (ident && ident.toString().indexOf('k:') != -1) {
+                               return removeKeyListener(ident);
+                       }
+                       if (ident instanceof Array) {
+                               //call removeListener for each array member
+                               var i = ident.length; while(i--) {
+                                       r.removeListener(ident[i]);
+                               }
+                               return true;
+                       }
+                       var listener = listenersByEventId[ident];
+                       if (! listener) { return false; }
+                       delete listenersByEventId[ident];
+                       var listeners = listenersByObjId[listener[0]][listener[1]];
+                       for (var i = 0, len = listeners.length; i < len; i++) {
+                               if (listeners[i] == listener) {
+                                       listeners.splice(i, 1);
+                                       break;
+                               }
+                       }
+                       if (! listeners.length) {
+                               delete listenersByObjId[listener[0]][listener[1]];
+                       }
+                       var listenersLeft = false;
+                       for (var i in listenersByObjId[listener[0]]) { listenersLeft = true; break;     }
+                       if (! listenersLeft) {
+                               delete listenersByObjId[listener[0]];
+                       }
+                       return true;
+               };
+               
+               /**
+               @name glow.events.removeAllListeners 
+               @function
+               @description Removes all listeners attached to a given object
+
+               @param {String | glow.dom.NodeList | Object | Object[] } detachFrom The object(s) to remove listeners from.
+               
+                       If the parameter is a string, then it is treated as a CSS selector,
+                       listeners are removed from all nodes.
+               
+               @returns glow.events
+               
+               @example
+                       glow.events.removeAllListeners("#myDiv");
+               */
+               r.removeAllListeners = function(obj) {
+                       var i,
+                               objId,
+                               listenerIds = [],
+                               listenerIdsLen = 0,
+                               eventName,
+                               events;
+                       
+                       // cater for selector
+                       if (typeof obj == "string") {
+                               // get nodes
+                               obj = $(obj);
+                       }
+                       // cater for arrays & nodelists
+                       if (obj instanceof Array || obj instanceof glow.dom.NodeList) {
+                               //call removeAllListeners for each array member
+                               i = obj.length; while(i--) {
+                                       r.removeAllListeners(obj[i]);
+                               }
+                               return r;
+                       }
+                       
+                       // get the objects id
+                       objId = obj[psuedoPrivateEventKey];
+                       
+                       // if it doesn't have an id it doesn't have events... return
+                       if (!objId) {
+                               return r;
+                       }
+                       events = listenersByObjId[objId];
+                       for (eventName in events) {
+                               i = events[eventName].length; while(i--) {
+                                       listenerIds[listenerIdsLen++] = events[eventName][i][4];
+                               }
+                       }
+                       // remove listeners for that object
+                       if (listenerIds.length) {
+                               r.removeListener( listenerIds );
+                       }
+                       return r;
+               }
+
+               /**
+               @name glow.events.fire
+               @function
+               @description Fires an event on an object.
+
+               @param {Object} attachedTo The object that the event is associated with.
+               
+               @param {String} name The name of the event.
+               
+                       Event names should not start with the word 'on'.
+                       
+               @param {Object | glow.events.Event} [event] An event object or properties to add to a default event object
+               
+                       If not specified, a generic event object is created. If you provide a simple
+                       object, a default Event will be created with the properties from the provided object.
+       
+               @returns {Object}
+               
+                       The event object.
+               
+               @example
+                       // firing a custom event
+                       Ball.prototype.move = function () {
+                               // move the ball...
+                               // check its position
+                               if (this._height == 0) {
+                                       var event = glow.events.fire(this, 'bounce', {
+                                               bounceCount: this._bounceCount
+                                       });
+                                       
+                                       // handle what to do if a listener returned false
+                                       if ( event.defaultPrevented() ) {
+                                               this.stopMoving();
+                                       }
+                               }
+                       };
+                       
+               @example
+                       // listening to a custom event
+                       var myBall = new Ball();
+                       
+                       glow.events.addListener(myBall, "bounce", function(event) {
+                               if (event.bounceCount == 3) {
+                                       // stop bouncing after 3 bounces
+                                       return false;
+                               }
+                       });
+               */
+               r.fire = function (attachedTo, name, e) {
+                       if (! attachedTo) throw 'glow.events.fire: required parameter attachedTo not passed (name: ' + name + ')';
+                       if (! name) throw 'glow.events.fire: required parameter name not passed';
+                       if (! e) { e = new r.Event(); }
+                       if ( e.constructor === Object ) { e = new r.Event( e ) }
+
+                       if (typeof attachedTo == 'string') {
+                               if (! glow.dom) { throw "glow.dom must be loaded to use a selector as the first argument to glow.events.addListener"; }
+                               attachedTo = $(attachedTo);
+                       }
+
+                       e.type = name;
+                       e.attachedTo = attachedTo;
+                       if (! e.source) { e.source = attachedTo; }
+
+                       if (attachedTo instanceof glow.dom.NodeList) {
+
+                               attachedTo.each(function(i){
+
+                                       callListeners(attachedTo[i], e);
+
+                               });
+
+                       } else {
+
+                               callListeners(attachedTo, e);
+
+                       }
+
+                       return e;
+               };
+
+               function callListeners(attachedTo, e) {
+                       
+                       var objIdent,
+                               objListeners,
+                               objEventListeners = objListeners && objListeners[e.type];
+
+                       // 3 assignments, but stop assigning if any of them are false
+                       (objIdent = attachedTo[psuedoPrivateEventKey]) &&
+                       (objListeners = listenersByObjId[objIdent]) &&
+                       (objEventListeners = objListeners[e.type]);
+
+                       if (! objEventListeners) { return e; }
+
+                       var listener;
+                       var listeners = objEventListeners.slice(0);
+
+                       // we make a copy of the listeners before calling them, as the event handlers may
+                       // remove themselves (took me a while to track this one down)
+                       for (var i = 0, len = listeners.length; i < len; i++) {
+                               listener = listeners[i];
+                               if ( listener[2].call(listener[3] || attachedTo, e) === false ) {
+                                       e.preventDefault();
+                               }
+                       }
+
+               }
+
+               /**
+               @private
+               @name glow.events.addKeyListener
+               @deprecated
+               @function
+               @description Adds an event listener for a keyboard event HELLO.
+               
+                       <p><em>Notes for Opera</em></p>
+                       
+                       It is currently impossible to differentiate certain key events in 
+                       Opera (for example the RIGHT (the right arrow key) and the 
+                       apostrope (') result in the same code). For this reason pressing 
+                       either of these keys will result in key listeners specified as 
+                       "RIGHT" and/or "'" to be fired.
+                       
+                       <p><em>Key Identifiers</em></p>
+                       
+                       The key param uses the following strings to refer to special keys, 
+                       i.e. non alpha-numeric keys.
+                       
+                       <ul>
+                       <li>CAPSLOCK</li>
+                       <li>NUMLOCK</li>
+                       <li>SCROLLLOCK</li>
+                       <li>BREAK</li>
+                       <li>BACKTICK</li>
+                       <li>BACKSPACE</li>
+                       <li>PRINTSCREEN</li>
+                       <li>MENU</li>
+                       <li>SPACE</li>
+                       <li>ESC</li>
+                       <li>TAB</li>
+                       <li>META</li>
+                       <li>RIGHTMETA</li>
+                       <li>ENTER</li>
+                       <li>F1</li>
+                       <li>F2</li>
+                       <li>F3</li>
+                       <li>F4</li>
+                       <li>F5</li>
+                       <li>F6</li>
+                       <li>F7</li>
+                       <li>F8</li>
+                       <li>F9</li>
+                       <li>F10</li>
+                       <li>F11</li>
+                       <li>F12</li>
+                       <li>INS</li>
+                       <li>HOME</li>
+                       <li>PAGEUP</li>
+                       <li>DEL</li>
+                       <li>END</li>
+                       <li>PAGEDOWN</li>
+                       <li>LEFT</li>
+                       <li>UP</li>
+                       <li>RIGHT</li>
+                       <li>DOWN</li>
+                       </ul>
+
+               @param {String} key The key or key combination to listen to. 
+               
+                       This parameter starts with modifier keys 'CTRL', 'ALT' and 
+                       'SHIFT'. Modifiers can appear in any combination and order and are 
+                       separated by a '+'.
+                       
+                       Following any modifiers is the key character. To specify a 
+                       character code, use the appropriate escape sequence (e.g. 
+                       "CTRL+\u0065" = CTRL+e"). 
+                       
+                       To specify a special key, the key character should be replaced with 
+                       a key identifier, see description below (e.g. "RIGHT" specifies the 
+                       right arrow key).
+                       
+               @param {String} type The type of key press to listen to.
+                       
+                       Possible values for this parameter are:
+                       
+                       <dl>
+                       <dt>press</dt><dd>the key is pressed (comparable to a mouse click)</dd>
+                       <dt>down</dt><dd>the key is pushed down</dd>
+                       <dt>up</dt><dd>the key is released</dd>
+                       </dl>
+               
+               @param {Function} callback The function to be called when the event fires.
+                       
+               @param {Object} [context] The execution scope of the callback.
+       
+                       If this parameter is not passed then the attachTo object will be the 
+                       context of the callback.
+       
+               @returns {Number}
+               
+                       A unique identifier for the event suitable for passing to 
+                       {@link glow.events.removeListener}.
+               
+               @example
+                       glow.events.addKeyListener("CTRL+ALT+a", "press",
+                       function () { alert("CTRL+ALT+a pressed"); }
+                   );
+                       glow.events.addKeyListener("SHIFT+\u00A9", "down",
+                               function () { alert("SHIFT+© pushed") }
+                       );
+               */
+               var keyRegex = /^((?:(?:ctrl|alt|shift)\+)*)(?:(\w+|.)|[\n\r])$/i;
+               r.addKeyListener = function (key, type, callback, context) {
+                       type.replace(/^key/i, "");
+                       type = type.toLowerCase();
+                       if (! (type == 'press' || type == 'down' || type == 'up')) {
+                               throw 'event type must be press, down or up';
+                       }
+                       if (! topKeyListeners[type]) { initTopKeyListener(type); }
+                       var res = key.match(keyRegex),
+                               mods = 0,
+                               charCode;
+                       if (! res) { throw 'key format not recognised'; }
+                       if (res[1].toLowerCase().indexOf('ctrl') != -1)  { mods += CTRL;  }
+                       if (res[1].toLowerCase().indexOf('alt') != -1)   { mods += ALT;   }
+                       if (res[1].toLowerCase().indexOf('shift') != -1) { mods += SHIFT; }
+                       var eventKey = mods + ':' + (res[2] ? res[2].toLowerCase() : '\n') + ':' + type;
+                       var ident = 'k:' + keyListenerId++;
+                       keyTypes[ident] = eventKey;
+                       var listeners = keyListeners[eventKey];
+                       if (! listeners) { listeners = keyListeners[eventKey] = []; }
+                       listeners[listeners.length] = [ident, type, callback, context];
+                       return ident;
+               };
+
+               /**
+               @name  glow.events.Event
+               @class
+               @param {Object} [properties] Properties to add to the Event instance.
+                       Each key-value pair in the object will be added to the Event as
+                       properties
+               @description Object passed into all events
+                       
+                       Some of the properties described below are only available for 
+                       certain event types. These are listed in the property descriptions 
+                       where applicable.
+                       
+                       <p><em>Notes for Opera</em></p>
+                       
+                       The information returned from Opera about key events does not allow 
+                       certain keys to be differentiated. This mainly applies to special 
+                       keys, such as the arrow keys, function keys, etc. which conflict 
+                       with some printable characters.
+                       
+               */
+               r.Event = function ( obj ) {
+                       if( obj ) {
+                               glow.lang.apply( this, obj );
+                       }
+               };
+               
+               /**
+               @name glow.events.Event#attachedTo
+               @type Object | Element
+               @description The object/element that the listener is attached to.
+               
+                       See the description for 'source' for more details.
+               */
+               
+               /**
+               @name glow.events.Event#source
+               @type Element
+               @description The actual object/element that the event originated from.
+                       
+                       For example, you could attach a listener to an 'ol' element to 
+                       listen for clicks. If the user clicked on an 'li' the source property 
+                       would be the 'li' element, and 'attachedTo' would be the 'ol'.
+               */
+               
+               /**
+               @name glow.events.Event#pageX
+               @type Number
+               @description The horizontal position of the mouse pointer in the page in pixels.
+               
+                       <p><em>Only available for mouse events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#pageY
+               @type Number
+               @description The vertical position of the mouse pointer in the page in pixels.
+               
+                       <p><em>Only available for mouse events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#button
+               @type Number
+               @description  A number representing which button was pressed.
+               
+                       <p><em>Only available for mouse events.</em></p>
+                       
+                       0 for the left button, 1 for the middle button or 2 for the right button.
+               */
+
+               /**
+               @name glow.events.Event#relatedTarget
+               @type Element
+               @description The element that the mouse has come from or is going to.
+               
+                       <p><em>Only available for mouse over/out events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#wheelDelta
+               @type Number
+               @description The number of clicks up (positive) or down (negative) that the user moved the wheel.
+               
+                       <p><em>Only available for mouse wheel events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#ctrlKey
+               @type Boolean
+               @description Whether the ctrl key was pressed during the key event.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#shiftKey
+               @type Boolean
+               @description  Whether the shift key was pressed during the key event.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#altKey
+               @type Boolean
+               @description Whether the alt key was pressed during the key event.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#capsLock                        
+               @type Boolean | Undefined
+               @description Whether caps-lock was on during the key event
+               
+                       <p><em>Only available for keyboard events.</em></p>
+               
+                       If the key is not alphabetic, this property will be undefined 
+                       as it is not possible to tell if caps-lock is on in this scenario.
+               */
+               
+               /**
+               @name glow.events.Event#keyCode
+               @type Number
+               @description An integer number represention of the keyboard key that was pressed.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+               */
+               
+               /**
+               @name glow.events.Event#key
+               @type String | Undefined
+               @description  A short identifier for the key for special keys.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+                       
+                       If the key was not a special key this property will be undefined.
+                       
+                       See the list of key identifiers in {@link glow.events.addKeyListener}
+               */
+               
+               /**
+               @name glow.events.Event#charCode
+               @type Number | Undefined
+               @description The unicode character code for a printable character.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+                       
+                       This will be undefined if the key was not a printable character.
+               */
+               
+               /**
+               @name glow.events.Event#chr
+               @type String
+               @description A printable character string.
+               
+                       <p><em>Only available for keyboard events.</em></p>
+                       
+                       The string of the key that was pressed, for example 'j' or 's'.
+                       
+                       This will be undefined if the key was not a printable character.
+               */
+               
+
+               /**
+               @name glow.events.Event#preventDefault
+               @function
+               @description Prevent the default action for events. 
+               
+                       This can also be achieved by returning false from an event callback
+               
+               */
+               r.Event.prototype.preventDefault = function () {
+                       if (this[psuedoPreventDefaultKey]) { return; }
+                       this[psuedoPreventDefaultKey] = true;
+                       if (this.nativeEvent && this.nativeEvent.preventDefault) {
+                               this.nativeEvent.preventDefault();
+                               this.nativeEvent.returnValue = false;
+                       }
+               };
+
+               /**
+               @name glow.events.Event#defaultPrevented
+               @function
+               @description Test if the default action has been prevented.
+               
+               @returns {Boolean}
+               
+                       True if the default action has been prevented.
+               */
+               r.Event.prototype.defaultPrevented = function () {
+                       return !! this[psuedoPreventDefaultKey];
+               };
+
+               /**
+               @name glow.events.Event#stopPropagation
+               @function
+               @description Stops the event propagating. 
+               
+                       For DOM events, this stops the event bubbling up through event 
+                       listeners added to parent elements. The event object is marked as
+                       having had propagation stopped (see 
+                       {@link glow.events.Event#propagationStopped propagationStopped}).
+               
+               @example
+                       // catch all click events that are not links
+                       glow.events.addListener(
+                               document,
+                               'click',
+                               function () { alert('document clicked'); }
+                       );
+
+                       glow.events.addListener(
+                               'a',
+                               'click',
+                               function (e) { e.stopPropagation(); }
+                       );
+               */
+               r.Event.prototype.stopPropagation = function () {
+                       if (this[psuedoStopPropagationKey]) { return; }
+                       this[psuedoStopPropagationKey] = true;
+                       var e = this.nativeEvent;
+                       if (e) {
+                               e.cancelBubble = true;
+                               if (e.stopPropagation) { e.stopPropagation(); }
+                       }
+               };
+
+               /**
+               @name glow.events.Event#propagationStopped
+               @function
+               @description Tests if propagation has been stopped for this event.
+               
+               @returns {Boolean}
+               
+                       True if event propagation has been prevented.
+
+               */
+               r.Event.prototype.propagationStopped = function () {
+                       return !! this[psuedoStopPropagationKey];
+               };
+               
+               //cleanup to avoid mem leaks in IE
+               if (glow.env.ie < 8 || glow.env.webkit < 500) {
+                       r.addListener(window, "unload", clearEvents);
+               }
+
+               glow.events = r;
+               glow.events.listenersByObjId = listenersByObjId;
+       }
+});/**
+@name glow.data
+@namespace
+@description Serialising and de-serialising data
+@see <a href="../furtherinfo/data/data.shtml">Using glow.data</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.data",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", "glow.dom"]],
+       builder: function(glow) {
+               //private
+
+               /*
+               PrivateProperty: TYPES
+                       hash of strings representing data types
+               */
+               var TYPES = {
+                       UNDEFINED : "undefined",
+                       OBJECT    : "object",
+                       NUMBER    : "number",
+                       BOOLEAN   : "boolean",
+                       STRING    : "string",
+                       ARRAY     : "array",
+                       FUNCTION  : "function",
+                       NULL      : "null"
+               }
+
+               /*
+               PrivateProperty: TEXT
+                       hash of strings used in encoding/decoding
+               */
+               var TEXT = {
+                       AT    : "@",
+                       EQ    : "=",
+                       DOT   : ".",
+                       EMPTY : "",
+                       AND   : "&",
+                       OPEN  : "(",
+                       CLOSE : ")"
+               }
+
+               /*
+               PrivateProperty: JSON
+                       nested hash of strings and regular expressions used in encoding/decoding Json
+               */
+               var JSON = {
+                       HASH : {
+                               START     : "{",
+                               END       : "}",
+                               SHOW_KEYS : true
+                       },
+
+                       ARRAY : {
+                               START     : "[",
+                               END       : "]",
+                               SHOW_KEYS : false
+                       },
+
+                       DATA_SEPARATOR   : ",",
+                       KEY_SEPARATOR    : ":",
+                       KEY_DELIMITER    : "\"",
+                       STRING_DELIMITER : "\"",
+
+                       SAFE_PT1 : /^[\],:{}\s]*$/,
+                       SAFE_PT2 : /\\./g,
+                       SAFE_PT3 : /\"[^\"\\\n\r]*\"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,
+                       SAFE_PT4 : /(?:^|:|,)(?:\s*\[)+/g
+               }
+
+               /*
+               PrivateProperty: SLASHES
+                       hash of strings and regular expressions used in encoding strings
+               */
+               var SLASHES = {
+                       TEST : /[\b\n\r\t\\\f\"]/g,
+                       B : {PLAIN : "\b", ESC : "\\b"},
+                       N : {PLAIN : "\n", ESC : "\\n"},
+                       R : {PLAIN : "\r", ESC : "\\r"},
+                       T : {PLAIN : "\t", ESC : "\\t"},
+                       F : {PLAIN : "\f", ESC : "\\f"},
+                       SL : {PLAIN : "\\", ESC : "\\\\"},
+                       QU : {PLAIN : "\"", ESC : "\\\""}
+               }
+
+               /*
+               PrivateMethod: _replaceSlashes
+                       Callback function for glow.lang.replace to escape appropriate characters
+
+               Arguments:
+                       s - the regex match to be tested
+
+               Returns:
+                       The escaped version of the input.
+               */
+               function _replaceSlashes(s) {
+                       switch (s) {
+                               case SLASHES.B.PLAIN: return SLASHES.B.ESC;
+                               case SLASHES.N.PLAIN: return SLASHES.N.ESC;
+                               case SLASHES.R.PLAIN: return SLASHES.R.ESC;
+                               case SLASHES.T.PLAIN: return SLASHES.T.ESC;
+                               case SLASHES.F.PLAIN: return SLASHES.F.ESC;
+                               case SLASHES.SL.PLAIN: return SLASHES.SL.ESC;
+                               case SLASHES.QU.PLAIN: return SLASHES.QU.ESC;
+                               default: return s;
+                       }
+               }
+
+               /*
+               PrivateMethod: _getType
+                       Returns the data type of the object
+
+               Arguments:
+                       object - the object to be tested
+
+               Returns:
+                       A one of the TYPES constant properties that represents the data type of the object.
+               */
+               function _getType(object) {
+                       if((typeof object) == TYPES.OBJECT) {
+                               if (object == null) {
+                                       return TYPES.NULL;
+                               } else {
+                                       return (object instanceof Array)?TYPES.ARRAY:TYPES.OBJECT;
+                               }
+                       } else {
+                               return (typeof object);
+                       }
+               }
+
+               //public
+               glow.data = {
+                       /**
+                       @name glow.data.encodeUrl
+                       @function
+                       @description Encodes an object for use as a query string.
+                       
+                               Returns a string representing the object suitable for use 
+                               as a query string, with all values suitably escaped.
+                               It does not include the initial question mark. Where the 
+                               input field was an array, the key is repeated in the output.
+                       
+                       @param {Object} object The object to be encoded.
+                       
+                               This must be a hash whose values can only be primitives or 
+                               arrays of primitives.
+                       
+                       @returns {String}
+                       
+                       @example
+                               var getRef = glow.data.encodeUrl({foo: "Foo", bar: ["Bar 1", "Bar2"]});
+                               // will return "foo=Foo&bar=Bar%201&bar=Bar2"
+                       */
+                       encodeUrl : function (object) {
+                               var objectType = _getType(object);
+                               var paramsList = [];
+                               var listLength = 0;
+
+                               if (objectType != TYPES.OBJECT) {
+                                       throw new Error("glow.data.encodeUrl: cannot encode item");
+                               } else {
+                                       for (var key in object) {
+                                               switch(_getType(object[key])) {
+                                                       case TYPES.FUNCTION:
+                                                       case TYPES.OBJECT:
+                                                               throw new Error("glow.data.encodeUrl: cannot encode item");
+                                                               break;
+                                                       case TYPES.ARRAY:
+                                                               for(var i = 0, l = object[key].length; i < l; i++) {
+                                                                       switch(_getType(object[key])[i]) {
+                                                                               case TYPES.FUNCTION:
+                                                                               case TYPES.OBJECT:
+                                                                               case TYPES.ARRAY:
+                                                                                       throw new Error("glow.data.encodeUrl: cannot encode item");
+                                                                                       break;
+                                                                               default:
+                                                                                       paramsList[listLength++] = key + TEXT.EQ + encodeURIComponent(object[key][i]);
+                                                                       }
+                                                               }
+                                                               break;
+                                                       default:
+                                                               paramsList[listLength++] = key + TEXT.EQ + encodeURIComponent(object[key]);
+                                               }
+                                       }
+
+                                       return paramsList.join(TEXT.AND);
+                               }
+                       },
+                       /**
+                       @name glow.data.decodeUrl
+                       @function
+                       @description Decodes a query string into an object.
+                       
+                               Returns an object representing the data given by the query 
+                               string, with all values suitably unescaped. All keys in the 
+                               query string are keys of the object. Repeated keys result 
+                               in an array.
+                       
+                       @param {String} string The query string to be decoded.
+                       
+                               It should not include the initial question mark.
+                       
+                       @returns {Object}
+                       
+                       @example
+                               var getRef = glow.data.decodeUrl("foo=Foo&bar=Bar%201&bar=Bar2");
+                               // will return the object {foo: "Foo", bar: ["Bar 1", "Bar2"]}
+                       */
+                       decodeUrl : function (text) {
+                               if(_getType(text) != TYPES.STRING) {
+                                       throw new Error("glow.data.decodeUrl: cannot decode item");
+                               } else if (text === "") {
+                                       return {};
+                               }
+
+                               var result = {};
+                               var keyValues = text.split(/[&;]/);
+
+                               var thisPair, key, value;
+
+                               for(var i = 0, l = keyValues.length; i < l; i++) {
+                                       thisPair = keyValues[i].split(TEXT.EQ);
+                                       if(thisPair.length != 2) {
+                                               throw new Error("glow.data.decodeUrl: cannot decode item");
+                                       } else {
+                                               key   = glow.lang.trim( decodeURIComponent(thisPair[0]) );
+                                               value = glow.lang.trim( decodeURIComponent(thisPair[1]) );
+
+                                               switch (_getType(result[key])) {
+                                                       case TYPES.ARRAY:
+                                                               result[key][result[key].length] = value;
+                                                               break;
+                                                       case TYPES.UNDEFINED:
+                                                               result[key] = value;
+                                                               break;
+                                                       default:
+                                                               result[key] = [result[key], value];
+                                               }
+                                       }
+                               }
+
+                               return result;
+                       },
+                       /**
+                       @name glow.data.encodeJson
+                       @function
+                       @description Encodes an object into a string JSON representation.
+                       
+                               Returns a string representing the object as JSON.
+                       
+                       @param {Object} object The object to be encoded.
+                        
+                               This can be arbitrarily nested, but must not contain 
+                               functions or cyclical structures.
+                       
+                       @returns {Object}
+                       
+                       @example
+                               var myObj = {foo: "Foo", bar: ["Bar 1", "Bar2"]};
+                               var getRef = glow.data.encodeJson(myObj);
+                               // will return '{"foo": "Foo", "bar": ["Bar 1", "Bar2"]}'
+                       */
+                       encodeJson : function (object, options) {
+                               function _encode(object, options)
+                               {
+                                       if(_getType(object) == TYPES.ARRAY) {
+                                               var type = JSON.ARRAY;
+                                       } else {
+                                               var type = JSON.HASH;
+                                       }
+
+                                       var serial = [type.START];
+                                       var len = 1;
+                                       var dataType;
+                                       var notFirst = false;
+
+                                       for(var key in object) {
+                                               dataType = _getType(object[key]);
+
+                                               if(dataType != TYPES.UNDEFINED) { /* ignore undefined data */
+                                                       if(notFirst) {
+                                                               serial[len++] = JSON.DATA_SEPARATOR;
+                                                       }
+                                                       notFirst = true;
+
+                                                       if(type.SHOW_KEYS) {
+                                                               serial[len++] = JSON.KEY_DELIMITER;
+                                                               serial[len++] = key;
+                                                               serial[len++] = JSON.KEY_DELIMITER;
+                                                               serial[len++] = JSON.KEY_SEPARATOR;
+                                                       }
+
+                                                       switch(dataType) {
+                                                               case TYPES.FUNCTION:
+                                                                       throw new Error("glow.data.encodeJson: cannot encode item");
+                                                                       break;
+                                                               case TYPES.STRING:
+                                                               default:
+                                                                       serial[len++] = JSON.STRING_DELIMITER;
+                                                                       serial[len++] = glow.lang.replace(object[key], SLASHES.TEST, _replaceSlashes);
+                                                                       serial[len++] = JSON.STRING_DELIMITER;
+                                                                       break;
+                                                               case TYPES.NUMBER:
+                                                               case TYPES.BOOLEAN:
+                                                                       serial[len++] = object[key];
+                                                                       break;
+                                                               case TYPES.OBJECT:
+                                                               case TYPES.ARRAY:
+                                                                       serial[len++] = _encode(object[key], options);
+                                                                       break;
+                                                               case TYPES.NULL:
+                                                                       serial[len++] = TYPES.NULL;
+                                                                       break;
+                                                       }
+                                               }
+                                       }
+                                       serial[len++] = type.END;
+
+                                       return serial.join(TEXT.EMPTY);
+                               }
+
+                               options = options || {};
+                               var type = _getType(object);
+
+                               if((type == TYPES.OBJECT) || (type == TYPES.ARRAY)) {
+                                       return _encode(object, options);
+                               } else {
+                                       throw new Error("glow.data.encodeJson: cannot encode item");
+                               }
+                       },
+                       /**
+                       @name glow.data.decodeJson
+                       @function
+                       @description Decodes a string JSON representation into an object.
+                               
+                               Returns a JavaScript object that mirrors the data given.
+                       
+                       @param {String} string The string to be decoded.
+                               Must be valid JSON. 
+                       
+                       @param {Object} opts
+                       
+                                       Zero or more of the following as properties of an object:
+                                       @param {Boolean} [opts.safeMode=false] Whether the string should only be decoded if it is  deemed "safe". 
+                                       The json.org regular expression checks are used. 
+                       
+                       @returns {Object}
+                       
+                       @example
+                               var getRef = glow.data.decodeJson('{foo: "Foo", bar: ["Bar 1", "Bar2"]}');
+                               // will return {foo: "Foo", bar: ["Bar 1", "Bar2"]}
+                       
+                               var getRef = glow.data.decodeJson('foobar', {safeMode: true});
+                               // will throw an error
+                       */
+                       decodeJson : function (text, options) {
+                               if(_getType(text) != TYPES.STRING) {
+                                       throw new Error("glow.data.decodeJson: cannot decode item");
+                               }
+
+                               options = options || {};
+                               options.safeMode = options.safeMode || false;
+
+                               var canEval = true;
+
+                               if(options.safeMode) {
+                                       canEval = (JSON.SAFE_PT1.test(text.replace(JSON.SAFE_PT2, TEXT.AT).replace(JSON.SAFE_PT3, JSON.ARRAY.END).replace(JSON.SAFE_PT4, TEXT.EMPTY)));
+                               }
+
+                               if(canEval) {
+                                       try {
+                                               return eval(TEXT.OPEN + text + TEXT.CLOSE);
+                                       }
+                                       catch(e) {/* continue to error */}
+                               }
+
+                               throw new Error("glow.data.decodeJson: cannot decode item");
+                       },
+                       /**
+                       @name glow.data.escapeHTML
+                       @function
+                       @description Escape HTML entities.
+                       
+                               Returns a string with HTML entities escaped.
+                       
+                       @param {String} string The string to be escaped.
+                       
+                       @returns {String}
+                       
+                       @example
+                               // useful for protecting against XSS attacks:
+                               var fieldName = '" onclick="alert(\'hacked\')" name="';
+                       
+                               // but should be used in all cases like this:
+                               glow.dom.create('<input name="' + glow.data.escapeHTML(untrustedString) + '"/>');
+                        */
+                       escapeHTML : function (html) {
+                               return glow.dom.create('<div></div>').text(html).html();
+                       }                  
+               };
+       }
+});
+/**
+@name glow.net
+@namespace
+@description Sending data to & from the server
+@see <a href="../furtherinfo/net/net.shtml">Using glow.net</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.net",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", "glow.data", "glow.events"]],
+       builder: function(glow) {
+               //private
+
+               var STR = {
+                               XML_ERR:"Cannot get response as XML, check the mime type of the data",
+                               POST_DEFAULT_CONTENT_TYPE:'application/x-www-form-urlencoded;'
+                       },
+                       endsPlusXml = /\+xml$/,
+                       /**
+                        * @name glow.net.scriptElements
+                        * @private
+                        * @description Script elements that have been added via {@link glow.net.loadScript loadScript}
+                        * @type Array
+                        */
+                       scriptElements = [],
+                       /**
+                        * @name glow.net.callbackPrefix
+                        * @private
+                        * @description Callbacks in _jsonCbs will be named this + a number
+                        * @type String
+                        */
+                       callbackPrefix = "c",
+                       /**
+                        * @name glow.net.globalObjectName
+                        * @private
+                        * @description Name of the global object used to store loadScript callbacks
+                        * @type String
+                        */
+                       globalObjectName = "_" + glow.UID + "loadScriptCbs",
+                       $ = glow.dom.get,
+                       events = glow.events,
+                       emptyFunc = function(){};
+
+               /**
+                * @name glow.net.xmlHTTPRequest
+                * @private
+                * @function
+                * @description Creates an xmlHTTPRequest transport
+                * @returns Object
+                */
+               function xmlHTTPRequest() {
+                       //try IE first. IE7's xmlhttprequest and XMLHTTP6 are broken. Avoid avoid avoid!
+                       if (window.ActiveXObject) {
+                               return (xmlHTTPRequest = function() { return new ActiveXObject("Microsoft.XMLHTTP"); })();
+                       } else {
+                               return (xmlHTTPRequest = function() { return new XMLHttpRequest(); })();
+                       }
+               }
+
+               /**
+                * @name glow.net.populateOptions
+                * @private
+                * @function
+                * @description Adds defaults to get / post option object
+                * @param {Object} opts Object to add defaults to
+                * @returns Object
+                */
+               function populateOptions(opts) {
+                       return glow.lang.apply(
+                               {
+                                       onLoad: emptyFunc,
+                                       onError: emptyFunc,
+                                       onAbort: emptyFunc,
+                                       headers: {},
+                                       async: true,
+                                       useCache: false,
+                                       data: null,
+                                       defer: false,
+                                       forceXml: false
+                               },
+                               opts || {}
+                       );
+               }
+
+               /*
+               PrivateMethod: noCacheUrl
+                       Adds random numbers to the querystring of a url so the browser doesn't use a cached version
+               */
+
+               function noCacheUrl(url) {
+                       return [url, (/\?/.test(url) ? "&" : "?"), "a", new Date().getTime(), parseInt(Math.random()*100000)].join("");
+               }
+
+               /*
+               PrivateMethod: makeXhrRequest
+                       Makes an http request
+               */
+               /**
+                * @name glow.net.makeXhrRequest
+                * @private
+                * @function
+                * @description Makes an xhr http request
+                * @param {String} method HTTP Method
+                * @param {String} url URL of the request
+                * @param {Object} Options, see options for {@link glow.net.get}
+                * @returns Object
+                */
+               function makeXhrRequest(method, url, opts) {
+                       var req = xmlHTTPRequest(), //request object
+                               data = opts.data && (typeof opts.data == "string" ? opts.data : glow.data.encodeUrl(opts.data)),
+                               i,
+                               request = new Request(req, opts);
+
+                       if (!opts.useCache) {
+                               url = noCacheUrl(url);
+                       }
+
+                       //open needs to go first to maintain cross-browser support for readystates
+                       req.open(method, url, opts.async);
+
+                       //add custom headers
+                       for (i in opts.headers) {
+                               req.setRequestHeader(i, opts.headers[i]);
+                       }
+
+                       function send() {
+                               request.send = emptyFunc;
+                               if (opts.async) {
+                                       //sort out the timeout if there is one
+                                       if (opts.timeout) {
+                                               request._timeout = setTimeout(function() {
+                                                       abortRequest(request);
+                                                       var response = new Response(req, true, request);
+                                                       events.fire(request, "error", response);
+                                               }, opts.timeout * 1000);
+                                       }
+
+                                       req.onreadystatechange = function() {
+                                               if (req.readyState == 4) {
+                                                       //clear the timeout
+                                                       request._timeout && clearTimeout(request._timeout);
+                                                       //set as completed
+                                                       request.completed = true;
+                                                       var response = new Response(req, false, request);
+                                                       if (response.wasSuccessful) {
+                                                               events.fire(request, "load", response);
+                                                       } else {
+                                                               events.fire(request, "error", response);
+                                                       }
+                                                       // prevent parent scopes leaking (cross-page) in IE
+                                                       req.onreadystatechange = new Function();
+                                               }
+                                       };
+                                       req.send(data);
+                                       return request;
+                               } else {
+                                       req.send(data);
+                                       request.completed = true;
+                                       var response = new Response(req, false, request);
+                                       if (response.wasSuccessful) {
+                                               events.fire(request, "load", response);
+                                       } else {
+                                               events.fire(request, "error", response);
+                                       }
+                                       return response;
+                               }
+                       }
+
+                       request.send = send;
+                       return opts.defer ? request : send();
+               }
+
+               //public
+               var r = {}; //the module
+
+               /**
+               @name glow.net.get
+               @function
+               @description Makes an HTTP GET request to a given url
+
+               @param {String} url
+                       Url to make the request to. This can be a relative path. You cannot make requests
+                       for files on other domains, to do that you must put your data in a javascript
+                       file and use {@link glow.net.loadScript} to fetch it.
+               @param {Object} opts
+                       Options Object of options.
+                       @param {Function} [opts.onLoad] Callback to execute when the request has sucessfully loaded
+                               The callback is passed a Response object as its first parameter.
+                       @param {Function} [opts.onError] Callback to execute if the request was unsucessful
+                               The callback is passed a Response object as its first parameter.
+                               This callback will also be run if a request times out.
+                       @param {Function} [opts.onAbort] Callback to execute if the request is aborted
+                       @param {Object} [opts.headers] A hash of headers to send along with the request
+                               Eg {"Accept-Language": "en-gb"}
+                       @param {Boolean} [opts.async=true] Should the request be performed asynchronously?
+                       @param {Boolean} [opts.useCache=false] Allow a cached response
+                               If false, a random number is added to the query string to ensure a fresh version of the file is being fetched
+                       @param {Number} [opts.timeout] Time to allow for the request in seconds
+                               No timeout is set by default. Only applies for async requests. Once
+                               the time is reached, the error event will fire with a "408" status code.
+                       @param {Boolean} [opts.defer=false] Do not send the request straight away
+                               Deferred requests need to be triggered later using myRequest.send()
+                       @param {Boolean} [opts.forceXml=false] Treat the response as XML.
+                               This will allow you to use {@link glow.net.Response#xml response.xml()}
+                               even if the response has a non-XML mime type.
+
+               @returns {glow.net.Request|glow.net.Response}
+                       A response object for non-defered sync requests, otherwise a
+                       request object is returned
+
+               @example
+                       var request = glow.net.get("myFile.html", {
+                               onLoad: function(response) {
+                                       alert("Got file:\n\n" + response.text());
+                               },
+                               onError: function(response) {
+                                       alert("Error getting file: " + response.statusText());
+                               }
+                       });
+               */
+               r.get = function(url, o) {
+                       o = populateOptions(o);
+                       return makeXhrRequest('GET', url, o);
+               };
+
+               /**
+               @name glow.net.post
+               @function
+               @description Makes an HTTP POST request to a given url
+
+               @param {String} url
+                       Url to make the request to. This can be a relative path. You cannot make requests
+                       for files on other domains, to do that you must put your data in a javascript
+                       file and use {@link glow.net.loadScript} to fetch it.
+               @param {Object|String} data
+                       Data to post, either as a JSON-style object or a urlEncoded string
+               @param {Object} opts
+                       Same options as {@link glow.net.get}
+
+               @returns {Number|glow.net.Response}
+                       An integer identifying the async request, or the response object for sync requests
+
+               @example
+                       var postRef = glow.net.post("myFile.html",
+                               {key:"value", otherkey:["value1", "value2"]},
+                               {
+                                       onLoad: function(response) {
+                                               alert("Got file:\n\n" + response.text());
+                                       },
+                                       onError: function(response) {
+                                               alert("Error getting file: " + response.statusText());
+                                       }
+                               }
+                       );
+               */
+               r.post = function(url, data, o) {
+                       o = populateOptions(o);
+                       o.data = data;
+                       if (!o.headers["Content-Type"]) {
+                               o.headers["Content-Type"] = STR.POST_DEFAULT_CONTENT_TYPE;
+                       }
+                       return makeXhrRequest('POST', url, o);
+               };
+
+               /**
+               @name glow.net.loadScript
+               @function
+               @description Loads data by adding a script element to the end of the page
+                       This can be used cross domain, but should only be used with trusted
+                       sources as any javascript included in the script will be executed.
+
+               @param {String} url
+                       Url of the script. Use "{callback}" in the querystring as the callback
+                       name if the data source supports it, then you can use the options below
+               @param {Object} [opts]
+                       An object of options to use if "{callback}" is specified in the url.
+                       @param {Function} [opts.onLoad] Called when loadScript succeeds.
+                               The parameters are passed in by the external data source
+                       @param {Function} [opts.onError] Called on timeout
+                               No parameters are passed
+                       @param {Function} [opts.onAbort] Called if the request is aborted
+                       @param {Boolean} [opts.useCache=false] Allow a cached response
+                       @param {Number} [opts.timeout] Time to allow for the request in seconds
+                       @param {String} [opts.charset] Charset attribute value for the script
+
+               @returns {glow.net.Request}
+
+               @example
+                       glow.net.loadScript("http://www.server.com/json/tvshows.php?jsoncallback={callback}", {
+                               onLoad: function(data) {
+                                       alert("Data loaded");
+                               }
+                       });
+               */
+               r.loadScript = function(url, opts) {
+                       //id of the request
+                       var newIndex = scriptElements.length,
+                               //script element that gets inserted on the page
+                               script,
+                               //generated name of the callback, may not be used
+                               callbackName = callbackPrefix + newIndex,
+                               opts = populateOptions(opts),
+                               request = new Request(newIndex, opts),
+                               url = opts.useCache ? url : noCacheUrl(url),
+                               //the global property used to hide callbacks
+                               globalObject = window[globalObjectName] || (window[globalObjectName] = {});
+
+                       //assign onload
+                       if (opts.onLoad != emptyFunc) {
+                               globalObject[callbackName] = function() {
+                                       //clear the timeout
+                                       request._timeout && clearTimeout(request._timeout);
+                                       //set as completed
+                                       request.completed = true;
+                                       // call the user's callback
+                                       opts.onLoad.apply(this, arguments);
+                                       // cleanup references to prevent leaks
+                                       request.destroy();
+                                       script = globalObject[callbackName] = undefined;
+                                       delete globalObject[callbackName];
+                               };
+                               url = glow.lang.interpolate(url, {callback: globalObjectName + "." + callbackName});
+                       }
+
+                       script = scriptElements[newIndex] = document.createElement("script");
+
+                       if (opts.charset) {
+                               script.charset = opts.charset;
+                       }
+
+                       //add abort event
+                       events.addListener(request, "abort", opts.onAbort);
+
+                       glow.ready(function() {
+                               //sort out the timeout
+                               if (opts.timeout) {
+                                       request._timeout = setTimeout(function() {
+                                               abortRequest(request);
+                                               opts.onError();
+                                       }, opts.timeout * 1000);
+                               }
+                               //using setTimeout to stop Opera 9.0 - 9.26 from running the loaded script before other code
+                               //in the current script block
+                               if (glow.env.opera) {
+                                       setTimeout(function() {
+                                               if (script) { //script may have been removed already
+                                                       script.src = url;
+                                               }
+                                       }, 0);
+                               } else {
+                                       script.src = url;
+                               }
+                               //add script to page
+                               document.body.appendChild(script);
+                       });
+
+                       return request;
+               }
+
+               /**
+                *      @name glow.net.abortRequest
+                *      @private
+                *      @function
+                *      @description Aborts the request
+                *              Doesn't trigger any events
+                *
+                *      @param {glow.net.Request} req Request Object
+                *      @returns this
+                */
+               function abortRequest(req) {
+                       var nativeReq = req.nativeRequest,
+                               callbackIndex = req._callbackIndex;
+
+                       //clear timeout
+                       req._timeout && clearTimeout(req._timeout);
+                       //different if request came from loadScript
+                       if (nativeReq) {
+                               //clear listeners
+                               // prevent parent scopes leaking (cross-page) in IE
+                               nativeReq.onreadystatechange = new Function();
+                               nativeReq.abort();
+                       } else if (callbackIndex) {
+                               //clear callback
+                               window[globalObjectName][callbackPrefix + callbackIndex] = emptyFunc;
+                               //remove script element
+                               glow.dom.get(scriptElements[callbackIndex]).destroy();
+                       }
+               }
+
+               /**
+                * @name glow.net.Request
+                * @class
+                * @description Returned by {@link glow.net.post post}, {@link glow.net.get get} async requests and {@link glow.net.loadScript loadScript}
+                * @glowPrivateConstructor There is no direct constructor, since {@link glow.net.post post} and {@link glow.net.get get} create the instances.
+                */
+                
+               /**
+                * @name glow.net.Request#event:load
+                * @event
+                * @param {glow.events.Event} event Event Object
+                * @description Fired when the request is sucessful
+                *   For a get / post request, this will be fired when request returns
+                *   with an HTTP code of 2xx. loadScript requests will fire 'load' only
+                *   if {callback} is used in the URL.
+                */
+                
+               /**
+                * @name glow.net.Request#event:abort
+                * @event
+                * @param {glow.events.Event} event Event Object
+                * @description Fired when the request is aborted
+                *   If you cancel the default (eg, by returning false) the request
+                *   will continue.
+                * @description Returned by {@link glow.net.post glow.net.post}, {@link glow.net.get glow.net.get} async requests and {@link glow.net.loadScript glow.net.loadScript}
+                * @see <a href="../furtherinfo/net/net.shtml">Using glow.net</a>
+                * @glowPrivateConstructor There is no direct constructor, since {@link glow.net.post glow.net.post} and {@link glow.net.get glow.net.get} create the instances.
+                */
+                
+               /**
+                * @name glow.net.Request#event:error
+                * @event
+                * @param {glow.events.Event} event Event Object
+                * @description Fired when the request is unsucessful
+                *   For a get/post request, this will be fired when request returns
+                *   with an HTTP code which isn't 2xx or the request times out. loadScript
+                *   calls will fire 'error' only if the request times out.
+                */
+                
+                
+               /*
+                We don't want users to create instances of this class, so the constructor is documented
+                out of view of jsdoc
+
+                @param {Object} requestObj
+                       Object which represents the request type.
+                       For XHR requests it should be an XmlHttpRequest object, for loadScript
+                       requests it should be a number, the Index of the callback in glow.net._jsonCbs
+                @param {Object} opts
+                       Zero or more of the following as properties of an object:
+                       @param {Function} [opts.onLoad] Called when the request is sucessful
+                       @param {Function} [opts.onError] Called when a request is unsucessful
+                       @param {Function} [opts.onAbort] Called when a request is aborted
+
+               */
+               function Request(requestObj, opts) {
+                       /**
+                        * @name glow.net.Request#_timeout
+                        * @private
+                        * @description timeout ID. This is set by makeXhrRequest or loadScript
+                        * @type Number
+                        */
+                       this._timeout = null;
+                       
+                       /*
+                        @name glow.net.Request#_forceXml
+                        @private
+                        @type Boolean
+                        @description Force the response to be treated as xml
+                       */
+                       this._forceXml = opts.forceXml;
+                       
+                       // force the reponse to be treated as xml
+                       // IE doesn't support overrideMineType, we need to deal with that in {@link glow.net.Response#xml}
+                       if (opts.forceXml && requestObj.overrideMimeType) {
+                               requestObj.overrideMimeType('application/xml');
+                       }
+                       
+                       /**
+                        * @name glow.net.Request#complete
+                        * @description Boolean indicating whether the request has completed
+                        * @example
+                               // request.complete with an asynchronous call
+                               var request = glow.net.get(
+                                       "myFile.html", 
+                                       {
+                                               async: true,
+                                               onload: function(response) {
+                                                       alert(request.complete); // returns true
+                                               }
+                                       }
+                               );
+                               alert(request.complete); // returns boolean depending on timing of asynchronous call
+
+                               // request.complete with a synchronous call
+                               var request = glow.net.get("myFile.html", {async: false;});
+                               alert(request.complete); // returns true
+                        * @type Boolean
+                        */
+                       this.complete = false;
+
+                       if (typeof requestObj == "number") {
+                               /**
+                                * @name glow.net.Request#_callbackIndex
+                                * @private
+                                * @description Index of the callback in glow.net._jsonCbs
+                                *   This is only relavent for requests made via loadscript using the
+                                *   {callback} placeholder
+                                * @type Number
+                                */
+                               this._callbackIndex = requestObj;
+                       } else {
+                               /**
+                                * @name glow.net.Request#nativeRequest
+                                * @description The request object from the browser.
+                                *   This may not have the same properties and methods across user agents.
+                                *   Also, this will be undefined if the request originated from loadScript.
+                                * @example
+                               var request = glow.net.get(
+                                       "myFile.html", 
+                                       {
+                                               async: true,
+                                               onload: function(response) {
+                                                       alert(request.NativeObject); // returns Object()
+                                               }
+                                       }
+                               );
+                                * @type Object
+                                */
+                               this.nativeRequest = requestObj;
+                       }
+
+                       //assign events
+                       var eventNames = ["Load", "Error", "Abort"], i=0;
+
+                       for (; i < 3; i++) {
+                               events.addListener(this, eventNames[i].toLowerCase(), opts["on" + eventNames[i]]);
+                       }
+
+               }
+               Request.prototype = {
+                       /**
+                       @name glow.net.Request#send
+                       @function
+                       @description Sends the request.
+                               This is done automatically unless the defer option is set
+                       @example
+                               var request = glow.net.get(
+                                       "myFile.html", 
+                                       {
+                                               onload : function(response) {alert("Loaded");},
+                                               defer: true
+                                       }
+                               );
+                               request.send(); // returns "Loaded"
+                       @returns {Object}
+                               This for async requests or a response object for sync requests
+                       */
+                       //this function is assigned by makeXhrRequest
+                       send: function() {},
+                       /**
+                        *      @name glow.net.Request#abort
+                        *      @function
+                        *      @description Aborts an async request
+                        *              The load & error events will not fire. If the request has been
+                        *              made using {@link glow.net.loadScript loadScript}, the script
+                        *              may still be loaded but the callback will not be fired.
+                        * @example
+                               var request = glow.net.get(
+                                       "myFile.html", 
+                                       {
+                                               async: true,
+                                               defer: true,
+                                               onabort: function() {
+                                                       alert("Something bad happened.  The request was aborted.");
+                                               }
+                                       }
+                               );
+                               request.abort(); // returns "Something bad happened.  The request was aborted"
+                        *      @returns this
+                        */
+                       abort: function() {
+                               if (!this.completed && !events.fire(this, "abort").defaultPrevented()) {
+                                       abortRequest(this);
+                               }
+                               return this;
+                       },
+                       /**
+                        @name glow.net.Request#destroy
+                        @function
+                        @description Release memory from a {@link glow.net.loadScript} call.
+                               
+                               This is called automatically by {@link glow.net.loadScript loadScript}
+                               calls that have {callback} in the URL. However, if you are not using
+                               {callback}, you can use this method manually to release memory when
+                               the request has finished.
+                        
+                        @example
+                               var request = glow.net.loadScript('http://www.bbc.co.uk/whatever.js');
+                       
+                        @returns this
+                       */
+                       destroy: function() {
+                               if (this._callbackIndex !== undefined) {
+                                       // set timeout is used here to prevent a crash in IE7 (possibly other version) when the script is from the filesystem
+                                       setTimeout(function() {
+                                               $( scriptElements[this._callbackIndex] ).destroy();
+                                               scriptElements[this._callbackIndex] = undefined;
+                                               delete scriptElements[this._callbackIndex];
+                                       }, 0);
+                               }
+                               return this;
+                       }
+               };
+
+               /**
+               @name glow.net.Response
+               @class
+               @description Provided in callbacks to {@link glow.net.post glow.net.post} and {@link glow.net.get glow.net.get}
+               @see <a href="../furtherinfo/net/net.shtml">Using glow.net</a>
+
+               @glowPrivateConstructor There is no direct constructor, since {@link glow.net.post glow.net.post} and {@link glow.net.get glow.net.get} create the instances.
+               */
+               /*
+                These params are hidden as we don't want users to try and create instances of this...
+
+                @param {XMLHttpRequest} nativeResponse
+                @param {Boolean} [timedOut=false] Set to true if the response timed out
+                @param {glow.net.Request} [request] Original request object
+               */
+               function Response(nativeResponse, timedOut, request) {
+                       //run Event constructor
+                       events.Event.call(this);
+                       
+                       /**
+                       @name glow.net.Response#_request
+                       @private
+                       @description Original request object
+                       @type glow.net.Request
+                       */
+                       this._request = request;
+                       
+                       /**
+                       @name glow.net.Response#nativeResponse
+                       @description The response object from the browser.
+                               This may not have the same properties and methods across user agents.
+                       @type Object
+                       */
+                       this.nativeResponse = nativeResponse;
+                       /**
+                       @name glow.net.Response#status
+                       @description HTTP status code of the response
+                       @type Number
+                       */
+                       //IE reports status as 1223 rather than 204, for laffs
+                       this.status = timedOut ? 408 :
+                               nativeResponse.status == 1223 ? 204 : nativeResponse.status;
+
+                       /**
+                        * @name glow.net.Response#timedOut
+                        * @description Boolean indicating if the requests time out was reached.
+                        * @type Boolean
+                        */
+                       this.timedOut = !!timedOut;
+
+                       /**
+                        * @name glow.net.Response#wasSuccessful
+                        * @description  Boolean indicating if the request returned successfully.
+                        * @type Boolean
+                        */
+                       this.wasSuccessful = (this.status >= 200 && this.status < 300) ||
+                               //from cache
+                               this.status == 304 ||
+                               //watch our for requests from file://
+                               (this.status == 0 && nativeResponse.responseText);
+
+               }
+               
+               /**
+               @name glow.net-shouldParseAsXml
+               @function
+               @description Should the response be treated as xml? This function is used by IE only
+                       'this' is the response object
+               @returns {Boolean}
+               */
+               function shouldParseAsXml() {
+                       var contentType = this.header("Content-Type");
+                       // IE 6 & 7 fail to recognise Content-Types ending +xml (eg application/rss+xml)
+                       // Files from the filesystem don't have a content type, but could be xml files, parse them to be safe
+                       return endsPlusXml.test(contentType) || contentType === '';
+               }
+               
+               //don't want to document this inheritance, it'll just confuse the user
+               glow.lang.extend(Response, events.Event, {
+                       /**
+                       @name glow.net.Response#text
+                       @function
+                       @description Gets the body of the response as plain text
+                       @returns {String}
+                               Response as text
+                       */
+                       text: function() {
+                               return this.nativeResponse.responseText;
+                       },
+                       /**
+                       @name glow.net.Response#xml
+                       @function
+                       @description Gets the body of the response as xml
+                       @returns {xml}
+                               Response as XML
+                       */
+                       xml: function() {
+                               var nativeResponse = this.nativeResponse;
+                               
+                               if (
+                                       // IE fails to recognise the doc as XML in some cases
+                                       ( glow.env.ie && shouldParseAsXml.call(this) )
+                                       // If the _forceXml option is set, we need to turn the response text into xml
+                                       || ( this._request._forceXml && !this._request.nativeRequest.overrideMimeType && window.ActiveXObject )
+                               ) {
+                                       var doc = new ActiveXObject("Microsoft.XMLDOM");
+                    doc.loadXML( nativeResponse.responseText );
+                                       return doc;
+                               }
+                               else {
+                                       // check property exists
+                                       if (!nativeResponse.responseXML) {
+                                               throw new Error(STR.XML_ERR);
+                                       }
+                                       return nativeResponse.responseXML;
+                               }                               
+                       },
+
+                       /**
+                       @name glow.net.Response#json
+                       @function
+                       @description Gets the body of the response as a json object
+
+                       @param {Boolean} [safeMode=false]
+                               If true, the response will be parsed using a string parser which
+                               will filter out non-JSON javascript, this will be slower but
+                               recommended if you do not trust the data source.
+
+                       @returns {Object}
+                       */
+                       json: function(safe) {
+                               return glow.data.decodeJson(this.text(), {safeMode:safe});
+                       },
+
+                       /**
+                       @name glow.net.Response#header
+                       @function
+                       @description Gets a header from the response
+
+                       @param {String} name
+                               Header name
+
+                       @returns {String}
+                               Header value
+
+                       @example var contentType = myResponse.header("Content-Type");
+                       */
+                       header: function(name) {
+                               return this.nativeResponse.getResponseHeader(name);
+                       },
+
+                       /**
+                       @name glow.net.Response#statusText
+                       @function
+                       @description Gets the meaning of {@link glow.net.Response#status myResponse.status}
+
+                       @returns {String}
+                       */
+                       statusText: function() {
+                               return this.timedOut ? "Request Timeout" : this.nativeResponse.statusText;
+                       }
+               })
+
+               glow.net = r;
+       }
+});
+
+/**
+@name glow.tweens
+@namespace
+@description Functions for modifying animations
+@see <a href="../furtherinfo/tweens">What are tweens?</a>
+
+*/
+(window.gloader || glow).module({
+       name: "glow.tweens",
+       library: ["glow", "1.7.0"],
+       depends: [],
+       builder: function(glow) {
+
+               /*
+               PrivateMethod: _reverse
+                       Takes a tween function and returns a function which does the reverse
+               */
+               function _reverse(tween) {
+                       return function(t) {
+                               return 1 - tween(1 - t);
+                       }
+               }
+
+               glow.tweens = {
+                       /**
+                       @name glow.tweens.linear
+                       @function
+                       @description Returns linear tween.
+
+                               Will transition values from start to finish with no
+                               acceleration or deceleration.
+
+                       @returns {Function}
+                       */
+                       linear: function() {
+                               return function(t) { return t; };
+                       },
+                       /**
+                       @name glow.tweens.easeIn
+                       @function
+                       @description Creates a tween which starts off slowly and accelerates.
+
+                       @param {Number} [strength=2] How strong the easing is.
+
+                               A higher number means the animation starts off slower and
+                               ends quicker.
+
+                       @returns {Function}
+                       */
+                       easeIn: function(strength) {
+                               strength = strength || 2;
+                               return function(t) {
+                                       return Math.pow(1, strength - 1) * Math.pow(t, strength);
+                               }
+                       },
+                       /**
+                       @name glow.tweens.easeOut
+                       @function
+                       @description Creates a tween which starts off fast and decelerates.
+
+                       @param {Number} [strength=2] How strong the easing is.
+
+                               A higher number means the animation starts off faster and
+                               ends slower
+
+                       @returns {Function}
+                        */
+                       easeOut: function(strength) {
+                               return _reverse(this.easeIn(strength));
+                       },
+                       /**
+                       @name glow.tweens.easeBoth
+                       @function
+                       @description Creates a tween which starts off slowly, accelerates then decelerates after the half way point.
+
+                               This produces a smooth and natural looking transition.
+
+                       @param {Number} [strength=2] How strong the easing is.
+
+                               A higher number produces a greater difference between
+                               start / end speed and the mid speed.
+
+                       @returns {Function}
+                       */
+                       easeBoth: function(strength) {
+                               return this.combine(this.easeIn(strength), this.easeOut(strength));
+                       },
+                       /**
+                       @name glow.tweens.overshootIn
+                       @function
+                       @description Returns the reverse of {@link glow.tweens.overshootOut overshootOut}
+
+                       @param {Number} [amount=1.70158] How much to overshoot.
+
+                               The default is 1.70158 which results in a 10% overshoot.
+
+                       @returns {Function}
+                       */
+                       overshootIn: function(amount) {
+                               return _reverse(this.overshootOut(amount));
+                       },
+                       /**
+                       @name glow.tweens.overshootOut
+                       @function
+                       @description Creates a tween which overshoots its end point then returns to its end point.
+
+                       @param {Number} [amount=1.70158] How much to overshoot.
+
+                               The default is 1.70158 which results in a 10% overshoot.
+
+                       @returns {Function}
+                       */
+                       overshootOut: function(amount) {
+                               amount = amount || 1.70158;
+                               return function(t) {
+                                       if (t == 0 || t == 1) { return t; }
+                                       return ((t -= 1)* t * ((amount + 1) * t + amount) + 1);
+                               }
+                       },
+                       /**
+                       @name glow.tweens.overshootBoth
+                       @function
+                       @description Returns a combination of {@link glow.tweens.overshootIn overshootIn} and {@link glow.tweens.overshootOut overshootOut}
+
+                       @param {Number} [amount=1.70158] How much to overshoot.
+
+                               The default is 1.70158 which results in a 10% overshoot.
+
+                       @returns {Function}
+                       */
+                       overshootBoth: function(amount) {
+                               return this.combine(this.overshootIn(amount), this.overshootOut(amount));
+                       },
+                       /**
+                       @name glow.tweens.bounceIn
+                       @function
+                       @description Returns the reverse of {@link glow.tweens.bounceOut bounceOut}
+
+                       @returns {Function}
+                       */
+                       bounceIn: function() {
+                               return _reverse(this.bounceOut());
+                       },
+                       /**
+                       @name glow.tweens.bounceOut
+                       @function
+                       @description Returns a tween which bounces against the final value 3 times before stopping
+
+                       @returns {Function}
+                       */
+                       bounceOut: function() {
+                               return function(t) {
+                                       if (t < (1 / 2.75)) {
+                                               return 7.5625 * t * t;
+                                       } else if (t < (2 / 2.75)) {
+                                               return (7.5625 * (t -= (1.5 / 2.75)) * t + .75);
+                                       } else if (t < (2.5 / 2.75)) {
+                                               return (7.5625 * (t -= (2.25 / 2.75)) * t + .9375);
+                                       } else {
+                                               return (7.5625 * (t -= (2.625 / 2.75)) * t + .984375);
+                                       }
+                               };
+                       },
+                       /**
+                       @name glow.tweens.bounceBoth
+                       @function
+                       @description Returns a combination of {@link glow.tweens.bounceIn bounceIn} and {@link glow.tweens.bounceOut bounceOut}
+
+                       @returns {Function}
+                       */
+                       bounceBoth: function() {
+                               return this.combine(this.bounceIn(), this.bounceOut());
+                       },
+                       /**
+                       @name glow.tweens.elasticIn
+                       @function
+                       @description Returns the reverse of {@link glow.tweens.elasticOut elasticOut}
+
+                       @param {Number} [amplitude=1] How strong the elasticity is.
+
+                       @param {Number} [period=0.3] The frequency period.
+
+                       @returns {Function}
+                       */
+                       elasticIn: function(a, p) {
+                               return _reverse(this.elasticOut(a, p));
+                       },
+                       /**
+                       @name glow.tweens.elasticOut
+                       @function
+                       @description Creates a tween which has an elastic movement.
+
+                               You can tweak the tween using the parameters but you'll
+                               probably find the defaults sufficient.
+
+                       @param {Number} [amplitude=1] How strong the elasticity is.
+
+                       @param {Number} [period=0.3] The frequency period.
+
+                       @returns {Function}
+                       */
+                       elasticOut: function(a, p) {
+                               return function (t) {
+                                       if (t == 0 || t == 1) {
+                                               return t;
+                                       }
+                                       if (!p) {
+                                               p = 0.3;
+                                       }
+                                       if (!a || a < 1) {
+                                               a = 1;
+                                               var s = p / 4;
+                                       } else {
+                                               var s = p / (2 * Math.PI) * Math.asin(1 / a);
+                                       }
+                                       return a * Math.pow(2, -10 * t) * Math.sin( (t-s) * (2 * Math.PI) / p) + 1;
+                               }
+                       },
+                       /**
+                       @name glow.tweens.elasticBoth
+                       @function
+                       @description Returns a combination of {@link glow.tweens.elasticIn elasticIn} and {@link glow.tweens.elasticOut elasticOut}
+
+                       @param {Number} [amplitude=1] How strong the elasticity is.
+
+                       @param {Number} [period=0.3] The frequency period.
+
+                       @returns {Function}
+                       */
+                       elasticBoth: function(a, p) {
+                               p = p || 0.45;
+                               return this.combine(this.elasticIn(a, p), this.elasticOut(a, p));
+                       },
+                       /**
+                       @name glow.tweens.combine
+                       @function
+                       @description Create a tween from two tweens.
+
+                               This can be useful to make custom tweens which, for example,
+                               start with an easeIn and end with an overshootOut. To keep
+                               the motion natural, you should configure your tweens so the
+                               first ends and the same velocity that the second starts.
+
+                       @param {Function} tweenIn Tween to use for the first half
+
+                       @param {Function} tweenOut Tween to use for the second half
+
+                       @example
+                               // 4.5 has been chosen for the easeIn strength so it
+                               // ends at the same velocity as overshootOut starts.
+                               var myTween = glow.tweens.combine(
+                                       glow.tweens.easeIn(4.5),
+                                       glow.tweens.overshootOut()
+                               );
+
+                       @returns {Function}
+                       */
+                       combine: function(tweenIn, tweenOut) {
+                               return function (t) {
+                                       if (t < 0.5) {
+                                               return tweenIn(t * 2) / 2;
+                                       } else {
+                                               return tweenOut((t - 0.5) * 2) / 2 + 0.5;
+                                       }
+                               }
+                       }
+               };
+       }
+});
+/**
+@name glow.anim
+@namespace
+@description Simple and powerful animations.
+@requires glow, glow.tweens, glow.events, glow.dom
+@see <a href="../furtherinfo/tweens/">What are tweens?</a>
+@see <a href="../furtherinfo/anim/">Guide to creating animations, with interactive examples</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.anim",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", "glow.tweens", "glow.events", "glow.dom"]],
+       builder: function(glow) {
+               //private
+               var $ = glow.dom.get,
+                       manager,
+                       events = glow.events,
+                       dom = glow.dom,
+                       get = dom.get,
+                       hasUnits = /width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,
+                       noNegatives = /width|height|padding|opacity/,
+                       usesYAxis = /height|top/,
+                       getUnit = /(\D+)$/,
+                       testElement = dom.create('<div style="position:absolute;visibility:hidden"></div>');
+               
+               /*
+                 Converts event shortcuts in an options object to real events
+                 instance - the object to add events to
+                 opts - the options object containing the listener functions
+                 eventProps - an array of property names of potential listeners, eg ['onFrame', 'onComplete']
+               */
+               function addEventsFromOpts(instance, opts, eventProps) {
+                       for (var i = 0, len = eventProps.length; i < len; i++) {
+                               // does opts.onWhatever exist?
+                               if (opts[ eventProps[i] ]) {
+                                       events.addListener(
+                                               instance,
+                                               // convert "onWhatever" to "whatever"
+                                               eventProps[i].slice(2).toLowerCase(),
+                                               opts[ eventProps[i] ]
+                                       );
+                               }
+                       }
+               }
+               
+               (function() {
+                       var queue = [], //running animations
+                               queueLen = 0,
+                               intervalTime = 1, //ms between intervals
+                               interval; //holds the number for the interval
+                       manager = {
+                               /**
+                               @name glow.anim-manager.addToQueue
+                               @private
+                               @function
+                               @description Adds an animation to the queue.
+                               */
+                               addToQueue: function(anim) {
+                                       //add the item to the queue
+                                       queue[queueLen++] = anim;
+                                       anim._playing = true;
+                                       anim._timeAnchor = anim._timeAnchor || new Date().valueOf();
+                                       if (!interval) {
+                                               this.startInterval();
+                                       }
+                               },
+                               /**
+                               @name glow.anim-manager.removeFromQueue
+                               @private
+                               @function
+                               @description Removes an animation from the queue.
+                               */
+                               removeFromQueue: function(anim) {
+                                       for (var i = 0; i < queueLen; i++) {
+                                               if (queue[i] == anim) {
+                                                       queue.splice(i, 1);
+                                                       anim._timeAnchor = null;
+                                                       anim._playing = false;
+                                                       //stop the queue if there's nothing in it anymore
+                                                       if (--queueLen == 0) {
+                                                               this.stopInterval();
+                                                       }
+                                                       return;
+                                               }
+                                       }
+                               },
+                               /**
+                               @name glow.anim-manager.startInterval
+                               @private
+                               @function
+                               @description Start processing the queue every interval.
+                               */
+                               startInterval: function() {
+                                       interval = window.setInterval(this.processQueue, intervalTime);
+                               },
+                               /**
+                               @name glow.anim-manager.stopInterval
+                               @private
+                               @function
+                               @description Stop processing the queue.
+                               */
+                               stopInterval: function() {
+                                       window.clearInterval(interval);
+                                       interval = null;
+                               },
+                               /**
+                               @name glow.anim-manager.processQueue
+                               @private
+                               @function
+                               @description Animate each animation in the queue.
+                               */
+                               processQueue: function() {
+                                       var anim, i, now = new Date().valueOf();
+                                       for (i = 0; i < queueLen; i++) {
+                                               anim = queue[i];
+                                               if (anim.position == anim.duration) {
+                                                       manager.removeFromQueue(anim);
+                                                       //need to decrement the index because we've just removed an item from the queue
+                                                       i--;
+                                                       events.fire(anim, "complete");
+                                                       if (anim._opts.destroyOnComplete) {
+                                                               anim.destroy();
+                                                       }
+                                                       continue;
+                                               }
+                                               if (anim.useSeconds) {
+                                                       anim.position = (now - anim._timeAnchor) / 1000;
+                                                       if (anim.position > anim.duration) {
+                                                               anim.position = anim.duration;
+                                                       }
+                                               } else {
+                                                       anim.position++;
+                                               }
+                                               anim.value = anim.tween(anim.position / anim.duration);
+                                               events.fire(anim, "frame");
+                                       }
+                               }
+                       };
+               })();
+
+               /**
+               @name glow.anim.convertCssUnit
+               @private
+               @function
+               @param {nodelist} element
+               @param {string|number} fromValue Assumed pixels.
+               @param {string} toUnit (em|%|pt...)
+               @param {string} axis (x|y)
+               @description Converts a css unit.
+
+               We need to know the axis for calculating relative values, since they're
+               relative to the width / height of the parent element depending
+               on the situation.
+
+               */
+               function convertCssUnit(element, fromValue, toUnit, axis) {
+                       var elmStyle = testElement[0].style,
+                               axisProp = (axis == "x") ? "width" : "height",
+                               startPixelValue,
+                               toUnitPixelValue;
+                       //reset stuff that may affect the width / height
+                       elmStyle.margin = elmStyle.padding = elmStyle.border = "0";
+                       startPixelValue = testElement.css(axisProp, fromValue).insertAfter(element)[axisProp]();
+                       //using 10 of the unit then dividing by 10 to increase accuracy
+                       toUnitPixelValue = testElement.css(axisProp, 10 + toUnit)[axisProp]() / 10;
+                       testElement.remove();
+                       return startPixelValue / toUnitPixelValue;
+               }
+
+               /**
+               @name glow.anim.keepWithinRange
+               @private
+               @function
+               @param num
+               @param [start]
+               @param [end]
+               @description
+               Takes a number then an (optional) lower range and an (optional) upper range. If the number
+               is outside the range the nearest range boundary is returned, else the number is returned.
+               */
+               function keepWithinRange(num, start, end) {
+                       if (start !== undefined && num < start) {
+                               return start;
+                       }
+                       if (end !== undefined && num > end) {
+                               return end;
+                       }
+                       return num;
+               }
+
+               /**
+               @name glow.anim.buildAnimFunction
+               @private
+               @function
+               @param element
+               @param spec
+               @description Builds a function for an animation.
+               */
+               function buildAnimFunction(element, spec) {
+                       var cssProp,
+                               r = ["a=(function(){"],
+                               rLen = 1,
+                               fromUnit,
+                               unitDefault = [0,"px"],
+                               to,
+                               from,
+                               unit,
+                               a;
+
+                       for (cssProp in spec) {
+                               r[rLen++] = 'element.css("' + cssProp + '", ';
+                               //fill in the blanks
+                               if (typeof spec[cssProp] != "object") {
+                                       to = spec[cssProp];
+                               } else {
+                                       to = spec[cssProp].to;
+                               }
+                               if ((from = spec[cssProp].from) === undefined) {
+                                       if (cssProp == "font-size" || cssProp == "background-position") {
+                                               throw new Error("From value must be set for " + cssProp);
+                                       }
+                                       from = element.css(cssProp);
+                               }
+                               //TODO help some multi value things?
+                               if (hasUnits.test(cssProp)) {
+                                       //normalise the units for unit-ed values
+                                       unit = (getUnit.exec(to) || unitDefault)[1];
+                                       fromUnit = (getUnit.exec(from) || unitDefault)[1];
+                                       //make them numbers, we have the units seperate
+                                       from = parseFloat(from) || 0;
+                                       to = parseFloat(to) || 0;
+                                       //if the units don't match, we need to have a play
+                                       if (from && unit != fromUnit) {
+                                               if (cssProp == "font-size") {
+                                                       throw new Error("Units must be the same for font-size");
+                                               }
+                                               from = convertCssUnit(element, from + fromUnit, unit, usesYAxis.test(cssProp) ? "y" : "x");
+                                       }
+                                       if (noNegatives.test(cssProp)) {
+                                               r[rLen++] = 'keepWithinRange((' + (to - from) + ' * this.value) + ' + from + ', 0) + "' + unit + '"';
+                                       } else {
+                                               r[rLen++] = '(' + (to - from) + ' * this.value) + ' + from + ' + "' + unit + '"';
+                                       }
+                               } else if (! (isNaN(from) || isNaN(to))) { //both pure numbers
+                                       from = Number(from);
+                                       to = Number(to);
+                                       r[rLen++] = '(' + (to - from) + ' * this.value) + ' + from;
+                               } else if (cssProp.indexOf("color") != -1) {
+                                       to = dom.parseCssColor(to);
+                                       if (! glow.lang.hasOwnProperty(from, "r")) {
+                                               from = dom.parseCssColor(from);
+                                       }
+                                       r[rLen++] = '"rgb(" + keepWithinRange(Math.round(' + (to.r - from.r) + ' * this.value + ' + from.r +
+                                               '), 0, 255) + "," + keepWithinRange(Math.round(' + (to.g - from.g) + ' * this.value + ' + from.g +
+                                               '), 0, 255) + "," + keepWithinRange(Math.round(' + (to.b - from.b) + ' * this.value + ' + from.b +
+                                               '), 0, 255) + ")"';
+                               } else if (cssProp == "background-position") {
+                                       var vals = {},
+                                               fromTo = ["from", "to"],
+                                               unit = (getUnit.exec(from) || unitDefault)[1];
+                                       vals.fromOrig = from.toString().split(/\s/);
+                                       vals.toOrig = to.toString().split(/\s/);
+
+                                       if (vals.fromOrig[1] === undefined) {
+                                               vals.fromOrig[1] = "50%";
+                                       }
+                                       if (vals.toOrig[1] === undefined) {
+                                               vals.toOrig[1] = "50%";
+                                       }
+
+                                       for (var i = 0; i < 2; i++) {
+                                               vals[fromTo[i] + "X"] = parseFloat(vals[fromTo[i] + "Orig"][0]);
+                                               vals[fromTo[i] + "Y"] = parseFloat(vals[fromTo[i] + "Orig"][1]);
+                                               vals[fromTo[i] + "XUnit"] = (getUnit.exec(vals[fromTo[i] + "Orig"][0]) || unitDefault)[1];
+                                               vals[fromTo[i] + "YUnit"] = (getUnit.exec(vals[fromTo[i] + "Orig"][1]) || unitDefault)[1];
+                                       }
+
+                                       if ((vals.fromXUnit !== vals.toXUnit) || (vals.fromYUnit !== vals.toYUnit)) {
+                                               throw new Error("Mismatched axis units cannot be used for " + cssProp);
+                                       }
+
+                                       r[rLen++] = '(' + (vals.toX - vals.fromX) + ' * this.value + ' + vals.fromX + ') + "' + vals.fromXUnit + ' " + (' +
+                                                               (vals.toY - vals.fromY) + ' * this.value + ' + vals.fromY + ') + "' + vals.fromYUnit + '"';
+                               }
+                               r[rLen++] = ');';
+                       }
+                       r[rLen++] = "})";
+                       return eval(r.join(""));
+               }
+
+               //public
+               var r = {}; //return object
+
+               /**
+               @name glow.anim.css
+               @function
+               @description Animates CSS properties of an element.
+               @param {String | glow.dom.NodeList | Element} element Element to animate.
+
+                       This can be a CSS selector (first match will be used),
+                       {@link glow.dom.NodeList} (first node will be used), or a DOM element.
+
+               @param {Number} duration Animation duration, in seconds by default.
+
+               @param {Object} spec An object describing the properties to animate.
+
+                       This object should consist of property names corresponding to the
+                       CSS properties you wish to animate, and values which are objects
+                       with 'from' and 'to' properties with the values to animate between
+                       or a number/string representing the value to animate to.
+
+                       If the 'from' property is absent, the elements current CSS value
+                       will be used instead.
+
+                       See the spec example below for more information.
+
+               @param {Object} opts Optional options object.
+
+               @param {Boolean} [opts.useSeconds=true] Specifies whether duration should be in seconds rather than frames.
+
+               @param {Function} [opts.tween=linear tween] The way the value moves through time. See {@link glow.tweens}.
+               
+               @param {Boolean} [opts.destroyOnComplete=false] Destroy the animation once it completes?
+                       This will free any DOM references the animation may have created. Once
+                       the animation completes, you won't be able to start it again.
+                       
+               @param {Function} [opts.onStart] Shortcut for adding a "start" event listener
+               @param {Function} [opts.onFrame] Shortcut for adding a "frame" event listener
+               @param {Function} [opts.onStop] Shortcut for adding a "stop" event listener
+               @param {Function} [opts.onComplete] Shortcut for adding a "complete" event listener
+               @param {Function} [opts.onResume] Shortcut for adding a "resume" event listener
+               
+               @example
+               // an example of an spec object
+               {
+                       "height": {from: "10px", to: "100px"},
+                       "width": "100px",
+                       "font-size": {from: "0.5em", to: "1.3em"}
+               }
+
+               @example
+               // animate an elements height and opacity to 0 from current values over 1 second
+               glow.anim.css("#myElement", 1, {
+                       "height" : 0,
+                       "opacity" : 0
+               }).start();
+
+               @returns {glow.anim.Animation}
+               */
+               r.css = function(element, duration, spec, opts) {
+
+                       element = get(element);
+
+                       var anim = new r.Animation(duration, opts);
+
+                       // Fix for trac 156 - glow.anim.css should fail better if the element doesn't exist
+                       if (element[0]) {
+                               events.addListener(anim, "frame", buildAnimFunction(element, spec));
+                       }
+                       return anim;
+               };
+               
+               /**
+               @name glow.anim-slideElement
+               @private
+               @function
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               @param {Number} duration Animation duration in seconds.
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               @description Builds a function for an animation.
+               */
+               slideElement = function slideElement(element, duration, action, opts) {
+                       duration = duration || 0.5;
+                       // normalise 'element' to NodeList
+                       element = $(element);
+                       
+                       opts = glow.lang.apply({
+                               tween: glow.tweens.easeBoth(),
+                               onStart: function(){},
+                               onComplete: function(){}
+                       }, opts);
+                       
+                       var i = 0,
+                               thatlength = element.length,
+                               completeHeight,
+                               fromHeight,
+                               channels = [],
+                               timeline;
+                       
+                       for(; i < thatlength; i++) {
+                               if (action == "up" || (action == "toggle" && element.slice(i, i+1).height() > 0)) {
+                                       element[i].style.overflow = 'hidden';
+                                       // give the element layout in IE
+                                       if (glow.env.ie < 8) {
+                                               element[i].style.zoom = 1;
+                                       }
+                                       completeHeight = 0;
+                                       fromHeight = element.slice(i, i+1).height();
+                               } else if (action == "down" || (action == "toggle" && element.slice(i, i+1).height() == 0)) {
+                                       fromHeight = element.slice(i, i+1).height();
+                                       element[i].style.height = "auto";
+                                       completeHeight = element.slice(i, i+1).height();
+                                       element[i].style.height = fromHeight + "px";
+                               }
+
+                               channels[i] = [
+                                       glow.anim.css(element[i], duration, {
+                                               'height': {from: fromHeight, to: completeHeight}
+                                       }, { tween: opts.tween })
+                               ];
+
+                       }
+                       
+                       timeline = new glow.anim.Timeline(channels, {
+                               destroyOnComplete: true
+                       });
+                       
+                       events.addListener(timeline, "complete", function() {
+                               // return heights to "auto" for slide down
+                               element.each(function() {
+                                       if (this.style.height != "0px") {
+                                               this.style.height = "auto";
+                                       }
+                               })
+                       });
+                       
+                       events.addListener(timeline, "start", opts.onStart);
+                       events.addListener(timeline, "complete", opts.onComplete);
+                       
+                       // return & start our new timeline
+                       return timeline.start();
+               };
+
+               /**
+               @name glow.anim.slideDown
+               @function
+               @description Slide a NodeList down from a height of 0 
+               
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               
+               @param {Number} duration Animation duration in seconds.
+               
+               @param {Function} opts Object
+                
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+               
+                       glow.anim.slideDown("#menu", 1);
+                                
+               **/     
+               r.slideDown = function(element, duration, opts) {
+                       return slideElement(element, duration, 'down', opts);
+               };
+
+               /**
+               @name glow.anim.slideUp
+               @function
+               @description Slide a NodeList up to a height of 0 
+               
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               
+               @param {Number} duration Animation duration in seconds.
+               
+               @param {Function} opts Object
+                
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+                               
+                       glow.anim.slideUp("#menu", 1);
+                                
+               **/             
+               r.slideUp = function(element, duration, opts) {
+                       return slideElement(element, duration, 'up', opts);
+               };
+               
+               /**
+               @name glow.anim.slideToggle
+               @function
+               @description Toggle a NodeList Up or Down depending on it's present state. 
+               
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               
+               @param {Number} duration Animation duration in seconds.
+               
+               @param {Function} opts Object
+                
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+                               
+                       glow.anim.slideToggle("#menu", 1);
+                                
+               **/                     
+               r.slideToggle = function(element, duration, opts) {
+                       return slideElement(element, duration, 'toggle', opts);
+               };
+
+
+               /**
+               @name glow.anim.fadeOut
+               @function
+               @description Fade out a set of elements 
+               
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               
+               @param {Number} duration Animation duration in seconds.
+               
+               @param {Function} opts Object
+                
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+                               
+                       glow.anim.fadeOut("#menu", 1);
+                                
+               **/
+               r.fadeOut = function(element, duration, opts) {
+                       return r.fadeTo(element, 0, duration, opts)
+        };
+               
+               /**
+               @name glow.anim.fadeIn
+               @function
+               @description Fade in a set of elements 
+                
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               
+               @param {Number} duration Animation duration in seconds.
+                 
+               @param {Function} opts Object
+                
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+                               
+                       glow.anim.fadeIn("#menu", 1);
+                                
+               **/
+               r.fadeIn = function(element, duration, opts){
+                       r.fadeTo(element, 1, duration, opts);
+        };
+               
+               /**
+               @name glow.anim.fadeTo
+               @function
+               @description Fade a set of elements to a given opacity
+                
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+                
+               @param {Number} opacity fade to opacity level between 0 & 1. 
+                
+               @param {Number} duration Animation duration in seconds.
+                 
+               @param {Function} opts Object
+                
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+                               
+                       glow.anim.fadeTo("#menu", 0.5, 1);
+                                
+               **/
+               r.fadeTo = function(element, opacity, duration, opts){
+                       duration = duration || 0.5;
+                       // normalise 'element' to NodeList
+                       element = $(element);
+                       
+                       opts = glow.lang.apply({
+                               tween: glow.tweens.easeBoth(),
+                               onStart: function(){},
+                               onComplete: function(){}
+                       }, opts);
+                       
+                       var i = 0,
+                               thatlength = element.length,
+                               channels = [],
+                               timeline;
+                       
+                       for(; i < thatlength; i++) {
+                               channels[i] = [
+                                       glow.anim.css(element[i], duration, {
+                                               'opacity': opacity
+                                       }, { tween: opts.tween })
+                               ];
+                       }
+                       
+                       timeline = new glow.anim.Timeline(channels, {
+                               destroyOnComplete: true
+                       });
+                       
+                       events.addListener(timeline, "start", opts.onStart);
+                       events.addListener(timeline, "complete", opts.onComplete);
+                       
+                       // return & start our new timeline
+                       return timeline.start();
+        };
+        
+
+               /**
+               @name glow.anim.highlight
+               @function
+               @description    Highlight an element by fading the background colour
+                
+               @param {String | glow.dom.NodeList} element Element to animate. CSS Selector can be used.
+               
+               @param {String} highlightColour highlight colour in hex, "rgb(r, g, b)" or css colour name. 
+                
+               @param {Number} duration Animation duration in seconds.
+                 
+               @param {Function} opts Object
+                
+               @param {Function} [opts.completeColour] The background colour of the element once the highlight is complete.
+               
+                                                 If none supplied Glow assumes the element's existing background color (e.g. #336699),
+                                                 if the element has no background color specified (e.g. Transparent)
+                                                 the highlight will transition to white.
+               
+               @param {Function} [opts.tween=easeBoth tween] The way the value moves through time. See {@link glow.tweens}.
+                 
+               @param {Function} [opts.onStart] The function to be called when the first element in the NodeList starts the animation.  
+                
+               @param {Function} [opts.onComplete] The function to be called when the first element in the NodeList completes the animation.
+               
+               @returns {glow.anim.Timeline}
+               
+                       A started timeline
+               
+               @example
+                               
+                       glow.anim.highlight("#textInput", "#ff0", 1);
+               **/
+               r.highlight = function(element, highlightColour, duration, opts){
+                       // normalise element
+                       element = $(element);
+                       
+                       duration = duration || 1;
+                       highlightColour = highlightColour || '#ffff99';
+                       
+                       opts = glow.lang.apply({
+                               tween: glow.tweens.easeBoth(),
+                               onStart: function(){},
+                               onComplete: function(){}
+                       }, opts);
+                       
+                       var i = 0, 
+                               transArray = [],
+                               elmsLength = element.length,
+                               completeColour,
+                               channels = [],
+                               timeline;
+                       
+                       for(; i < elmsLength; i++) {
+                               
+                               completeColour = opts.completeColour || element.slice(i, i+1).css("background-color");
+
+                               if (completeColour == "transparent" || completeColour == "") { 
+                                       completeColour = "#fff";
+                               }
+                               channels[i] = [
+                                       r.css(element[i], duration, {
+                                               "background-color" : {from:highlightColour, to:completeColour}
+                                       }, {tween: opts.tween})
+                               ];
+                       }
+                       
+                       timeline = new glow.anim.Timeline(channels, {
+                               destroyOnComplete: true
+                       });
+                       
+                       events.addListener(timeline, "start", opts.onStart);
+                       events.addListener(timeline, "complete", opts.onComplete);
+                       return timeline.start();
+        };
+
+               /**
+               @name glow.anim.Animation
+               @class
+               @description Controls modifying values over time.
+
+                       You can create an animtion instance using the constructor, or use
+                       one of the helper methods in {@link glow.anim}.
+
+                       Once you have created your animation instance, you can use
+                       events such as "frame" to change values over time.
+
+               @param {Number} duration Length of the animation in seconds / frames.
+
+                       Animations which are given a duration in seconds may drop frames to
+                       finish in the given time.
+
+               @param {Object} opts Object of options.
+
+               @param {Boolean} [opts.useSeconds=true] Specifies whether duration should be in seconds rather than frames.
+
+               @param {Function} [opts.tween=linear tween] The way the value moves through time.
+
+                       See {@link glow.tweens}.
+                       
+               @param {Boolean} [opts.destroyOnComplete=false] Destroy the animation once it completes?
+                       This will free any DOM references the animation may have created. Once
+                       the animation completes, you won't be able to start it again.
+                       
+               @param {Function} [opts.onStart] Shortcut for adding a "start" event listener
+               @param {Function} [opts.onFrame] Shortcut for adding a "frame" event listener
+               @param {Function} [opts.onStop] Shortcut for adding a "stop" event listener
+               @param {Function} [opts.onComplete] Shortcut for adding a "complete" event listener
+               @param {Function} [opts.onResume] Shortcut for adding a "resume" event listener
+
+               @example
+                       var myAnim = new glow.anim.Animation(5, {
+                               tween:glow.tweens.easeBoth()
+                       });
+
+               */
+
+               /**
+               @name glow.anim.Animation#event:start
+               @event
+               @description Fired when the animation is started from the beginning.
+               @param {glow.events.Event} event Event Object
+               @example
+                       var myAnim = new glow.anim.Animation(5, {
+                               tween:glow.tweens.easeBoth()
+                       });
+                       glow.events.addListener(myAnim, "start", function() {
+                               alert("Started animation which lasts " + this.duration + " seconds");
+                       });
+                       myAnim.start();
+               */
+
+               /**
+               @name glow.anim.Animation#event:frame
+               @event
+               @description Fired in each frame of the animation.
+
+                       This is where you'll specify what your animation does.
+               
+               @param {glow.events.Event} event Event Object
+               @example
+                       var myAnim = new glow.anim.Animation(5, {
+                               tween:glow.tweens.easeBoth()
+                       });
+                       
+                       var myDiv = glow.dom.get("#myDiv"),
+                           divStartHeight = myDiv.height(),
+                           divEndHeight = 500,
+                           divHeightChange = divEndHeight - divStartHeight;
+
+                       glow.events.addListener(myAnim, "frame", function() {
+                               myDiv.height(divStartHeight + (divHeightChange * this.value));
+                       });
+                       myAnim.start();
+               */
+
+               /**
+               @name glow.anim.Animation#event:stop
+               @event
+               @description Fired when the animation is stopped before its end.
+
+                       If your listener prevents the default action (for instance,
+                       by returning false) the animtion will not be stopped.
+               
+               @param {glow.events.Event} event Event Object
+               */
+
+               /**
+               @name glow.anim.Animation#event:complete
+               @event
+               @description Fired when the animation ends.
+               @param {glow.events.Event} event Event Object
+               */
+
+               /**
+               @name glow.anim.Animation#event:resume
+               @event
+               @description Fired when the animation resumes after being stopped.
+
+                       If your listener prevents the default action (for instance, by
+                       returning false) the animation will not be resumed.
+
+               @param {glow.events.Event} event Event Object
+               */
+               // constructor items that relate to events
+               var animationEventConstructorNames = ["onStart", "onStop", "onComplete", "onResume", "onFrame"];
+               
+               r.Animation = function(duration, opts) {
+                       this._opts = opts = glow.lang.apply({
+                               useSeconds: true,
+                               tween: glow.tweens.linear(),
+                               destroyOnComplete: false,
+                               onStart: null,
+                               onStop: null,
+                               onComplete: null,
+                               onResume: null,
+                               onFrame: null
+                       }, opts);
+
+                       /**
+                       @name glow.anim.Animation#_playing
+                       @type Boolean
+                       @private
+                       @default false
+                       @description Indicates whether the animation is playing.
+                       */
+                       this._playing = false;
+
+                       /**
+                       @name glow.anim.Animation#_timeAnchor
+                       @type Number
+                       @private
+                       @default null
+                       @description A timestamp used to keep the animation in the right position.
+                       */
+                       this._timeAnchor = null;
+
+                       /**
+                       @name glow.anim.Animation#duration
+                       @type Number
+                       @description Length of the animation in seconds / frames.
+                       */
+                       this.duration = duration;
+
+                       /**
+                       @name glow.anim.Animation#useSeconds
+                       @type Boolean
+                       @description Indicates whether duration is in seconds rather than frames.
+                       */
+                       this.useSeconds = opts.useSeconds;
+
+                       /**
+                       @name glow.anim.Animation#tween
+                       @type Function
+                       @description The tween used by the animation.
+                       */
+                       this.tween = opts.tween;
+
+                       /**
+                       @name glow.anim.Animation#position
+                       @type Number
+                       @default 0
+                       @description Seconds since starting, or current frame.
+                       */
+                       this.position = 0;
+
+                       /**
+                       @name glow.anim.Animation#value
+                       @type Number
+                       @default 0
+                       @description Current tweened value of the animtion, usually between 0 & 1.
+                               The value may become greater than 1 or less than 0 depending
+                               on the tween used.
+                               
+                               {@link glow.tweens.elasticOut} for instance will result
+                               in values higher than 1, but will still end at 1.
+                       */
+                       this.value = 0;
+                       
+                       // add events from constructor opts
+                       addEventsFromOpts(this, opts, animationEventConstructorNames);
+               };
+               r.Animation.prototype = {
+
+                       /**
+                       @name glow.anim.Animation#start
+                       @function
+                       @description Starts playing the animation from the beginning.
+                       @example
+                               var myAnim = new glow.anim.Animation(5, {
+                                       tween:glow.tweens.easeBoth()
+                               });
+                               //attach events here
+                               myAnim.start();
+                       @returns {glow.anim.Animation}
+                       */
+                       start: function() {
+                               if (this._playing) {
+                                       this.stop();
+                               }
+                               var e = events.fire(this, "start");
+                               if (e.defaultPrevented()) { return this; }
+                               this._timeAnchor = null;
+                               this.position = 0;
+                               manager.addToQueue(this);
+
+                               return this;
+                       },
+
+                       /**
+                       @name glow.anim.Animation#stop
+                       @function
+                       @description Stops the animation playing.
+                       @returns {glow.anim.Animation}
+                       */
+                       stop: function() {
+                               if (this._playing) {
+                                       var e = events.fire(this, "stop");
+                                       if (e.defaultPrevented()) { return this; }
+                                       manager.removeFromQueue(this);
+                               }
+                               return this;
+                       },
+                       
+                       /**
+                       @name glow.anim.Animation#destroy
+                       @function
+                       @description Destroys the animation & detatches references to DOM nodes
+                               Call this on animations you no longer need to free memory.
+                       @returns {glow.anim.Animation}
+                       */
+                       destroy: function() {
+                               // stop the animation in case it's still playing
+                               this.stop();
+                               events.removeAllListeners(this);
+                               return this;
+                       },
+
+                       /**
+                       @name glow.anim.Animation#resume
+                       @function
+                       @description Resumes the animation from where it was stopped.
+                       @returns {glow.anim.Animation}
+                       */
+                       resume: function() {
+                               if (! this._playing) {
+                                       var e = events.fire(this, "resume");
+                                       if (e.defaultPrevented()) { return this; }
+                                       //set the start time to cater for the pause
+                                       this._timeAnchor = new Date().valueOf() - (this.position * 1000);
+                                       manager.addToQueue(this);
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.anim.Animation#isPlaying
+                       @function
+                       @description Returns true if the animation is playing.
+                       @returns {Boolean}
+                       */
+                       isPlaying: function() {
+                               return this._playing;
+                       },
+                       /**
+                       @name glow.anim.Animation#goTo
+                       @function
+                       @description Goes to a specific point in the animation.
+                       @param {Number} pos Position in the animation to go to.
+
+                               This should be in the same units as the duration of your
+                               animation (seconds or frames).
+
+                       @example
+                               var myAnim = new glow.anim.Animation(5, {
+                                       tween:glow.tweens.easeBoth()
+                               });
+                               //attach events here
+                               //start the animation from half way through
+                               myAnim.goTo(2.5).resume();
+                       @returns this
+                       */
+                       goTo: function(pos) {
+                               this._timeAnchor = new Date().valueOf() - ((this.position = pos) * 1000);
+                               this.value = this.tween(this.duration && this.position / this.duration);
+                               events.fire(this, "frame");
+                               return this;
+                       }
+               };
+
+               /**
+               @name glow.anim.Timeline
+               @class
+               @description Synchronises and chains animations.
+               @param {Array | Array[]} channels An array of channels or a single channel.
+
+                       A channel is defined as an array containing numbers, animations and
+                       functions.
+
+                       Numbers indicate a number of seconds to wait before proceeding to
+                       the next item. Animations will be played, when the animation is
+                       complete the next item is processed. Functions will be called, then
+                       the next item is processed.
+
+               @param {Object} opts An object of options.
+               @param {Boolean} [opts.loop=false] Specifies whether the timeline loops.
+
+                       The "complete" event does not fire for looping animations.
+                       
+               @param {Boolean} [opts.destroyOnComplete=false] Destroy the animation once it completes?
+                       This will free any DOM references the animation may have created. Once
+                       the animation completes, you won't be able to start it again.
+                       
+               @param {Function} [opts.onStart] Shortcut for adding a "start" event listener
+               @param {Function} [opts.onStop] Shortcut for adding a "stop" event listener
+               @param {Function} [opts.onComplete] Shortcut for adding a "complete" event listener
+               @param {Function} [opts.onResume] Shortcut for adding a "resume" event listener
+
+               @example
+                       // in the simplest form, a timeline can be used to
+                       // string multiple animations together:
+                       
+
+                       // make our animations
+                       var moveUp = glow.anim.css(myDiv, 2, {
+                               "top": {to:"0"}
+                       });
+                       var moveDown = glow.anim.css(myDiv, 1, {
+                               "top": {to:"100px"}
+                       });
+                       // string them together
+                       new glow.anim.Timeline([moveUp, moveDown]).start();
+
+               @example
+                       // if you wanted a one second gap between the animations, the last line would be:
+                       new glow.anim.Timeline([moveUp, 1, moveDown]).start();
+
+               @example
+                       // you can run animations simutainiously with multiple channels.
+                       new glow.anim.Timeline([
+                               [moveDivUp, 1, moveDivDown],
+                               [moveListDown, 1, moveListUp]
+                       ]).start();
+               @see <a href="../furtherinfo/animtimeline/">Creating a mexican wave with an animation timeline</a>
+               */
+               /**
+               @name glow.anim.Timeline#event:start
+               @event
+               @description Fired when the timeline is started from the beginning.
+
+                       This event will also trigger during each loop of a looping animation.
+                       If your listener prevents the default action (for instance, by
+                       returning false) the timeline will not start.
+               
+               @param {glow.events.Event} event Event Object
+               @example
+                       var myTimeline = new glow.anim.Timeline([anim1, anim2]);
+                       glow.events.addListener(myTimeline, "start", function() {
+                               alert("Started timeline");
+                       });
+                       myTimeline.start();
+               */
+               /**
+               @name glow.anim.Timeline#event:stop
+               @event
+               @description Fired when the timeline is stopped before its end.
+
+                       If your listener prevents the default action (for instance, by
+                       returning false) the timeline will not stop.
+               
+               @param {glow.events.Event} event Event Object
+               */
+               /**
+               @name glow.anim.Timeline#event:complete
+               @event
+               @description Fired when the timeline ends.
+
+                       This event does not fire on looping timelines.
+               
+               @param {glow.events.Event} event Event Object
+               */
+               /**
+               @name glow.anim.Timeline#event:resume
+               @event
+               @description Fired when the timeline resumes after being stopped.
+
+                       If your listener prevents the default action (for instance, by
+                       returning false) the timeline will not resume.
+               
+               @param {glow.events.Event} event Event Object
+               */
+               var timelineEventConstructorNames = ["onStart", "onStop", "onComplete", "onResume"];
+               r.Timeline = function(channels, opts) {
+                       this._opts = opts = glow.lang.apply({
+                               loop: false,
+                               destroyOnComplete: false,
+                               onStart: null,
+                               onStop: null,
+                               onComplete: null,
+                               onResume: null
+                       }, opts);
+                       /*
+                       PrivateProperty: _channels
+                               Array of channels
+                       */
+                       //normalise channels so it's always an array of array(s)
+                       this._channels = (channels[0] && channels[0].push) ? channels : [channels];
+                       /*
+                       PrivateProperty: _channelPos
+                               index of each currently playing animation
+                       */
+                       this._channelPos = [];
+                       /*
+                       PrivateProperty: _playing
+                               Is the timeline playing?
+                       */
+                       this._playing = false;
+
+                       /**
+                       @name glow.anim.Timeline#loop
+                       @type Boolean
+                       @description Inidcates whether the timeline loops.
+
+                               The "complete" event does not fire for looping animations.
+                               This can be set while a timeline is playing.
+                       */
+                       this.loop = opts.loop;
+
+                       var i, j, iLen, jLen,
+                               channel,
+                               allChannels = this._channels,
+                               totalDuration = 0,
+                               channelDuration;
+
+                       //process channels
+                       for (i = 0, iLen = allChannels.length; i < iLen; i++) {
+                               channel = allChannels[i];
+                               channelDuration = 0;
+                               for (j = 0, jLen = channel.length; j < jLen; j++) {
+                                       //create a blank animation for time waiting
+                                       if (typeof channel[j] == "number") {
+                                               channel[j] = new r.Animation(channel[j]);
+                                       }
+                                       if (channel[j] instanceof r.Animation) {
+                                               if (! channel[j].useSeconds) {
+                                                       throw new Error("Timelined animations must be timed in seconds");
+                                               }
+                                               channel[j]._timelineOffset = channelDuration * 1000;
+                                               channelDuration += channel[j].duration;
+                                               channel[j]._channelIndex = i;
+                                       }
+                               }
+                               /**
+                               @name glow.anim.Timeline#duration
+                               @type Number
+                               @description Length of the animation in seconds
+                               */
+                               this.duration = totalDuration = Math.max(channelDuration, totalDuration);
+                       }
+                       /*
+                       PrivateProperty: _controlAnim
+                               This is used to keep the animation in time
+                       */
+                       this._controlAnim = new r.Animation(totalDuration);
+                       events.addListener(this._controlAnim, "frame", this._processFrame, this);
+                       events.addListener(this._controlAnim, "complete", this._complete, this);
+                       
+                       // add events from constructor
+                       addEventsFromOpts(this, opts, timelineEventConstructorNames);
+               };
+               r.Timeline.prototype = {
+                       /*
+                       PrivateMethod: _advanceChannel
+                               Move to the next position in a particular channel
+                       */
+                       _advanceChannel: function(i) {
+                               //is there a next animation in the channel?
+                               var currentAnim = this._channels[i][this._channelPos[i]],
+                                       nextAnim = this._channels[i][++this._channelPos[i]];
+
+                               if (currentAnim && currentAnim._playing) {
+                                       currentAnim._playing = false;
+                                       events.fire(currentAnim, "complete");
+                                       if (currentAnim._opts.destroyOnComplete) {
+                                               currentAnim.destroy();
+                                       }
+                               }
+                               if ((nextAnim) !== undefined) {
+                                       if (typeof nextAnim == "function") {
+                                               nextAnim();
+                                               this._advanceChannel(i);
+                                       } else {
+                                               nextAnim.position = 0;
+                                               nextAnim._channelIndex = i;
+                                               events.fire(nextAnim, "start");
+                                               nextAnim._playing = true;
+                                       }
+                               }
+                       },
+                       _complete: function() {
+                               if (this.loop) {
+                                       this.start();
+                                       return;
+                               }
+                               this._playing = false;
+                               events.fire(this, "complete");
+                               if (this._opts.destroyOnComplete) {
+                                       this.destroy();
+                               }
+                       },
+                       _processFrame: function() {
+                               var i, len, anim, controlAnim = this._controlAnim,
+                                       msFromStart = (new Date().valueOf()) - controlAnim._timeAnchor;
+
+                               for (i = 0, len = this._channels.length; i < len; i++) {
+                                       if (! (anim = this._channels[i][this._channelPos[i]])) { continue; }
+                                       anim.position = (msFromStart - anim._timelineOffset) / 1000;
+                                       if (anim.position > anim.duration) {
+                                               anim.position = anim.duration;
+                                       }
+                                       anim.value = anim.tween(anim.position / anim.duration);
+                                       events.fire(anim, "frame");
+                                       if (anim.position == anim.duration) {
+                                               this._advanceChannel(i);
+                                       }
+                               }
+                       },
+
+                       /**
+                       @name glow.anim.Timeline#start
+                       @function
+                       @description Starts playing the timeline from the beginning.
+                       @returns this
+                       */
+                       start: function() {
+                               var e = events.fire(this, "start");
+                               if (e.defaultPrevented()) { return this; }
+                               var i, iLen, j, jLen, anim;
+                               this._playing = true;
+                               for (i = 0, iLen = this._channels.length; i < iLen; i++) {
+                                       this._channelPos[i] = -1;
+                                       this._advanceChannel(i);
+                                       for (j = this._channels[i].length; j; j--) {
+                                               anim = this._channels[i][j];
+                                               if (anim instanceof r.Animation) {
+                                                       anim.goTo(0);
+                                               }
+                                       }
+                               }
+                               this._controlAnim.start();
+                               return this;
+                       },
+
+                       /**
+                       @name glow.anim.Timeline#stop
+                       @function
+                       @description Stops the timeline.
+                       @returns this
+                       */
+                       stop: function() {
+                               if (this._playing) {
+                                       var e = events.fire(this, "stop");
+                                       if (e.defaultPrevented()) { return this; }
+                                       this._playing = false;
+                                       var anim;
+                                       for (var i = 0, len = this._channels.length; i<len; i++) {
+                                               anim = this._channels[i][this._channelPos[i]];
+                                               if (anim instanceof r.Animation && anim._playing) {
+                                                       events.fire(anim, "stop");
+                                                       anim._playing = false;
+                                               }
+                                       }
+                                       this._controlAnim.stop();
+                               }
+                               return this;
+                       },
+                       
+                       /**
+                       @name glow.anim.Timeline#destroy
+                       @function
+                       @description Destroys the timeline & animations within it
+                               Call this on timeline you no longer need to free memory.
+                       @returns this
+                       */
+                       destroy: function() {
+                               var i, j;
+                               // stop the animation in case it's still playing
+                               this.stop();
+                               events.removeAllListeners(this);
+                               this._controlAnim.destroy();
+                               
+                               // loop through all the channels
+                               i = this._channels.length; while (i--) {
+                                       // loop through all the animations
+                                       j = this._channels[i].length; while (j--) {
+                                               // check it has a destroy method (making sure it's an animation & not a function)
+                                               if (this._channels[i][j].destroy) {
+                                                       // DESTROYYYYY!
+                                                       this._channels[i][j].destroy();
+                                               }
+                                       }
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.anim.Timeline#resume
+                       @function
+                       @description Resumes the timeline from wherever it was stopped.
+                       @returns this
+                       */
+                       resume: function() {
+                               if (! this._playing) {
+                                       var e = events.fire(this, "resume");
+                                       if (e.defaultPrevented()) { return this; }
+                                       this._playing = true;
+                                       var anim;
+                                       for (var i = 0, len = this._channels.length; i<len; i++) {
+                                               anim = this._channels[i][ this._channelPos[i] ];
+                                               if (anim instanceof r.Animation && !anim._playing) {
+                                                       events.fire(anim, "resume");
+                                                       anim._playing = true;
+                                               }
+                                       }
+                                       this._controlAnim.resume();
+                               }
+                               return this;
+                       },
+
+                       /**
+                       @name glow.anim.Timeline#isPlaying
+                       @function
+                       @returns {Boolean}
+                       @description Returns true if the timeline is playing.
+                       */
+                       isPlaying: function() {
+                               return this._playing;
+                       },
+                       
+                       /**
+                       @name glow.anim.Timeline#goTo
+                       @function
+                       @returns this
+                       @description Go to a specific point in the timeline
+                       @param {Number|glow.anim.Animation} pos Position in the timeline to go to.
+
+                               You can go to a specific point in time (in seconds) or provide
+                               a reference to a particular animation to begin at.
+
+                       @example
+                               var myTimeline = new glow.anim.Timeline([anim1, anim2]);
+                               
+                               //start the Timeline 2.5 seconds in
+                               myTimeline.goTo(2.5).resume();
+                               
+                       @example
+                               var myTimeline = new glow.anim.Timeline([anim1, anim2]);
+                               
+                               //start the Timeline from anim2
+                               myTimeline.goTo(anim2).resume();
+                       */
+                       goTo: function(pos) {
+                               var i,
+                                       j,
+                                       k,
+                                       channelsLen = this._channels.length,
+                                       channelLen,
+                                       // holding var for an anim
+                                       anim,
+                                       runningDuration;
+                               
+                               if (typeof pos == "number") {
+                                       
+                                       if (pos > this.duration) {
+                                               // if the position is greater than the total, 'loop' the value
+                                               if (this.loop) {
+                                                       pos = pos % this.duration;
+                                               } else {
+                                                       pos = this.duration;
+                                               }
+                                       }
+                                       
+                                       // advance the control anim
+                                       this._controlAnim.goTo(pos);
+                                       
+                                       // loop through the animations in all the channels, find out which
+                                       // one to start playing from
+                                       for (i = 0; i < channelsLen; i++) {
+
+                                               runningDuration = 0;
+                                               // go through animations in that channel
+                                               for (j = 0, channelLen = this._channels[i].length; j < channelLen; j++) {
+                                                       anim = this._channels[i][j];
+                                                       
+                                                       if (anim instanceof r.Animation) {
+                                                               // we found an animation we should be playing
+                                                               if ( (runningDuration + anim.duration) > pos) {
+                                                                       // record its position and leave the loop
+                                                                       this._channelPos[i] = j;
+                                                                       anim.goTo(pos - runningDuration);
+                                                                       break;
+                                                               }
+                                                               // we're moving to a position where this animation has
+                                                               // finished playing, need to fire its final frame
+                                                               anim.goTo(anim.duration);
+                                                               // add that anim to the running total
+                                                               runningDuration += anim.duration;
+                                                       }
+                                                       
+                                               }
+                                               // right, now we need to move all animations after this
+                                               // one to the start...
+                                               for (k = channelLen; k > j; k--) {
+                                                       anim.goTo(0);
+                                               }
+                                       }
+                               } else {
+                                       // ok, we've been provided with an object rather than a number of seconds
+                                       // Let's convert it to seconds and rerun this function
+                                       for (i = 0; i < channelsLen; i++) {
+                                               // let's count this to find out what "time" the item the user wants to play is at
+                                               runningDuration = 0;
+                                               
+                                               // let's loop through animations in that channel
+                                               for (j = 0, channelLen = this._channels[i].length; j < channelLen; j++) {
+                                                       anim = this._channels[i][j];
+                                                       
+                                                       if (anim === pos) {
+                                                               // oh! We've found the thing they want to play
+                                                               return this.goTo(runningDuration);
+                                                       }
+                                                       if (anim instanceof r.Animation) {
+                                                               // add that anim to the running total
+                                                               runningDuration += anim.duration;
+                                                       }
+                                               }
+                                       }
+                                       throw "Animation not found in animation channels";
+                               }
+                               return this;
+                       }
+               };
+               glow.anim = r;
+       }
+});
+/**
+       @name glow.forms
+       @namespace
+       @see <a href="../furtherinfo/forms/">Validating Forms</a>
+       @see <a href="../furtherinfo/forms/defaultfeedback/">Using default form feedback</a>
+       @see <a href="../furtherinfo/forms/example.shtml">Working example</a>
+       @description Validating HTML Forms.
+               To get started, you'll need to create a {@link glow.forms.Form Form instance}.
+ */
+(window.gloader || glow).module({
+       name: "glow.forms",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", 'glow.dom', 'glow.events', 'glow.anim', 'glow.net', 'glow.i18n']],
+       builder: function(glow) {
+
+       var $i18n = glow.i18n,
+               $interpolate = glow.lang.interpolate;
+
+       $i18n.addLocaleModule("GLOW_FORMS", "en", {
+               TEST_MESSAGE_REQUIRED  : "Value is required",
+               TEST_MESSAGE_IS_NUMBER : "Must be a number.",
+               TEST_MESSAGE_MIN       : "The value must be at least {arg}.",
+               TEST_MESSAGE_MAX       : "The value must be less than {arg}.",
+               TEST_MESSAGE_RANGE     : "The value must be {min} or greater, and less than {max}.",
+               TEST_MESSAGE_MIN_COUNT : "Must be have at least {arg} values.",
+               TEST_MESSAGE_MAX_COUNT : "Must be have at most {arg} values.",
+               TEST_MESSAGE_COUNT     : "Must have {arg} values.",
+               TEST_MESSAGE_REGEX     : "Must be in the correct format.",
+               TEST_MESSAGE_MIN_LEN   : "Must be at least {arg} characters.",
+               TEST_MESSAGE_MAX_LEN   : "Must be at most {arg} characters.",
+               TEST_MESSAGE_IS_EMAIL  : "Must be a valid email address.",
+               TEST_MESSAGE_SAME_AS   : "Must be the same as: {arg}",
+               TEST_MESSAGE_AJAX      : "server responded",
+               TEST_MESSAGE_IS        : "Must be {arg}",
+               TEST_MESSAGE_IS_NOT    : "Must not be {arg}"
+       });
+
+glow.forms = {};
+
+/**
+       @name glow.forms.Form
+       @constructor
+       @description Create an object to add tests to.
+       @see <a href="../furtherinfo/forms/">Validating Forms</a>
+       @see <a href="../furtherinfo/forms/defaultfeedback/">Using default form feedback</a>
+       @param {glow.dom.NodeList | Selector} formNode
+       @param {Object} [opts]
+       @param {Function} [opts.onValidate] Handles the 'validate' event when all tests are complete. Default is glow.forms.feedback.defaultFeedback.
+       @example
+       myForm = new glow.forms.Form(
+               glow.dom.get("#htmlFormId"),
+               {
+                       onValidate: function(results) {
+                               // ...
+                       }
+               }
+       );
+ */
+glow.forms.Form = function(formNode, opts) { /*debug*///console.log("glow.forms.Form#new("+formNode+", "+opts+")");
+       /**
+       @name glow.forms.Form#formNode
+       @type glow.dom.NodeList
+       @description NodeList containing the form element
+       */
+       this.formNode = glow.dom.get(formNode);
+       if (!this.formNode[0]) throw "Could not find form. Possibly run before DOM ready.";
+       this._fields = [];
+       this._result = null;
+       this.opts = opts || {};
+       glow.events.addListener(this, "validate", this.opts.onValidate || feedback.defaultFeedback);
+
+       this._idleTimer = null;
+       
+       this._localeModule = $i18n.getLocaleModule("GLOW_FORMS");
+
+       // add event listener to form
+       var thisForm = this;
+       glow.events.addListener(
+               this.formNode,
+               "submit",
+               function() {
+                       thisForm.validate('submit');
+                       return false; // submit() will be called from the nextField method instead
+               }
+       );
+}
+
+/**
+       @name glow.forms.Form#event:validate
+       @event
+       @description Fired whenever the glow tries to validate a form.
+       
+       If you prefer you can set a handler for this event via the <code>onValidate</code> option of the glow.forms.Form constructor.
+       
+       @param {glow.forms.ValidateResult} event A specialised Event object.
+       @example
+       
+       glow.events.addListener(myForm, "validate", function(e) {
+               if (e.eventName == 'submit') {
+                       if (e.errorCount == 0) { alert("Well done!"); }
+                       else { e.preventDefault(); } // stop the submit from happening
+               }
+       });
+ */
+
+/**
+       @name glow.forms.Form#validate
+       @function
+       @description Run validation tests.
+               This is called automatically depending on the tests added to the form.
+               However, you can trigger validation manually
+       @param {String} [eventName='submit'] Run only tests tied to this eventname.
+       @param {String} [fieldName] Run only tests attached to the form element with this name.
+ */
+glow.forms.Form.prototype.validate = function(eventName, fieldName) { /*debug*///console.log("glow.forms.Form#validate("+eventName+", "+fieldName+")");
+       this.eventName = eventName || 'submit'; // default
+       this._result = new glow.forms.ValidateResult(this.eventName);
+       this._result.form = this;
+
+       this._fieldCur = 0;
+       this._testCur = -1;
+
+       this._fieldName = fieldName;
+       nextTest.call(this);
+}
+
+/**
+       Advance the test cursor to get the next test in the queue and then run it.
+       @function
+       @name nextTest
+       @this {glow.forms.Form}
+       @calledBy glow.forms.Form#validate
+       @calledBy onTestResult
+       @private
+ */
+var nextTest = function() { /*debug*///console.log("glow.forms.Form#nextTest()");
+       this._testCur++;
+       if (this._testCur >= this._fields[this._fieldCur]._tests.length) { // run out of tests for the current field?
+               if (!nextField.call(this)) return;
+       }
+
+       var currentTest = this._fields[this._fieldCur]._tests[this._testCur]; // shortcut
+
+       // get value from form element, normalize into an array
+       var fieldValue;
+       if (currentTest.opts.field) { // a conditional test
+               fieldValue = this.formNode.val()[currentTest.opts.field] || "";
+               currentTest.isConditional = true;
+       }
+       else {
+               fieldValue = this.formNode.val()[this._fields[this._fieldCur].name] || "";
+       }
+
+       // values should always be an array
+       if (!fieldValue.join) fieldValue = [fieldValue];
+
+       var callback = function(that) { // closure
+               return function() { onTestResult.apply(that, arguments) };
+       }(this);
+
+       // only run tests that are tied to the eventName being validated
+       currentTest.opts.on = currentTest.opts.on || "submit";
+       if (
+               this._result.eventName
+               && (" "+currentTest.opts.on+" ").indexOf(" "+this._result.eventName+" ") != -1 // assume space delimited event names
+       ) {
+               // skip tests that are not tied to the fieldName being validated
+               if (this._fieldName && this._fieldName != currentTest.name) {
+                       nextTest.call(this);
+                       return;
+               }
+
+               // run the test, if it exists
+               if (typeof glow.forms.tests[currentTest.type] != "function") {
+                       throw "Unimplemented test: no test exists of type '"+currentTest.type+"'.";
+               }
+               
+               currentTest.opts._localeModule = this._localeModule;
+               glow.forms.tests[currentTest.type](fieldValue, currentTest.opts, callback, this.formNode.val());
+       }
+       else {
+               nextTest.call(this);
+       }
+}
+
+/**
+       Advance the field cursor to get the next field in the queue.
+       @function
+       @name nextField
+       @this {glow.forms.Form}
+       @calledBy glow.forms.Form#nextTest
+       @private
+ */
+var nextField = function() { /*debug*///console.log("glow.forms.Form#nextField()");
+       // start at the beginning of the next field
+       this._fieldCur++;
+       this._testCur = 0;
+
+       if (this._fieldCur >= this._fields.length) { // run out of fields?
+               this._fieldCur = 0;
+               // ready to fire the validate event now
+               glow.events.fire(this, "validate", this._result);
+               
+               if ( this.eventName == "submit" && this._result && !this._result.defaultPrevented() ) { // ready to submit now
+                       try {
+                               // we cannot initiate a form submit by simply returning true or false from
+                               // this event handler because there may be asynchronous tests still pending at this point,
+                               // so we must call submit ourselves, after the last field has finally been tested
+                               this.formNode[0].submit();
+                       }
+                       catch(e) {
+                               throw new Error("Glow can't submit the form because the submit function can't be called. Perhaps that form's submit was replaced by an input element named 'submit'?");
+                       }
+               }
+               
+               return false; // don't keep going
+       }
+
+       return true; // do keep going
+}
+
+/**
+       @name onTestResult
+       @function
+       @this {glow.forms.Form}
+       @calledBy glow.forms.tests.*
+       @param {Number} result One of: glow.forms.PASS, glow.forms.FAIL
+       @param {String} message
+       @private
+ */
+var onTestResult = function(result, message) { /*debug*///console.log("glow.forms.Form#onTestResult("+result+", "+message+")");
+       // convert result from a boolean to glow.forms.FAIL / glow.forms.PASS
+       if (typeof result == "boolean") result = (result)? glow.forms.PASS : glow.forms.FAIL;
+
+       // a conditional test has failed?
+       if (this._fields[this._fieldCur]._tests[this._testCur].isConditional && result === glow.forms.FAIL) {
+               result = glow.forms.SKIP; // failure of a conditional test becomes a skip
+       }
+
+       this._result.fields.push(
+               {
+                       name: this._fields[this._fieldCur].name,
+                       result: result,
+                       message: message
+               }
+       );
+
+       if (result !== glow.forms.PASS) { // might be a fail or a skip
+               if (result === glow.forms.FAIL) this._result.errorCount++;
+
+               // skip over all further tests for this field
+               this._testCur = this._fields[this._fieldCur]._tests.length;
+       }
+
+       nextTest.call(this);
+}
+
+/**
+       @name glow.forms.Form#addTests
+       @function
+       @description Add one or more tests to a field.
+       @param {String} fieldName The name of the field to add tests to.
+       @param {Array} [spec]
+       
+               Test specifications identify the type of test to be run on a field to
+               determine whether it contains desired data. See docs on the
+               {@link glow.forms.tests types of tests}.
+       
+       @example
+       //pattern for a test specification
+       [
+         "testName", //name of the test to run
+         {
+           arg     : 5,                //an argument for the test, not all tests need this
+           on      : "submit change",  //when should this test be run?
+           message : "Incorrect value" //a custom error message to display
+         }
+       ]
+       
+       @example
+       //setting a form up for validation
+       var myForm = new glow.forms.Form(glow.dom.get("#myFormId"))
+               .addTests(
+                       "username",
+                       ["required"],
+                       ["maxLen", {
+                               arg: 12,
+                               message: "Name must be les than 12 characters long."
+                       }]
+               )
+               .addTests(
+                       "email",
+                       ["isEmail"]
+               );
+ */
+glow.forms.Form.prototype.addTests = function(fieldName /*...*/) { /*debug*///console.log("glow.forms.Form#addTests("+fieldName+", ...)");
+       var field = {name: fieldName, _tests:[]};
+
+       var changeCallback = function(that) {
+               return function() {
+                       that.validate.apply(that, ["change", fieldName])
+               };
+       }(this);
+
+       var clickCallback = function(that) {
+               return function() {
+                       that.validate.apply(that, ["click", fieldName])
+               };
+       }(this);
+
+       var idleCallback = function(that) {
+               return function() {
+                       that.validate.apply(that, ["idle", fieldName]);
+               };
+       }(this);
+
+       // loop over test specifications
+       for (var i = 1; i < arguments.length; i++) {
+               var testType = arguments[i][0];
+               var testOpts = (arguments[i].length > 1)? arguments[i][1] : {}; // default opts
+
+               field._tests.push({name: fieldName, type: testType, opts: testOpts});
+
+               // add event listeners to form fields for change events
+               if (!changeCallback.added && (" "+testOpts.on+" ").indexOf(" change ") != -1) {
+                       var inputs = this.formNode.get("*").each(function (i) {
+                               if (this.name == fieldName) {
+                                       glow.events.addListener(this, "change", changeCallback);
+                                       changeCallback.added = true;
+                               }
+                       });
+               }
+
+               // add event listeners to form fields for click events
+               if (!clickCallback.added && (" "+testOpts.on+" ").indexOf(" click ") != -1) {
+                       var inputs = this.formNode.get("*").each(function (i) {
+                               if (this.name == fieldName) {
+                                       glow.events.addListener(this, "click", clickCallback);
+                                       clickCallback.added = true;
+                               }
+                       });
+               }
+
+               if (!idleCallback.added && (" "+testOpts.on+" ").indexOf(" idle ") != -1) {
+                       var idleDelay = (typeof testOpts.delay != "undefined")? parseInt(testOpts.delay) : 1000; // default delay before idle handler is run
+
+                       var inputs = this.formNode.get("*").each(function (i) {
+                               if (this.name == fieldName) {
+                                       // FIXME: adding idleTimeoutID to HTML element, is this the best way?
+                                       glow.events.addListener(this, "keyup", function(t){ return function() {window.clearTimeout(this.idleTimeoutID); if (this.value) this.idleTimeoutID = window.setTimeout(idleCallback, t)} }(idleDelay));
+                                       glow.events.addListener(this, "blur", function() {window.clearTimeout(this.idleTimeoutID)});
+
+                                       idleCallback.added = true;
+                               }
+                       });
+               }
+       }
+
+       this._fields.push(field);
+
+       return this; // chained
+}
+
+/**
+       @name glow.forms.ValidateResult
+       @constructor
+       @extends glow.events.Event
+       @description The overall result returned by an attempt to validate the current state of the form.
+       
+       The ValidateResult object is used by glow.forms.Form to accumulate and record the test results as they are run. It is created automatically by the running validation so it is not necessary for the user to instantiate it directly, but it is useful to know the properties and their meanings as these will likely be referred to when a custom <code>onValidate</code> handler is run.
+       @param {String} eventName
+       @property {String} eventName The name of the event that was associated with this validation event.
+       
+       Validation can happen based on one of several different user interactions, this property allows you to identify the type of interaction that initiated this validation. Examples are:
+       
+               <dl>
+                       <dt>submit</dt>
+                       <dd>The user has done something to submit the form, for example by pressing the Submit button.</dd>
+                       <dt>change</dt>
+                       <dd>The user has modified the value of a form field.</dd>
+                       <dt>idle</dt>
+                       <dd>The user is typing in a form field but has paused for a moment (by default 1 second).</dd>
+                       <dt>click</dt>
+                       <dd>The user has clicked the mouse on or in a form field.</dd>
+               </dl>
+       
+       Which user interaction is associated with which tests is determined by the options you used when you added the test. See the documentation for {@link glow.forms.Form#addTests} for more information. 
+       
+       @property {Object[]} fields Each object in this array has a name of a field, a test result such as glow.forms.PASS, glow.forms.FAIL or glow.forms.SKIP, and a message describing the test result.
+       
+       The effect of validation is that the value or state of each field in the form is compared to the tests the developer has added to the fields. In each tested field a determination is made that the current value either passes or fails (or, if the test wasn't run at all, is skipped). The <code>fields</code> property provides information on the overall result of the validation, on each field that was tested and the results.
+       
+       @property {Number} errorCount The number of fields that had a failing test.
+       
+       From the <code>fields</code> property you can determine how many fields have failing or passing values; this is property is simply a more convenient way to access the total failing count of tests that fail. If no tests fail then this value will be 0 and you can consider the form to have validated.
+       
+ */
+glow.forms.ValidateResult = function(eventName) {
+       glow.events.Event.apply(this);
+
+       this.eventName = eventName;
+       this.errorCount = 0;
+       this.value = undefined;
+       this.fields = [];
+}
+
+glow.lang.extend(glow.forms.ValidateResult, glow.events.Event);
+
+/**
+       @name glow.forms.PASS
+       @type Number
+       @description Constant for a passed test.
+               This indicates that the value in a field passes all the tests associated with it. You can use this when creating {@link glow.forms.tests.custom custom tests}
+ */
+glow.forms.PASS =  1;
+/**
+       @name glow.forms.FAIL
+       @type Number
+       @description Constant for a failing test.
+               This indicates that the value in a field fails at least one of the tests associated with it. You can use this when creating {@link glow.forms.tests.custom custom tests}
+ */
+glow.forms.FAIL =  0;
+/**
+       @name glow.forms.SKIP
+       @type Number
+       @description Constant for a skipped test.
+               This indicates that there was some unmet condition associated with the applied tests, so they were not run. This state is not considered a fail, and will not affect glow.forms.ValidateResult#errorCount. You can use this when creating {@link glow.forms.tests.custom custom tests}.
+ */
+glow.forms.SKIP = -1;
+
+/**
+       @name glow.forms.tests
+       @namespace
+       @see <a href="../furtherinfo/forms/">Validating Forms</a>
+       @see <a href="../furtherinfo/forms/example.shtml">Working example</a>
+       @description Collection of built-in tests that can be added to any form field as a way of validating that field's value.
+
+       <p>You do not need to call these functions directly, the devloper use a test by passing its name to the {@link glow.forms.Form#addTests addTests} method.</p>
+
+       <p>For more information about tests, how to create your own custom tests, or to see what arguments these tests take, you may refer to the <a href="../furtherinfo/forms/#custom_tests">Creating
+       Custom Tests</a> section of the Validating Forms user guide.</p>
+ */
+glow.forms.tests = {
+       /**
+               @name glow.forms.tests.required
+               @function
+               @description The value must contain at least one non-whitespace character.
+               
+               A text input field that is empty, or contains only spaces for example will fail this test.
+               
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["required"]
+               );
+        */
+       required: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.required()");
+               var message = opts.message || opts._localeModule.TEST_MESSAGE_REQUIRED;
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (/^\s*$/.test(values[i])) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.isNumber
+               @function
+               @description The value must be a valid number.
+               
+               A field that is empty, or contains a value that is not a number like 1 or 3.14 will fail this test.
+               
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["isNumber"]
+               );
+        */
+       isNumber: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.isNumber()");
+               var message = opts.message || opts._localeModule.TEST_MESSAGE_IS_NUMBER;
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i] == "" || isNaN(values[i])) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.min
+               @function
+               @description The numeric value must be at least the given value.
+               
+               A field whose value, when converted to a number, is not less than the given arg will fail this test.
+               
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["min", {
+                               arg: "1"
+                       }]
+               );
+        */
+       min: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.min()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_MIN, {arg: opts.arg});
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (Number(values[i]) < Number(opts.arg)) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.max
+               @function
+               @description The numeric value must be no more than the given value.
+               
+               A field whose value, when converted to a number, is not more than the given arg will fail this test.
+               
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["max", {
+                               arg: "100"
+                       }]
+               );
+        */
+       max: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.max()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_MAX, {arg: opts.arg});
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (Number(values[i]) > Number(opts.arg)) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.range
+               @function
+               @description The numeric value must be between x..y.
+               
+               A field whose value, when converted to a number, is not more than x and less than y will fail this test.
+               
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["range", {
+                               arg: "18..118"
+                       }]
+               );
+        */
+       range: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.range()");
+               var minmax = opts.arg.split(".."); // like "0..10"
+               if (typeof minmax[0] == "undefined" || typeof minmax[1] == "undefined") {
+                       throw "Range test requires a parameter like 0..10."
+               }
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_RANGE, {min: minmax[0], max : minmax[1]});
+
+               // cast to numbers to avoid stringy comparisons
+               minmax[0] *= 1;
+               minmax[1] *= 1;
+
+               // reverse if the order is hi..lo
+               if (minmax[0] > minmax[1]) {
+                       var temp = minmax[0];
+                       minmax[0] = minmax[1];
+                       minmax[1] = temp;
+               }
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i] < minmax[0] || values[i] > minmax[1]) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.minCount
+               @function
+               @description There must be at least the given number of values submitted with this name.
+                       This is useful for multiple selects and checkboxes that have the same name.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["minCount", {
+                               arg: "1"
+                       }]
+               );
+        */
+       minCount: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.minCount()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_MIN_COUNT, {arg: opts.arg});
+
+               var count = 0;
+
+               for (var i = 0; i < values.length; i++ ) {
+                       if (values[i] != "") count++;
+               }
+
+               if (count < opts.arg) {
+                       callback(glow.forms.FAIL, message);
+                       return;
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.maxCount
+               @function
+               @description There must be no more than the given number of values submitted with this name.
+                       This is useful for multiple selects and checkboxes that have the same name.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["maxCount", {
+                               arg: "10"
+                       }]
+               );
+        */
+       maxCount: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.maxCount()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_MAX_COUNT, {arg: opts.arg});
+
+               var count = 0;
+
+               for (var i = 0; i < values.length; i++ ) {
+                       if (values[i] != "") count++;
+               }
+
+               if (count > opts.arg) {
+                       callback(glow.forms.FAIL, message);
+                       return;
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.count
+               @function
+               @description There must be exactly the given number of values submitted with this name.
+                       This is useful for multiple selects and checkboxes that have the same name.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["count", {
+                               arg: "2"
+                       }]
+               );
+        */
+       count: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.count()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_COUNT, {arg: opts.arg});
+
+               var count = 0;
+
+               for (var i = 0; i < values.length; i++ ) {
+                       if (values[i] != "") count++;
+               }
+
+               if (count != opts.arg) {
+                       callback(glow.forms.FAIL, message);
+                       return;
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.regex
+               @function
+               @description The value must match the given regular expression.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["regex", {
+                               arg: /^[A-Z0-9]*$/
+                       }]
+               );
+        */
+       regex: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.regex()");
+               var message = opts.message || opts._localeModule.TEST_MESSAGE_REGEX;
+
+               var regex = (typeof opts.arg == "string")? new RegExp(opts.arg) : opts.arg; // if its not a string assume its a regex literal
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (!regex.test(values[i])) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.minLen
+               @function
+               @description The value must be at least the given number of characters long.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["minLen", {
+                               arg: "3"
+                       }]
+               );
+        */
+       minLen: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.minLen()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_MIN_LEN, {arg: opts.arg});
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i].length < opts.arg) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.maxLen
+               @function
+               @description The value must be at most the given number of characters long.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["maxLen", {
+                               arg: "24"
+                       }]
+               );
+        */
+       maxLen: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.maxLen()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_MAX_LEN, {arg: opts.arg});
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i].length > opts.arg) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.isEmail
+               @function
+               @description The value must be a valid email address.
+                       This checks the formatting of the address, not whether the address
+                       exists.
+               @example
+               myForm.addTests(
+                       "fieldName",
+                       ["isEmail"]
+               );
+        */
+       isEmail: function(values, opts, callback) { /*debug*///console.log("glow.forms.tests.isEmail()");
+               var message = opts.message || opts._localeModule.TEST_MESSAGE_IS_EMAIL;
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (!/^\s*[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\s*$/i.test(values[i])) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.sameAs
+               @function
+               @description The value must be the same as the value in the given field.
+               @example
+               myForm.addTests(
+                       "email_confirm",
+                       ["sameAs", {
+                               arg: "email"
+                       }]
+               );
+        */
+       sameAs: function(values, opts, callback, formValues) { /*debug*///console.log("glow.forms.tests.sameAs()");
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_SAME_AS, {arg: opts.arg});
+               var compareTo = formValues[opts.arg];
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i] != compareTo) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.ajax
+               @function
+               @description Send the data to the server for testing.
+                       A request to the given URL will be made and the response will be passed to the given callback.
+                       
+                       'arg' is the function to handle the response from the server.
+                       
+                       This function should return a truthy value to indicate whether the server 
+                       response should be considered a PASS or a FAIL. Optionally you can include a bespoke
+                       error message by returning an array of two elements, the first being
+                       the PASS or FAIL verdict, and the second being the error message to display.
+                       
+                       'url' is the url to call. You can use placeholders in here for form values (see example).
+               @example
+               
+               myForm.addTests(
+                       "username",
+                       ["ajax", {
+                               url: "/cgi/checkname.cgi?name={username}",
+                               arg: function (response) {
+                                       if (response.text() == "OK") {
+                                               return glow.forms.PASS;
+                                       } else {
+                                               return [glow.forms.FAIL, "That name is already taken."];
+                                       }
+                               },
+                               message: "The server responded: that name is not permitted."
+                       }]
+               );
+        */
+       ajax: function(values, opts, callback, formValues) { /*debug*///console.log("glow.forms.tests.ajax() - "+opts.url);
+               var queryValues = {},
+                   message = (opts.message || opts._localeModule.TEST_MESSAGE_AJAX);
+                   
+               for (var p in formValues) {
+                       if (typeof formValues[p] == "string") {
+                               queryValues[p] = escape(formValues[p]);
+                       }
+                       else if (typeof formValues[p].push != "undefined") {
+                               queryValues[p] = glow.lang.map(formValues[p], function(i) { return escape(i); }).join(",");
+                       }
+               }
+               var url = glow.lang.interpolate(opts.url, queryValues);
+
+               var request = glow.net.get(url, {
+                       onLoad: function(response) { /*debug*///console.log("glow.forms.tests.ajax - onLoad()");
+                               var verdict = opts.arg(response);
+                               if (typeof verdict.push == "undefined") verdict = [verdict, message];
+                               callback(verdict[0], verdict[1]);
+                       },
+                       onError: function(response) {
+                               alert("Error getting file: "+url);
+                       }
+               });
+       }
+       ,
+       /**
+               @name glow.forms.tests.custom
+               @function
+               @description Create a custom test.
+               
+                       'arg' is a function which tests the form value.
+                       
+                       The function is given the following parameters:
+                       
+                       <dl>
+                               <dt>values</dt>
+                               <dd>
+                                       An array of values submitted for that form field. If you
+                                       are only expecting one value, it can be accessed via values[0]
+                               </dd>
+                               <dt>opts</dt>
+                               <dd>
+                                       An object of any additional data included with the test
+                               </dd>
+                               <dt>callback</dt>
+                               <dd>
+                                       This is a function used to tell Glow whether the test has
+                                       passed or not. A callback is used rather than 'return' to
+                                       allow async tests. The first parameter is either glow.forms.PASS
+                                       or glow.forms.FAIL, the second is the success or failure message.
+                               </dd>
+                               <dt>formData</dt>
+                               <dd>
+                                       This is an object of all values captured in the form.
+                               </dd>
+                       </dl>
+               
+               @example
+               myForm.addTests(
+                       "username",
+                       ["custom", {
+                               arg: function(values, opts, callback, formData) {
+                                       for (var i = 0, len = values.length; i < len; i++) {
+                                               if (values[i] == "Jake") {
+                                                       callback(glow.forms.FAIL, "The name Jake is not allowed.");
+                                                       return;
+                                               }
+                                       }
+                                       callback(glow.forms.PASS, "Good name.");
+                               }
+                       }]
+               );
+        */
+       custom: function(values, opts, callback) {  /*debug*///console.log("glow.forms.tests.custom()");
+               opts.arg.apply(this, arguments);
+       }
+       ,
+       /**
+               @name glow.forms.tests.is
+               @function
+               @description The value must be equal to a particular value
+               @example
+               // this test ensures "other" is required *if* the "reason" field is equal to "otherReason"
+               myForm.addTests(
+                       "other",
+                       ["is", {
+                               field: "reason",
+                               arg: "otherReason"
+                       }],
+                       ["required"]
+               );
+        */
+       "is": function(values, opts, callback) {
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_IS, {arg: opts.arg});
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i] != opts.arg) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+       ,
+       /**
+               @name glow.forms.tests.isNot
+               @function
+               @description The value must not be equal to a particular value
+               @example
+               // you may have a dropdown select where the first option is "none" for serverside reasons
+               myForm.addTests(
+                       "gender",
+                       ["isNot", {
+                               arg: "none"
+                       }]
+               );
+        */
+       "isNot": function(values, opts, callback) {
+               var message = opts.message || $interpolate(opts._localeModule.TEST_MESSAGE_IS_NOT, {arg: opts.arg});
+
+               for (var i = 0, len = values.length; i < len; i++) {
+                       if (values[i] == opts.arg) {
+                               callback(glow.forms.FAIL, message);
+                               return;
+                       }
+               }
+               callback(glow.forms.PASS, message);
+       }
+}
+
+
+/**
+@name glow.forms.feedback
+@namespace
+@description Collection of functions for displaying validation results to the user
+
+  <p>These functions should be used as handlers for {@link glow.forms.Form}'s validate event. At the
+  moment there is only one provided handler, more may be added in the future.</p>
+
+  <p>Of course, you don't have to use any of the methods here, you can provide your own.</p>
+
+@see <a href="../furtherinfo/forms/defaultfeedback">Using the default form feedback</a>
+*/
+
+var feedback = glow.forms.feedback = {};
+
+/**
+@name glow.forms.feedback.defaultFeedback
+@function
+@description Default handler used by {@link glow.forms.Form}.
+
+  <p>This method outputs messages to the user informing them which fields
+  contain invalid data. The output is unstyled and flexible.</p>
+
+@param {glow.forms.ValidateResult} result Object provided by the validate event
+
+@see <a href="../furtherinfo/forms/defaultfeedback">Using the default form feedback</a>
+*/
+feedback.defaultFeedback = (function() {
+       
+       //a hidden form element used to update a screenreader's buffer
+       var screenReaderBufferUpdater;
+       
+       //attempts to update the buffer of the screen reader
+       function updateScreenReaderBuffer() {
+               if (!screenReaderBufferUpdater) {
+                       screenReaderBufferUpdater = glow.dom.create('<input type="hidden" value="0" name="1.7.0" id="1.7.0" />').appendTo(document.body);
+               }
+               screenReaderBufferUpdater[0].value++;
+       }
+       
+       //write out the messages which appear next to (or near) the fields
+       function inlineErrors(response) {
+               var fields = response.fields, //field test results
+                       fieldElm, //holder for the field element(s) being processed
+                       msgContainer, //holder for contextual message holder
+                       labelError, //error holder within label element
+                       i, len;
+
+               for (i = 0, len = fields.length; i < len; i++) {
+                       fieldElm = glow.dom.get(response.form.formNode[0].elements[fields[i].name]);
+                       //here's where we get the error container, which is the label by default
+                       //also we need to escape invalid css chars CSS
+                       msgContainer = glow.dom.get("." + fields[i].name.replace(/(\W)/g, "\\$1") + "-msgContainer");
+                       if (!msgContainer[0] && fieldElm.length == 1) {
+                               //none found, try and get the label
+                               msgContainer = response.form.formNode.get("label").filter(function() { return this.htmlFor == fieldElm[0].id })
+                       }
+
+                       labelError = msgContainer.get("span.glow-errorMsg");
+
+                       if (fields[i].result) {
+                               //clear error messages & classes
+                               labelError.remove();
+                               fieldElm.removeClass("glow-invalid");
+                       } else {
+                               if (msgContainer.length) {
+                                       //add the error span to the label if it isn't already there
+                                       if (!labelError[0]) {
+                                               msgContainer.append( (labelError = glow.dom.create('<span class="glow-errorMsg"></span>')) );
+                                       }
+                                       labelError.text(fields[i].message);
+                                       fieldElm.addClass("glow-invalid");
+                               }
+                       }
+               }
+       }
+
+       //write out a list of errors to appear at the top of the form
+       function summaryError(response) {
+               var fields = response.fields, //field test results
+                       fieldElm, //holder for the field element(s) being processed
+                       errorSummary, //div containing error summary
+                       errorList, //list of errors inside the error summary
+                       promptContainer, //holds the 'question' of the field
+                       prompt, //text to prefix each error line with
+                       i,
+                       len;
+
+               //remove existing summary
+               response.form.formNode.get("div.glow-errorSummary").remove();
+               //create a summary div
+               errorSummary = glow.dom.create('<div class="glow-errorSummary" tabindex="-1"><ul></ul></div>');
+               errorList = errorSummary.get("ul");
+               for (i = 0, len = fields.length; i < len; i++) {
+                       fieldElm = glow.dom.get(response.form.formNode[0].elements[fields[i].name]);
+                       promptContainer = glow.dom.get("." + fields[i].name.replace(/(\W)/g, "\\$1") + "-prompt");
+                       if (!promptContainer[0] && fieldElm.length == 1) {
+                               //we don't have a default, get the label
+                               promptContainer = response.form.formNode.get("label").filter(function() { return this.htmlFor == fieldElm[0].id })
+                       }
+                       //did we get a prompt container?
+                       if (promptContainer[0]) {
+                               //get rid of superflous content in the prompt container (such as errors)
+                               promptContainer.get("span.glow-errorMsg").remove();
+                               prompt = glow.lang.trim(promptContainer.text());
+                               if (prompt.slice(-1) == ":") {
+                                       prompt = prompt.slice(0, -1);
+                               }
+                       } else {
+                               //else we just use the field name
+                               prompt = fields[i].name.replace(/^\w/, function(s) { return s.toUpperCase() } );
+                       }
+
+                       if (!fields[i].result) {
+                               errorList.append( glow.dom.create("<li></li>").text(prompt + ": " + fields[i].message) );
+                       }
+               }
+               response.form.formNode.prepend(errorSummary.css("opacity", "0"));
+               glow.anim.css(errorSummary, "0.5", {
+                       opacity: {from: 0, to: 1}
+               }, {tween: glow.tweens.easeOut()}).start();
+               
+               // if the error summary has been hidden, IE7 throws an exception here
+               try {           
+                       errorSummary[0].focus();
+               } catch (e) {}
+               
+               updateScreenReaderBuffer();
+       }
+
+       return function(response) {
+               if (response.eventName == "submit") {
+                       //do we have any errors?
+                       if (!response.errorCount) {
+                               //remove existing summary
+                               response.form.formNode.get("div.glow-errorSummary").remove();
+                               return;
+                       }
+                       summaryError(response);
+               }
+               // display inline errors
+               // we put this inside setTimeout to avoid an IE bug that can result
+               // in the cursor appearing outside the form element
+               setTimeout(function() {
+                       inlineErrors(response);
+               }, 0);
+               
+               return false;
+       }
+}());
+
+       }
+});
+/**
+@name glow.embed
+@namespace
+@description Detect and embed Flash objects
+@see <a href="../furtherinfo/embed/">Flash embedding</a>
+*/
+(window.gloader || glow).module({
+       name: "glow.embed",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", "glow.dom", "glow.data", "glow.i18n"]],
+       builder: function(glow) {
+
+               var $i18n = glow.i18n;
+               
+               $i18n.addLocaleModule("GLOW_EMBED", "en", {
+                       FLASH_MESSAGE : "This content requires Flash Player version {min} (installed version: {installed})",
+                       NO_PLAYER_MESSAGE : "No Flash Flayer installed, or version is pre 6.0.0"
+               });
+
+               /**
+               @name to_attributes
+               @private
+               @function
+               @param object
+               @returns attribute string suitable for inclusion within Flash embed/object tag
+               @description converts a hash to a space delimited string of attribute assignments
+
+                       Simple values are assumed for the object properties, with the exception of
+                       'flashVars' which is treated as a special case. If 'flashVars' is itself an object,
+                       it will be serialised in querystring format.
+                       returns string representation of object as attribute assignments eg:
+                       {id:"myId",name:"my-name"}  becomes  'id="myId" name="my-name"'
+
+               */
+               function to_attributes(object){
+
+                       var attributes = "";
+
+                       for (var $param in object){
+                               if ($param.toLowerCase() == "flashvars" && typeof object[$param] == "object"){
+                                       attributes += ' FlashVars="' + glow.data.encodeUrl(object[$param]) + '"';
+                               }
+                               else {
+                                       attributes += ' ' + $param + '="' + object[$param] + '"';
+                               }
+                       }
+                       return attributes;
+               }
+
+               /**
+               @name toParams
+               @private
+               @function
+               @param object
+               @returns string of param tags or an object element
+               @description converts a hash to a string of param tags
+
+                       Simple values are assumed for the object properties, with the exception of
+                       'flashVars' which is treated as a special case. If 'flashVars' is itself an object,
+                       it will be serialised in querystring format.
+               */
+               function toParams(object) {
+                       var r = "",
+                               key,
+                               value;
+
+                       for (key in object) {
+                               if (key.toLowerCase() == "flashvars" && typeof object[key] == "object"){
+                                       value = glow.data.encodeUrl(object[key]);
+                               } else {
+                                       value = object[key];
+                               }
+
+                               r += '<param name="' + key + '" value="' + value + '" />\n';
+                       }
+                       return r;
+               }
+
+               /**
+               @name _set_defaults
+               @private
+               @function
+               @param target
+               @param options
+               @returns
+               @description applies a hash of default property values to a target object
+
+                       Properties on the defaults object are copied to the target object if no such property is present.
+
+               */
+               function _set_defaults(target,defaults){
+                       target = target || {};
+
+                       for (var param in defaults) {
+                               if (typeof target[param] == "undefined") {
+                                       // is it safe to assign an object reference or should it be cloned ?
+                                       target[param] = defaults[param];
+                               }
+                               else if (typeof defaults[param] == "object") {
+                                       target[param] = _set_defaults(target[param],defaults[param]);
+                               }
+                       }
+
+                       return target;
+               }
+
+               /**
+                @name _platform
+                @private
+                @returns {string} 'win' or 'mac' or 'other'
+                @description identify the operating system
+                */
+               function _platform(){
+                       var platform = (navigator.platform || navigator.userAgent);
+                       return platform.match(/win/i) ? "win" : platform.match(/mac/i) ? "mac" : "other";
+               }
+
+               /**
+               @name _askFlashPlayerForVersion
+               @private
+               @function
+               @param {Shockwave.Flash} flash_player a reference to an ActiveX Shockwave Flash player object
+               @returns version object with structure: {major:n,minor:n,release:n,actual:"string"}
+               @description returns flash_player version, as reported by the GetVariable("$version") method
+               */
+               function _askFlashPlayerForVersion(flash_player){
+
+                       var $regexFLASH_VERSION = /^WIN (\d+),(\d+),(\d+),\d+$/;
+                       var $version = flash_player.GetVariable("$version");
+                       if ($match = $regexFLASH_VERSION.exec($version)){
+                               return {
+                                       major   : parseInt($match[1]),
+                                       minor   : parseInt($match[2]),
+                                       release : parseInt($match[3]),
+                                       actual  : $version
+                               };
+                       }
+                       else {
+                               // throw an exception, something very strange going on if flash player returns version in any other format ?
+
+                       }
+               }
+
+               /**
+               @name _getFlashPlayerVersion
+               @private
+               @function
+               @returns version object with structure: {major:n,minor:n,release:n,actual:"string"}
+               @description returns flash_player version
+
+                       Query installed Flash player version, using either ActiveX object creation (for Internet Explorer) or
+                       navigator plugins collection.
+
+               */
+               function _getFlashPlayerVersion(){
+                       var $match, flash_player, NO_FLASH = {major : 0, minor : 0, release : 0}, result = NO_FLASH;
+                       
+                       if (glow.env.ie){
+                               try {
+                                       flash_player = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+                                       result = _askFlashPlayerForVersion(flash_player);
+                               }
+                               catch(e){
+                                       // Version 6 needs kid-glove treatment as releases 21 thru 29 crash if GetVariable("$version") is called
+                                       try {
+                                               flash_player = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                                               try {
+                                                       // This works from release 47 onward...(first public release after 29)
+                                                       flash_player.AllowScriptAccess = "always";
+                                                       result = _askFlashPlayerForVersion(flash_player);
+                                               }
+                                               catch(e){
+                                                       // we cannot safely test between releases 21...29, so assume the latest and hope for the best...
+                                                       result = {major:6,minor:0,release:29};
+                                               }
+                                       }
+                                       catch (e){
+                                               // nothing more we can do, either no flash installed, flash player version is ancient or ActiveX is disabled
+                                       }
+                               }
+                       }
+                       else {
+                               var regexFLASH_VERSION = /^Shockwave Flash\s*(\d+)\.(\d+)\s*\w(\d+)$/;
+
+                               if ((flash_player = navigator.plugins["Shockwave Flash"]) && ($match = regexFLASH_VERSION.exec(flash_player.description))){
+                                       result = {
+                                               major   : parseInt($match[1]),
+                                               minor   : parseInt($match[2]),
+                                               release : parseInt($match[3]),
+                                               actual  : flash_player.description
+                                       };
+                               }
+                       }
+
+                       result.toString = function(){return this.major ? [this.major,this.minor,this.release].join(".") : $i18n.getLocaleModule("GLOW_EMBED").NO_PLAYER_MESSAGE};
+
+                       return result;
+
+               }
+
+               /**
+                @name installed_flash_player
+                @private
+                @description version of installed Flash player, initialised at startup.
+                */
+               var installed_flash_player = _getFlashPlayerVersion();
+
+
+               /**
+               @name _meetsVersionRequirements
+               @private
+               @function
+               @param {string|object} requiredVersion string or version object
+
+                       major version must be specified. minor version is optional. release is optional, but both major and
+                       minor versions must also be supplied if release is specified.
+                       eg, as string:  "9.0.0",  "9.1",  "9"
+                       or, as object:  {major:9,minor:0,release:0},  {major:9,minor:0}, {major:9}
+
+               @returns {boolean}.
+               @description returns true if installed Flash player version meets requested version requirements
+
+               */
+               function _meetsVersionRequirements(requiredVersion){
+
+                       if (typeof requiredVersion != "object"){
+                               var match = String(requiredVersion).match(/^(\d+)(?:\.(\d+)(?:\.(\d+))?)?$/);
+                               if (!match){
+                                       throw new Error('glow.embed._meetsVersionRequirements: invalid format for version string, require "n.n.n" or "n.n" or simply "n" where n is a numeric value');
+                               }
+
+                               requiredVersion = {
+                                       major   : parseInt(match[1],10),
+                                       minor   : parseInt(match[2]||0,10),
+                                       release : parseInt(match[3]||0,10)
+                               }
+                       }
+
+                       var v = installed_flash_player, rv = requiredVersion;
+
+                       // return true if we meet the minimum version requirement...
+                       return (v.major > rv.major ||
+                          (v.major == rv.major && v.minor > rv.minor) ||
+                          (v.major == rv.major && v.minor == rv.minor && v.release >= rv.release));
+
+               }
+
+               /**
+               @name _wrap_embedding_tag
+               @private
+               @function
+               @param {string} src
+               @param {object} attributes Hash of attributes to be included
+               @param {string} params Hash of params to be included. These will be included as attributes for all but IE
+               @returns {string} object or embed tag
+               @description returns a complete object or embed tag, as appropriate (ie browser dependent)
+               */
+               var _wrap_embedding_tag = glow.env.ie ? _wrap_object_tag : _wrap_embed_tag;
+               function _wrap_embed_tag(src, attributes, params){
+                       return '<embed type="application/x-shockwave-flash" src="' + src + '"' + to_attributes(attributes) + to_attributes(params) + '></embed>';
+               }
+               function _wrap_object_tag(src, attributes, params){
+                       return '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + to_attributes(attributes) + '><param name="movie" value="' + src + '" />' + toParams(params) + '</object>';
+               }
+
+               var r = {},
+                       idIndex = 0; // Used with private function _getId()
+
+               /**
+               @name _getId()
+               @private
+               @function
+               @returns {string} unique string to use for id of a flash object
+               @description Returns a unique to the page string to use for the id of the flash object.  This function ensures that all flash objects embedded into the page get an id.
+               */
+               function _getId() {
+                       return glow.UID + "FlashEmbed" + (idIndex++);
+               }
+
+               /**
+               @name glow.embed.Flash
+               @class
+               @description A wrapper for a Flash movie so it can be embedded into a page
+               @see <a href="../furtherinfo/embed/">Flash embedding</a>
+
+               @param {String} src Absolute or relative URL of a Flash movie file to embed
+               @param {selector | glow.dom.NodeList} container The element to embed the movie into
+
+                       <p>If a CSS selector is provided then the first matching element is used as the
+                       container.</p>
+
+                       <p>If the parameter is a {@link glow.dom.NodeList}, then the first
+                       element of the list is used as the container.</p>
+
+               @param {String|Object} minVersion The minimum required version of the Flash plugin.
+
+                       <p>The Flash plugin has a version numbering scheme comprising of  major, minor and
+                       release numbers.</p>
+
+                       <p>This param can be a string with the major number only, major plus minor numbers, or
+                       full three-part version number, e.g. "9",  "9.1" , "6.0.55" are all valid values.</p>
+
+                       <p>If minVersion is set as an object, it must use a similar structure to the object
+                       returned by the {@link glow.embed.Flash#version} method, e.g: <code>{major: 9, minor:0,
+                       release:0}</code>.</p>
+
+               @param {Object} [opts]
+
+                       Hash of optional parameters.
+
+                       @param {String} [opts.width] Width of the Flash movie. Defaults to "100%"
+                       @param {String} [opts.height] Height of the Flash movie. Defaults to "100%"
+                       @param {String} [opts.id] Unique id to be assigned to Flash movie instance.
+                       @param {String} [opts.className] CSS class to be assigned to the embedding element.
+                       @param {Object} [opts.attributes] A hash of attributes to assign to the embedded element tag.
+                       @param {Object} [opts.params] A hash of optional Flash-specific parameters.
+                               For example quality, wmode, bgcolor, flashvars.
+                       @param {String|Function} [opts.message] Error handling message or function.
+
+                               A message to display in the event that the Flash player is either not
+                               installed or is an earlier version than the specified minVersion. This message will
+                               be written into the container element instead of the Flash movie.
+
+                               If a function is supplied, it will be invoked and any return value will be used
+                               as the message to write into the container.
+
+                       @example
+                               var myFlash = new glow.embed.Flash("/path/to/flash.swf", "#flashContainer", "9");
+
+                       @example
+                               var myFlash = new glow.embed.Flash("/path/to/flash.swf", "#flashContainer", "9", {
+                                       width: "400px",
+                                       height: "300px"
+                               });
+
+                       @example
+                               var myFlash = new glow.embed.Flash("/path/to/flash.swf", "#flashContainer", "9", {
+                                       width: "400px",
+                                       height: "300px",
+                                       params: {
+                                               wmode: "transparent",
+                                               flashvars: {
+                                                       navColour: "red",
+                                                       username: "Frankie"
+                                               }
+                                       }
+                               });
+                */
+               r.Flash = function(src, container, minVersion, opts){
+
+                       opts = _set_defaults(opts,{
+                                       width   : "100%",
+                                       height  : "100%",
+                                       params  : {
+                                               allowscriptaccess       : "always",
+                                               allowfullscreen         : "true",
+                                               quality                         : "high"
+                                       },
+                                       attributes : {},
+                                       //expressInstall : false, // TODO add this in a later release
+                                       message : glow.lang.interpolate($i18n.getLocaleModule("GLOW_EMBED").FLASH_MESSAGE, {min: minVersion, installed: installed_flash_player}),
+                                       // create a default ID one hasn't been created as an attribute
+                                       id : (opts && opts.attributes && opts.attributes.id) || _getId() // Fix for trac 165
+                               }
+                       );
+
+                       /**
+                        @name glow.embed.Flash#container
+                        @type glow.dom.NodeList
+                        @description The element containing the embedded movie.
+                        */
+                       container = glow.dom.get(container);
+                       if (!container.length){
+                               throw new Error("glow.embed.Flash unable to locate container");
+                       }
+                       this.container = container;
+
+                       //this.expressInstall = opts.expressInstall; // TODO add this in a later release
+
+                       /**
+                        @name glow.embed.Flash#movie
+                        @type Element
+                        @description A reference to the actual Flash movie element, for direct script access.
+                        @example
+                               myFlash.movie.exposedFlashMethod();
+                        */
+                       this.movie = null;
+
+                       this._displayErrorMessage = typeof opts.message == "function" ? opts.message : function(){return opts.message};
+
+                       /**
+                        @name glow.embed.Flash#isSupported
+                        @type Boolean
+                        @description Does the user have the correct version of Flash?
+                               This will be false if the user has an earler version of Flash
+                               installed than this movie requires, or the user doesn't have
+                               any version of Flash instaled.
+                        @example
+                               if ( !myFlash.isSupported ) {
+                                       alert('Please download the latest version of Flash');
+                               }
+                       */
+                       this.isSupported;
+
+                       // Check that the min version requirement is satisfied and store this status, so we don't later try to embed the thing
+                       // if we don't can't meet the version requirements.
+
+                       if (this.isSupported = _meetsVersionRequirements(minVersion)){
+                               var attrs = opts.attributes,
+                                       overwrites = ["id", "width", "height"],
+                                       i = overwrites.length;
+
+                               // copies stuff like opts.id to attr.id
+                               while (i--) {
+                                       if (opts[overwrites[i]]) { attrs[overwrites[i]] = opts[overwrites[i]]; }
+                               }
+
+                               if (opts.className) { attrs["class"] = opts.className; }
+                               this._embed_tag = _wrap_embedding_tag(src, attrs, opts.params);
+                       }
+                       /*
+                       else if (this.expressInstall && _meetsVersionRequirements("6.0.65") && _platform().match(/^win|mac$/)) {
+
+                               // Callback to be invokes in case of express install error
+                               window[glow.UID + "flashExpressInstallCancelled"] = function(){
+                                       alert("Flash update cancelled");
+                               }
+                               window[glow.UID + "flashExpressInstallFailed"] = function(){
+                                       alert("Unable to complete update, please go to adobe.com...");
+                               }
+                               window[glow.UID + "flashExpressInstallComplete"] = function(){
+
+                                       alert("New version of flash installed");
+
+                               }
+
+                               new glow.embed.Flash("expressInstall.swf",
+                                       this.container,
+                                       "6.0.65", {
+                                       //TODO check minimum width/height
+                                               width:opts.width,
+                                               height:opts.height,
+                                               params : {
+                                                       flashVars : {
+                                                               MMredirectURL :  window.location.toString(),
+                                                               MMplayerType : glow.env.ie ? "ActiveX" : "PlugIn",
+                                                               MMdoctitle : document.title,
+                                                               GlowCallback : glow.UID + "flashExpressInstall"
+                                                       }
+                                               }
+                                       }
+                               ).embed();
+
+                               this.expressInstalling = true;
+                       }*/
+               };
+
+               /**
+                @name glow.embed.Flash.version
+                @function
+                @description Get details of the current users Flash plugin
+                @returns An object with details of the currently installed Flash plugin.
+
+                       <dl>
+                               <dt>major (number)</dt><dd>Flash player major version mumber</dd>
+                               <dt>minor (number)</dt><dd>Flash player minor version mumber.</dd>
+                               <dt>release (number)</dt><dd>Flash player release version mumber.</dd>
+                               <dt>actual (string)</dt><dd>The Flash version exactly as reported by the Flash player.</dd>
+                               <dt>toString (function)</dt><dd>toString implementation in the form "major.minor.release" Eg "9.0.2"</dd>
+                       </dl>
+
+               @example
+                       var version = glow.embed.Flash.version();
+                       alert("curr = " + version.major) // "curr = 9"
+                       alert("curr = " + version) // "curr = 9.0.2"
+                */
+               r.Flash.version = function(){
+                       return installed_flash_player;
+               };
+
+               /**
+                @name glow.embed.Flash#embed
+                @function
+                @description Embed the Flash movie into the document
+                @returns {glow.embed.Flash}
+
+                @example
+                       var myFlash = new glow.embed.Flash(...);
+                       myFlash.embed();
+               */
+               r.Flash.prototype.embed = function(){
+                       var containerElm = this.container[0];
+                       if (this.isSupported){
+
+                               containerElm.innerHTML = this._embed_tag;
+
+                               this.movie = containerElm.firstChild;
+
+                       }/*
+                       else if (this.expressInstalling){
+                               // wait for expressInstall to complete
+
+                       }*/
+                       else {
+                               var message = this._displayErrorMessage();
+                               if (message){
+                                       containerElm.innerHTML = message;
+                               }
+                       }
+
+                       return this;
+
+               };
+
+               glow.embed = r;
+
+       }
+});
+/**
+@name glow.dragdrop
+@namespace
+@description Simplifying drag and drop behaviour
+*/
+(window.gloader || glow).module({
+       name: "glow.dragdrop",
+       library: ["glow", "1.7.0"],
+       depends: [["glow", "1.7.0", "glow.tweens", "glow.events", "glow.dom", "glow.anim"]],
+       builder: function(glow) {
+               var events                 = glow.events,
+                       addListener        = events.addListener,
+                       fire               = events.fire,
+                       removeListener = events.removeListener,
+                       dom                        = glow.dom,
+                       $                          = dom.get,
+                       create             = dom.create;
+
+               //public
+               var r = {},
+                       _zIndex = 1000,
+                       _ieStrict = (document.compatMode == "CSS1Compat" && glow.env.ie >= 5) ? true : false,
+                       _ieTrans= (document.compatMode != "CSS1Compat" && glow.env.ie >= 5) ? true : false,
+                       _ie = glow.env.ie >= 5,
+                       sides = ['top', 'right', 'bottom', 'left'];
+
+               /*
+               PrivateFunction: memoize(clss, name)
+
+               Replace a method with a version that caches the result after the first run.
+
+               Arguments:
+
+                       *clss* (function)
+
+                       The class whose method is being memoized.
+
+                       *name*
+
+                       The name of the method to memoize.
+               */
+
+               function memoize (clss, name) {
+                       var orig = clss.prototype[name];
+                       var cachedName = 'cached_' + name;
+                       clss.prototype[name] = function () {
+                               if (cachedName in this) return this[cachedName];
+                               return this[cachedName] = orig.apply(this, arguments);
+                       };
+               }
+               
+               /*
+                Copy margins from one element to another
+               */
+               function copyMargins(to, from) {
+                       var i = sides.length, margin;
+                       
+                       while (i--) {
+                               margin = 'margin-' + sides[i];
+                               to.css(margin, from.css(margin));
+                       }
+               }
+
+               /*
+               PrivateFunction: memoizeNamed(clss, methodName)
+
+               Replace a method that takes a name with a version that caches the result for each name after the first run.
+
+               Arguments:
+
+                       *clss* (function)
+
+                       The class whose method is being memoized.
+
+                       *methodName*
+
+                       The name of the method to memoize.
+               */
+
+               function memoizeNamed (clss, methodName) {
+                       var orig = clss.prototype[methodName];
+                       var cachedName = 'cached_' + methodName;
+                       clss.prototype[methodName] = function (name) {
+                               if (! this[cachedName]) this[cachedName] = {};
+                               if (name in this[cachedName]) return this[cachedName][name];
+                               return this[cachedName][name] = orig.apply(this, arguments);
+                       };
+               }
+
+               /*
+               PrivateFunction: reset(obj, names)
+
+               Remove cached values for a set of memoized methods.
+
+               Arguments:
+
+                       *obj* (object)
+
+                       The object containing cached values.
+
+                       *names* (array of strings)
+
+                       The names of methods whose values have been cached.
+               */
+
+               function reset (obj, names) {
+                       for (var i = 0, l = names.length; i < l; i++) {
+                               delete obj['cached_' + names[i]];
+                       }
+               }
+
+               /*
+               PrivateFunction: resetNamed(obj, meth, names)
+
+               Remove cached values for a set of named properties for a method.
+
+               Arguments:
+
+                       *obj* (object)
+
+                       The object containing cached values.
+
+                       *meth* (string)
+
+                       The name of the method whose values have been cached.
+
+                       *names* (array of strings)
+
+                       The names of the cached properties.
+
+               function resetNamed (obj, meth, names) {
+                       var cache = obj['cached_' + meth];
+                       if (! cache) return;
+                       for (var i = 0, l = names.length; i < l; i++) {
+                               delete cache[names[i]];
+                       }
+               }
+               */
+
+               /*
+               PrivateClass: Box
+
+               Calculates and caches information about an element in the box model.
+
+               Constructor:
+
+                        (code)
+                        new Box(el)
+                        (end)
+
+               Arguments:
+
+                       *el* (glow.dom.NodeList)
+
+                       The element that calculations will be performed on.
+               */
+
+               var Box = function (el) {
+                       this.el = el;
+               };
+
+               Box.prototype = {
+
+                       /*
+                       PrivateMethod: val
+
+                       Get an pixel value for a CSS style.
+
+                       Arguments:
+
+                               *style* (string)
+
+                               The name of a CSS style (e.g. "margin-top".
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       val: function (style) {
+                               var val = parseInt(this.el.css(style));
+                               // TODO - fix dom so margin-left return value is always defined?
+//                             if (isNaN(val)) throw 'got NaN in val for ' + style + ': ' + this.el.css(style);
+                               return val || 0;
+//                             return val;
+                       },
+
+                       /*
+                       PrivateMethod: width
+
+                       Get the width of the element.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       width: function () {
+                               return this.borderWidth()
+                                        - this.val('border-left-width')
+                                        - this.val('border-right-width');
+                       },
+
+                       /*
+                       PrivateMethod: height
+
+                       Get the height of the element.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       height: function () {
+                               return this.borderHeight()
+                                        - this.val('border-top-width')
+                                        - this.val('border-bottom-width');
+                       },
+
+                       /*
+                       PrivateMethod: offsetParentPageTop
+
+                       Get the number of pixels from the top of nearest element with absolute, relative or fixed position to the
+                       top of the page.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+                       offsetParentPageTop: function () {
+                               var el = this.el[0], pos, top;
+                               while (el = el.offsetParent) {
+                                       if ( $(el).css('position') != 'static' ) {
+                                               break;
+                                       }
+                               }
+                               return el ?
+                                       $(el).offset().top :
+                                       0;
+                       },
+
+                       /*
+                       PrivateMethod: offsetTop
+
+                       This gets what CSS 'top' would be if the element were position "absolute"
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+                       offsetTop: function () {
+                               return this.el.position().top;
+                       },
+
+                       /*
+                       PrivateMethod: offsetLeft
+
+                       This gets what CSS 'left' would be if the element were position "absolute"
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+                       offsetLeft: function () {
+                               return this.el.position().left;
+                       },
+
+                       /*
+                       PrivateMethod: borderWidth
+
+                       Get the width of the element from the left edge of the left border to the right
+                       edge of the right border.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       borderWidth: function () {
+                               var width = this.el[0].offsetWidth;
+                               if (glow.env.khtml) {
+                                       width -= this.val('margin-left')
+                                                       + this.val('margin-right')
+                                                       + this.val('border-left-width')
+                                                       + this.val('border-right-width');
+                               }
+                               return width;
+                       },
+
+                       /*
+                       PrivateMethod: borderHeight
+
+                       Get the height of an element from the top edge of the top border to the bottom
+                       edge of the bottom border.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       borderHeight: function () {
+                               if (this._logicalBottom) {
+                                       return this._logicalBottom - this.offsetTop();
+                               }
+                               var height = this.el[0].offsetHeight;
+                               if (glow.env.khtml) {
+                                       height -= this.val('margin-top')
+                                                       + this.val('margin-bottom')
+                                                       + this.val('border-top-width')
+                                                       + this.val('border-bottom-width');
+                               }
+                               return height;
+                       },
+
+
+                       /*
+                       PrivateMethod: outerWidth
+
+                       Get the width of the element in including margin, borders and padding.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       outerWidth: function () {
+                               return this.borderWidth() + this.val('margin-left') + this.val('margin-right');
+                       },
+
+                       /*
+                       PrivateMethod: outerHeight
+
+                       Get the height of the element in including margin, borders and padding. This
+                       does not take account of collapsable margins (i.e. it assumes the margins are
+                       present).
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       outerHeight: function () {
+                               return this.borderHeight() + this.val('margin-top') + this.val('margin-bottom');
+                       },
+
+                       /*
+                       PrivateMethod: innerLeftPos
+
+                       Get the offset of the left edge of the content of the box (i.e. excluding
+                       margin, border and padding).
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       innerLeftPos: function () {
+                               return this.offsetLeft()
+                                        + this.val('margin-left')
+                                        + this.val('border-left-width')
+                                        + this.val('padding-left');
+                       },
+
+                       /*
+                       PrivateMethod: innerTopPos
+
+                       Get the offset of the top edge of the content of the box (i.e. excluding
+                       margin, border and padding).
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       innerTopPos: function () {
+                               return this.offsetTop()
+                                        + this.val('margin-top')
+                                        + this.val('border-top-width')
+                                        + this.val('padding-top');
+                       },
+
+                       /*
+                       PrivateMethod: surroundWidth
+
+                       Get the combined width of the horizontal margins, borders and paddings.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       surroundWidth: function () {
+                               return this.val('border-left-width')
+                                        + this.val('padding-left')
+                                        + this.val('padding-right')
+                                        + this.val('border-right-width');
+                       },
+
+                       /*
+                       PrivateMethod: surroundHeight
+
+                       Get the combined height of the horizontal margins, borders and paddings.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       surroundHeight: function () {
+                               return this.val('border-top-width')
+                                        + this.val('padding-top')
+                                        + this.val('padding-bottom')
+                                        + this.val('border-bottom-width');
+                       },
+
+                       /*
+                       PrivateMethod: verticalCenter
+
+                       Get the vertical offset of the center of the element from it's offset parent.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       verticalCenter: function () {
+                               return this.offsetTop() + (this.outerHeight() / 2);
+                       },
+
+                       /*
+                       PrivateMethod: verticalCenter
+
+                       Get the vertical offset of the center of the element from it's offset parent.
+
+                       Returns:
+                               An integer number of pixels.
+                       */
+
+                       horizontalCenter: function () {
+                               return this.offsetTop() + (this.outerWidth() / 2);
+                       }
+
+               };
+
+               for (var i in Box.prototype) {
+                       if (i == 'val') memoizeNamed(Box, i);
+                       else memoize(Box, i);
+               }
+
+               glow.lang.apply(Box.prototype, {
+
+                       /*
+                       PrivateMethod: resetPosition
+
+                       Reset cached position values for the element.
+                       */
+
+                       resetPosition: function () {
+                               reset(this, [
+                                       'offsetTop',
+                                       'offsetLeft',
+                                       'borderTopPos',
+                                       'borderLeftPos',
+                                       'innerTopPos',
+                                       'innerLeftPos',
+                                       'verticalCenter',
+                                       'horizontalCenter'
+                               ]);
+                       },
+
+                       /*
+                       PrivateMethod: setLogicalBottom
+
+                       Set the logical value for the position of the bottom of the border (offsetTop + offsetHeight).
+
+                       Arguments:
+
+                               *bottom* (integer)
+
+                               The value to use for the bottom of the box.
+                       */
+                       setLogicalBottom: function (bottom) {
+                               this._logicalBottom = bottom;
+                       },
+
+                       /*
+                       PrivateMethod: boundsFor
+
+                       Get the the bounds for the left and top css properties of a child box to
+                       ensure that it stays within this element.
+
+                       Arguments:
+
+                               *childBox* (Box)
+
+                               A Box object representing the space taken up by the child element.
+
+                       Returns:
+                               An array of top, right, bottom and left pixel bounds for the top and left
+                               css properties of the child element.
+                       */
+
+                       boundsFor: function (childBox) {
+                               var top, left, pos = this.el.css('position');
+                               if (pos != 'static') {
+                                   top = left = 0;
+                               }
+                               else {
+                                       top = this.innerTopPos();
+                                       left = this.innerLeftPos();
+                               }
+                               return [
+                                       top,                                                                               // top
+                                       left + this.width() - childBox.outerWidth(),   // right
+                                       top  + this.height() - childBox.outerHeight(), // bottom
+                                       left                                                                               // left
+                               ];
+                       },
+
+                       /*
+                       PrivateMethod: outerBounds
+
+                       Get the top, right, bottom and left offsets of the outside edge of the border
+                       of the box.
+
+                       Returns:
+                               An array of integer pixel offsets for the top, right, bottom, left edges of the
+                               boxes border.
+                       */
+
+                       outerBounds: function () {
+                               var offset = this.el.offset(),
+                                       left = offset.left,
+                                       top = offset.top;
+                               return [
+                                       top,
+                                       left + this.borderWidth(),
+                                       top + this.borderHeight(),
+                                       left
+                               ];
+                       },
+
+                       /*
+                       PrivateMethod: intersectSize
+
+                       Get the intersection of this box with another box.
+
+                       Arguments:
+
+                               *that* (Box)
+
+                               A Box object to test for intersection with this box.
+
+                               *touches* (boolean)
+
+                               If true, then the boxes don't have to intersect but can merely touch.
+
+                       Returns:
+                               An integer number of square pixels that the the outside of the
+                               edge of the border of this box intersects with that of the passed
+                               in box.
+                       */
+
+                       intersectSize: function (that, touches) {
+                               var a = this.outerBounds(), b = that.outerBounds();
+                               
+                               if (touches) {
+                                       a[1]++; b[1]++; a[2]++; b[2]++;
+                               }
+                               return (
+                                       a[2] < b[0] ? 0 :
+                                       b[2] < a[0] ? 0 :
+                                       a[0] < b[0] ? (a[2] < b[2] ? a[2] - b[0] : b[2] - b[0]) :
+                                       b[2] < a[2] ? b[2] - a[0] : a[2] - a[0]
+                               ) * (
+                                       a[1] < b[3] ? 0 :
+                                       b[1] < a[3] ? 0 :
+                                       a[3] < b[3] ? (a[1] < b[1] ? a[1] - b[3] : b[1] - b[3]) :
+                                       b[1] < a[1] ? b[1] - a[3] : a[1] - a[3]
+                               );
+                       },
+
+                       /*
+                       PrivateMethod: sizePlaceholder
+
+                       Size and position a placeholder/drop indicator element to match that
+                       of the element.
+
+                       Arguments:
+
+                               *placeholder* (glow.dom.NodeList)
+
+                               The element that will be sized.
+
+                               *pos* (optional string)
+
+                               The value for the placeholder's CSS position. Defaults to the position
+                               of this element.
+
+                               *startLeft* (integer)
+
+                               The original left position of the element.
+
+                               *startTop* (integer)
+
+                               The original top position of the element.
+                       */
+
+                       sizePlaceholder: function (placeholder, pos, startLeft, startTop) {
+                               var placeholderBox = new Box(placeholder),
+                                       el = this.el,
+                                       position = pos || el.css('position');
+                               
+                               placeholder.css('display', 'none');
+                               
+                               el.after(placeholder);
+                               
+                               placeholder.css('width', (el[0].offsetWidth - placeholderBox.surroundWidth()) + 'px')
+                                       .css('height', (el[0].offsetHeight - placeholderBox.surroundHeight()) + 'px');
+                               
+                               // copy margin values
+                               copyMargins(placeholder, el);
+                               
+                               placeholder.remove();
+                               
+                               placeholder.css('display', 'block');
+                               
+                               if (position != 'static') {
+                                       placeholder.css('left', startLeft + 'px');
+                                       placeholder.css('top', startTop + 'px');
+                               }
+                               placeholder.css('position', position);
+                       },
+
+                       /*
+                       PrivateMethod: contains
+
+                       Check if a box is contained within this box.
+
+                       Arguments:
+
+                               *box* (Box)
+
+                               The box to test.
+
+                       Returns:
+                               Boolean, true if contained.
+                       */
+
+                       contains: function (box) {
+                               var bounds = this.boundsFor(box),
+                                       position = box.el.position(),
+                                       top = position.top,
+                                       left = position.left;
+                               
+                               return top  >= bounds[0]  // top
+                                       && left <= bounds[1]  // right
+                                       && top  <= bounds[2]  // bottom
+                                       && left >= bounds[3]; // left
+                       },
+
+                       /*
+                       PrivateMethod: containsPoint
+
+                       Arguments:
+
+                               *offset* (object)
+
+                               The offset to check - an object containing x and y integer pixel values.
+
+                       Returns:
+                               Boolean, true if the point over the visible part of the element (i.e. including the borders).
+                       */
+
+                       containsPoint: function (offset) {
+                               var elementOffset = this.el.offset();
+                               return offset.x >= elementOffset.left
+                                       && offset.y >= elementOffset.top
+                                       && offset.x <= elementOffset.left + this.borderWidth()
+                                       && offset.y <= elementOffset.top  + this.borderHeight();
+                       },
+
+                       /*
+                       PrivateMethod: positionedAncestorBox
+
+                       Get a new Box for nearest ancestor of the element that has position 'absolute', 'fixed' or 'relative'.
+
+                       Returns:
+                               An integer pixel offset.
+                       */
+
+                       positionedAncestorBox: function () {
+                               var el = this.el.parent(), pos;
+                               while (el[0]) {
+                                       pos = el.css('position') || 'static';
+                                       if (pos == 'relative' || pos == 'absolute' || pos == 'fixed')
+                                               return new Box(el);
+                                       el = el.parent();
+                               }
+                               return null;
+                       }
+               });
+
+               function placeholderElement (el) {
+                       var tag = el[0].tagName.toLowerCase() == 'li' ? 'li' : 'div';
+                       var placeholder = create('<' + tag + '></' + tag + '>');
+                       if (tag == 'li') placeholder.css('list-style-type', 'none');
+                       return placeholder;
+               }
+
+               /**
+               @name glow.dragdrop.Draggable
+               @class
+               @description An element that can be dragged using the mouse.
+               @see <a href="../furtherinfo/dragdrop/draggables.shtml">Draggable examples</a>
+
+               @param {String | Element | glow.dom.NodeList} element The element or CSS selector for an element to be made draggable.
+
+                       If a {@link glow.dom.NodeList NodeList} or CSS selector matching
+                       multiple elements is passed only the first element is made draggable.
+
+               @param {Object} [opts]
+
+                       An object of options.
+
+                       The opts object allows you to pass in functions to use as event
+                       listeners. This is purely for convenience, you can also use
+                       {@link glow.events.addListener} to add them the normal way.
+
+               @param {String} [opts.placeholder=spacer] Defines what to leave in place of the draggable whilst being dragged.
+
+                       Possible values for this param are:
+
+                       <dl>
+                       <dt>spacer</dt><dd>an empty div is created where the draggable started.</dd>
+                       <dt>clone</dt><dd>an exact clone of the original element.</dd>
+                       <dt>none</dt><dd>no placeholder will be created.</dd>
+                       </dl>
+
+               @param {String} [opts.placeholderClass=glow-dragdrop-placeholder] A class be applied to the placeholder element.
+
+                       This can be used to to add styling for indicating where the element
+                       has been dragged from, add opacity, etc.
+
+               @param {Selector | Element | glow.dom.NodeList} [opts.handle] Restrict the drag 'handle' to an element within the draggable.
+
+               @param {Selector | Element | glow.dom.NodeList} [opts.container] Constrain dragging to within the bounds of the specified element.
+
+               @param {Array} [opts.dropTargets] An array of {@link glow.dragdrop.DropTarget DropTargets}.
+
+                       Specifies which {@link glow.dragdrop.DropTarget DropTargets} this draggable is associated with.
+
+               @param {String} [opts.axis] Restrict dragging to an axis.
+
+                       Possible values for this param are:
+
+                       <dl>
+                       <dt>x</dt><dd>Restricts dragging to the x-axis</dd>
+                       <dt>y</dt><dd>Restricts dragging to the y-axis</dd>
+                       </dl>
+
+               @param {String[]} [opts.dragPrevention=input, textarea, button, select, option, a] Disables dragging from the specified array of element names
+
+                       By default dragging will not work when the user clicks in form
+                       elements, otherwise these elements would be unusable.
+                       
+               @param {Number|Object} [opts.step=1] The pixel interval the draggable snaps to.
+                       If a number, the draggable will step by that number of pixels on the x and y axis. You
+                       can provide an object in the form <code>{x:2, y:4}</code> to set different steps to each
+                       axis.
+
+               @param {Function} [opts.onDrag] An event listener that fires when the draggable starts being dragged.
+
+               @param {Function} [opts.onEnter] An event listener that fires when the draggable is dragged over a drop target.
+
+               @param {Function} [opts.onLeave] An event listener that fires when the draggable is dragged out of a drop target.
+
+               @param {Function} [opts.onDrop] An event listener that fires when the draggable is dropped.
+               
+               @param {Function} [opts.onAfterDrop] An event listener that fires after the element has dropped, including any animations
+
+                       The default action is to animate the draggable back to it's start
+                       position. This can be cancelled by returning false from the listener
+                       or calling {@link glow.events.Event.preventDefault} on the
+                       {@link glow.events.Event} param.
+                       
+               @example
+                       // create a draggable element with a corresponding DropTarget,
+                       // container and two event listeners
+                       var myDraggable = new glow.dragdrop.Draggable('#draggable', {
+                               dropTargets : [ myDropTarget ],
+                               container : '#container',
+                               onDrag : function () {
+                                       this.element.css('opacity', '0.7');
+                               },
+                               onDrop : function () {
+                                       this.element.css('opacity', '1');
+                               }
+                       });
+       */
+       /**
+               @name glow.dragdrop.Draggable#event:drag
+               @event
+               @description Fired when the draggable starts being dragged.
+
+                       Concelling this event results in the user being unable to pick up
+                       the draggable.
+               
+               @param {glow.events.Event} event Event Object
+       */
+       /**
+               @name glow.dragdrop.Draggable#event:enter
+               @event
+               @description Fired when the draggable is dragged over a drop target.
+               @param {glow.events.Event} event Event Object
+       */
+       /**
+               @name glow.dragdrop.Draggable#event:leave
+               @event
+               @description Fired when the draggable is dragged out of a drop target.
+               @param {glow.events.Event} event Event Object
+       */
+       /**
+               @name glow.dragdrop.Draggable#event:drop
+               @event
+               @description Fired when the draggable is dropped.
+               @param {glow.events.Event} event Event Object
+       */
+       /**
+               @name glow.dragdrop.Draggable#event:afterDrop
+               @event
+               @description Fired after the element has dropped, including any animations
+               @param {glow.events.Event} event Event Object
+       */
+               r.Draggable = function (el, opts) {
+
+                       /**
+                       @name glow.dragdrop.Draggable#element
+                       @type glow.dom.NodeList
+                       @description glow.dom.NodeList containing the draggable element
+                       */
+                       this.element = $(el);
+                       this._opts = opts = glow.lang.apply({
+                               dragPrevention   : ['input', 'textarea', 'button', 'select', 'option', 'a'],
+                               placeholder          : 'spacer',
+                               placeholderClass : 'glow-dragdrop-placeholder',
+                               step                     : {x:1, y:1}
+                       }, opts || {});
+                       
+                       //normalise the step param to an object
+                       if (typeof opts.step == "number") {
+                               opts.step = {x: opts.step, y: opts.step};
+                       } else {
+                               opts.step.x = opts.step.x || 1;
+                               opts.step.y = opts.step.y || 1;
+                       }
+
+                       this._preventDrag = [];
+                       for (var i = 0, l = opts.dragPrevention.length; i < l; i++) {
+                               this._preventDrag[i] = opts.dragPrevention[i].toLowerCase();
+                       }
+
+                       if (opts.container) { this.container = $(opts.container); }
+                       this._handle = opts.handle && this.element.get(opts.handle) || this.element;
+
+                       if (opts.dropTargets) this.dropTargets = $(opts.dropTargets);
+
+                               //used for IE literal edge case bug fix
+                               //this._mouseUp = true;
+                               //bug fix to get document.body.scrollTop to return true value (not 0) if using transitional 4.01 doctype
+                               //get('body')[0].style.overflow = 'auto';
+                               //this._opts = o, this._targetCoords = [], this.isOverTarget = false;
+
+                       var listeners = this._listeners = [],
+                               i = 0;
+
+                       if (opts.onDrag)  listeners[i++] = addListener(this, 'drag',  this._opts.onDrag,  this);
+                       if (opts.onEnter) listeners[i++] = addListener(this, 'enter', this._opts.onEnter, this);
+                       if (opts.onLeave) listeners[i++] = addListener(this, 'leave', this._opts.onLeave, this);
+                       if (opts.onDrop)  listeners[i++] = addListener(this, 'drop',  this._opts.onDrop,  this);
+
+                       this._dragListener = addListener(this._handle, 'mousedown', this._startDragMouse, this);
+
+                       return;
+               };
+
+
+               /*
+               Group: Methods
+               */
+
+               //var applyFloatBugfix = glow.env.ie;
+
+               r.Draggable.prototype = {
+
+                       /*
+                       PrivateMethod: _createPlaceholder
+
+                       Create an element that occupies the space where the draggable has been dragged from.
+                       */
+
+                       _createPlaceholder: function () {
+                               var el = this.element,
+                                       placeholder,
+                                       box = this._box;
+
+                               if (this._opts.placeholder == 'clone') {
+                                       placeholder = el.clone();
+                               }
+                               else { // placeholder == 'spacer'
+                                       placeholder = placeholderElement(el);
+                               }
+                               if (this._opts.placeholderClass) {
+                                       placeholder.addClass(this._opts.placeholderClass);
+                               }
+                               box.sizePlaceholder(placeholder, null, this._startLeft, this._startTop);
+                               el.after(placeholder);
+                               this._placeholder = placeholder;
+                       },
+
+                       /*
+                       PrivateMethod: _removePlaceholder
+
+                       Removes the placeholder (see above) from the document.
+                       */
+
+                       _removePlaceholder: function () {
+                               this._placeholder.remove();
+                       },
+
+                       /*
+                       PrivateMethod: _resetPosition
+
+                       Sets the position CSS property to what it started as without moving the draggable. If the
+                       original position was 'static' and making it 'static' again would mean moving the draggable,
+                       then the position is set to 'relative'.
+                       */
+
+                       _resetPosition: function () {
+                               var origPos = this._preDragPosition,
+                                       el = this.element,
+                                       box = this._box,
+                                       startOffset = this._startOffset,
+                                       pos = el.css('position'),
+                                       newLeft,
+                                       newTop;
+                               
+                               box.resetPosition();
+                               
+                               var position = box.el.position(),
+                                       offset = {
+                                               x: position.left,
+                                               y: position.top
+                                       };
+
+                               if (this._placeholder || this._dropIndicator) {
+                                       el.remove();
+                               }
+                               
+                               if (origPos == 'static' && offset.y == startOffset.y && offset.x == startOffset.x) {
+                                       el.css('position', 'static');
+                                       el.css('left', '');
+                                       el.css('top', '');
+                               }
+                               else {
+                                       el.css('z-index', this._preDragZIndex);
+                                       el.css('position', origPos == 'static' ? 'relative' : origPos);
+                                       if (origPos == 'static') {
+                                               newLeft = offset.x - startOffset.x;
+                                               newTop = offset.y - startOffset.y;
+                                       }
+                                       else if (origPos == 'relative' && pos != 'relative') {
+                                               newLeft = this._startLeft + (offset.x - startOffset.x);
+                                               newTop = this._startTop + (offset.y - startOffset.y);
+                                       }
+                                       if (pos != origPos) {
+                                               el.css('left', newLeft ? newLeft + 'px' : '');
+                                               el.css('top', newTop ? newTop + 'px' : '');
+                                       }
+                               }
+                               if (this._dropIndicator) {
+                                       var parent = this._dropIndicator.parent()[0];
+                                       if (parent)     parent.replaceChild(el[0], this._dropIndicator[0]);
+                                       delete this._dropIndicator;
+                                       if (this._placeholder) {
+                                               this._placeholder.remove();
+                                               delete this._placeholder;
+                                       }
+                                       // this is canceling out some of the stuff done in the if statement above, could be done better
+                                       el.css('position', origPos);
+                                       if (origPos == 'relative' && pos != 'relative') {
+                                               el.css('left', this._startLeft);
+                                               el.css('top', this._startTop);
+                                       }
+                               }
+                               else if (this._placeholder) {
+                                       var parent = this._placeholder.parent()[0];
+                                       if (parent)     parent.replaceChild(el[0], this._placeholder[0]);
+                                       delete this._placeholder;
+                               }
+                       },
+
+                       /*
+                       PrivateFunction: _startDragMouse
+
+                       Start the draggable dragging when the mousedown event is fired.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The mousedown event that caused the listener to be fired.
+                       */
+
+                       _startDragMouse: function (e) {
+                               var preventDrag = this._preventDrag,
+                                       source = e.source,
+                                       tag = source.tagName.toLowerCase();
+
+                               for (var i = 0, l = preventDrag.length; i < l; i++) {
+                                       if (preventDrag[i] == tag) {
+                                               return;
+                                       }
+                               }
+                               
+                               //fire the drag event
+                               if (fire(this, 'drag').defaultPrevented()) {
+                                       //the default action was prevented, don't do any dragging
+                                       return;
+                               }
+
+                               if (this._dragging == 1)
+                                       return this.endDrag();
+                               else if (this._dragging)
+                                       return;
+
+                               // _dragging set to 1 during drag, 2 while ending drag and back to 0 when ready for new drag
+                               this._dragging = 1;
+
+                               var el = this.element,
+                                       container = this.container,
+                                       opts = this._opts,
+                                       box = this._box = new Box(el),
+                                       step = opts.step;
+
+                               this._preDragPosition = el.css('position');
+                               
+                               var position = box.el.position(), 
+                                       startOffset = this._startOffset = {
+                                               x: position.left,
+                                               y: position.top
+                                       };
+                               
+                               if (container) {
+                                       this._containerBox = new Box(container);
+                                       this._bounds = this._containerBox.boundsFor(box);
+                                       //we may need to decrease the bounds to keep the element in step (if it's using stepped dragging)
+                                       //basically makes the bounding box smaller to fit in with the stepping
+                                       if (step.x != 1) {
+                                               this._bounds[3] -= (this._bounds[3] - startOffset.x) % step.x;
+                                               this._bounds[1] -= (this._bounds[1] - startOffset.x) % step.x;
+                                       }
+                                       if (step.y != 1) {
+                                               this._bounds[0] -= (this._bounds[0] - startOffset.y) % step.y;
+                                               this._bounds[2] -= (this._bounds[2] - startOffset.y) % step.y;
+                                       }
+                               }
+                               else {
+                                       delete this._bounds;
+                               }
+
+                               this._mouseStart = {
+                                       x: e.pageX,
+                                       y: e.pageY
+                               };
+
+                               
+
+                               this._preDragStyle = el.attr('style');
+
+                               this._preDragZIndex = el.css('z-index');
+
+                               el.css('z-index', _zIndex++);
+
+                               this._startLeft = el[0].style.left ? parseInt(el[0].style.left) : 0;
+                               this._startTop = el[0].style.top ? parseInt(el[0].style.top) : 0;
+
+
+                               if (opts.placeholder && opts.placeholder != 'none') {
+                                       this._createPlaceholder();
+                               }
+
+                               el.css('position', 'absolute');
+                               el.css('left', startOffset.x + 'px');
+                               el.css('top', startOffset.y + 'px');
+
+                               if(_ieStrict) {
+                                       this._scrollY = document.documentElement.scrollTop;
+                                       this._innerHeight = document.documentElement.clientHeight;
+                               }
+                               else if(_ieTrans){
+                                       this._scrollY = document.body.scrollTop;
+                                       this._innerHeight = document.body.clientHeight;
+                               }
+                               else {
+                                       this._scrollY = window.scrollY;
+                                       this._innerHeight = window.innerHeight;
+                               }
+
+                               var cancelFunc = function () { return false },
+                                       doc = document.documentElement;
+
+                               if (this.dropTargets) {
+                                       var event = new events.Event();
+                                       event.draggable = this;
+                                       for (var i = 0, l = this.dropTargets.length; i < l; i++) {
+                                               fire(this.dropTargets[i], 'active', event);
+                                       }
+
+                                       this._mousePos = {
+                                               x: e.pageX,
+                                               y: e.pageY
+                                       };
+                                       this._testForDropTargets();
+                               }
+
+                               this._dragListeners = [
+                                       addListener(doc, 'selectstart', cancelFunc),
+                                       addListener(doc, 'dragstart',   cancelFunc),
+                                       addListener(doc, 'mousedown',   cancelFunc),
+                                       addListener(doc, 'mousemove',   this._dragMouse, this),
+                                       addListener(doc, 'mouseup',      this._releaseElement, this)
+                               ];
+                               return false;
+                       },
+
+                       /*
+                       PrivateFunction: _dragMouse
+
+                       Move the draggable when a mousemove event is received.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The mousedown event that caused the listener to be fired.
+                       */
+
+                       _dragMouse: function (e) {
+                               var element = this.element,
+                                       axis = this._opts.axis,
+                                       //do we need to do axis here, or just not apply the newX/Y if axis is used? May be faster
+                                       newX = axis == 'y' ?
+                                               this._startOffset.x:
+                                               (this._startOffset.x + e.pageX - this._mouseStart.x),
+                                       newY = axis == 'x' ?
+                                               this._startOffset.y:
+                                               (this._startOffset.y + e.pageY - this._mouseStart.y),
+                                       bounds = this._bounds,
+                                       step = this._opts.step;
+                               
+                               
+                               //round position to the nearest step
+                               if (step.x != 1) {
+                                       newX = Math.round((newX - this._startOffset.x) / step.x) * step.x + this._startOffset.x;
+                               }
+                               if (step.y != 1) {
+                                       newY = Math.round((newY - this._startOffset.y) / step.y) * step.y + this._startOffset.y;
+                               }
+                               
+                               // only pay for the function call if we have a container or an axis
+                               if (bounds) {
+                                       // only apply bounds on the axis we're using
+                                       if (axis != 'y') {
+                                               newX = newX < bounds[3] ? bounds[3] : newX > bounds[1] ? bounds[1] : newX;
+                                       }
+                                       if (axis != 'x') {
+                                               newY = newY < bounds[0] ? bounds[0] : newY > bounds[2] ? bounds[2] : newY;
+                                       }
+                               }
+                               
+                               // set the new position
+                               element[0].style.left = newX + 'px';
+                               element[0].style.top = newY + 'px';
+
+                               //if there are dragTargets check if the draggable is over the target
+                               if (this.dropTargets) {
+                                       this._mousePos = { x: e.pageX, y: e.pageY };
+                               }
+                               // check for IE mouseup outside of page boundary
+                               if(_ie && e.nativeEvent.button == 0) {
+                                       this._releaseElement(e);
+                                       return false;
+                               };
+                               return false;
+                       },
+
+                       /*
+                       PrivateFunction: _testForDropTarget
+
+                       Check if the draggable is over a drop target. Sets the activeTarget property of the draggable
+                       to the drop target that the draggable is over, if any.
+
+                       Arguments:
+
+                               *mousePos* (object)
+
+                               The position of the mouse pointer relative to the document. The object has x and y integer
+                               pixel properties.
+                       */
+                       _testForDropTargets: function (fromTimeout) {
+
+                               if (! this._lock) this._lock = 0;
+                               if (fromTimeout) this._lock--;
+                               else if (this.lock) return;
+
+                               if (this._dragging != 1) return;
+
+                               var previousTarget = this.activeTarget,
+                                       activeTarget,
+                                       targets = this.dropTargets,
+                                       target,
+                                       targetBox,
+                                       box = this._box,
+                                       mousePos = this._mousePos;
+
+                               box.resetPosition();
+
+                               var maxIntersectSize = 0;
+                               for (var i = 0, l = targets.length; i < l; i++) {
+                                       target = targets[i];
+                                       targetBox = target._box;
+                                       if (target._opts.tolerance == 'contained') {
+                                               if (targetBox.contains(box)) {
+                                                       activeTarget = target;
+                                                       break;
+                                               }
+                                       }
+                                       else if (target._opts.tolerance == 'cursor') {
+                                               if (targetBox.containsPoint(mousePos)) {
+                                                       activeTarget = target;
+                                                       break;
+                                               }
+                                       }
+                                       else {
+                                               var intersectSize = targetBox.intersectSize(box, true);
+                                               if (intersectSize > maxIntersectSize) {
+                                                       maxIntersectSize = intersectSize;
+                                                       activeTarget = target;
+                                               }
+                                       }
+                               }
+                               this.activeTarget = activeTarget;
+
+                               // enter events
+                               if (activeTarget !== previousTarget) {
+                                       if (activeTarget) {
+                                               // enter on the target
+                                               var draggableEnterEvent = new events.Event();
+                                               draggableEnterEvent.draggable = this;
+                                               fire(activeTarget, 'enter', draggableEnterEvent);
+
+                                               // enter on this (the draggable)
+                                               var enterTargetEvent = new events.Event();
+                                               enterTargetEvent.dropTarget = activeTarget;
+                                               fire(this, 'enter', enterTargetEvent);
+                                       }
+
+                                       if (previousTarget) {
+                                               // leave on target
+                                               var draggableLeaveEvent = new events.Event();
+                                               draggableLeaveEvent.draggable = this;
+                                               fire(previousTarget, 'leave', draggableLeaveEvent);
+
+                                               // leave on this (draggable)
+                                               var leaveTargetEvent = new events.Event();
+                                               leaveTargetEvent.dropTarget = previousTarget;
+                                               fire(this, 'leave', leaveTargetEvent);
+                                       }
+                               }
+                               // place the drop indicator in the drop target (not in the drop target class for speed)
+                               if (activeTarget && activeTarget._opts.dropIndicator != 'none') {
+                                       var childBox,
+                                               childBoxes = activeTarget._childBoxes,
+                                               children = activeTarget._children;
+                                       box.resetPosition();
+                                       var totalHeight = activeTarget._box.innerTopPos();
+                                       var draggablePosition = mousePos.y - box.offsetParentPageTop();
+                                       var placed = 0;
+                                       for (var i = 0, l = childBoxes.length; i < l; i++) {
+                                               if (children[i] == this.element[0]) continue;
+                                               childBox = childBoxes[i];
+                                               totalHeight += childBox.outerHeight();
+                                               if (draggablePosition <= totalHeight) {
+                                                       if (activeTarget._dropIndicatorAt != i) {
+                                                               $(childBox.el).before(activeTarget._dropIndicator);
+                                                               activeTarget._dropIndicatorAt = i;
+                                                       }
+                                                       placed = 1;
+                                                       break;
+                                               }
+                                       }
+                                       if (! placed) {
+                                               if (childBox) {
+                                                       $(childBox.el).after(activeTarget._dropIndicator);
+                                                       activeTarget._dropIndicatorAt = i + 1;
+                                               }
+                                               else {
+                                                       activeTarget.element.append(activeTarget._dropIndicator);
+                                                       activeTarget._dropIndicatorAt = 0;
+                                               }
+                                       }
+                               }
+
+                               this._lock++;
+                               var this_ = this;
+                               setTimeout(function () { this_._testForDropTargets(1) }, 100);
+                       },
+
+                       /*
+                       PrivateMethod: releaseElement
+
+                       Finish the drag when a mouseup event is recieved.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The mouseup event that caused the listener to be fired.
+                       */
+
+                       _releaseElement: function () {
+                               if (this._dragging != 1) return;
+                               this._dragging = 2;
+
+                               var i, l;
+
+                               //call the onInactive function on all the dropTargets for this draggable
+                               var dropTargets = this.dropTargets,
+                                       activeTarget = this.activeTarget;
+
+                               if (dropTargets) {
+                                       for (i = 0, l = dropTargets.length; i < l; i++) {
+                                               var event = new events.Event();
+                                               event.draggable = this;
+                                               event.droppedOnThis = activeTarget && activeTarget == dropTargets[i];
+                                               fire(dropTargets[i], 'inactive', event);
+                                       }
+                               }
+
+                               if (activeTarget) {
+                                       var event = new events.Event();
+                                       event.draggable = this;
+                                       fire(activeTarget, 'drop', event);
+                               }
+
+                               var dragListeners = this._dragListeners;
+                               for (i = 0, l = dragListeners.length; i < l; i++) {
+                                       events.removeListener(dragListeners[i]);
+                               }
+
+                               var dropEvent = fire(this, "drop");
+                               if (! dropEvent.defaultPrevented() && this.dropTargets) {
+                                       this.returnHome();
+                               }
+                               else {
+                                       this.endDrag();
+                               }
+
+                       },
+
+                       /*
+                       Method: endDrag
+
+                       Finishes dragging the draggable. Removes the placeholder (if any) and resets the position CSS property
+                       of the draggable.
+
+                       TODO - revist this code example
+
+                       N.B. This is called by default but if you overwrite the onDrop function then you will have to call it youoriginal
+                       (code)
+                       // empty NodeList
+                       var myDraggable = new glow.dragdrop.Draggable('#draggable', {
+                               onDrop = function(e){
+                                       do some stuff that takes a while.....
+                                       this.endDrag();
+                                       false;
+                               }
+                       });
+                       (end)
+                       */
+
+                       endDrag: function(){
+                               if (this._dragging != 2) return;
+                               this._dragging = 0;
+
+                               //remove any helpers/placeholders
+                               
+                               if (this._reset) {
+                                       this._reset();
+                                       delete this._reset;
+                               }
+                               
+                               if (this.placeholder) {
+                                       this.placeholder.remove();
+                               }
+                               this._resetPosition();
+                               delete this.activeTarget;
+                               fire(this, "afterDrop");
+                       },
+
+                       /*
+                       Event: returnHome
+
+                       Animates the Draggable back to it's start position and calls endDrag() at the end of the
+                       transition. This is called by default when the Draggable, that has a DragTarget, is dropped.
+                       However if you override the default onDrop function you may want to call this function your
+                       original
+
+                       Arguments
+                               tween (function)
+                               The animation you wish to used for easing the Draggable. See <glow.tweens>. This is optional, the default is a linear tween. e.g. glow.tweens.easeboth
+                       */
+
+                       returnHome: function(tween){
+                               var mytween = (tween) ? tween : glow.tweens.linear(),
+                                       leftDestination,
+                                       topDestination,
+                                       el = this.element,
+                                       position = this._box.el.position(),
+                                       distance = Math.pow(
+                                               Math.pow(this._startOffset.x - position.left, 2)
+                                               + Math.pow(this._startOffset.y - position.top, 2),
+                                               0.5
+                                       ),
+                                       duration = 0.3 + (distance / 1000);
+                               
+                               var channels = [[
+                                       glow.anim.css(el, duration, {
+                                               left: this._startOffset.x,
+                                               top : this._startOffset.y
+                                       }, { tween: mytween })
+                               ]];
+
+                               if (this._dropIndicator) {
+                                       channels.push([glow.anim.css(this._dropIndicator, duration - 0.1, { opacity: { to: 0 } })]);
+                               }
+
+                               var timeline = new glow.anim.Timeline(channels);
+                               addListener(timeline, 'complete', function () {
+                                       this.endDrag();
+                               }, this);
+                               timeline.start();
+                               return;
+                       }
+               };
+
+
+               var dropTargetId = 0;
+
+               /**
+               @name glow.dragdrop.DropTarget
+               @class
+               @description An element that can react to Draggables.
+               @see <a href="../furtherinfo/dragdrop/droptargets.shtml">DropTarget examples</a>
+
+               @param {String | Element | glow.dom.NodeList} element The element or CSS selector for an element to be made droppable.
+
+                       If a {@link glow.dom.NodeList NodeList} or CSS selector matching
+                       multiple elements is passed only the first element is made droppable.
+
+               @param {Object} [opts]
+
+                       An object of options.
+
+                       The opts object allows you to pass in functions to use as event
+                       listeners. This is purely for convenience, you can also use
+                       {@link glow.events.addListener} to add them the normal way.
+
+               @param {String} [opts.tolerance=intersect] The point at which the target becomes active when a draggable moves over it.
+
+                       Possible values for this param are:
+
+                       <dl>
+                       <dt>intersect</dt><dd>The target becomes active as soon as any part of the draggable is over the target.</dd>
+                       <dt>cursor</dt><dd>The target becomes active when the cursor is over the target.</dd>
+                       <dt>contained</dt><dd>The target only becomes active once the whole draggable is within the target.</dd>
+                       </dl>
+
+               @param {String} [opts.dropIndicator=none] Whether to create an element when a Draggable is over the DropTarget.
+
+                       Possible values for this param are:
+
+                       <dl>
+                       <dt>spacer</dt><dd>an empty div will be added to the drop target to indicate where the Draggable will be dropped.</dd>
+                       <dt>none</dt><dd>no drop indicator will be created.</dd>
+                       </dl>
+
+               @param {String} [opts.dropIndicatorClass=glow-dragdrop-dropindicator] The class apply to the dropIndicator element.
+
+                       This is useful if you want to style the drop indicator.
+
+               @param {Function} [opts.onEnter] An event listener to fire when an associated Draggable is dragged over the drop target.
+
+               @param {Function} [opts.onLeave] An event listener to fire when an associated Draggable is dragged out of the drop target.
+
+               @param {Function} [opts.onDrop] An event listener to fire when an associated Draggable is dropped on the drop target.
+
+               @param {Function} [opts.onActive] An event listener to fire when an associated Draggable starts being dragged.
+
+               @param {Function} [opts.onInactive] An event listener to fire when an associated Draggable stops being dragged.
+               
+               @example
+                       var myDropTarget = new glow.dragdrop.DropTarget('#dropTarget', {
+                               onActive: function(e){
+                                               this.element.css('border', '2px solid blue');
+                               },
+                               onInactive: function(e){
+                                               this.element.css('border', '');
+                                               this.element.css('opacity', '1');
+                               },
+                               onEnter: function(e){
+                                               this.element.css('opacity', '0.2');
+                               },
+                               onLeave: function(e){
+                                               this.element.css('opacity', '1');
+                               },
+                               onDrop: function(e){
+                                               this.element.css('backgroundColor', 'green');
+                               }
+                       });
+               */
+               /**
+               @name glow.dragdrop.DropTarget#event:active
+               @event
+               @description Fired when a draggable linked to this drop target starts being dragged.
+               @param {glow.events.Event} event Event Object
+               */
+               /**
+               @name glow.dragdrop.DropTarget#event:inactive
+               @event
+               @description Fired when a draggable linked to this drop target stops dragging.
+               @param {glow.events.Event} event Event Object
+               */
+               /**
+               @name glow.dragdrop.DropTarget#event:enter
+               @event
+               @description Fired when a draggable linked to this drop target is dragged over the target.
+               @param {glow.events.Event} event Event Object
+               */
+               /**
+               @name glow.dragdrop.DropTarget#event:leave
+               @event
+               @description Fired when a draggable linked to this drop target is dragged out of the target.
+               @param {glow.events.Event} event Event Object
+               */
+               /**
+               @name glow.dragdrop.DropTarget#event:drop
+               @event
+               @description Fired when a draggable linked is dropped on this drop target.
+               @param {glow.events.Event} event Event Object
+               */
+               r.DropTarget = function(el, opts) {
+                       /**
+                       @name glow.dragdrop.DropTarget#element
+                       @type glow.dom.NodeList
+                       @description glow.dom.NodeList containing the draggable element
+                       */
+                       el = this.element = $(el);
+                       if (! el.length) throw 'no element passed into DropTarget constuctor';
+                       if (el.length > 1) throw 'more than one element passed into DropTarget constructor';
+
+                       // id is for indexing drop targets in an object for getting to them quickly
+                       this._id = ++dropTargetId;
+
+                       this._opts = opts = glow.lang.apply({
+                               dropIndicator      : 'none',
+                               dropIndicatorClass : 'glow-dragdrop-dropindicator',
+                               tolerance          : 'intersect'
+                       }, opts || {});
+
+                       if (opts.onActive)   addListener(this, 'active',   opts.onActive);
+                       if (opts.onInactive) addListener(this, 'inactive', opts.onInactive);
+                       if (opts.onEnter)        addListener(this, 'enter',     opts.onEnter);
+                       if (opts.onLeave)        addListener(this, 'leave',     opts.onLeave);
+                       if (opts.onDrop)         addListener(this, 'drop',       opts.onDrop);
+
+                       addListener(this, 'active', this._onActive);
+                       addListener(this, 'inactive', this._onInactive);
+
+                       return this;
+               };
+
+
+               r.DropTarget.prototype = {
+
+                       /*
+                       Method: setLogicalBottom(height)
+
+                       Set a bottom pos to use for detecting if a draggable is over the drop target to use
+                       other than the actual bottom of the drop target (offsetTop + offsetHeight).
+
+                       Arguments:
+
+                               *bottom* (integer)
+
+                               The number of pixels to use for the bottom of the drop target.
+                       */
+                       setLogicalBottom: function (bottom) {
+                               this._logicalBottom = bottom;
+                       },
+
+                       /*
+                       PrivateMethod: _onActive
+
+                       Respond to an associated draggable when it starts to be dragged.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The active event that caused the event listener to be fired.
+                       */
+
+                       _onActive: function (e) {
+                               var draggable = e.draggable;
+
+                               this._box = new Box(this.element);
+                               if (this._logicalBottom) this._box.setLogicalBottom(this._logicalBottom);
+
+                               if (this._opts.dropIndicator == 'none') return;
+
+                               this._onEnterListener = addListener(this, 'enter', this._onEnter);
+                               this._onLeaveListener = addListener(this, 'leave', this._onLeave);
+
+                               this._dropIndicator = placeholderElement(draggable.element);
+
+                               if (this._opts.dropIndicatorClass) {
+                                       this._dropIndicator.addClass(this._opts.dropIndicatorClass);
+                               }
+                               draggable._box.sizePlaceholder(this._dropIndicator, 'relative', 0, 0);
+
+
+                               var children = this._children = $(this.element.children()).filter(function () {
+                                       var el = $(this);
+                                       return (! e.draggable._placeholder || ! el.eq(e.draggable._placeholder))
+                                               && (! this._dropIndicator || ! el.eq(this._dropIndicator));
+                               });
+                               var childBoxes = this._childBoxes = [];
+                               children.each(function (i) {
+                                       childBoxes[i] = new Box($(children[i]));
+                               });
+                       },
+
+                       /*
+                       PrivateMethod: _onInactive
+
+                       Respond to an associated draggable when it finishes being dragged.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The inactive event that caused the event listener to be fired.
+                       */
+
+                       _onInactive: function (e) {
+                               removeListener(this._onEnterListener);
+                               removeListener(this._onLeaveListener);
+
+                               delete this._box;
+
+                               if (this._opts.dropIndicator == 'none') return;
+
+                               if (! e.droppedOnThis && this._dropIndicator) {
+                                       this._dropIndicator.remove();
+                                       delete this._dropIndicator;
+                               }
+                               delete this._childBoxes;
+                               delete this._children;
+                       },
+
+                       /*
+                       PrivateMethod: _onEnter
+
+                       Respond to an associated draggable being dragged over the drop target.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The enter event that caused the event listener to be fired.
+                       */
+
+                       _onEnter: function () {
+                               this._dropIndicatorAt = -1;
+                       },
+
+                       /*
+                       PrivateMethod: _onLeave
+
+                       Respond to an associated draggable being dragged out of the drop target.
+
+                       Arguments:
+
+                               *e* (glow.events.Event)
+
+                               The leave event that caused the event listener to be fired.
+                       */
+
+                       _onLeave: function () {
+                               this._dropIndicator.remove();
+                       },
+
+                       /*
+                       Method: moveToPosition
+
+                       Insert the draggable's element within the drop target where the drop indicator currently is. Sets
+                       the start offset of the drag to the position of the drop indicator so that it will be animated
+                       to it's final location, rather than where the drag started.
+                       */
+
+                       moveToPosition : function (draggable) {
+                               var dropIndicator = this._dropIndicator,
+                                       box = new Box(dropIndicator);
+                               //dropIndicator.after(draggable.element);
+                               var marginLeft = parseInt(dropIndicator.css('margin-left')) || 0,
+                                       marginTop  = parseInt(dropIndicator.css('margin-top')) || 0,
+                                       position = box.el.position();
+                                       
+                               draggable._startOffset = {
+                                       x: position.left,
+                                       y: position.top
+                               };
+                               draggable._dropIndicator = dropIndicator;
+                               delete this._dropIndicator;
+                       }
+
+               }
+               glow.dragdrop = r;
+
+
+       }
+});
+/*@end @*/
diff --git a/ricoClient/js/baselibs/glow.core.js b/ricoClient/js/baselibs/glow.core.js
new file mode 100644 (file)
index 0000000..a9a53e4
--- /dev/null
@@ -0,0 +1,20 @@
+/*     
+       Copyright 2009 British Broadcasting Corporation
+
+       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.
+*/
+(function(){var f={glow:true},b=/([$^\\\/()|?+*\[\]{}.-])/g,a=navigator.userAgent.toLowerCase(),k="1.7.0",r=0,g=[],m=0,q=[],o=0,s=false,n={VERSION:k,UID:"glow"+Math.floor(Math.random()*(1<<30)),isDomReady:window.gloader&&gloader.isReady,isReady:window.gloader&&gloader.isReady,env:function(){var u=[0,NaN],d=(/opera[\s\/]([\w\.]+)/.exec(a)||u)[1],v=d?NaN:(/msie ([\w\.]+)/.exec(a)||u)[1],x=(/rv:([\w\.]+).*gecko\//.exec(a)||u)[1],e=(/applewebkit\/([\w\.]+)/.exec(a)||u)[1],t=(/khtml\/([\w\.]+)/.exec(a)||u)[1],w=parseFloat;return{gecko:w(x),ie:w(v),opera:w(d),webkit:w(e),khtml:w(t),version:v||x||e||d||t,standardsMode:document.compatMode!="BackCompat"&&(!v||v>=6)};}(),module:function(u){var t=2,w=u.depends[0]||[],d=w.length,e=u.name,v=window.glow;if(u.library[1]!=n.VERSION){throw new Error("Cannot register "+e+": Version mismatch");}if(w[2]){for(;t<d;t++){if(!f[w[t]]){throw new Error("Module "+w[t]+" required before "+e);}}}u.builder(n);f[e]=true;return n;},ready:function(d){if(this.isReady){d();}else{q[o++]=d;}return this;},_readyBlockers:{},_addReadyBlock:function(d){if(d in n._readyBlockers){throw new Error("Blocker '"+d+"' already exists");}n._readyBlockers[d]=true;n.isReady=false;r++;return n;},_removeReadyBlock:function(d){if(n._readyBlockers[d]){n._readyBlockers[d]=false;r--;if(!r){n.isReady=true;p();}}return n;},onDomReady:function(d){if(this.isDomReady){d();}else{g[m++]=d;}},lang:{trim:function(d){return d.replace(/^\s*((?:[\S\s]*\S)?)\s*$/,"$1");},toArray:function(e){if(e.constructor==Array){return e;}var u=[],t=0,d=e.length;for(;t<d;t++){u[t]=e[t];}return u;},apply:function(d,t){for(var e in t){d[e]=t[e];}return d;},map:function(e,x,w){if(Array.prototype.map){return Array.prototype.map.call(e,x,w||e);}if(!x.call){throw new TypeError();}var d=e.length,v=[],u=w||e,t=0;for(;t<d;t++){if(t in e){v[t]=x.call(u,e[t],t,e);}}return v;},replace:(function(){var d="g".replace(/g/,function(){return"l";})!="l",e=String.prototype.replace;return function(y,w,t){var z,v,x,u;if(!d||typeof(t)!="function"){return e.call(y,w,t);}if(!(w instanceof RegExp)){z=y.indexOf(w);return z==-1?y:e.call(y,w,t.call(null,w,z,y));}u=[];x=w.lastIndex=0;while((v=w.exec(y))!=null){z=v.index;u[u.length]=y.slice(x,z);u[u.length]=t.apply(null,v);if(w.global){x=w.lastIndex;}else{x=z+v[0].length;break;}}u[u.length]=y.slice(x);return u.join("");};})(),interpolate:function(t,w,u){var d,v,e,x;u=u||{};if(u.escapeHtml){if(!n.dom){throw new Error("glow.lang.interpolate - glow.dom is needed for escapeHtml");}x=n.dom.create("<div></div>");}if(u.delimiter==undefined){d=/\{[^{}]+\}/g;}else{v=u.delimiter.substr(0,1).replace(b,"\\$1");e=u.delimiter.substr(1,1).replace(b,"\\$1")||v;d=new RegExp(v+"[^"+v+e+"]+"+e,"g");}return t.replace(d,function(D){var A=D.slice(1,-1),C=A.split("."),B,z=0,y=C.length;if(A in w){B=w[A];}else{B=w;for(;z<y;z++){if(C[z] in B){B=B[C[z]];}else{return D;}}}if(u.escapeHtml){B=x.text(B).html();}return B;});},hasOwnProperty:{}.hasOwnProperty?function(d,e){return d.hasOwnProperty(e);}:function(x,y){var u=x[y],w=x.__proto__,t=w?w[y]:{};if(u!==t){return true;}var e=n.lang.hasOwnProperty(w,y),d=w[y]={},v=(x[y]!==d);delete w[y];if(e){w[name]=d;}return v;},extend:function(e,u,d){var t=function(){},v;t.prototype=u.prototype;v=new t();e.prototype=v;v.constructor=e;e.base=u;if(d){n.lang.apply(e.prototype,d);}},clone:function(t){var d,u,e;t=t.valueOf();if(typeof t!=="object"){return t;}else{if(t[0]||t.concat){e=[];d=t.length;while(d--){e[d]=arguments.callee(t[d]);}}else{e={};for(d in t){e[d]=arguments.callee(t[d]);}}return e;}}}},h=n.env,l=document;function c(){n.isDomReady=true;for(var d=0;d<m;d++){g[d]();}}function p(){if(s){return;}s=true;for(var d=0;d<o;){q[d]();d++;if(r){break;}}q=q.slice(d);o=o-d;s=false;}(function(){if(n.isDomReady){return;}n._addReadyBlock("glow_domReady");if(h.ie){if(typeof window.frameElement!="undefined"){l.attachEvent("onreadystatechange",function(){if(l.readyState=="complete"){l.detachEvent("onreadystatechange",arguments.callee);c();n._removeReadyBlock("glow_domReady");}});}else{(function(){try{l.documentElement.doScroll("left");}catch(u){setTimeout(arguments.callee,0);return;}c();n._removeReadyBlock("glow_domReady");})();}}else{if(n.env.webkit<525.13&&typeof l.readyState!="undefined"){var e=function(){if(/loaded|complete/.test(l.readyState)){c();n._removeReadyBlock("glow_domReady");}else{setTimeout(e,0);}};e();}else{var t=function(){if(t.fired){return;}t.fired=true;c();n._removeReadyBlock("glow_domReady");};if(l.addEventListener){l.addEventListener("DOMContentLoaded",t,false);}var d=window.onload;window.onload=function(){if(d){d();}t();};}}})();n.isSupported=!(h.ie<6||(h.gecko<1.9&&!/^1\.8\.1/.test(h.version))||h.opera<9||h.webkit<412);if(!n.isSupported){n._addReadyBlock("glow_browserSupport");}if(window.gloader){gloader.library({name:"glow",version:"1.7.0",builder:function(){return n;}});}else{if(window.glow){throw new Error("Glow global object already exists");}else{window.glow=n;}}if(n.ie){try{document.execCommand("BackgroundImageCache",false,true);}catch(j){}}})();
+/*@cc_on @*/
+/*@if (@_jscript_version > 5.5)@*/
+(window.gloader||glow).module({name:"glow.i18n",library:["glow","1.7.0"],depends:[["glow","1.7.0"]],builder:function(r){var A;var t={l:/^[a-z]$/,lv:/^[a-z]{2,3}$/,s:/^[A-Z][a-z]{3}$/,r:/^[A-Z]{2}|[0-9]{3}$/,v:/^[a-z0-9]{4,}$/};var s=1,k=2,l=4,j=8,p=s+k+l+j,f=s+l+j,x=s+k+j,c=s+j,y=s+k+l,e=s+l,d=s+k;var m={l:s,s:k,r:l,v:j},I=["l","s","r","v"],F={l:0,s:1,r:2,v:3};var C={};var b={};var o=w(document.documentElement.lang||"en")||w("en");function D(K){for(var J in t){if(t[J].test(K)){return J;}}return"";}function w(V){if(!V.split){V="";}var N=V.split("-"),Q=N.length,R=[],K={l:"",s:"",r:"",v:""},J=0,O=J,U=0,P,S;for(var M=0,T=I.length;M<T;M++){O=J;P=I[M];S=F[P];while((D(N[O]).indexOf(P)==-1)&&(O<Q)){O++;}if(O<Q){R[S]=N[O];U+=m[P];K[P]=N[O];N[O]="*";J=O;}}var L=R.join("-").replace(/-+/g,"-");if((L=="")||(L.substring(0,1)=="-")){return false;}else{return{canonical:L,mask:U,subtags:K};}}function g(K,M,J){var L;if((J&~K.mask)==0){L=K.subtags.l;if(k&J){L=L+"-"+K.subtags.s;}if(l&J){L=L+"-"+K.subtags.r;}if(j&J){L=L+"-"+K.subtags.v;}if(M(L)){return L;}}return false;}function a(K,N,J,L){var M;switch(K.mask){case f:if((M=g(K,N,f))){break;}case e:if((M=g(K,N,e))){break;}case p:if((M=g(K,N,p))){break;}case y:if((M=g(K,N,y))){break;}case x:if((M=g(K,N,x))){break;}case d:if((M=g(K,N,d))){break;}case c:if((M=g(K,N,c))){break;}case s:if((M=g(K,N,s))){break;}default:if(N("en")){M="en";}else{M=null;}}if(M==null){L();}else{J(M);}}function v(L){var J=o,K=w(L);if(K){o=K;o.next=J;}return A;}function H(){o=o.next||o;return A;}function B(){return o.canonical;}function h(M,L,Q){var J=w(L),P,O,K;if(J){P=C[J.canonical]=C[J.canonical]||{};O=P[M]=P[M]||{};K=b[M]=b[M]||{};for(var N in Q){O[N]=Q[N];K[N]=1;}}return A;}function E(K,J){var L={},S=J||{},N=b[K]||{},O=o,T,Q;function P(U){if(C[U]&&C[U][K]&&C[U][K][Q]){return true;}else{return false;}}function R(U){L[Q]=C[U][K][Q];}function M(){L[Q]="[Error! No "+K+"."+Q+" on "+O.canonical+"]";}if(S.locale!=undefined){T=w(S.locale);if(T){O=T;}}for(Q in N){a(O,P,R,M);}return L;}function G(K,L){for(var J in L){h(J,K,L[J]);}return A;}function u(L,M){var K=M||{},J=w(L);if(K.module){if(K.label){return q(J,K.module,K.label);}else{return n(J,K.module);}}else{return z(J);}return null;}function q(L,N,M){var J;function P(Q){if(C[Q]&&C[Q][N]&&C[Q][N][M]){return true;}else{return false;}}function O(Q){J=Q;}function K(){J="**error** - no negotiated value exists";}a(L,P,O,K);return J;}function n(L,O){var K=b[O]||{},N={},M;function Q(R){if(C[R]&&C[R][O]&&C[R][O][M]){return true;}else{return false;}}function P(R){N[M]=R;}function J(){N[M]="**error** - no negotiated value exists";}for(M in K){a(L,Q,P,J);}return N;}function z(K){var N={},M,L;function P(Q){if(C[Q]&&C[Q][M]&&C[Q][M][L]){return true;}else{return false;}}function O(Q){N[M][L]=Q;}function J(){N[M][L]="**error** - no negotiated value exists";}for(M in b){N[M]={};for(L in b[M]){a(K,P,O,J);}}return N;}r.i18n=A={setLocale:v,revertLocale:H,getLocale:B,addLocaleModule:h,getLocaleModule:E,addLocalePack:G,checkLocale:u};G("en",{PROPERTIES:{LANGUAGE:"English",DIR:"ltr"}});}});(window.gloader||glow).module({name:"glow.dom",library:["glow","1.7.0"],depends:[],builder:function(u){var n=u.env,k=u.lang,s={tagName:/^(\w+|\*)/,combinator:/^\s*([>]?)\s*/,classNameOrId:(n.webkit<417)?new RegExp("^([\\.#])((?:(?![\\.#\\[:\\s\\\\]).|\\\\.)+)"):/^([\.#])((?:[^\.#\[:\\\s]+|\\.)+)/},X=/([$^\\\/()|?+*\[\]{}.-])/g,B={},R={checked:"checked","class":"className",disabled:"disabled","for":"htmlFor",maxlength:"maxLength"},c={checked:true,disabled:true},ah={maxlength:function(r){return r.toString()=="2147483647"?undefined:r;}},ad=1,x="_unique"+u.UID,ai="_uniqueData"+u.UID,ag=1,L=[],I={black:0,silver:12632256,gray:8421504,white:16777215,maroon:8388608,red:16711680,purple:8388736,fuchsia:16711935,green:32768,lime:65280,olive:8421376,yellow:16776960,navy:128,blue:255,teal:32896,aqua:65535,orange:16753920},D=/height|top/,t=/^rgb\(([\d\.]+)(%?),\s*([\d\.]+)(%?),\s*([\d\.]+)(%?)/i,A=/^(?:(width|height)|(border-(top|bottom|left|right)-width))$/,C=/width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,T,d,K,H,aa=window,l=document,V,G,w,P=l.createElement("div"),y=[1,"<table>","</table>"],ab=[0,"",""],O=n.webkit<526?[0,"","</div>",true]:[1,"b<div>","</div>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],E={caption:y,thead:y,th:a,colgroup:y,tbody:y,tr:[2,"<table><tbody>","</tbody></table>"],td:a,tfoot:y,option:[1,"<select>","</select>"],legend:[1,"<fieldset>","</fieldset>"],link:O,script:O,style:O};if(n.ie){window.attachEvent("onunload",function(){P=null;});}u.ready(function(){V=l.body;G=l.documentElement;});(function(){var r=l.createElement("div");r.a=1;w=!!r.cloneNode(true).a;})();function af(r){for(var aj=r.firstChild;aj;aj=aj.nextSibling){if(aj.nodeType==1){return aj;}}return null;}function v(r){return new RegExp(["(^|\\s)",r.replace(X,"\\$1"),"($|\\s)"].join(""),"g");}function N(ap){var ao=[],al=(/^\s*<([^\s>]+)/.exec(ap)||[,"div"])[1],aj=E[al]||ab,am,ak,an=0;P.innerHTML=(aj[1]+ap+aj[2]);ak=P;am=aj[0];while(am--){ak=ak.lastChild;}while(ak.firstChild){ao[an++]=ak.removeChild(ak.firstChild);}ak=null;return ao;}function p(al){var ak=[],aj=0;for(;al[aj];aj++){ak[aj]=al[aj];}return ak;}function e(am,aj){for(var al=this,r=0,ak=al.length;r<ak;r++){aj.call(al[r],am.call?am.call(al[r],r):am);}return al;}if(document.all){T=function(ak,aj){var al=0,r=ak.length,am=aj.length;if(typeof aj.length=="number"){for(;al<am;al++){ak[r++]=aj[al];}}else{for(;aj[al];al++){ak[r++]=aj[al];}}};}else{T=function(ak,aj){var al=0,r=ak.length;for(;aj[al];al++){ak[r++]=aj[al];}};}function M(r){return(r.ownerDocument&&!r.ownerDocument.body)||(r.documentElement&&!r.documentElement.body);}if(n.ie){d=function(ak){if(ak.length==1){return ak;}var am=[],aj=0,al=0;for(;ak[al];al++){if(ak[al].getAttribute(x)!=ad&&ak[al].nodeType==1){am[aj++]=ak[al];}ak[al].setAttribute(x,ad);}for(al=0;ak[al];al++){ak[al].removeAttribute(x);}ad++;return am;};}else{d=function(ak){if(ak.length==1){return ak;}var am=[],aj=0,al=0;for(;ak[al];al++){if(ak[al][x]!=ad&&ak[al].nodeType==1){am[aj++]=ak[al];}ak[al][x]=ad;}ad++;return am;};}if(document.all){H=function(aj,al){var am=[],ak=0;for(;al[ak];ak++){if(aj=="*"&&al[ak].all&&!M(al[ak])){T(am,al[ak].all);}else{T(am,al[ak].getElementsByTagName(aj));}}return am;};}else{H=function(ak,am){var an=[],al=0,aj=am.length;for(;al<aj;al++){T(an,am[al].getElementsByTagName(ak));}return an;};}function b(am){var al=[],an=am.childNodes,ak=0,aj=0;for(;an[ak];ak++){if(an[ak].nodeType==1&&an[ak].nodeName!="!"){al[aj++]=an[ak];}}return al;}var U=["border-left-width","border-right-width","padding-left","padding-right"],Q=["border-top-width","border-bottom-width","padding-top","padding-bottom"];function f(ap,an){var am,aj=n.standardsMode?G:V,ao=(an=="width"),ak=ao?"Width":"Height",al;if(ap.window){am=n.webkit<522.11?(ao?ap.innerWidth:ap.innerHeight):n.webkit?(ao?V.clientWidth:ap.innerHeight):n.opera<9.5?(ao?V.clientWidth:V.clientHeight):(ao?aj.clientWidth:aj.clientHeight);}else{if(ap.getElementById){am=Math.max(V["scroll"+ak],G["scroll"+ak]);}else{al=ao?U:Q;am=ap["offset"+ak]-parseInt(Z(ap,al));}}return am;}function ae(r){if(n.ie<6){return r.document.body;}else{return r.ownerDocument.body;}}function j(al,am,ak){if(typeof am=="number"||/\d$/.test(am)){am+="px";}for(var aj=0,r=al.length;aj<r;aj++){al[aj].style[ak]=am;}}function W(r){if(r=="float"){return n.ie?"styleFloat":"cssFloat";}return k.replace(r,/-(\w)/g,function(aj,ak){return ak.toUpperCase();});}function z(ap,an){var am,ao=ap.style,al=ao.display,aj=ao.visibility,ak=ao.position;ao.visibility="hidden";ao.position="absolute";ao.display="block";if(!h(ap)){ao.position=ak;am=z(ap.parentNode,an);ao.display=al;ao.visibility=aj;}else{am=an();ao.display=al;ao.position=ak;ao.visibility=aj;}return am;}function h(r){return r.offsetWidth||r.offsetHeight;}function Z(ar,al){var ak,au=0,ap=0,ao=al.length,an=l.defaultView&&(l.defaultView.getComputedStyle(ar,null)||l.defaultView.getComputedStyle),am=ar.currentStyle,at,aq,aj=al.push||A.exec(al)||[];if(al.push){for(;ap<ao;ap++){au+=parseInt(Z(ar,al[ap]),10)||0;}return au+"px";}if(aj[1]){if(!h(ar)){return z(ar,function(){return f(ar,aj[1])+"px";});}return f(ar,aj[1])+"px";}else{if(aj[2]&&u.env.ie&&Z(ar,"border-"+aj[3]+"-style")=="none"){return"0";}else{if(an){if(typeof an=="function"){at=ar.style.display;ak=z(ar,function(){if(al=="display"){ar.style.display=at;if(!l.defaultView.getComputedStyle(ar,null)){return"none";}ar.style.display="block";}return Z(ar,al);});}else{if(n.webkit>500&&n.webkit<526&&al=="margin-right"&&an.getPropertyValue("position")!="absolute"){al="margin-left";}ak=an.getPropertyValue(al);}}else{if(am){if(al=="opacity"){aq=/alpha\(opacity=([^\)]+)\)/.exec(am.filter);return aq?String(parseInt(aq[1],10)/100):"1";}ak=String(am[W(al)]);if(/^-?[\d\.]+(?!px)[%a-z]+$/i.test(ak)&&al!="font-size"){ak=J(ar,ak,D.test(al))+"px";}}}}}if(al.indexOf("color")!=-1){ak=S(ak).toString();}else{if(ak.indexOf("url")==0){ak=ak.replace(/\"/g,"");}}return ak;}function J(ao,aq,am){var ak=am?"top":"left",an=am?"Top":"Left",ar=ao.style,al=ar[ak],ap=ao.runtimeStyle[ak],aj;ao.runtimeStyle[ak]=ao.currentStyle[ak];ar[ak]=aq;aj=ar["pixel"+an];ar[ak]=al;ao.runtimeStyle[ak]=ap;return aj;}function S(ak){if(/^(transparent|rgba\(0, ?0, ?0, ?0\))$/.test(ak)){return"transparent";}var ao,aj,ap,aq,al,an=Math.round,ar=parseInt,am=parseFloat;if(ao=t.exec(ak)){aj=ao[2]?an(((am(ao[1])/100)*255)):ar(ao[1]);ap=ao[4]?an(((am(ao[3])/100)*255)):ar(ao[3]);aq=ao[6]?an(((am(ao[5])/100)*255)):ar(ao[5]);}else{if(typeof ak=="number"){al=ak;}else{if(ak.charAt(0)=="#"){if(ak.length=="4"){ak="#"+ak.charAt(1)+ak.charAt(1)+ak.charAt(2)+ak.charAt(2)+ak.charAt(3)+ak.charAt(3);}al=ar(ak.slice(1),16);}else{al=I[ak];}}aj=(al)>>16;ap=(al&65280)>>8;aq=(al&255);}ak=new String("rgb("+aj+", "+ap+", "+aq+")");ak.r=aj;ak.g=ap;ak.b=aq;return ak;}function m(an){var am="",ak=an.childNodes,al=0,aj=ak.length;for(;al<aj;al++){if(ak[al].nodeType==3){am+=ak[al].nodeValue;}else{if(ak[al].nodeType==1){am+=m(ak[al]);}}}return am;}function q(ao,al){var ak=[],aj=0,r,am=0,an=ao.length;for(;am<an;am++){r=ao[am];while(r=r[al+"Sibling"]){if(r.nodeType==1&&r.nodeName!="!"){ak[aj++]=r;break;}}}return Y.get(ak);}function F(aj){var r=aj.offsetParent;while(r&&Y.get(r).css("position")=="static"){r=r.offsetParent;}if(!r&&Y.get(G).css("position")!="static"){r=G;}return r||null;}function ac(am,al){var ak,aj="scroll"+(al?"Left":"Top");if(am.window){ak=am.document.documentElement[aj]||(al?am.pageXOffset:am.pageYOffset)||0;}else{ak=am[aj];}return ak;}function o(ak,aj,r){if(ak.window){ak.scrollTo(aj?r:ac(ak,true),!aj?r:ac(ak,false));}else{ak["scroll"+(aj?"Left":"Top")]=r;}}function g(r,al,ak){var aj=r.length;if(ak!==undefined){while(aj--){o(r[aj],al,ak);}return r;}else{return ac(r[0],al);}}var Y={};Y.get=function(){var am=new u.dom.NodeList(),al=0,ak=arguments,aj=ak.length;for(;al<aj;al++){if(typeof ak[al]=="string"){am.push(new u.dom.NodeList().push(l).get(ak[al]));}else{am.push(ak[al]);}}return am;};Y.create=function(an,am){var r=[],aj=0,al=0,ak;am=u.lang.apply({interpolate:null,escapeHtml:false},am||{});if(am.interpolate){an=k.interpolate(an,am.interpolate,{escapeHtml:am.escapeHtml});}ak=N(an);for(;ak[aj];aj++){if(ak[aj].nodeType==1&&ak[aj].nodeName!="!"){r[al++]=ak[aj];}else{if(ak[aj].nodeType==3&&k.trim(ak[aj].nodeValue)!==""){throw new Error("glow.dom.create - Text must be wrapped in an element");}}}return new Y.NodeList().push(r);};Y.parseCssColor=function(r){var aj=S(r);return{r:aj.r,g:aj.g,b:aj.b};};Y.NodeList=function(){this.length=0;};Y.NodeList.prototype={item:function(r){return this[r];},push:function(){var ak=arguments,aj=ak.length,al=0,ao,r,am=this,an=Array.prototype.push;for(;al<aj;al++){if(!ak[al]){continue;}else{if(ak[al].nodeType==1||ak[al].nodeType==9||ak[al].document){an.call(am,ak[al]);}else{if(ak[al][0]){for(ao=0,r=ak[al].length;ao<r;ao++){an.call(am,ak[al][ao]);}}}}}return am;},each:function(al){for(var r=0,ak=this,aj=ak.length;r<aj;r++){al.call(ak[r],r,ak);}return ak;},eq:function(al){var ak=this,r=0,aj=ak.length;if(!al.push){al=[al];}if(al.length!=ak.length){return false;}for(;r<aj;r++){if(ak[r]!=al[r]){return false;}}return true;},isWithin:function(al){if(al.push){al=al[0];}if(!al||!this.length){return false;}var ak=this,r=0,aj=ak.length,am;if(al.contains&&n.webkit>=521){for(;r<aj;r++){if(!(al.contains(ak[r])&&ak[r]!=al)){return false;}}}else{if(ak[0].compareDocumentPosition){for(;r<aj;r++){if(!(ak[r].compareDocumentPosition(al)&8)){return false;}}}else{for(;r<aj;r++){am=ak[r];while(am=am.parentNode){if(am==al){break;}}if(!am){return false;}}}}return true;},attr:function(ak){var am=this,aj=arguments,r=aj.length,al,an;if(am.length===0){return r>1?am:undefined;}if(typeof ak=="object"){for(al in ak){if(k.hasOwnProperty(ak,al)){am.attr(al,ak[al]);}}return am;}if(n.ie&&R[ak]){if(r>1){e.call(am,aj[1],function(ao){this[R[ak]]=ao;});return am;}an=am[0][R[ak]];if(c[ak]){return an?ak:undefined;}else{if(ah[ak]){return ah[ak](an);}}return an;}if(r>1){e.call(am,aj[1],function(ao){this.setAttribute(ak,ao);});return am;}return M(am[0])?am[0].getAttribute(ak):am[0].getAttribute(ak,2);},removeAttr:function(aj){var r=n.ie&&R[aj],am=this,ak=0,al=am.length;for(;ak<al;ak++){if(r){am[ak][r]="";}else{am[ak].removeAttribute(aj);}}return am;},hasAttr:function(al){var an=this[0],ak=an.attributes;if(M(an)&&n.ie){var ak=an.attributes,am=0,aj=ak.length;for(;am<aj;am++){if(ak[am].nodeName==al){return ak[am].specified;}}return false;}else{if(this[0].getAttributeNode){var r=this[0].getAttributeNode(al);return r?r.specified:false;}}return typeof ak[r]!="undefined";},prop:function(r,am){if(r.constructor===Object){var al=r,ak;for(ak in al){this.prop(ak,al[ak]);}return this;}if(am!==undefined){var aj=this.length;while(aj--){this[aj][r]=am;}return this;}if(!this[0]){return undefined;}return this[0][r];},hasClass:function(r){for(var aj=0,ak=this.length;aj<ak;aj++){if((" "+this[aj].className+" ").indexOf(" "+r+" ")!=-1){return true;}}return false;},addClass:function(r){for(var aj=0,ak=this.length;aj<ak;aj++){if((" "+this[aj].className+" ").indexOf(" "+r+" ")==-1){this[aj].className+=((this[aj].className)?" ":"")+r;}}return this;},removeClass:function(r){var ak=v(r),am=this,aj=0,al=am.length;for(;aj<al;aj++){am[aj].className=am[aj].className.replace(ak," ");}return am;},toggleClass:function(aj){var al=this.length,ak,r=" "+aj+" ";while(al--){ak=" "+this[al].className+" ";if(ak.indexOf(r)!=-1){this[al].className=ak.replace(r," ");}else{this[al].className+=" "+aj;}}return this;},val:function(){function al(ap){var am=ap.type,an=ap.checked,ar=ap.value,at=[],ao=0;if(am=="radio"){return an?ar:"";}else{if(am=="checkbox"){return an?ar:"";}else{if(am=="select-one"){return ap.selectedIndex>-1?ap.options[ap.selectedIndex].value:"";}else{if(am=="select-multiple"){for(var aq=ap.options.length;ao<aq;ao++){if(ap.options[ao].selected){at[at.length]=ap.options[ao].value;}}return at;}else{return ar;}}}}}function aj(an){var av={},au={},aq=an.elements,at=0,ap=aq.length,am,ax,ar,ao,aw;for(;at<ap;at++){ax=aq[at];aw=ax.nodeName.toLowerCase();am=ax.name;if(aw=="fieldset"||aw=="object"||!am){continue;}if(ax.type=="checkbox"&&!ax.checked){if(!am in av){av[am]=undefined;}}else{if(ax.type=="radio"){if(au[am]){au[am][au[am].length]=ax;}else{au[am]=[ax];}}else{var ay=al(ax);if(am in av){if(av[am].push){av[am][av[am].length]=ay;}else{av[am]=[av[am],ay];}}else{av[am]=ay;}}}}for(at in au){ar=0;for(ap=au[at].length;ar<ap;ar++){ao=au[at][ar];am=ao.name;if(ao.checked){av[ao.name]=ao.value;break;}}if(!am in av){av[am]=undefined;}}return av;}function r(an,aw){var am,ax,at={},aq,ar=0,ao,au,av,ap;for(am in aw){ax=an[am];if(ax&&ax[0]&&!ax.options){aw[am]=aw[am]&&aw[am].push?aw[am]:[aw[am]];at.radios=[];at.checkboxesSelects=[];at.multiSelects=[];at.other=[];for(ar=0;ax[ar];ar++){ap=ax[ar].type;if(ap=="radio"){aq="radios";}else{if(ap=="select-one"||ap=="checkbox"){aq="checkboxesSelects";}else{if(ap=="select-multiple"){aq="multiSelects";}else{aq="other";}}}at[aq][at[aq].length]=ax[ar];}for(ar=0;at.multiSelects[ar];ar++){aw[am]=ak(at.multiSelects[ar],aw[am]);}for(ar=0;at.checkboxesSelects[ar];ar++){ak(at.checkboxesSelects[ar],"");for(ao=0,au=aw[am].length;ao<au;ao++){if(ak(at.checkboxesSelects[ar],aw[am][ao])){aw[am].slice(ao,1);break;}}}for(ar=0;at.radios[ar];ar++){at.radios[ar].checked=false;av=false;for(ao=0,au=aw[am].length;ao<au;ao++){if(ak(at.radios[ar],aw[am][ao])){aw[am].slice(ao,1);av=true;break;}if(av){break;}}}for(ar=0;at.other[ar]&&aw[am][ar]!==undefined;ar++){ak(at.other[ar],aw[am][ar]);}}else{if(ax&&ax.nodeName){ak(ax,aw[am]);}}}}function ak(ao,aq){var ar=0,an,ap=0,av,am,au;if(ao.type=="select-one"){for(an=ao.options.length;ar<an;ar++){if(ao.options[ar].value==aq){ao.selectedIndex=ar;return true;}}return false;}else{if(ao.type=="select-multiple"){var at=!!aq.push;for(ar=0,an=ao.options.length;ar<an;ar++){am=ao.options[ar];au=am.value;if(at){am.selected=false;for(av=aq.length;ap<av;ap++){if(au==aq[ap]){am.selected=true;aq.splice(ap,1);break;}}}else{return am.selected=aq==au;}}return false;}else{if(ao.type=="radio"||ao.type=="checkbox"){ao.checked=aq==ao.value;return aq==ao.value;}else{ao.value=aq;return true;}}}}return function(){var am=arguments,aq=am[0],ap=this,an=0,ao=ap.length;if(am.length===0){return ap[0].nodeName=="FORM"?aj(ap[0]):al(ap[0]);}if(ap[0].nodeName=="FORM"){if(!typeof aq=="object"){throw"value for FORM must be object";}r(ap[0],aq);}else{for(;an<ao;an++){ak(ap[an],aq);}}return ap;};}(),slice:function(){return new Y.NodeList().push(Array.prototype.slice.apply(this,arguments));},sort:function(al){var ak=this,aj=0,r;if(!ak.length){return ak;}if(!al){if(typeof ak[0].sourceIndex=="number"){al=function(an,am){return an.sourceIndex-am.sourceIndex;};}else{if(ak[0].compareDocumentPosition){al=function(an,am){return 3-(an.compareDocumentPosition(am)&6);};}else{r=H("*",[l]);for(;r[aj];aj++){r[aj]._sourceIndex=aj;}al=function(an,am){return an._sourceIndex-am._sourceIndex;};}}}return Y.get([].sort.call(ak,al));},filter:function(am){var aj=[],r=0,ak=0,al=this.length;for(;ak<al;ak++){if(am.apply(this[ak],[ak])){aj[r++]=this[ak];}}return Y.get(aj);},children:function(){var aj=[],r=0,ak=0,an=0,am=this.length,al;for(;ak<am;ak++){aj=aj.concat(b(this[ak]));}return Y.get(aj);},parent:function(){var aj=[],r=0,ak=0,al=this.length;for(;ak<al;ak++){aj[r++]=this[ak].parentNode;}return Y.get(d(aj));},ancestors:function(){var aj=[],r=0,ak=0,al=this.length,am;while(ak<al){am=this[ak].parentNode;while(am&&am.nodeType==1){aj[r++]=am;am=am.parentNode;}ak++;}return Y.get(d(aj));},wrap:function(am){var al=this.length,r,ak,aj;if(typeof am=="string"){aj=Y.create(am);}else{aj=Y.get(am);}for(i=0;i<al;i++){ak=aj[0];while(ak){r=af(ak);if(r){ak=r;}else{break;}}if(this[i].parentNode){aj.insertBefore(this[i]);}if(i!=al-1){aj=aj.clone();}ak.appendChild(this[i]);}return this;},unwrap:function(){var aj,r=this.parent(),ak=r.length;for(i=0;i<ak;i++){aj=r.slice(i,i+1);if(!aj[0].parentNode){aj.children().remove();aj.destroy();}else{aj.children().insertBefore(aj);aj.destroy();}}return this;},next:function(){return q(this,"next");},prev:function(){return q(this,"previous");},is:function(aj){var ak=u.dom.get(aj),am=0,r=this.length,al,an;node:for(;am<r;am++){for(al=0,an=ak.length;al<an;al++){if(this[am]==ak[al]){continue node;}}return false;}return true;},text:function(){var r=arguments,aj=0,al=this,ak=al.length;if(r.length>0){for(;aj<ak;aj++){al[aj].innerHTML="";al[aj].appendChild(l.createTextNode(r[0]));}return al;}return al[0].innerText||al[0].textContent==undefined?m(al[0]):al[0].textContent;},empty:function(){var aj=0,r=this.length;for(;aj<r;aj++){while(this[aj].firstChild){this[aj].removeChild(this[aj].firstChild);}}return this;},remove:function(){for(var al=this,aj=0,ak=al.length,r;aj<ak;aj++){if(r=al[aj].parentNode){r.removeChild(al[aj]);}}return al;},destroy:function(){this.get("*").push(this).removeData();this.appendTo(P);P.innerHTML="";Array.prototype.splice.call(this,0,this.length);return this;},clone:function(am){var aj=[],al=this.length,r,ak;eventIdProp="__eventId"+u.UID;while(al--){aj[al]=this[al].cloneNode(true);}r=Y.get(aj).get("*").push(aj);if(w&&!M(aj[0])){al=r.length;while(al--){r[al][eventIdProp]=null;}}ak=this.get("*").push(this);al=r.length;while(al--){r[al].removeAttribute(ai);u.dom.get(r[al]).data(u.dom.get(ak[al]).data());}if(am){if(!u.events){throw"glow.events required to clone event listeners";}u.events._copyListeners(this.get("*").push(this),r||Y.get(aj).get("*").push(aj));}return Y.get(aj);},html:function(r){var aj=0,ak=this.length;if(r!==undefined){return this.empty().append(r);}return this[0]?this[0].innerHTML:"";},width:function(r){if(r==undefined){return f(this[0],"width");}j(this,r,"width");return this;},height:function(r){if(r==undefined){return f(this[0],"height");}j(this,r,"height");return this;},scrollLeft:function(r){return g(this,true,r);},scrollTop:function(r){return g(this,false,r);},show:function(){var ak=0,aj=this.length,r,al;for(;ak<aj;ak++){r=Y.get(this[ak]);al=r[0].style;if(r.css("display")=="none"){al.display="";al.visibility="visible";if(r.css("display")=="none"){al.display="block";}}}return this;},hide:function(){return this.css("display","none").css("visibility","hidden");},css:function(ao,al){var ak=this,an,aj=0,r=ak.length,am=ao;if(ao.constructor===Object){for(style in ao){this.css(style,ao[style]);}return ak;}else{if(al!=undefined){ao=W(ao);for(;aj<r;aj++){an=ak[aj].style;if(typeof al=="number"&&C.test(am)){al=al.toString()+"px";}if(ao=="opacity"&&n.ie){an.zoom="1";if(al===""){an.filter="";}else{an.filter="alpha(opacity="+Math.round(Number(al,10)*100)+")";}}else{an[ao]=al;}}return ak;}else{if(!r){return;}return Z(ak[0],ao);}}},offset:function(){var an=this[0],al={x:ac(window,true),y:ac(window,false)};if(!u.env.webkit&&an.getBoundingClientRect){var ap=an.getBoundingClientRect();return{top:ap.top+al.y-G.clientTop,left:ap.left+al.x-G.clientLeft};}else{var ao=an.offsetTop,r=an.offsetLeft,aj=an,aq,am=false,ak=an;while(an=an.offsetParent){r+=an.offsetLeft;ao+=an.offsetTop;if(Z(an,"position")=="fixed"){am=true;}if(n.gecko||n.webkit>500){r+=parseInt(Z(an,"border-left-width"))||0;ao+=parseInt(Z(an,"border-top-width"))||0;}if(an.nodeName.toLowerCase()!="body"){ak=an;}}an=aj;while((an=an.parentNode)&&(an!=V)&&(an!=G)){r-=an.scrollLeft;ao-=an.scrollTop;if(n.gecko&&Z(an,"overflow")!="visible"){r+=parseInt(Z(an,"border-left-width"));ao+=parseInt(Z(an,"border-top-width"));}}if(am){r+=al.x;ao+=al.y;}if((n.webkit<500&&(am||Z(ak,"position")=="absolute"))||(n.gecko&&Z(ak,"position")!="absolute")){r-=V.offsetLeft;ao-=V.offsetTop;}return{left:r,top:ao};}},position:function(){var aj=Y.get(F(this[0])),ao=!!aj[0],an=parseInt(this.css("margin-left"))||0,am=parseInt(this.css("margin-top"))||0,al=(ao&&parseInt(aj.css("border-left-width")))||0,r=(ao&&parseInt(aj.css("border-top-width")))||0,ap=this.offset(),ak=ao?aj.offset():{top:0,left:0};return{left:ap.left-ak.left-an-al,top:ap.top-ak.top-am-r};},append:function(an){var am=this,aj=0,ak=1,al=am.length,r;if(al==0){return am;}r=typeof an=="string"?p(N(an)):an.nodeType?[an]:p(an);for(;r[aj];aj++){am[0].appendChild(r[aj]);}for(;ak<al;ak++){for(aj=0;r[aj];aj++){am[ak].appendChild(r[aj].cloneNode(true));}}return am;},prepend:function(ao){var am=this,aj=0,ak=1,al=am.length,r,an;if(al==0){return am;}r=typeof ao=="string"?p(N(ao)):ao.nodeType?[ao]:p(ao);an=am[0].firstChild;for(;r[aj];aj++){am[0].insertBefore(r[aj],an);}for(;ak<al;ak++){an=am[ak].firstChild;for(aj=0;r[aj];aj++){am[ak].insertBefore(r[aj].cloneNode(true),an);}}return am;},appendTo:function(r){if(!(r instanceof Y.NodeList)){r=Y.get(r);}r.append(this);return this;},prependTo:function(r){if(!(r instanceof Y.NodeList)){r=Y.get(r);}r.prepend(this);return this;},after:function(ap){var ao=this,an=ao.length,ak,aj,al,am=1,r;if(an==0){return ao;}ak=typeof ap=="string"?Y.create(ap):ap instanceof Y.NodeList?ap:Y.get(ap);aj=ak.length;for(al=aj-1;al>=0;al--){ao[0].parentNode.insertBefore(ak[al],ao[0].nextSibling);}for(;am<an;am++){r=ak.clone();for(al=aj-1;al>=0;al--){ao[am].parentNode.insertBefore(r[al],ao[am].nextSibling);}}return ao;},before:function(ap){var ao=this,an=ao.length,al=0,am=1,ak,aj,r;if(an==0){return ao;}ak=typeof ap=="string"?Y.create(ap):ap instanceof Y.NodeList?ap:Y.get(ap);aj=ak.length;for(;al<aj;al++){ao[0].parentNode.insertBefore(ak[al],ao[0]);}for(;am<an;am++){r=ak.clone();for(al=0;al<aj;al++){ao[am].parentNode.insertBefore(r[al],ao[am]);}}return ao;},insertAfter:function(r){if(!(r instanceof Y.NodeList)){r=Y.get(r);}r.after(this);return this;},insertBefore:function(r){if(!(r instanceof Y.NodeList)){r=Y.get(r);}r.before(this);return this;},replaceWith:function(r){if(n.webkit<500){this.after(K).remove();Y.get("u.glow-placeholder").after(r).remove();}else{this.after(r).remove();}return this;},data:function(ak,al){if(typeof ak==="object"){for(var an in ak){this.data(an,ak[an]);}return this;}var r,am;switch(arguments.length){case 0:if(this[0]===undefined){return undefined;}r=this[0][ai]||ag++;return L[r]||(L[r]={});case 1:if(this[0]===undefined){return undefined;}r=this[0][ai];return r?L[r][ak]:undefined;case 2:for(var aj=this.length;aj--;){am=this[aj];if(!(r=am[ai])){r=ag++;am[ai]=r;L[r]={};}L[r][ak]=al;}return this;default:throw new Error("glow.dom.NodeList#data expects 2 or less arguments, not "+arguments.length+".");}},removeData:function(ak){var am,aj=this.length,r;while(aj--){am=this[aj];r=am[ai];if(r!==undefined){switch(arguments.length){case 0:L[r]=undefined;am[ai]=undefined;try{delete am[ai];}catch(al){am.removeAttribute&&am.removeAttribute(ai);}break;case 1:L[r][ak]=undefined;delete L[r][ak];break;default:throw new Error("glow.dom.NodeList#removeData expects 1 or less arguments, not "+arguments.length+".");}}}return this;},get:function(){function ak(az){if(B[az]){return B[az];}var ar=[],aC=0,at,aA,av,ax,aB,ay,au=true,aw=az;while(az&&az!=ay){aA="";av="";ay=az;if(ax=s.combinator.exec(az)){at=ax[1];az=az.slice(ax[0].length);}if(ax=s.tagName.exec(az)){aA=ax[1];az=az.slice(ax[0].length);}if(ax=s.classNameOrId.exec(az)){if(ax[1]=="#"){av=ax[2];az=az.slice(ax[0].length);}}if(!at){if(av&&au){ar[aC++]=[am,[av.replace(/\\/g,""),aA||"*",null]];}else{ar[aC++]=[H,[aA||"*",null]];if(av){ar[aC++]=[ap,[av.replace(/\\/g,""),null]];}}}else{if(at==">"){ar[aC++]=[al,[null]];if(av){ar[aC++]=[ap,[av.replace(/\\/g,""),null]];}if(aA&&aA!="*"){ar[aC++]=[aq,[aA,null]];}}}aB=true;while(aB){if(az.charAt(0)=="#"||az.charAt(0)=="."){if(ax=s.classNameOrId.exec(az)){if(az.charAt(0)=="#"){ar[aC++]=[ap,[ax[2].replace(/\\/g,""),null]];}else{ar[aC++]=[ao,[ax[2].replace(/\\/g,""),null]];}az=az.slice(ax[0].length);}else{throw new Error("Invalid Selector "+aw);}}else{aB=false;}}au=false;}if(az!==""){throw new Error("Invalid Selector "+aw);}return B[az]=ar;}function an(ar,av){var au=av;for(var at=0,aw=ar.length;at<aw;at++){ar[at][1][ar[at][1].length-1]=au;au=ar[at][0].apply(this,ar[at][1]);}return au;}function am(at,ax,au){var ar=[],aB=0,aw=[],aA=0,ay;for(var az=0,av=au.length;az<av;az++){if(au[az].getElementById){ay=au[az].getElementById(at);if(ay&&(ay.tagName==ax.toUpperCase()||ax=="*"||ay.tagName==ax)){ar[aB++]=ay;}}else{aw[aA++]=au[az];}}if(aw[0]){aw=H(ax,aw);aw=ap(at,aw);}return ar.concat(aw);}function al(au){var av=[],at=0,ar=au.length;for(;at<ar;at++){T(av,b(au[at]));}return av;}function ap(av,at){for(var ar=0,au=at.length;ar<au;ar++){if(at[ar].id==av){return[at[ar]];}}return[];}function aq(av,au){var ax=[],ar=0;for(var at=0,aw=au.length;at<aw;at++){if(au[at].tagName==av.toUpperCase()||au[at].tagName==av){ax[ar++]=au[at];}}return ax;}function ao(av,au){var ax=[],ar=0;for(var at=0,aw=au.length;at<aw;at++){if((" "+au[at].className+" ").indexOf(" "+av+" ")!=-1){ax[ar++]=au[at];}}return ax;}function aj(ay,au){var av;var ax=[];var aw=ay.split(",");for(var at=0,ar=aw.length;at<ar;at++){av=ak(u.lang.trim(aw[at]));ax=ax.concat(an(av,au));}return ax;}function r(at,av){at=at.length?at:[at];var aw=[];var ar;for(var au=0;at[au];au++){ar=u.dom.get(at[au]);for(var ax=0;av[ax];ax++){if(ar.isWithin(av[ax])){aw[aw.length]=ar[0];break;}}}return aw;}return function(av){if(!this.length){return this;}var au=[];for(var at=0,ar=arguments.length;at<ar;at++){if(typeof arguments[at]=="string"){au=au.concat(aj(arguments[at],this));}else{au=au.concat(r(arguments[at],this));}}return u.dom.get(d(au));};}()};K=Y.create('<u class="glow-placeholder"></u>');u.dom=Y;}});(window.gloader||glow).module({name:"glow.events",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.dom"]],builder:function(o){var k=o.dom.get;var C={};var x=1;var m=1;var n={};var b={};var p={};var l="__eventId"+o.UID;var g=l+"PreventDefault";var u=l+"StopPropagation";var E={};var f=1;var B={};var z={};var G=1;var d=2;var s=4;var h={TAB:"\t",SPACE:" ",ENTER:"\n",BACKTICK:"`"};var K={"96":223};var t={CAPSLOCK:20,NUMLOCK:144,SCROLLLOCK:145,BREAK:19,BACKTICK:223,BACKSPACE:8,PRINTSCREEN:44,MENU:93,SPACE:32,SHIFT:16,CTRL:17,ALT:18,ESC:27,TAB:9,META:91,RIGHTMETA:92,ENTER:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,INS:45,HOME:36,PAGEUP:33,DEL:46,END:35,PAGEDOWN:34,LEFT:37,UP:38,RIGHT:39,DOWN:40};var I={};for(var H in t){I[""+t[H]]=H;}var y="0123456789=;'\\/#,.-";function D(O){var N=z[O];if(!N){return false;}var M=B[N];if(!M){return false;}for(var L=0,r=M.length;L<r;L++){if(M[L][0]==O){M.splice(L,1);return true;}}return false;}function A(r){E[r]=C.addListener(document,"key"+r,function(R){var P=0;if(R.ctrlKey){P+=G;}if(R.altKey){P+=d;}if(R.shiftKey){P+=s;}var Q=R.chr?R.chr.toLowerCase():R.key?R.key.toLowerCase():R.keyCode;var N=P+":"+Q+":"+r;var O=B[N]?B[N].slice(0):[];if(R.shiftKey){var S=(P&~s)+":"+Q+":"+r;if(B[S]){for(var M=0,L=B[S].length;M<L;M++){O[O.length]=B[S][M];}}}if(!O){return;}for(var M=0,L=O.length;M<L;M++){if(O[M][2].call(O[M][3]||this,R)===false){R.preventDefault();}}return !R.defaultPrevented();});}function w(){var r;for(r in b){C.removeListener(r);}}var q;var J,e;function F(O,N,L){var r;L=!!L;if(o.env.opera){if(N.toLowerCase()=="resize"&&!J&&O==window){J=C.addListener(window.document.body,"resize",function(R){C.fire(window,"resize",R);});}else{if(N.toLowerCase()=="scroll"&&!e&&O==window){e=C.addListener(window.document,"scroll",function(R){C.fire(window,"scroll",R);});}}}var Q=function(T){if(!T){T=window.event;}var S=new C.Event(),R=N.toLowerCase();S.nativeEvent=T;S.source=T.target||T.srcElement;S.relatedTarget=T.relatedTarget||(R=="mouseover"?T.fromElement:T.toElement);S.button=o.env.ie?(T.button&1?0:T.button&2?2:1):T.button;if(T.pageX||T.pageY){S.pageX=T.pageX;S.pageY=T.pageY;}else{if(T.clientX||T.clientY){S.pageX=T.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;S.pageY=T.clientY+document.body.scrollTop+document.documentElement.scrollTop;}}if(R=="mousewheel"){S.wheelDelta=T.wheelDelta?T.wheelDelta/120:T.detail?-T.detail/3:0;if(S.wheelDelta==0){return;}}if(R.indexOf("key")!=-1){S.altKey=!!T.altKey;S.ctrlKey=!!T.ctrlKey;S.shiftKey=!!T.shiftKey;if(N=="keydown"){q=T.keyCode;}S.charCode=T.keyCode&&T.charCode!==0?undefined:T.charCode;if(R=="keypress"){if(typeof(S.charCode)=="undefined"){S.charCode=T.keyCode;}if(o.env.opera&&S.charCode&&S.charCode==q&&y.indexOf(String.fromCharCode(S.charCode))==-1){S.charCode=undefined;S.keyCode=q;}}if(S.charCode&&S.charCode<=49){S.charCode=undefined;}if(S.charCode){S.chr=String.fromCharCode(S.charCode);}else{if(T.keyCode){S.charCode=undefined;S.keyCode=K[T.keyCode.toString()]||T.keyCode;S.key=I[S.keyCode];if(h[S.key]){S.chr=h[S.key];S.charCode=S.chr.charCodeAt(0);}}}if(S.chr){S.capsLock=S.chr.toUpperCase()!=S.chr?S.shiftKey:S.chr.toLowerCase()!=S.chr?!S.shiftKey:undefined;}}C.fire(this,N,S);if(S.defaultPrevented()){return false;}};if(O.addEventListener&&(!o.env.webkit||o.env.webkit>418)){if((N=="focus"||N=="blur")&&(o.env.opera)){O.parentNode.addEventListener(N,function(){},true);}O.addEventListener(N.toLowerCase()=="mousewheel"&&o.env.gecko?"DOMMouseScroll":N,Q,L);}else{var M="on"+N;var P=O[M];if(P){O[M]=function(){var R=P.apply(this,arguments),S=Q.apply(this,arguments);return(R!==false)&&(S!==false);};}else{O[M]=Q;}}O=null;}function a(M,N){var O=k(M),r=N?"mouseout":"mouseover",L=N?"mouseleave":"mouseenter";C.addListener(M,r,function(Q){var P=k(Q.relatedTarget);if(!P.eq(O)&&!P.isWithin(O)){return !C.fire(O[0],L,Q).defaultPrevented();}});}C._copyListeners=function(R,Q){var M=R.length,P,r,L,O,N;while(M--){if(R[M][l]){P=n[R[M][l]];for(r in P){L=0;O=P[r].length;for(;L<O;L++){N=P[r][L];C.addListener(Q[M],r,N[2],N[3]);}}}}};C.addListener=function(S,M,V,O){var T=false;if(!S){throw"no attachTo paramter passed to addListener";}if(typeof S=="string"){if(!o.dom){throw"glow.dom must be loaded to use a selector as the first argument to glow.events.addListener";}S=k(S);}if(o.dom&&S instanceof o.dom.NodeList){var U=[],R=S.length;while(R--){U[R]=C.addListener(S[R],M,V,O);}return U;}var N;if(!(N=S[l])){N=S[l]=m++;}var Q=x++;var P=[N,M,V,O,Q];b[Q]=P;var r=n[N];if(!r){r=n[N]={};}var L=r[M];if(!L){L=r[M]=[];}L[L.length]=P;if((S.addEventListener||S.attachEvent)&&!p[N+":"+M]){switch(M){case"mouseenter":a(S,false);return Q;case"mouseleave":a(S,true);return Q;case"focus":if(o.env.ie){c(S,true);return Q;}else{T=true;}break;case"blur":if(o.env.ie){c(S,false);return Q;}else{T=true;}break;}F(S,M,T);p[N+":"+M]=true;}return Q;};function c(M,N){var r=N?"focusin":"focusout",L=N?"focus":"blur";C.addListener(M,r,function(O){return !C.fire(M,L,O).defaultPrevented();});}C.removeListener=function(O){if(O&&O.toString().indexOf("k:")!=-1){return D(O);}if(O instanceof Array){var L=O.length;while(L--){C.removeListener(O[L]);}return true;}var N=b[O];if(!N){return false;}delete b[O];var M=n[N[0]][N[1]];for(var L=0,r=M.length;L<r;L++){if(M[L]==N){M.splice(L,1);break;}}if(!M.length){delete n[N[0]][N[1]];}var P=false;for(var L in n[N[0]]){P=true;break;}if(!P){delete n[N[0]];}return true;};C.removeAllListeners=function(Q){var N,M,P=[],O=0,r,L;if(typeof Q=="string"){Q=k(Q);}if(Q instanceof Array||Q instanceof o.dom.NodeList){N=Q.length;while(N--){C.removeAllListeners(Q[N]);}return C;}M=Q[l];if(!M){return C;}L=n[M];for(r in L){N=L[r].length;while(N--){P[O++]=L[r][N][4];}}if(P.length){C.removeListener(P);}return C;};C.fire=function(r,L,M){if(!r){throw"glow.events.fire: required parameter attachedTo not passed (name: "+L+")";}if(!L){throw"glow.events.fire: required parameter name not passed";}if(!M){M=new C.Event();}if(M.constructor===Object){M=new C.Event(M);}if(typeof r=="string"){if(!o.dom){throw"glow.dom must be loaded to use a selector as the first argument to glow.events.addListener";}r=k(r);}M.type=L;M.attachedTo=r;if(!M.source){M.source=r;}if(r instanceof o.dom.NodeList){r.each(function(N){v(r[N],M);});}else{v(r,M);}return M;};function v(R,Q){var L,r,M=r&&r[Q.type];(L=R[l])&&(r=n[L])&&(M=r[Q.type]);if(!M){return Q;}var N;var S=M.slice(0);for(var O=0,P=S.length;O<P;O++){N=S[O];if(N[2].call(N[3]||R,Q)===false){Q.preventDefault();}}}var j=/^((?:(?:ctrl|alt|shift)\+)*)(?:(\w+|.)|[\n\r])$/i;C.addKeyListener=function(Q,P,R,L){P.replace(/^key/i,"");P=P.toLowerCase();if(!(P=="press"||P=="down"||P=="up")){throw"event type must be press, down or up";}if(!E[P]){A(P);}var N=Q.match(j),S=0,T;if(!N){throw"key format not recognised";}if(N[1].toLowerCase().indexOf("ctrl")!=-1){S+=G;}if(N[1].toLowerCase().indexOf("alt")!=-1){S+=d;}if(N[1].toLowerCase().indexOf("shift")!=-1){S+=s;}var r=S+":"+(N[2]?N[2].toLowerCase():"\n")+":"+P;var M="k:"+f++;z[M]=r;var O=B[r];if(!O){O=B[r]=[];}O[O.length]=[M,P,R,L];return M;};C.Event=function(r){if(r){o.lang.apply(this,r);}};C.Event.prototype.preventDefault=function(){if(this[g]){return;}this[g]=true;if(this.nativeEvent&&this.nativeEvent.preventDefault){this.nativeEvent.preventDefault();this.nativeEvent.returnValue=false;}};C.Event.prototype.defaultPrevented=function(){return !!this[g];};C.Event.prototype.stopPropagation=function(){if(this[u]){return;}this[u]=true;var r=this.nativeEvent;if(r){r.cancelBubble=true;if(r.stopPropagation){r.stopPropagation();}}};C.Event.prototype.propagationStopped=function(){return !!this[u];};if(o.env.ie<8||o.env.webkit<500){C.addListener(window,"unload",w);}o.events=C;o.events.listenersByObjId=n;}});(window.gloader||glow).module({name:"glow.data",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.dom"]],builder:function(glow){var TYPES={UNDEFINED:"undefined",OBJECT:"object",NUMBER:"number",BOOLEAN:"boolean",STRING:"string",ARRAY:"array",FUNCTION:"function",NULL:"null"};var TEXT={AT:"@",EQ:"=",DOT:".",EMPTY:"",AND:"&",OPEN:"(",CLOSE:")"};var JSON={HASH:{START:"{",END:"}",SHOW_KEYS:true},ARRAY:{START:"[",END:"]",SHOW_KEYS:false},DATA_SEPARATOR:",",KEY_SEPARATOR:":",KEY_DELIMITER:'"',STRING_DELIMITER:'"',SAFE_PT1:/^[\],:{}\s]*$/,SAFE_PT2:/\\./g,SAFE_PT3:/\"[^\"\\\n\r]*\"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,SAFE_PT4:/(?:^|:|,)(?:\s*\[)+/g};var SLASHES={TEST:/[\b\n\r\t\\\f\"]/g,B:{PLAIN:"\b",ESC:"\\b"},N:{PLAIN:"\n",ESC:"\\n"},R:{PLAIN:"\r",ESC:"\\r"},T:{PLAIN:"\t",ESC:"\\t"},F:{PLAIN:"\f",ESC:"\\f"},SL:{PLAIN:"\\",ESC:"\\\\"},QU:{PLAIN:'"',ESC:'\\"'}};function _replaceSlashes(s){switch(s){case SLASHES.B.PLAIN:return SLASHES.B.ESC;case SLASHES.N.PLAIN:return SLASHES.N.ESC;case SLASHES.R.PLAIN:return SLASHES.R.ESC;case SLASHES.T.PLAIN:return SLASHES.T.ESC;case SLASHES.F.PLAIN:return SLASHES.F.ESC;case SLASHES.SL.PLAIN:return SLASHES.SL.ESC;case SLASHES.QU.PLAIN:return SLASHES.QU.ESC;default:return s;}}function _getType(object){if((typeof object)==TYPES.OBJECT){if(object==null){return TYPES.NULL;}else{return(object instanceof Array)?TYPES.ARRAY:TYPES.OBJECT;}}else{return(typeof object);}}glow.data={encodeUrl:function(object){var objectType=_getType(object);var paramsList=[];var listLength=0;if(objectType!=TYPES.OBJECT){throw new Error("glow.data.encodeUrl: cannot encode item");}else{for(var key in object){switch(_getType(object[key])){case TYPES.FUNCTION:case TYPES.OBJECT:throw new Error("glow.data.encodeUrl: cannot encode item");break;case TYPES.ARRAY:for(var i=0,l=object[key].length;i<l;i++){switch(_getType(object[key])[i]){case TYPES.FUNCTION:case TYPES.OBJECT:case TYPES.ARRAY:throw new Error("glow.data.encodeUrl: cannot encode item");break;default:paramsList[listLength++]=key+TEXT.EQ+encodeURIComponent(object[key][i]);}}break;default:paramsList[listLength++]=key+TEXT.EQ+encodeURIComponent(object[key]);}}return paramsList.join(TEXT.AND);}},decodeUrl:function(text){if(_getType(text)!=TYPES.STRING){throw new Error("glow.data.decodeUrl: cannot decode item");}else{if(text===""){return{};}}var result={};var keyValues=text.split(/[&;]/);var thisPair,key,value;for(var i=0,l=keyValues.length;i<l;i++){thisPair=keyValues[i].split(TEXT.EQ);if(thisPair.length!=2){throw new Error("glow.data.decodeUrl: cannot decode item");}else{key=glow.lang.trim(decodeURIComponent(thisPair[0]));value=glow.lang.trim(decodeURIComponent(thisPair[1]));switch(_getType(result[key])){case TYPES.ARRAY:result[key][result[key].length]=value;break;case TYPES.UNDEFINED:result[key]=value;break;default:result[key]=[result[key],value];}}}return result;},encodeJson:function(object,options){function _encode(object,options){if(_getType(object)==TYPES.ARRAY){var type=JSON.ARRAY;}else{var type=JSON.HASH;}var serial=[type.START];var len=1;var dataType;var notFirst=false;for(var key in object){dataType=_getType(object[key]);if(dataType!=TYPES.UNDEFINED){if(notFirst){serial[len++]=JSON.DATA_SEPARATOR;}notFirst=true;if(type.SHOW_KEYS){serial[len++]=JSON.KEY_DELIMITER;serial[len++]=key;serial[len++]=JSON.KEY_DELIMITER;serial[len++]=JSON.KEY_SEPARATOR;}switch(dataType){case TYPES.FUNCTION:throw new Error("glow.data.encodeJson: cannot encode item");break;case TYPES.STRING:default:serial[len++]=JSON.STRING_DELIMITER;serial[len++]=glow.lang.replace(object[key],SLASHES.TEST,_replaceSlashes);serial[len++]=JSON.STRING_DELIMITER;break;case TYPES.NUMBER:case TYPES.BOOLEAN:serial[len++]=object[key];break;case TYPES.OBJECT:case TYPES.ARRAY:serial[len++]=_encode(object[key],options);break;case TYPES.NULL:serial[len++]=TYPES.NULL;break;}}}serial[len++]=type.END;return serial.join(TEXT.EMPTY);}options=options||{};var type=_getType(object);if((type==TYPES.OBJECT)||(type==TYPES.ARRAY)){return _encode(object,options);}else{throw new Error("glow.data.encodeJson: cannot encode item");}},decodeJson:function(text,options){if(_getType(text)!=TYPES.STRING){throw new Error("glow.data.decodeJson: cannot decode item");}options=options||{};options.safeMode=options.safeMode||false;var canEval=true;if(options.safeMode){canEval=(JSON.SAFE_PT1.test(text.replace(JSON.SAFE_PT2,TEXT.AT).replace(JSON.SAFE_PT3,JSON.ARRAY.END).replace(JSON.SAFE_PT4,TEXT.EMPTY)));}if(canEval){try{return eval(TEXT.OPEN+text+TEXT.CLOSE);}catch(e){}}throw new Error("glow.data.decodeJson: cannot decode item");},escapeHTML:function(html){return glow.dom.create("<div></div>").text(html).html();}};}});(window.gloader||glow).module({name:"glow.net",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.data","glow.events"]],builder:function(h){var q={XML_ERR:"Cannot get response as XML, check the mime type of the data",POST_DEFAULT_CONTENT_TYPE:"application/x-www-form-urlencoded;"},s=/\+xml$/,n=[],e="c",m="_"+h.UID+"loadScriptCbs",g=h.dom.get,c=h.events,f=function(){};function p(){if(window.ActiveXObject){return(p=function(){return new ActiveXObject("Microsoft.XMLHTTP");})();}else{return(p=function(){return new XMLHttpRequest();})();}}function d(r){return h.lang.apply({onLoad:f,onError:f,onAbort:f,headers:{},async:true,useCache:false,data:null,defer:false,forceXml:false},r||{});}function t(r){return[r,(/\?/.test(r)?"&":"?"),"a",new Date().getTime(),parseInt(Math.random()*100000)].join("");}function j(A,r,x){var w=p(),y=x.data&&(typeof x.data=="string"?x.data:h.data.encodeUrl(x.data)),u,v=new o(w,x);if(!x.useCache){r=t(r);}w.open(A,r,x.async);for(u in x.headers){w.setRequestHeader(u,x.headers[u]);}function z(){v.send=f;if(x.async){if(x.timeout){v._timeout=setTimeout(function(){a(v);var C=new b(w,true,v);c.fire(v,"error",C);},x.timeout*1000);}w.onreadystatechange=function(){if(w.readyState==4){v._timeout&&clearTimeout(v._timeout);v.completed=true;var C=new b(w,false,v);if(C.wasSuccessful){c.fire(v,"load",C);}else{c.fire(v,"error",C);}w.onreadystatechange=new Function();}};w.send(y);return v;}else{w.send(y);v.completed=true;var B=new b(w,false,v);if(B.wasSuccessful){c.fire(v,"load",B);}else{c.fire(v,"error",B);}return B;}}v.send=z;return x.defer?v:z();}var l={};l.get=function(r,u){u=d(u);return j("GET",r,u);};l.post=function(r,u,v){v=d(v);v.data=u;if(!v.headers["Content-Type"]){v.headers["Content-Type"]=q.POST_DEFAULT_CONTENT_TYPE;}return j("POST",r,v);};l.loadScript=function(u,x){var v=n.length,r,y=e+v,x=d(x),w=new o(v,x),u=x.useCache?u:t(u),z=window[m]||(window[m]={});if(x.onLoad!=f){z[y]=function(){w._timeout&&clearTimeout(w._timeout);w.completed=true;x.onLoad.apply(this,arguments);w.destroy();r=z[y]=undefined;delete z[y];};u=h.lang.interpolate(u,{callback:m+"."+y});}r=n[v]=document.createElement("script");if(x.charset){r.charset=x.charset;}c.addListener(w,"abort",x.onAbort);h.ready(function(){if(x.timeout){w._timeout=setTimeout(function(){a(w);x.onError();},x.timeout*1000);}if(h.env.opera){setTimeout(function(){if(r){r.src=u;}},0);}else{r.src=u;}document.body.appendChild(r);});return w;};function a(u){var r=u.nativeRequest,v=u._callbackIndex;u._timeout&&clearTimeout(u._timeout);if(r){r.onreadystatechange=new Function();r.abort();}else{if(v){window[m][e+v]=f;h.dom.get(n[v]).destroy();}}}function o(w,u){this._timeout=null;this._forceXml=u.forceXml;if(u.forceXml&&w.overrideMimeType){w.overrideMimeType("application/xml");}this.complete=false;if(typeof w=="number"){this._callbackIndex=w;}else{this.nativeRequest=w;}var v=["Load","Error","Abort"],r=0;for(;r<3;r++){c.addListener(this,v[r].toLowerCase(),u["on"+v[r]]);}}o.prototype={send:function(){},abort:function(){if(!this.completed&&!c.fire(this,"abort").defaultPrevented()){a(this);}return this;},destroy:function(){if(this._callbackIndex!==undefined){setTimeout(function(){g(n[this._callbackIndex]).destroy();n[this._callbackIndex]=undefined;delete n[this._callbackIndex];},0);}return this;}};function b(v,r,u){c.Event.call(this);this._request=u;this.nativeResponse=v;this.status=r?408:v.status==1223?204:v.status;this.timedOut=!!r;this.wasSuccessful=(this.status>=200&&this.status<300)||this.status==304||(this.status==0&&v.responseText);}function k(){var r=this.header("Content-Type");return s.test(r)||r==="";}h.lang.extend(b,c.Event,{text:function(){return this.nativeResponse.responseText;},xml:function(){var u=this.nativeResponse;if((h.env.ie&&k.call(this))||(this._request._forceXml&&!this._request.nativeRequest.overrideMimeType&&window.ActiveXObject)){var r=new ActiveXObject("Microsoft.XMLDOM");r.loadXML(u.responseText);return r;}else{if(!u.responseXML){throw new Error(q.XML_ERR);}return u.responseXML;}},json:function(r){return h.data.decodeJson(this.text(),{safeMode:r});},header:function(r){return this.nativeResponse.getResponseHeader(r);},statusText:function(){return this.timedOut?"Request Timeout":this.nativeResponse.statusText;}});h.net=l;}});(window.gloader||glow).module({name:"glow.tweens",library:["glow","1.7.0"],depends:[],builder:function(b){function a(c){return function(d){return 1-c(1-d);};}b.tweens={linear:function(){return function(c){return c;};},easeIn:function(c){c=c||2;return function(d){return Math.pow(1,c-1)*Math.pow(d,c);};},easeOut:function(c){return a(this.easeIn(c));},easeBoth:function(c){return this.combine(this.easeIn(c),this.easeOut(c));},overshootIn:function(c){return a(this.overshootOut(c));},overshootOut:function(c){c=c||1.70158;return function(d){if(d==0||d==1){return d;}return((d-=1)*d*((c+1)*d+c)+1);};},overshootBoth:function(c){return this.combine(this.overshootIn(c),this.overshootOut(c));},bounceIn:function(){return a(this.bounceOut());},bounceOut:function(){return function(c){if(c<(1/2.75)){return 7.5625*c*c;}else{if(c<(2/2.75)){return(7.5625*(c-=(1.5/2.75))*c+0.75);}else{if(c<(2.5/2.75)){return(7.5625*(c-=(2.25/2.75))*c+0.9375);}else{return(7.5625*(c-=(2.625/2.75))*c+0.984375);}}}};},bounceBoth:function(){return this.combine(this.bounceIn(),this.bounceOut());},elasticIn:function(c,d){return a(this.elasticOut(c,d));},elasticOut:function(c,d){return function(e){if(e==0||e==1){return e;}if(!d){d=0.3;}if(!c||c<1){c=1;var f=d/4;}else{var f=d/(2*Math.PI)*Math.asin(1/c);}return c*Math.pow(2,-10*e)*Math.sin((e-f)*(2*Math.PI)/d)+1;};},elasticBoth:function(c,d){d=d||0.45;return this.combine(this.elasticIn(c,d),this.elasticOut(c,d));},combine:function(d,c){return function(e){if(e<0.5){return d(e*2)/2;}else{return c((e-0.5)*2)/2+0.5;}};}};}});(window.gloader||glow).module({name:"glow.anim",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.tweens","glow.events","glow.dom"]],builder:function(glow){var $=glow.dom.get,manager,events=glow.events,dom=glow.dom,get=dom.get,hasUnits=/width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,noNegatives=/width|height|padding|opacity/,usesYAxis=/height|top/,getUnit=/(\D+)$/,testElement=dom.create('<div style="position:absolute;visibility:hidden"></div>');function addEventsFromOpts(instance,opts,eventProps){for(var i=0,len=eventProps.length;i<len;i++){if(opts[eventProps[i]]){events.addListener(instance,eventProps[i].slice(2).toLowerCase(),opts[eventProps[i]]);}}}(function(){var queue=[],queueLen=0,intervalTime=1,interval;manager={addToQueue:function(anim){queue[queueLen++]=anim;anim._playing=true;anim._timeAnchor=anim._timeAnchor||new Date().valueOf();if(!interval){this.startInterval();}},removeFromQueue:function(anim){for(var i=0;i<queueLen;i++){if(queue[i]==anim){queue.splice(i,1);anim._timeAnchor=null;anim._playing=false;if(--queueLen==0){this.stopInterval();}return;}}},startInterval:function(){interval=window.setInterval(this.processQueue,intervalTime);},stopInterval:function(){window.clearInterval(interval);interval=null;},processQueue:function(){var anim,i,now=new Date().valueOf();for(i=0;i<queueLen;i++){anim=queue[i];if(anim.position==anim.duration){manager.removeFromQueue(anim);i--;events.fire(anim,"complete");if(anim._opts.destroyOnComplete){anim.destroy();}continue;}if(anim.useSeconds){anim.position=(now-anim._timeAnchor)/1000;if(anim.position>anim.duration){anim.position=anim.duration;}}else{anim.position++;}anim.value=anim.tween(anim.position/anim.duration);events.fire(anim,"frame");}}};})();function convertCssUnit(element,fromValue,toUnit,axis){var elmStyle=testElement[0].style,axisProp=(axis=="x")?"width":"height",startPixelValue,toUnitPixelValue;elmStyle.margin=elmStyle.padding=elmStyle.border="0";startPixelValue=testElement.css(axisProp,fromValue).insertAfter(element)[axisProp]();toUnitPixelValue=testElement.css(axisProp,10+toUnit)[axisProp]()/10;testElement.remove();return startPixelValue/toUnitPixelValue;}function keepWithinRange(num,start,end){if(start!==undefined&&num<start){return start;}if(end!==undefined&&num>end){return end;}return num;}function buildAnimFunction(element,spec){var cssProp,r=["a=(function(){"],rLen=1,fromUnit,unitDefault=[0,"px"],to,from,unit,a;for(cssProp in spec){r[rLen++]='element.css("'+cssProp+'", ';if(typeof spec[cssProp]!="object"){to=spec[cssProp];}else{to=spec[cssProp].to;}if((from=spec[cssProp].from)===undefined){if(cssProp=="font-size"||cssProp=="background-position"){throw new Error("From value must be set for "+cssProp);}from=element.css(cssProp);}if(hasUnits.test(cssProp)){unit=(getUnit.exec(to)||unitDefault)[1];fromUnit=(getUnit.exec(from)||unitDefault)[1];from=parseFloat(from)||0;to=parseFloat(to)||0;if(from&&unit!=fromUnit){if(cssProp=="font-size"){throw new Error("Units must be the same for font-size");}from=convertCssUnit(element,from+fromUnit,unit,usesYAxis.test(cssProp)?"y":"x");}if(noNegatives.test(cssProp)){r[rLen++]="keepWithinRange(("+(to-from)+" * this.value) + "+from+', 0) + "'+unit+'"';}else{r[rLen++]="("+(to-from)+" * this.value) + "+from+' + "'+unit+'"';}}else{if(!(isNaN(from)||isNaN(to))){from=Number(from);to=Number(to);r[rLen++]="("+(to-from)+" * this.value) + "+from;}else{if(cssProp.indexOf("color")!=-1){to=dom.parseCssColor(to);if(!glow.lang.hasOwnProperty(from,"r")){from=dom.parseCssColor(from);}r[rLen++]='"rgb(" + keepWithinRange(Math.round('+(to.r-from.r)+" * this.value + "+from.r+'), 0, 255) + "," + keepWithinRange(Math.round('+(to.g-from.g)+" * this.value + "+from.g+'), 0, 255) + "," + keepWithinRange(Math.round('+(to.b-from.b)+" * this.value + "+from.b+'), 0, 255) + ")"';}else{if(cssProp=="background-position"){var vals={},fromTo=["from","to"],unit=(getUnit.exec(from)||unitDefault)[1];vals.fromOrig=from.toString().split(/\s/);vals.toOrig=to.toString().split(/\s/);if(vals.fromOrig[1]===undefined){vals.fromOrig[1]="50%";}if(vals.toOrig[1]===undefined){vals.toOrig[1]="50%";}for(var i=0;i<2;i++){vals[fromTo[i]+"X"]=parseFloat(vals[fromTo[i]+"Orig"][0]);vals[fromTo[i]+"Y"]=parseFloat(vals[fromTo[i]+"Orig"][1]);vals[fromTo[i]+"XUnit"]=(getUnit.exec(vals[fromTo[i]+"Orig"][0])||unitDefault)[1];vals[fromTo[i]+"YUnit"]=(getUnit.exec(vals[fromTo[i]+"Orig"][1])||unitDefault)[1];}if((vals.fromXUnit!==vals.toXUnit)||(vals.fromYUnit!==vals.toYUnit)){throw new Error("Mismatched axis units cannot be used for "+cssProp);}r[rLen++]="("+(vals.toX-vals.fromX)+" * this.value + "+vals.fromX+') + "'+vals.fromXUnit+' " + ('+(vals.toY-vals.fromY)+" * this.value + "+vals.fromY+') + "'+vals.fromYUnit+'"';}}}}r[rLen++]=");";}r[rLen++]="})";return eval(r.join(""));}var r={};r.css=function(element,duration,spec,opts){element=get(element);var anim=new r.Animation(duration,opts);if(element[0]){events.addListener(anim,"frame",buildAnimFunction(element,spec));}return anim;};slideElement=function slideElement(element,duration,action,opts){duration=duration||0.5;element=$(element);opts=glow.lang.apply({tween:glow.tweens.easeBoth(),onStart:function(){},onComplete:function(){}},opts);var i=0,thatlength=element.length,completeHeight,fromHeight,channels=[],timeline;for(;i<thatlength;i++){if(action=="up"||(action=="toggle"&&element.slice(i,i+1).height()>0)){element[i].style.overflow="hidden";if(glow.env.ie<8){element[i].style.zoom=1;}completeHeight=0;fromHeight=element.slice(i,i+1).height();}else{if(action=="down"||(action=="toggle"&&element.slice(i,i+1).height()==0)){fromHeight=element.slice(i,i+1).height();element[i].style.height="auto";completeHeight=element.slice(i,i+1).height();element[i].style.height=fromHeight+"px";}}channels[i]=[glow.anim.css(element[i],duration,{height:{from:fromHeight,to:completeHeight}},{tween:opts.tween})];}timeline=new glow.anim.Timeline(channels,{destroyOnComplete:true});events.addListener(timeline,"complete",function(){element.each(function(){if(this.style.height!="0px"){this.style.height="auto";}});});events.addListener(timeline,"start",opts.onStart);events.addListener(timeline,"complete",opts.onComplete);return timeline.start();};r.slideDown=function(element,duration,opts){return slideElement(element,duration,"down",opts);};r.slideUp=function(element,duration,opts){return slideElement(element,duration,"up",opts);};r.slideToggle=function(element,duration,opts){return slideElement(element,duration,"toggle",opts);};r.fadeOut=function(element,duration,opts){return r.fadeTo(element,0,duration,opts);};r.fadeIn=function(element,duration,opts){r.fadeTo(element,1,duration,opts);};r.fadeTo=function(element,opacity,duration,opts){duration=duration||0.5;element=$(element);opts=glow.lang.apply({tween:glow.tweens.easeBoth(),onStart:function(){},onComplete:function(){}},opts);var i=0,thatlength=element.length,channels=[],timeline;for(;i<thatlength;i++){channels[i]=[glow.anim.css(element[i],duration,{opacity:opacity},{tween:opts.tween})];}timeline=new glow.anim.Timeline(channels,{destroyOnComplete:true});events.addListener(timeline,"start",opts.onStart);events.addListener(timeline,"complete",opts.onComplete);return timeline.start();};r.highlight=function(element,highlightColour,duration,opts){element=$(element);duration=duration||1;highlightColour=highlightColour||"#ffff99";opts=glow.lang.apply({tween:glow.tweens.easeBoth(),onStart:function(){},onComplete:function(){}},opts);var i=0,transArray=[],elmsLength=element.length,completeColour,channels=[],timeline;for(;i<elmsLength;i++){completeColour=opts.completeColour||element.slice(i,i+1).css("background-color");if(completeColour=="transparent"||completeColour==""){completeColour="#fff";}channels[i]=[r.css(element[i],duration,{"background-color":{from:highlightColour,to:completeColour}},{tween:opts.tween})];}timeline=new glow.anim.Timeline(channels,{destroyOnComplete:true});events.addListener(timeline,"start",opts.onStart);events.addListener(timeline,"complete",opts.onComplete);return timeline.start();};var animationEventConstructorNames=["onStart","onStop","onComplete","onResume","onFrame"];r.Animation=function(duration,opts){this._opts=opts=glow.lang.apply({useSeconds:true,tween:glow.tweens.linear(),destroyOnComplete:false,onStart:null,onStop:null,onComplete:null,onResume:null,onFrame:null},opts);this._playing=false;this._timeAnchor=null;this.duration=duration;this.useSeconds=opts.useSeconds;this.tween=opts.tween;this.position=0;this.value=0;addEventsFromOpts(this,opts,animationEventConstructorNames);};r.Animation.prototype={start:function(){if(this._playing){this.stop();}var e=events.fire(this,"start");if(e.defaultPrevented()){return this;}this._timeAnchor=null;this.position=0;manager.addToQueue(this);return this;},stop:function(){if(this._playing){var e=events.fire(this,"stop");if(e.defaultPrevented()){return this;}manager.removeFromQueue(this);}return this;},destroy:function(){this.stop();events.removeAllListeners(this);return this;},resume:function(){if(!this._playing){var e=events.fire(this,"resume");if(e.defaultPrevented()){return this;}this._timeAnchor=new Date().valueOf()-(this.position*1000);manager.addToQueue(this);}return this;},isPlaying:function(){return this._playing;},goTo:function(pos){this._timeAnchor=new Date().valueOf()-((this.position=pos)*1000);this.value=this.tween(this.duration&&this.position/this.duration);events.fire(this,"frame");return this;}};var timelineEventConstructorNames=["onStart","onStop","onComplete","onResume"];r.Timeline=function(channels,opts){this._opts=opts=glow.lang.apply({loop:false,destroyOnComplete:false,onStart:null,onStop:null,onComplete:null,onResume:null},opts);this._channels=(channels[0]&&channels[0].push)?channels:[channels];this._channelPos=[];this._playing=false;this.loop=opts.loop;var i,j,iLen,jLen,channel,allChannels=this._channels,totalDuration=0,channelDuration;for(i=0,iLen=allChannels.length;i<iLen;i++){channel=allChannels[i];channelDuration=0;for(j=0,jLen=channel.length;j<jLen;j++){if(typeof channel[j]=="number"){channel[j]=new r.Animation(channel[j]);}if(channel[j] instanceof r.Animation){if(!channel[j].useSeconds){throw new Error("Timelined animations must be timed in seconds");}channel[j]._timelineOffset=channelDuration*1000;channelDuration+=channel[j].duration;channel[j]._channelIndex=i;}}this.duration=totalDuration=Math.max(channelDuration,totalDuration);}this._controlAnim=new r.Animation(totalDuration);events.addListener(this._controlAnim,"frame",this._processFrame,this);events.addListener(this._controlAnim,"complete",this._complete,this);addEventsFromOpts(this,opts,timelineEventConstructorNames);};r.Timeline.prototype={_advanceChannel:function(i){var currentAnim=this._channels[i][this._channelPos[i]],nextAnim=this._channels[i][++this._channelPos[i]];if(currentAnim&&currentAnim._playing){currentAnim._playing=false;events.fire(currentAnim,"complete");if(currentAnim._opts.destroyOnComplete){currentAnim.destroy();}}if((nextAnim)!==undefined){if(typeof nextAnim=="function"){nextAnim();this._advanceChannel(i);}else{nextAnim.position=0;nextAnim._channelIndex=i;events.fire(nextAnim,"start");nextAnim._playing=true;}}},_complete:function(){if(this.loop){this.start();return;}this._playing=false;events.fire(this,"complete");if(this._opts.destroyOnComplete){this.destroy();}},_processFrame:function(){var i,len,anim,controlAnim=this._controlAnim,msFromStart=(new Date().valueOf())-controlAnim._timeAnchor;for(i=0,len=this._channels.length;i<len;i++){if(!(anim=this._channels[i][this._channelPos[i]])){continue;}anim.position=(msFromStart-anim._timelineOffset)/1000;if(anim.position>anim.duration){anim.position=anim.duration;}anim.value=anim.tween(anim.position/anim.duration);events.fire(anim,"frame");if(anim.position==anim.duration){this._advanceChannel(i);}}},start:function(){var e=events.fire(this,"start");if(e.defaultPrevented()){return this;}var i,iLen,j,jLen,anim;this._playing=true;for(i=0,iLen=this._channels.length;i<iLen;i++){this._channelPos[i]=-1;this._advanceChannel(i);for(j=this._channels[i].length;j;j--){anim=this._channels[i][j];if(anim instanceof r.Animation){anim.goTo(0);}}}this._controlAnim.start();return this;},stop:function(){if(this._playing){var e=events.fire(this,"stop");if(e.defaultPrevented()){return this;}this._playing=false;var anim;for(var i=0,len=this._channels.length;i<len;i++){anim=this._channels[i][this._channelPos[i]];if(anim instanceof r.Animation&&anim._playing){events.fire(anim,"stop");anim._playing=false;}}this._controlAnim.stop();}return this;},destroy:function(){var i,j;this.stop();events.removeAllListeners(this);this._controlAnim.destroy();i=this._channels.length;while(i--){j=this._channels[i].length;while(j--){if(this._channels[i][j].destroy){this._channels[i][j].destroy();}}}return this;},resume:function(){if(!this._playing){var e=events.fire(this,"resume");if(e.defaultPrevented()){return this;}this._playing=true;var anim;for(var i=0,len=this._channels.length;i<len;i++){anim=this._channels[i][this._channelPos[i]];if(anim instanceof r.Animation&&!anim._playing){events.fire(anim,"resume");anim._playing=true;}}this._controlAnim.resume();}return this;},isPlaying:function(){return this._playing;},goTo:function(pos){var i,j,k,channelsLen=this._channels.length,channelLen,anim,runningDuration;if(typeof pos=="number"){if(pos>this.duration){if(this.loop){pos=pos%this.duration;}else{pos=this.duration;}}this._controlAnim.goTo(pos);for(i=0;i<channelsLen;i++){runningDuration=0;for(j=0,channelLen=this._channels[i].length;j<channelLen;j++){anim=this._channels[i][j];if(anim instanceof r.Animation){if((runningDuration+anim.duration)>pos){this._channelPos[i]=j;anim.goTo(pos-runningDuration);break;}anim.goTo(anim.duration);runningDuration+=anim.duration;}}for(k=channelLen;k>j;k--){anim.goTo(0);}}}else{for(i=0;i<channelsLen;i++){runningDuration=0;for(j=0,channelLen=this._channels[i].length;j<channelLen;j++){anim=this._channels[i][j];if(anim===pos){return this.goTo(runningDuration);}if(anim instanceof r.Animation){runningDuration+=anim.duration;}}}throw"Animation not found in animation channels";}return this;}};glow.anim=r;}});(window.gloader||glow).module({name:"glow.forms",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.dom","glow.events","glow.anim","glow.net","glow.i18n"]],builder:function(g){var b=g.i18n,f=g.lang.interpolate;b.addLocaleModule("GLOW_FORMS","en",{TEST_MESSAGE_REQUIRED:"Value is required",TEST_MESSAGE_IS_NUMBER:"Must be a number.",TEST_MESSAGE_MIN:"The value must be at least {arg}.",TEST_MESSAGE_MAX:"The value must be less than {arg}.",TEST_MESSAGE_RANGE:"The value must be {min} or greater, and less than {max}.",TEST_MESSAGE_MIN_COUNT:"Must be have at least {arg} values.",TEST_MESSAGE_MAX_COUNT:"Must be have at most {arg} values.",TEST_MESSAGE_COUNT:"Must have {arg} values.",TEST_MESSAGE_REGEX:"Must be in the correct format.",TEST_MESSAGE_MIN_LEN:"Must be at least {arg} characters.",TEST_MESSAGE_MAX_LEN:"Must be at most {arg} characters.",TEST_MESSAGE_IS_EMAIL:"Must be a valid email address.",TEST_MESSAGE_SAME_AS:"Must be the same as: {arg}",TEST_MESSAGE_AJAX:"server responded",TEST_MESSAGE_IS:"Must be {arg}",TEST_MESSAGE_IS_NOT:"Must not be {arg}"});g.forms={};g.forms.Form=function(k,j){this.formNode=g.dom.get(k);if(!this.formNode[0]){throw"Could not find form. Possibly run before DOM ready.";}this._fields=[];this._result=null;this.opts=j||{};g.events.addListener(this,"validate",this.opts.onValidate||a.defaultFeedback);this._idleTimer=null;this._localeModule=b.getLocaleModule("GLOW_FORMS");var h=this;g.events.addListener(this.formNode,"submit",function(){h.validate("submit");return false;});};g.forms.Form.prototype.validate=function(h,j){this.eventName=h||"submit";this._result=new g.forms.ValidateResult(this.eventName);this._result.form=this;this._fieldCur=0;this._testCur=-1;this._fieldName=j;c.call(this);};var c=function(){this._testCur++;if(this._testCur>=this._fields[this._fieldCur]._tests.length){if(!d.call(this)){return;}}var j=this._fields[this._fieldCur]._tests[this._testCur];var h;if(j.opts.field){h=this.formNode.val()[j.opts.field]||"";j.isConditional=true;}else{h=this.formNode.val()[this._fields[this._fieldCur].name]||"";}if(!h.join){h=[h];}var k=function(l){return function(){e.apply(l,arguments);};}(this);j.opts.on=j.opts.on||"submit";if(this._result.eventName&&(" "+j.opts.on+" ").indexOf(" "+this._result.eventName+" ")!=-1){if(this._fieldName&&this._fieldName!=j.name){c.call(this);return;}if(typeof g.forms.tests[j.type]!="function"){throw"Unimplemented test: no test exists of type '"+j.type+"'.";}j.opts._localeModule=this._localeModule;g.forms.tests[j.type](h,j.opts,k,this.formNode.val());}else{c.call(this);}};var d=function(){this._fieldCur++;this._testCur=0;if(this._fieldCur>=this._fields.length){this._fieldCur=0;g.events.fire(this,"validate",this._result);if(this.eventName=="submit"&&this._result&&!this._result.defaultPrevented()){try{this.formNode[0].submit();}catch(h){throw new Error("Glow can't submit the form because the submit function can't be called. Perhaps that form's submit was replaced by an input element named 'submit'?");}}return false;}return true;};var e=function(h,j){if(typeof h=="boolean"){h=(h)?g.forms.PASS:g.forms.FAIL;}if(this._fields[this._fieldCur]._tests[this._testCur].isConditional&&h===g.forms.FAIL){h=g.forms.SKIP;}this._result.fields.push({name:this._fields[this._fieldCur].name,result:h,message:j});if(h!==g.forms.PASS){if(h===g.forms.FAIL){this._result.errorCount++;}this._testCur=this._fields[this._fieldCur]._tests.length;}c.call(this);};g.forms.Form.prototype.addTests=function(r){var q={name:r,_tests:[]};var j=function(s){return function(){s.validate.apply(s,["change",r]);};}(this);var n=function(s){return function(){s.validate.apply(s,["click",r]);};}(this);var o=function(s){return function(){s.validate.apply(s,["idle",r]);};}(this);for(var l=1;l<arguments.length;l++){var k=arguments[l][0];var p=(arguments[l].length>1)?arguments[l][1]:{};q._tests.push({name:r,type:k,opts:p});if(!j.added&&(" "+p.on+" ").indexOf(" change ")!=-1){var m=this.formNode.get("*").each(function(s){if(this.name==r){g.events.addListener(this,"change",j);j.added=true;}});}if(!n.added&&(" "+p.on+" ").indexOf(" click ")!=-1){var m=this.formNode.get("*").each(function(s){if(this.name==r){g.events.addListener(this,"click",n);n.added=true;}});}if(!o.added&&(" "+p.on+" ").indexOf(" idle ")!=-1){var h=(typeof p.delay!="undefined")?parseInt(p.delay):1000;var m=this.formNode.get("*").each(function(s){if(this.name==r){g.events.addListener(this,"keyup",function(u){return function(){window.clearTimeout(this.idleTimeoutID);if(this.value){this.idleTimeoutID=window.setTimeout(o,u);}};}(h));g.events.addListener(this,"blur",function(){window.clearTimeout(this.idleTimeoutID);});o.added=true;}});}}this._fields.push(q);return this;};g.forms.ValidateResult=function(h){g.events.Event.apply(this);this.eventName=h;this.errorCount=0;this.value=undefined;this.fields=[];};g.lang.extend(g.forms.ValidateResult,g.events.Event);g.forms.PASS=1;g.forms.FAIL=0;g.forms.SKIP=-1;g.forms.tests={required:function(j,m,n){var l=m.message||m._localeModule.TEST_MESSAGE_REQUIRED;for(var k=0,h=j.length;k<h;k++){if(/^\s*$/.test(j[k])){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},isNumber:function(j,m,n){var l=m.message||m._localeModule.TEST_MESSAGE_IS_NUMBER;for(var k=0,h=j.length;k<h;k++){if(j[k]==""||isNaN(j[k])){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},min:function(j,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_MIN,{arg:m.arg});for(var k=0,h=j.length;k<h;k++){if(Number(j[k])<Number(m.arg)){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},max:function(j,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_MAX,{arg:m.arg});for(var k=0,h=j.length;k<h;k++){if(Number(j[k])>Number(m.arg)){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},range:function(k,o,p){var n=o.arg.split("..");if(typeof n[0]=="undefined"||typeof n[1]=="undefined"){throw"Range test requires a parameter like 0..10.";}var m=o.message||f(o._localeModule.TEST_MESSAGE_RANGE,{min:n[0],max:n[1]});n[0]*=1;n[1]*=1;if(n[0]>n[1]){var j=n[0];n[0]=n[1];n[1]=j;}for(var l=0,h=k.length;l<h;l++){if(k[l]<n[0]||k[l]>n[1]){p(g.forms.FAIL,m);return;}}p(g.forms.PASS,m);},minCount:function(h,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_MIN_COUNT,{arg:m.arg});var k=0;for(var j=0;j<h.length;j++){if(h[j]!=""){k++;}}if(k<m.arg){n(g.forms.FAIL,l);return;}n(g.forms.PASS,l);},maxCount:function(h,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_MAX_COUNT,{arg:m.arg});var k=0;for(var j=0;j<h.length;j++){if(h[j]!=""){k++;}}if(k>m.arg){n(g.forms.FAIL,l);return;}n(g.forms.PASS,l);},count:function(h,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_COUNT,{arg:m.arg});var k=0;for(var j=0;j<h.length;j++){if(h[j]!=""){k++;}}if(k!=m.arg){n(g.forms.FAIL,l);return;}n(g.forms.PASS,l);},regex:function(j,n,o){var m=n.message||n._localeModule.TEST_MESSAGE_REGEX;var l=(typeof n.arg=="string")?new RegExp(n.arg):n.arg;for(var k=0,h=j.length;k<h;k++){if(!l.test(j[k])){o(g.forms.FAIL,m);return;}}o(g.forms.PASS,m);},minLen:function(j,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_MIN_LEN,{arg:m.arg});for(var k=0,h=j.length;k<h;k++){if(j[k].length<m.arg){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},maxLen:function(j,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_MAX_LEN,{arg:m.arg});for(var k=0,h=j.length;k<h;k++){if(j[k].length>m.arg){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},isEmail:function(j,m,n){var l=m.message||m._localeModule.TEST_MESSAGE_IS_EMAIL;for(var k=0,h=j.length;k<h;k++){if(!/^\s*[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\s*$/i.test(j[k])){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},sameAs:function(j,n,p,o){var m=n.message||f(n._localeModule.TEST_MESSAGE_SAME_AS,{arg:n.arg});var k=o[n.arg];for(var l=0,h=j.length;l<h;l++){if(j[l]!=k){p(g.forms.FAIL,m);return;}}p(g.forms.PASS,m);},ajax:function(o,h,q,n){var m={},r=(h.message||h._localeModule.TEST_MESSAGE_AJAX);for(var k in n){if(typeof n[k]=="string"){m[k]=escape(n[k]);}else{if(typeof n[k].push!="undefined"){m[k]=g.lang.map(n[k],function(p){return escape(p);}).join(",");}}}var j=g.lang.interpolate(h.url,m);var l=g.net.get(j,{onLoad:function(p){var s=h.arg(p);if(typeof s.push=="undefined"){s=[s,r];}q(s[0],s[1]);},onError:function(p){alert("Error getting file: "+j);}});},custom:function(h,j,k){j.arg.apply(this,arguments);},is:function(j,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_IS,{arg:m.arg});for(var k=0,h=j.length;k<h;k++){if(j[k]!=m.arg){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);},isNot:function(j,m,n){var l=m.message||f(m._localeModule.TEST_MESSAGE_IS_NOT,{arg:m.arg});for(var k=0,h=j.length;k<h;k++){if(j[k]==m.arg){n(g.forms.FAIL,l);return;}}n(g.forms.PASS,l);}};var a=g.forms.feedback={};a.defaultFeedback=(function(){var h;function l(){if(!h){h=g.dom.create('<input type="hidden" value="0" name="1.7.0" id="1.7.0" />').appendTo(document.body);}h[0].value++;}function k(o){var n=o.fields,r,q,s,p,m;for(p=0,m=n.length;p<m;p++){r=g.dom.get(o.form.formNode[0].elements[n[p].name]);q=g.dom.get("."+n[p].name.replace(/(\W)/g,"\\$1")+"-msgContainer");if(!q[0]&&r.length==1){q=o.form.formNode.get("label").filter(function(){return this.htmlFor==r[0].id;});}s=q.get("span.glow-errorMsg");if(n[p].result){s.remove();r.removeClass("glow-invalid");}else{if(q.length){if(!s[0]){q.append((s=g.dom.create('<span class="glow-errorMsg"></span>')));}s.text(n[p].message);r.addClass("glow-invalid");}}}}function j(p){var s=p.fields,v,n,o,r,m,q,t;p.form.formNode.get("div.glow-errorSummary").remove();n=g.dom.create('<div class="glow-errorSummary" tabindex="-1"><ul></ul></div>');o=n.get("ul");for(q=0,t=s.length;q<t;q++){v=g.dom.get(p.form.formNode[0].elements[s[q].name]);r=g.dom.get("."+s[q].name.replace(/(\W)/g,"\\$1")+"-prompt");if(!r[0]&&v.length==1){r=p.form.formNode.get("label").filter(function(){return this.htmlFor==v[0].id;});}if(r[0]){r.get("span.glow-errorMsg").remove();m=g.lang.trim(r.text());if(m.slice(-1)==":"){m=m.slice(0,-1);}}else{m=s[q].name.replace(/^\w/,function(w){return w.toUpperCase();});}if(!s[q].result){o.append(g.dom.create("<li></li>").text(m+": "+s[q].message));}}p.form.formNode.prepend(n.css("opacity","0"));g.anim.css(n,"0.5",{opacity:{from:0,to:1}},{tween:g.tweens.easeOut()}).start();try{n[0].focus();}catch(u){}l();}return function(m){if(m.eventName=="submit"){if(!m.errorCount){m.form.formNode.get("div.glow-errorSummary").remove();return;}j(m);}setTimeout(function(){k(m);},0);return false;};}());}});(window.gloader||glow).module({name:"glow.embed",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.dom","glow.data","glow.i18n"]],builder:function(n){var o=n.i18n;o.addLocaleModule("GLOW_EMBED","en",{FLASH_MESSAGE:"This content requires Flash Player version {min} (installed version: {installed})",NO_PLAYER_MESSAGE:"No Flash Flayer installed, or version is pre 6.0.0"});function b(s){var r="";for(var t in s){if(t.toLowerCase()=="flashvars"&&typeof s[t]=="object"){r+=' FlashVars="'+n.data.encodeUrl(s[t])+'"';}else{r+=" "+t+'="'+s[t]+'"';}}return r;}function q(s){var u="",t,v;for(t in s){if(t.toLowerCase()=="flashvars"&&typeof s[t]=="object"){v=n.data.encodeUrl(s[t]);}else{v=s[t];}u+='<param name="'+t+'" value="'+v+'" />\n';}return u;}function h(s,r){s=s||{};for(var t in r){if(typeof s[t]=="undefined"){s[t]=r[t];}else{if(typeof r[t]=="object"){s[t]=h(s[t],r[t]);}}}return s;}function c(){var r=(navigator.platform||navigator.userAgent);return r.match(/win/i)?"win":r.match(/mac/i)?"mac":"other";}function l(r){var t=/^WIN (\d+),(\d+),(\d+),\d+$/;var s=r.GetVariable("$version");if($match=t.exec(s)){return{major:parseInt($match[1]),minor:parseInt($match[2]),release:parseInt($match[3]),actual:s};}else{}}function k(){var s,u,v={major:0,minor:0,release:0},r=v;if(n.env.ie){try{u=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");r=l(u);}catch(w){try{u=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{u.AllowScriptAccess="always";r=l(u);}catch(w){r={major:6,minor:0,release:29};}}catch(w){}}}else{var t=/^Shockwave Flash\s*(\d+)\.(\d+)\s*\w(\d+)$/;if((u=navigator.plugins["Shockwave Flash"])&&(s=t.exec(u.description))){r={major:parseInt(s[1]),minor:parseInt(s[2]),release:parseInt(s[3]),actual:u.description};}}r.toString=function(){return this.major?[this.major,this.minor,this.release].join("."):o.getLocaleModule("GLOW_EMBED").NO_PLAYER_MESSAGE;};return r;}var m=k();function f(t){if(typeof t!="object"){var s=String(t).match(/^(\d+)(?:\.(\d+)(?:\.(\d+))?)?$/);if(!s){throw new Error('glow.embed._meetsVersionRequirements: invalid format for version string, require "n.n.n" or "n.n" or simply "n" where n is a numeric value');}t={major:parseInt(s[1],10),minor:parseInt(s[2]||0,10),release:parseInt(s[3]||0,10)};}var r=m,u=t;return(r.major>u.major||(r.major==u.major&&r.minor>u.minor)||(r.major==u.major&&r.minor==u.minor&&r.release>=u.release));}var e=n.env.ie?j:g;function g(t,r,s){return'<embed type="application/x-shockwave-flash" src="'+t+'"'+b(r)+b(s)+"></embed>";}function j(t,r,s){return'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+b(r)+'><param name="movie" value="'+t+'" />'+q(s)+"</object>";}var a={},p=0;function d(){return n.UID+"FlashEmbed"+(p++);}a.Flash=function(x,r,w,v){v=h(v,{width:"100%",height:"100%",params:{allowscriptaccess:"always",allowfullscreen:"true",quality:"high"},attributes:{},message:n.lang.interpolate(o.getLocaleModule("GLOW_EMBED").FLASH_MESSAGE,{min:w,installed:m}),id:(v&&v.attributes&&v.attributes.id)||d()});r=n.dom.get(r);if(!r.length){throw new Error("glow.embed.Flash unable to locate container");}this.container=r;this.movie=null;this._displayErrorMessage=typeof v.message=="function"?v.message:function(){return v.message;};this.isSupported;if(this.isSupported=f(w)){var s=v.attributes,u=["id","width","height"],t=u.length;while(t--){if(v[u[t]]){s[u[t]]=v[u[t]];}}if(v.className){s["class"]=v.className;}this._embed_tag=e(x,s,v.params);}};a.Flash.version=function(){return m;};a.Flash.prototype.embed=function(){var s=this.container[0];if(this.isSupported){s.innerHTML=this._embed_tag;this.movie=s.firstChild;}else{var r=this._displayErrorMessage();if(r){s.innerHTML=r;}}return this;};n.embed=a;}});(window.gloader||glow).module({name:"glow.dragdrop",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.tweens","glow.events","glow.dom","glow.anim"]],builder:function(j){var c=j.events,k=c.addListener,v=c.fire,g=c.removeListener,q=j.dom,h=q.get,m=q.create;var n={},w=1000,a=(document.compatMode=="CSS1Compat"&&j.env.ie>=5)?true:false,x=(document.compatMode!="CSS1Compat"&&j.env.ie>=5)?true:false,d=j.env.ie>=5,s=["top","right","bottom","left"];function b(r,z){var A=r.prototype[z];var y="cached_"+z;r.prototype[z]=function(){if(y in this){return this[y];}return this[y]=A.apply(this,arguments);};}function u(A,z){var r=s.length,y;while(r--){y="margin-"+s[r];A.css(y,z.css(y));}}function f(r,y){var A=r.prototype[y];var z="cached_"+y;r.prototype[y]=function(B){if(!this[z]){this[z]={};}if(B in this[z]){return this[z][B];}return this[z][B]=A.apply(this,arguments);};}function t(A,z){for(var y=0,r=z.length;y<r;y++){delete A["cached_"+z[y]];}}var o=function(r){this.el=r;};o.prototype={val:function(r){var y=parseInt(this.el.css(r));return y||0;},width:function(){return this.borderWidth()-this.val("border-left-width")-this.val("border-right-width");},height:function(){return this.borderHeight()-this.val("border-top-width")-this.val("border-bottom-width");},offsetParentPageTop:function(){var r=this.el[0],z,y;while(r=r.offsetParent){if(h(r).css("position")!="static"){break;}}return r?h(r).offset().top:0;},offsetTop:function(){return this.el.position().top;},offsetLeft:function(){return this.el.position().left;},borderWidth:function(){var r=this.el[0].offsetWidth;if(j.env.khtml){r-=this.val("margin-left")+this.val("margin-right")+this.val("border-left-width")+this.val("border-right-width");}return r;},borderHeight:function(){if(this._logicalBottom){return this._logicalBottom-this.offsetTop();}var r=this.el[0].offsetHeight;if(j.env.khtml){r-=this.val("margin-top")+this.val("margin-bottom")+this.val("border-top-width")+this.val("border-bottom-width");}return r;},outerWidth:function(){return this.borderWidth()+this.val("margin-left")+this.val("margin-right");},outerHeight:function(){return this.borderHeight()+this.val("margin-top")+this.val("margin-bottom");},innerLeftPos:function(){return this.offsetLeft()+this.val("margin-left")+this.val("border-left-width")+this.val("padding-left");},innerTopPos:function(){return this.offsetTop()+this.val("margin-top")+this.val("border-top-width")+this.val("padding-top");},surroundWidth:function(){return this.val("border-left-width")+this.val("padding-left")+this.val("padding-right")+this.val("border-right-width");},surroundHeight:function(){return this.val("border-top-width")+this.val("padding-top")+this.val("padding-bottom")+this.val("border-bottom-width");},verticalCenter:function(){return this.offsetTop()+(this.outerHeight()/2);},horizontalCenter:function(){return this.offsetTop()+(this.outerWidth()/2);}};for(var p in o.prototype){if(p=="val"){f(o,p);}else{b(o,p);}}j.lang.apply(o.prototype,{resetPosition:function(){t(this,["offsetTop","offsetLeft","borderTopPos","borderLeftPos","innerTopPos","innerLeftPos","verticalCenter","horizontalCenter"]);},setLogicalBottom:function(r){this._logicalBottom=r;},boundsFor:function(z){var y,r,A=this.el.css("position");if(A!="static"){y=r=0;}else{y=this.innerTopPos();r=this.innerLeftPos();}return[y,r+this.width()-z.outerWidth(),y+this.height()-z.outerHeight(),r];},outerBounds:function(){var z=this.el.offset(),y=z.left,r=z.top;return[r,y+this.borderWidth(),r+this.borderHeight(),y];},intersectSize:function(z,A){var y=this.outerBounds(),r=z.outerBounds();if(A){y[1]++;r[1]++;y[2]++;r[2]++;}return(y[2]<r[0]?0:r[2]<y[0]?0:y[0]<r[0]?(y[2]<r[2]?y[2]-r[0]:r[2]-r[0]):r[2]<y[2]?r[2]-y[0]:y[2]-y[0])*(y[1]<r[3]?0:r[1]<y[3]?0:y[3]<r[3]?(y[1]<r[1]?y[1]-r[3]:r[1]-r[3]):r[1]<y[1]?r[1]-y[3]:y[1]-y[3]);},sizePlaceholder:function(C,D,A,y){var B=new o(C),z=this.el,r=D||z.css("position");C.css("display","none");z.after(C);C.css("width",(z[0].offsetWidth-B.surroundWidth())+"px").css("height",(z[0].offsetHeight-B.surroundHeight())+"px");u(C,z);C.remove();C.css("display","block");if(r!="static"){C.css("left",A+"px");C.css("top",y+"px");}C.css("position",r);},contains:function(z){var y=this.boundsFor(z),r=z.el.position(),B=r.top,A=r.left;return B>=y[0]&&A<=y[1]&&B<=y[2]&&A>=y[3];},containsPoint:function(y){var r=this.el.offset();return y.x>=r.left&&y.y>=r.top&&y.x<=r.left+this.borderWidth()&&y.y<=r.top+this.borderHeight();},positionedAncestorBox:function(){var r=this.el.parent(),y;while(r[0]){y=r.css("position")||"static";if(y=="relative"||y=="absolute"||y=="fixed"){return new o(r);}r=r.parent();}return null;}});function e(y){var r=y[0].tagName.toLowerCase()=="li"?"li":"div";var z=m("<"+r+"></"+r+">");if(r=="li"){z.css("list-style-type","none");}return z;}n.Draggable=function(A,B){this.element=h(A);this._opts=B=j.lang.apply({dragPrevention:["input","textarea","button","select","option","a"],placeholder:"spacer",placeholderClass:"glow-dragdrop-placeholder",step:{x:1,y:1}},B||{});if(typeof B.step=="number"){B.step={x:B.step,y:B.step};}else{B.step.x=B.step.x||1;B.step.y=B.step.y||1;}this._preventDrag=[];for(var y=0,r=B.dragPrevention.length;y<r;y++){this._preventDrag[y]=B.dragPrevention[y].toLowerCase();}if(B.container){this.container=h(B.container);}this._handle=B.handle&&this.element.get(B.handle)||this.element;if(B.dropTargets){this.dropTargets=h(B.dropTargets);}var z=this._listeners=[],y=0;if(B.onDrag){z[y++]=k(this,"drag",this._opts.onDrag,this);}if(B.onEnter){z[y++]=k(this,"enter",this._opts.onEnter,this);}if(B.onLeave){z[y++]=k(this,"leave",this._opts.onLeave,this);}if(B.onDrop){z[y++]=k(this,"drop",this._opts.onDrop,this);}this._dragListener=k(this._handle,"mousedown",this._startDragMouse,this);return;};n.Draggable.prototype={_createPlaceholder:function(){var r=this.element,z,y=this._box;if(this._opts.placeholder=="clone"){z=r.clone();}else{z=e(r);}if(this._opts.placeholderClass){z.addClass(this._opts.placeholderClass);}y.sizePlaceholder(z,null,this._startLeft,this._startTop);r.after(z);this._placeholder=z;},_removePlaceholder:function(){this._placeholder.remove();},_resetPosition:function(){var G=this._preDragPosition,r=this.element,z=this._box,B=this._startOffset,D=r.css("position"),F,C;z.resetPosition();var A=z.el.position(),y={x:A.left,y:A.top};if(this._placeholder||this._dropIndicator){r.remove();}if(G=="static"&&y.y==B.y&&y.x==B.x){r.css("position","static");r.css("left","");r.css("top","");}else{r.css("z-index",this._preDragZIndex);r.css("position",G=="static"?"relative":G);if(G=="static"){F=y.x-B.x;C=y.y-B.y;}else{if(G=="relative"&&D!="relative"){F=this._startLeft+(y.x-B.x);C=this._startTop+(y.y-B.y);}}if(D!=G){r.css("left",F?F+"px":"");r.css("top",C?C+"px":"");}}if(this._dropIndicator){var E=this._dropIndicator.parent()[0];if(E){E.replaceChild(r[0],this._dropIndicator[0]);}delete this._dropIndicator;if(this._placeholder){this._placeholder.remove();delete this._placeholder;}r.css("position",G);if(G=="relative"&&D!="relative"){r.css("left",this._startLeft);r.css("top",this._startTop);}}else{if(this._placeholder){var E=this._placeholder.parent()[0];if(E){E.replaceChild(r[0],this._placeholder[0]);}delete this._placeholder;}}},_startDragMouse:function(I){var D=this._preventDrag,y=I.source,M=y.tagName.toLowerCase();for(var F=0,E=D.length;F<E;F++){if(D[F]==M){return;}}if(v(this,"drag").defaultPrevented()){return;}if(this._dragging==1){return this.endDrag();}else{if(this._dragging){return;}}this._dragging=1;var B=this.element,A=this.container,r=this._opts,H=this._box=new o(B),C=r.step;this._preDragPosition=B.css("position");var G=H.el.position(),J=this._startOffset={x:G.left,y:G.top};if(A){this._containerBox=new o(A);this._bounds=this._containerBox.boundsFor(H);if(C.x!=1){this._bounds[3]-=(this._bounds[3]-J.x)%C.x;this._bounds[1]-=(this._bounds[1]-J.x)%C.x;}if(C.y!=1){this._bounds[0]-=(this._bounds[0]-J.y)%C.y;this._bounds[2]-=(this._bounds[2]-J.y)%C.y;}}else{delete this._bounds;}this._mouseStart={x:I.pageX,y:I.pageY};this._preDragStyle=B.attr("style");this._preDragZIndex=B.css("z-index");B.css("z-index",w++);this._startLeft=B[0].style.left?parseInt(B[0].style.left):0;this._startTop=B[0].style.top?parseInt(B[0].style.top):0;if(r.placeholder&&r.placeholder!="none"){this._createPlaceholder();}B.css("position","absolute");B.css("left",J.x+"px");B.css("top",J.y+"px");if(a){this._scrollY=document.documentElement.scrollTop;this._innerHeight=document.documentElement.clientHeight;}else{if(x){this._scrollY=document.body.scrollTop;this._innerHeight=document.body.clientHeight;}else{this._scrollY=window.scrollY;this._innerHeight=window.innerHeight;}}var K=function(){return false;},L=document.documentElement;if(this.dropTargets){var z=new c.Event();z.draggable=this;for(var F=0,E=this.dropTargets.length;F<E;F++){v(this.dropTargets[F],"active",z);}this._mousePos={x:I.pageX,y:I.pageY};this._testForDropTargets();}this._dragListeners=[k(L,"selectstart",K),k(L,"dragstart",K),k(L,"mousedown",K),k(L,"mousemove",this._dragMouse,this),k(L,"mouseup",this._releaseElement,this)];return false;},_dragMouse:function(C){var r=this.element,y=this._opts.axis,D=y=="y"?this._startOffset.x:(this._startOffset.x+C.pageX-this._mouseStart.x),B=y=="x"?this._startOffset.y:(this._startOffset.y+C.pageY-this._mouseStart.y),A=this._bounds,z=this._opts.step;if(z.x!=1){D=Math.round((D-this._startOffset.x)/z.x)*z.x+this._startOffset.x;}if(z.y!=1){B=Math.round((B-this._startOffset.y)/z.y)*z.y+this._startOffset.y;}if(A){if(y!="y"){D=D<A[3]?A[3]:D>A[1]?A[1]:D;}if(y!="x"){B=B<A[0]?A[0]:B>A[2]?A[2]:B;}}r[0].style.left=D+"px";r[0].style.top=B+"px";if(this.dropTargets){this._mousePos={x:C.pageX,y:C.pageY};}if(d&&C.nativeEvent.button==0){this._releaseElement(C);return false;}return false;},_testForDropTargets:function(H){if(!this._lock){this._lock=0;}if(H){this._lock--;}else{if(this.lock){return;}}if(this._dragging!=1){return;}var z=this.activeTarget,y,R=this.dropTargets,S,C,F=this._box,K=this._mousePos;F.resetPosition();var D=0;for(var L=0,J=R.length;L<J;L++){S=R[L];C=S._box;if(S._opts.tolerance=="contained"){if(C.contains(F)){y=S;break;}}else{if(S._opts.tolerance=="cursor"){if(C.containsPoint(K)){y=S;break;}}else{var M=C.intersectSize(F,true);if(M>D){D=M;y=S;}}}}this.activeTarget=y;if(y!==z){if(y){var I=new c.Event();I.draggable=this;v(y,"enter",I);var r=new c.Event();r.dropTarget=y;v(this,"enter",r);}if(z){var E=new c.Event();E.draggable=this;v(z,"leave",E);var G=new c.Event();G.dropTarget=z;v(this,"leave",G);}}if(y&&y._opts.dropIndicator!="none"){var P,N=y._childBoxes,A=y._children;F.resetPosition();var Q=y._box.innerTopPos();var T=K.y-F.offsetParentPageTop();var O=0;for(var L=0,J=N.length;L<J;L++){if(A[L]==this.element[0]){continue;}P=N[L];Q+=P.outerHeight();if(T<=Q){if(y._dropIndicatorAt!=L){h(P.el).before(y._dropIndicator);y._dropIndicatorAt=L;}O=1;break;}}if(!O){if(P){h(P.el).after(y._dropIndicator);y._dropIndicatorAt=L+1;}else{y.element.append(y._dropIndicator);y._dropIndicatorAt=0;}}}this._lock++;var B=this;setTimeout(function(){B._testForDropTargets(1);},100);},_releaseElement:function(){if(this._dragging!=1){return;}this._dragging=2;var z,r;var D=this.dropTargets,C=this.activeTarget;if(D){for(z=0,r=D.length;z<r;z++){var B=new c.Event();B.draggable=this;B.droppedOnThis=C&&C==D[z];v(D[z],"inactive",B);}}if(C){var B=new c.Event();B.draggable=this;v(C,"drop",B);}var y=this._dragListeners;for(z=0,r=y.length;z<r;z++){c.removeListener(y[z]);}var A=v(this,"drop");if(!A.defaultPrevented()&&this.dropTargets){this.returnHome();}else{this.endDrag();}},endDrag:function(){if(this._dragging!=2){return;}this._dragging=0;if(this._reset){this._reset();delete this._reset;}if(this.placeholder){this.placeholder.remove();}this._resetPosition();delete this.activeTarget;v(this,"afterDrop");},returnHome:function(G){var z=(G)?G:j.tweens.linear(),C,r,A=this.element,E=this._box.el.position(),y=Math.pow(Math.pow(this._startOffset.x-E.left,2)+Math.pow(this._startOffset.y-E.top,2),0.5),B=0.3+(y/1000);var D=[[j.anim.css(A,B,{left:this._startOffset.x,top:this._startOffset.y},{tween:z})]];if(this._dropIndicator){D.push([j.anim.css(this._dropIndicator,B-0.1,{opacity:{to:0}})]);}var F=new j.anim.Timeline(D);k(F,"complete",function(){this.endDrag();},this);F.start();return;}};var l=0;n.DropTarget=function(r,y){r=this.element=h(r);if(!r.length){throw"no element passed into DropTarget constuctor";}if(r.length>1){throw"more than one element passed into DropTarget constructor";}this._id=++l;this._opts=y=j.lang.apply({dropIndicator:"none",dropIndicatorClass:"glow-dragdrop-dropindicator",tolerance:"intersect"},y||{});if(y.onActive){k(this,"active",y.onActive);}if(y.onInactive){k(this,"inactive",y.onInactive);}if(y.onEnter){k(this,"enter",y.onEnter);}if(y.onLeave){k(this,"leave",y.onLeave);}if(y.onDrop){k(this,"drop",y.onDrop);}k(this,"active",this._onActive);k(this,"inactive",this._onInactive);return this;};n.DropTarget.prototype={setLogicalBottom:function(r){this._logicalBottom=r;},_onActive:function(A){var y=A.draggable;this._box=new o(this.element);if(this._logicalBottom){this._box.setLogicalBottom(this._logicalBottom);}if(this._opts.dropIndicator=="none"){return;}this._onEnterListener=k(this,"enter",this._onEnter);this._onLeaveListener=k(this,"leave",this._onLeave);this._dropIndicator=e(y.element);if(this._opts.dropIndicatorClass){this._dropIndicator.addClass(this._opts.dropIndicatorClass);}y._box.sizePlaceholder(this._dropIndicator,"relative",0,0);var z=this._children=h(this.element.children()).filter(function(){var B=h(this);return(!A.draggable._placeholder||!B.eq(A.draggable._placeholder))&&(!this._dropIndicator||!B.eq(this._dropIndicator));});var r=this._childBoxes=[];z.each(function(B){r[B]=new o(h(z[B]));});},_onInactive:function(r){g(this._onEnterListener);g(this._onLeaveListener);delete this._box;if(this._opts.dropIndicator=="none"){return;}if(!r.droppedOnThis&&this._dropIndicator){this._dropIndicator.remove();delete this._dropIndicator;}delete this._childBoxes;delete this._children;},_onEnter:function(){this._dropIndicatorAt=-1;},_onLeave:function(){this._dropIndicator.remove();},moveToPosition:function(y){var C=this._dropIndicator,z=new o(C);var B=parseInt(C.css("margin-left"))||0,A=parseInt(C.css("margin-top"))||0,r=z.el.position();y._startOffset={x:r.left,y:r.top};y._dropIndicator=C;delete this._dropIndicator;}};j.dragdrop=n;}});
+/*@end @*/
diff --git a/ricoClient/js/baselibs/jquery-1.3.js b/ricoClient/js/baselibs/jquery-1.3.js
new file mode 100644 (file)
index 0000000..b1ae21d
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ *  Copyright 2009, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file
diff --git a/ricoClient/js/baselibs/jquery-1.4.js b/ricoClient/js/baselibs/jquery-1.4.js
new file mode 100644 (file)
index 0000000..a448490
--- /dev/null
@@ -0,0 +1,5999 @@
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
+ */
+(function( window, undefined ) {
+
+// 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 );
+       },
+
+       // Map over jQuery in case of overwrite
+       _jQuery = window.jQuery,
+
+       // Map over the $ in case of overwrite
+       _$ = window.$,
+
+       // Use the correct document accordingly with window argument (sandbox)
+       document = window.document,
+
+       // A central reference to the root jQuery(document)
+       rootjQuery,
+
+       // A simple way to check for HTML strings or ID strings
+       // (both of which we optimize for)
+       quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+       // Is it a simple selector
+       isSimple = /^.[^:#\[\.,]*$/,
+
+       // Check if a string has a non-whitespace character in it
+       rnotwhite = /\S/,
+
+       // Used for trimming whitespace
+       rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+       // Match a standalone tag
+       rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+       // Keep a UserAgent string for use with jQuery.browser
+       userAgent = navigator.userAgent,
+
+       // For matching the engine and version of the browser
+       browserMatch,
+       
+       // Has the ready events already been bound?
+       readyBound = false,
+       
+       // The functions to execute on DOM ready
+       readyList = [],
+
+       // The ready event handler
+       DOMContentLoaded,
+
+       // Save a reference to some core methods
+       toString = Object.prototype.toString,
+       hasOwnProperty = Object.prototype.hasOwnProperty,
+       push = Array.prototype.push,
+       slice = Array.prototype.slice,
+       indexOf = Array.prototype.indexOf;
+
+jQuery.fn = jQuery.prototype = {
+       init: function( selector, context ) {
+               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;
+               }
+
+               // Handle HTML strings
+               if ( typeof selector === "string" ) {
+                       // Are we dealing with HTML string or an ID?
+                       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] ) {
+                                       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 = buildFragment( [ match[1] ], [ doc ] );
+                                               selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+                                       }
+
+                               // HANDLE: $("#id")
+                               } else {
+                                       elem = document.getElementById( match[2] );
+
+                                       if ( elem ) {
+                                               // 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: $("TAG")
+                       } else if ( !context && /^\w+$/.test( selector ) ) {
+                               this.selector = selector;
+                               this.context = document;
+                               selector = document.getElementsByTagName( selector );
+
+                       // 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 jQuery( 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.isArray( selector ) ?
+                       this.setArray( selector ) :
+                       jQuery.makeArray( selector, this );
+       },
+
+       // Start with an empty selector
+       selector: "",
+
+       // The current version of jQuery being used
+       jquery: "1.4",
+
+       // 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.slice(num)[ 0 ] : 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 = jQuery( elems || null );
+
+               // 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;
+       },
+
+       // Force the current matched set of elements to become
+       // the specified array of elements (destroying the stack in the process)
+       // You should use pushStack() in order to do this, but maintain the stack
+       setArray: function( elems ) {
+               // Resetting the length to 0, then using the native Array push
+               // is a super-fast way to populate an object with array-like properties
+               this.length = 0;
+               push.apply( this, elems );
+
+               return this;
+       },
+
+       // 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();
+
+               // If the DOM is already ready
+               if ( jQuery.isReady ) {
+                       // Execute the function immediately
+                       fn.call( document, jQuery );
+
+               // Otherwise, remember the function for later
+               } else if ( readyList ) {
+                       // Add the function to the wait list
+                       readyList.push( fn );
+               }
+
+               return this;
+       },
+       
+       eq: function( 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 || jQuery(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() {
+       // copy reference to target object
+       var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+
+       // 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 object literal values or arrays
+                               if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
+                                       var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
+                                               : jQuery.isArray(copy) ? [] : {};
+
+                                       // 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 ) {
+               window.$ = _$;
+
+               if ( deep ) {
+                       window.jQuery = _jQuery;
+               }
+
+               return jQuery;
+       },
+       
+       // Is the DOM ready to be used? Set to true once it occurs.
+       isReady: false,
+       
+       // Handle when the DOM is ready
+       ready: function() {
+               // Make sure that the DOM is not already loaded
+               if ( !jQuery.isReady ) {
+                       // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+                       if ( !document.body ) {
+                               return setTimeout( jQuery.ready, 13 );
+                       }
+
+                       // Remember that the DOM is ready
+                       jQuery.isReady = true;
+
+                       // If there are functions bound, to execute
+                       if ( readyList ) {
+                               // Execute all of them
+                               var fn, i = 0;
+                               while ( (fn = readyList[ i++ ]) ) {
+                                       fn.call( document, jQuery );
+                               }
+
+                               // Reset the list of functions
+                               readyList = null;
+                       }
+
+                       // Trigger any bound ready events
+                       if ( jQuery.fn.triggerHandler ) {
+                               jQuery( document ).triggerHandler( "ready" );
+                       }
+               }
+       },
+       
+       bindReady: function() {
+               if ( readyBound ) {
+                       return;
+               }
+
+               readyBound = true;
+
+               // Catch cases where $(document).ready() is called after the
+               // browser event has already occurred.
+               if ( document.readyState === "complete" ) {
+                       return jQuery.ready();
+               }
+
+               // 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 toString.call(obj) === "[object Function]";
+       },
+
+       isArray: function( obj ) {
+               return toString.call(obj) === "[object Array]";
+       },
+
+       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 || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+                       return false;
+               }
+               
+               // Not own constructor property must be Object
+               if ( obj.constructor
+                       && !hasOwnProperty.call(obj, "constructor")
+                       && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+                       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 || hasOwnProperty.call( obj, key );
+       },
+
+       isEmptyObject: function( obj ) {
+               for ( var name in obj ) {
+                       return false;
+               }
+               return true;
+       },
+
+       noop: function() {},
+
+       // Evalulates a script in a global context
+       globalEval: function( data ) {
+               if ( data && rnotwhite.test(data) ) {
+                       // Inspired by code by Andrea Giammarchi
+                       // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement,
+                               script = document.createElement("script");
+
+                       script.type = "text/javascript";
+
+                       if ( jQuery.support.scriptEval ) {
+                               script.appendChild( document.createTextNode( data ) );
+                       } else {
+                               script.text = data;
+                       }
+
+                       // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+                       // This arises when a base node is used (#2709).
+                       head.insertBefore( script, head.firstChild );
+                       head.removeChild( script );
+               }
+       },
+
+       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 ( var value = object[0];
+                                       i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+                       }
+               }
+
+               return object;
+       },
+
+       trim: function( text ) {
+               return (text || "").replace( rtrim, "" );
+       },
+
+       // results is for internal usage only
+       makeArray: function( array, results ) {
+               var ret = results || [];
+
+               if ( array != null ) {
+                       // The window, strings (and functions) also have 'length'
+                       // The extra typeof function check is to prevent crashes
+                       // in Safari 2 (See: #3039)
+                       if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+                               push.call( ret, array );
+                       } else {
+                               jQuery.merge( ret, array );
+                       }
+               }
+
+               return ret;
+       },
+
+       inArray: function( 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;
+       },
+
+       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 = [];
+
+               // Go through the array, only saving the items
+               // that pass the validator function
+               for ( var i = 0, length = elems.length; i < length; i++ ) {
+                       if ( !inv !== !callback( elems[ i ], i ) ) {
+                               ret.push( elems[ i ] );
+                       }
+               }
+
+               return ret;
+       },
+
+       // arg is for internal usage only
+       map: function( elems, callback, arg ) {
+               var ret = [], value;
+
+               // Go through the array, translating each of the items to their
+               // new value (or values).
+               for ( var i = 0, length = elems.length; i < length; i++ ) {
+                       value = callback( elems[ i ], i, arg );
+
+                       if ( value != null ) {
+                               ret[ ret.length ] = value;
+                       }
+               }
+
+               return ret.concat.apply( [], ret );
+       },
+
+       // A global GUID counter for objects
+       guid: 1,
+
+       proxy: function( fn, proxy, thisObject ) {
+               if ( arguments.length === 2 ) {
+                       if ( typeof proxy === "string" ) {
+                               thisObject = fn;
+                               fn = thisObject[ proxy ];
+                               proxy = undefined;
+
+                       } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+                               thisObject = proxy;
+                               proxy = undefined;
+                       }
+               }
+
+               if ( !proxy && fn ) {
+                       proxy = function() {
+                               return fn.apply( thisObject || this, arguments );
+                       };
+               }
+
+               // Set the guid of unique handler to the same of original handler, so it can be removed
+               if ( fn ) {
+                       proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+               }
+
+               // So proxy can be declared as an argument
+               return proxy;
+       },
+
+       // Use of jQuery.browser is frowned upon.
+       // More details: http://docs.jquery.com/Utilities/jQuery.browser
+       uaMatch: function( ua ) {
+               var ret = { browser: "" };
+
+               ua = ua.toLowerCase();
+
+               if ( /webkit/.test( ua ) ) {
+                       ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
+
+               } else if ( /opera/.test( ua ) ) {
+                       ret = { browser: "opera", version:  /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
+                       
+               } else if ( /msie/.test( ua ) ) {
+                       ret = { browser: "msie", version: /msie ([\w.]+)/ };
+
+               } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
+                       ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
+               }
+
+               ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
+
+               return ret;
+       },
+
+       browser: {}
+});
+
+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;
+}
+
+if ( indexOf ) {
+       jQuery.inArray = function( elem, array ) {
+               return indexOf.call( array, elem );
+       };
+}
+
+// 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( error ) {
+               setTimeout( doScrollCheck, 1 );
+               return;
+       }
+
+       // and execute any waiting functions
+       jQuery.ready();
+}
+
+if ( indexOf ) {
+       jQuery.inArray = function( elem, array ) {
+               return indexOf.call( array, elem );
+       };
+}
+
+function evalScript( i, elem ) {
+       if ( elem.src ) {
+               jQuery.ajax({
+                       url: elem.src,
+                       async: false,
+                       dataType: "script"
+               });
+       } else {
+               jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+       }
+
+       if ( elem.parentNode ) {
+               elem.parentNode.removeChild( elem );
+       }
+}
+
+// Mutifunctional method to get and set values to a collection
+// The value/s can be optionally by executed if its a function
+function access( elems, key, value, exec, fn, pass ) {
+       var length = elems.length;
+       
+       // Setting many attributes
+       if ( typeof key === "object" ) {
+               for ( var k in key ) {
+                       access( elems, k, key[k], exec, fn, value );
+               }
+               return elems;
+       }
+       
+       // Setting one attribute
+       if ( value !== undefined ) {
+               // Optionally, function values get executed if exec is true
+               exec = !pass && exec && jQuery.isFunction(value);
+               
+               for ( var i = 0; i < length; i++ ) {
+                       fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+               }
+               
+               return elems;
+       }
+       
+       // Getting an attribute
+       return length ? fn( elems[0], key ) : null;
+}
+
+function now() {
+       return (new Date).getTime();
+}
+(function() {
+
+       jQuery.support = {};
+
+       var root = document.documentElement,
+               script = document.createElement("script"),
+               div = document.createElement("div"),
+               id = "script" + now();
+
+       div.style.display = "none";
+       div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+       var all = div.getElementsByTagName("*"),
+               a = div.getElementsByTagName("a")[0];
+
+       // Can't get basic test support
+       if ( !all || !all.length || !a ) {
+               return;
+       }
+
+       jQuery.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 insted)
+               style: /red/.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: div.getElementsByTagName("input")[0].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: document.createElement("select").appendChild( document.createElement("option") ).selected,
+
+               // Will be defined later
+               scriptEval: false,
+               noCloneEvent: true,
+               boxModel: null
+       };
+
+       script.type = "text/javascript";
+       try {
+               script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+       } catch(e) {}
+
+       root.insertBefore( script, root.firstChild );
+
+       // Make sure that the execution of code works by injecting a script
+       // tag with appendChild/createTextNode
+       // (IE doesn't support this, fails, and uses .text instead)
+       if ( window[ id ] ) {
+               jQuery.support.scriptEval = true;
+               delete window[ id ];
+       }
+
+       root.removeChild( script );
+
+       if ( div.attachEvent && div.fireEvent ) {
+               div.attachEvent("onclick", function click() {
+                       // Cloning a node shouldn't copy over any
+                       // bound event handlers (IE does this)
+                       jQuery.support.noCloneEvent = false;
+                       div.detachEvent("onclick", click);
+               });
+               div.cloneNode(true).fireEvent("onclick");
+       }
+
+       // Figure out if the W3C box model works as expected
+       // document.body must exist before we can do this
+       // TODO: This timeout is temporary until I move ready into core.js.
+       jQuery(function() {
+               var div = document.createElement("div");
+               div.style.width = div.style.paddingLeft = "1px";
+
+               document.body.appendChild( div );
+               jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+               document.body.removeChild( div ).style.display = 'none';
+               div = null;
+       });
+
+       // Technique from Juriy Zaytsev
+       // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+       var eventSupported = function( eventName ) { 
+               var el = document.createElement("div"); 
+               eventName = "on" + eventName; 
+
+               var isSupported = (eventName in el); 
+               if ( !isSupported ) { 
+                       el.setAttribute(eventName, "return;"); 
+                       isSupported = typeof el[eventName] === "function"; 
+               } 
+               el = null; 
+
+               return isSupported; 
+       };
+       
+       jQuery.support.submitBubbles = eventSupported("submit");
+       jQuery.support.changeBubbles = eventSupported("change");
+
+       // release memory in IE
+       root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+       "for": "htmlFor",
+       "class": "className",
+       readonly: "readOnly",
+       maxlength: "maxLength",
+       cellspacing: "cellSpacing",
+       rowspan: "rowSpan",
+       colspan: "colSpan",
+       tabindex: "tabIndex",
+       usemap: "useMap",
+       frameborder: "frameBorder"
+};
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+var emptyObject = {};
+
+jQuery.extend({
+       cache: {},
+       
+       expando:expando,
+
+       // The following elements throw uncatchable exceptions if you
+       // attempt to add expando properties to them.
+       noData: {
+               "embed": true,
+               "object": true,
+               "applet": true
+       },
+
+       data: function( elem, name, data ) {
+               if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+                       return;
+               }
+
+               elem = elem == window ?
+                       windowData :
+                       elem;
+
+               var id = elem[ expando ], cache = jQuery.cache, thisCache;
+
+               // Handle the case where there's no name immediately
+               if ( !name && !id ) {
+                       return null;
+               }
+
+               // Compute a unique ID for the element
+               if ( !id ) { 
+                       id = ++uuid;
+               }
+
+               // Avoid generating a new cache unless none exists and we
+               // want to manipulate it.
+               if ( typeof name === "object" ) {
+                       elem[ expando ] = id;
+                       thisCache = cache[ id ] = jQuery.extend(true, {}, name);
+               } else if ( cache[ id ] ) {
+                       thisCache = cache[ id ];
+               } else if ( typeof data === "undefined" ) {
+                       thisCache = emptyObject;
+               } else {
+                       thisCache = cache[ id ] = {};
+               }
+
+               // Prevent overriding the named cache with undefined values
+               if ( data !== undefined ) {
+                       elem[ expando ] = id;
+                       thisCache[ name ] = data;
+               }
+
+               return typeof name === "string" ? thisCache[ name ] : thisCache;
+       },
+
+       removeData: function( elem, name ) {
+               if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+                       return;
+               }
+
+               elem = elem == window ?
+                       windowData :
+                       elem;
+
+               var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
+
+               // If we want to remove a specific section of the element's data
+               if ( name ) {
+                       if ( thisCache ) {
+                               // Remove the section of cache data
+                               delete thisCache[ name ];
+
+                               // If we've removed all the data, remove the element's cache
+                               if ( jQuery.isEmptyObject(thisCache) ) {
+                                       jQuery.removeData( elem );
+                               }
+                       }
+
+               // Otherwise, we want to remove all of the element's data
+               } else {
+                       // Clean up the element expando
+                       try {
+                               delete elem[ expando ];
+                       } catch( e ) {
+                               // IE has trouble directly removing the expando
+                               // but it's ok with using removeAttribute
+                               if ( elem.removeAttribute ) {
+                                       elem.removeAttribute( expando );
+                               }
+                       }
+
+                       // Completely remove the data cache
+                       delete cache[ id ];
+               }
+       }
+});
+
+jQuery.fn.extend({
+       data: function( key, value ) {
+               if ( typeof key === "undefined" && this.length ) {
+                       return jQuery.data( this[0] );
+
+               } else if ( typeof key === "object" ) {
+                       return this.each(function() {
+                               jQuery.data( this, key );
+                       });
+               }
+
+               var parts = key.split(".");
+               parts[1] = parts[1] ? "." + parts[1] : "";
+
+               if ( value === undefined ) {
+                       var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+                       if ( data === undefined && this.length ) {
+                               data = jQuery.data( this[0], key );
+                       }
+                       return data === undefined && parts[1] ?
+                               this.data( parts[0] ) :
+                               data;
+               } else {
+                       return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+                               jQuery.data( this, key, value );
+                       });
+               }
+       },
+
+       removeData: function( key ) {
+               return this.each(function() {
+                       jQuery.removeData( this, key );
+               });
+       }
+});
+jQuery.extend({
+       queue: function( elem, type, data ) {
+               if ( !elem ) {
+                       return;
+               }
+
+               type = (type || "fx") + "queue";
+               var q = jQuery.data( elem, type );
+
+               // Speed up dequeue by getting out quickly if this is just a lookup
+               if ( !data ) {
+                       return q || [];
+               }
+
+               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();
+
+               // 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");
+                       }
+
+                       fn.call(elem, function() {
+                               jQuery.dequeue(elem, type);
+                       });
+               }
+       }
+});
+
+jQuery.fn.extend({
+       queue: function( type, data ) {
+               if ( typeof type !== "string" ) {
+                       data = type;
+                       type = "fx";
+               }
+
+               if ( data === undefined ) {
+                       return jQuery.queue( this[0], type );
+               }
+               return this.each(function( i, elem ) {
+                       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() {
+                       var elem = this;
+                       setTimeout(function() {
+                               jQuery.dequeue( elem, type );
+                       }, time );
+               });
+       },
+
+       clearQueue: function( type ) {
+               return this.queue( type || "fx", [] );
+       }
+});
+var rclass = /[\n\t]/g,
+       rspace = /\s+/,
+       rreturn = /\r/g,
+       rspecialurl = /href|src|style/,
+       rtype = /(button|input)/i,
+       rfocusable = /(button|input|object|select|textarea)/i,
+       rclickable = /^(a|area)$/i,
+       rradiocheck = /radio|checkbox/;
+
+jQuery.fn.extend({
+       attr: function( name, value ) {
+               return access( this, name, value, true, jQuery.attr );
+       },
+
+       removeAttr: function( name, fn ) {
+               return this.each(function(){
+                       jQuery.attr( this, name, "" );
+                       if ( this.nodeType === 1 ) {
+                               this.removeAttribute( name );
+                       }
+               });
+       },
+
+       addClass: function( value ) {
+               if ( jQuery.isFunction(value) ) {
+                       return this.each(function(i) {
+                               var self = jQuery(this);
+                               self.addClass( value.call(this, i, self.attr("class")) );
+                       });
+               }
+
+               if ( value && typeof value === "string" ) {
+                       var classNames = (value || "").split( rspace );
+
+                       for ( var i = 0, l = this.length; i < l; i++ ) {
+                               var elem = this[i];
+
+                               if ( elem.nodeType === 1 ) {
+                                       if ( !elem.className ) {
+                                               elem.className = value;
+
+                                       } else {
+                                               var className = " " + elem.className + " ";
+                                               for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+                                                       if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+                                                               elem.className += " " + classNames[c];
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               return this;
+       },
+
+       removeClass: function( value ) {
+               if ( jQuery.isFunction(value) ) {
+                       return this.each(function(i) {
+                               var self = jQuery(this);
+                               self.removeClass( value.call(this, i, self.attr("class")) );
+                       });
+               }
+
+               if ( (value && typeof value === "string") || value === undefined ) {
+                       var classNames = (value || "").split(rspace);
+
+                       for ( var i = 0, l = this.length; i < l; i++ ) {
+                               var elem = this[i];
+
+                               if ( elem.nodeType === 1 && elem.className ) {
+                                       if ( value ) {
+                                               var className = (" " + elem.className + " ").replace(rclass, " ");
+                                               for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+                                                       className = className.replace(" " + classNames[c] + " ", " ");
+                                               }
+                                               elem.className = className.substring(1, className.length - 1);
+
+                                       } 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) {
+                               var self = jQuery(this);
+                               self.toggleClass( value.call(this, i, self.attr("class"), 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 + " ";
+               for ( var i = 0, l = this.length; i < l; i++ ) {
+                       if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+                               return true;
+                       }
+               }
+
+               return false;
+       },
+
+       val: function( value ) {
+               if ( value === undefined ) {
+                       var elem = this[0];
+
+                       if ( elem ) {
+                               if ( jQuery.nodeName( elem, "option" ) ) {
+                                       return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+                               }
+
+                               // We need to handle select boxes special
+                               if ( jQuery.nodeName( elem, "select" ) ) {
+                                       var 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
+                                       for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+                                               var option = options[ i ];
+
+                                               if ( option.selected ) {
+                                                       // Get the specifc 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 );
+                                               }
+                                       }
+
+                                       return values;
+                               }
+
+                               // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+                               if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+                                       return elem.getAttribute("value") === null ? "on" : elem.value;
+                               }
+                               
+
+                               // Everything else, we just grab the value
+                               return (elem.value || "").replace(rreturn, "");
+
+                       }
+
+                       return undefined;
+               }
+
+               var isFunction = jQuery.isFunction(value);
+
+               return this.each(function(i) {
+                       var self = jQuery(this), val = value;
+
+                       if ( this.nodeType !== 1 ) {
+                               return;
+                       }
+
+                       if ( isFunction ) {
+                               val = value.call(this, i, self.val());
+                       }
+
+                       // Typecast each time if the value is a Function and the appended
+                       // value is therefore different each time.
+                       if ( typeof val === "number" ) {
+                               val += "";
+                       }
+
+                       if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+                               this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+                       } else if ( jQuery.nodeName( this, "select" ) ) {
+                               var values = jQuery.makeArray(val);
+
+                               jQuery( "option", this ).each(function() {
+                                       this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+                               });
+
+                               if ( !values.length ) {
+                                       this.selectedIndex = -1;
+                               }
+
+                       } else {
+                               this.value = val;
+                       }
+               });
+       }
+});
+
+jQuery.extend({
+       attrFn: {
+               val: true,
+               css: true,
+               html: true,
+               text: true,
+               data: true,
+               width: true,
+               height: true,
+               offset: true
+       },
+               
+       attr: function( elem, name, value, pass ) {
+               // don't set attributes on text and comment nodes
+               if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+                       return undefined;
+               }
+
+               if ( pass && name in jQuery.attrFn ) {
+                       return jQuery(elem)[name](value);
+               }
+
+               var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+                       // Whether we are setting (or getting)
+                       set = value !== undefined;
+
+               // Try to normalize/fix the name
+               name = notxml && jQuery.props[ name ] || name;
+
+               // Only do all the following if this is a node (faster for style)
+               if ( elem.nodeType === 1 ) {
+                       // These attributes require special treatment
+                       var special = rspecialurl.test( name );
+
+                       // Safari mis-reports the default selected property of an option
+                       // Accessing the parent's selectedIndex property fixes it
+                       if ( name === "selected" && !jQuery.support.optSelected ) {
+                               var parent = elem.parentNode;
+                               if ( parent ) {
+                                       parent.selectedIndex;
+       
+                                       // Make sure that it also works with optgroups, see #5701
+                                       if ( parent.parentNode ) {
+                                               parent.parentNode.selectedIndex;
+                                       }
+                               }
+                       }
+
+                       // If applicable, access the attribute via the DOM 0 way
+                       if ( name in elem && notxml && !special ) {
+                               if ( set ) {
+                                       // We can't allow the type property to be changed (since it causes problems in IE)
+                                       if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+                                               throw "type property can't be changed";
+                                       }
+
+                                       elem[ name ] = value;
+                               }
+
+                               // browsers index elements by id/name on forms, give priority to attributes.
+                               if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+                                       return elem.getAttributeNode( name ).nodeValue;
+                               }
+
+                               // 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/
+                               if ( name === "tabIndex" ) {
+                                       var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+                                       return attributeNode && attributeNode.specified ?
+                                               attributeNode.value :
+                                               rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+                                                       0 :
+                                                       undefined;
+                               }
+
+                               return elem[ name ];
+                       }
+
+                       if ( !jQuery.support.style && notxml && name === "style" ) {
+                               if ( set ) {
+                                       elem.style.cssText = "" + value;
+                               }
+
+                               return elem.style.cssText;
+                       }
+
+                       if ( set ) {
+                               // convert the value to a string (all browsers do this but IE) see #1070
+                               elem.setAttribute( name, "" + value );
+                       }
+
+                       var attr = !jQuery.support.hrefNormalized && notxml && special ?
+                                       // Some attributes require a special call on IE
+                                       elem.getAttribute( name, 2 ) :
+                                       elem.getAttribute( name );
+
+                       // Non-existent attributes return null, we normalize to undefined
+                       return attr === null ? undefined : attr;
+               }
+
+               // elem is actually elem.style ... set the style
+               // Using attr for specific style information is now deprecated. Use style insead.
+               return jQuery.style( elem, name, value );
+       }
+});
+var fcleanup = function( nm ) {
+       return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+               return "\\" + ch;
+       });
+};
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+       // Bind an event to an element
+       // Original by Dean Edwards
+       add: function( elem, types, handler, data ) {
+               if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+                       return;
+               }
+
+               // For whatever reason, IE has trouble passing the window object
+               // around, causing it to be cloned in the process
+               if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
+                       elem = window;
+               }
+
+               // Make sure that the function being executed has a unique ID
+               if ( !handler.guid ) {
+                       handler.guid = jQuery.guid++;
+               }
+
+               // if data is passed, bind to handler
+               if ( data !== undefined ) {
+                       // Create temporary function pointer to original handler
+                       var fn = handler;
+
+                       // Create unique handler function, wrapped around original handler
+                       handler = jQuery.proxy( fn );
+
+                       // Store data in unique handler
+                       handler.data = data;
+               }
+
+               // Init the element's event structure
+               var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
+                       handle = jQuery.data( elem, "handle" ), eventHandle;
+
+               if ( !handle ) {
+                       eventHandle = function() {
+                               // Handle the second event of a trigger and when
+                               // an event is called after a page has unloaded
+                               return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+                                       jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+                                       undefined;
+                       };
+
+                       handle = jQuery.data( elem, "handle", eventHandle );
+               }
+
+               // If no handle is found then we must be trying to bind to one of the
+               // banned noData elements
+               if ( !handle ) {
+                       return;
+               }
+
+               // Add elem as a property of the handle function
+               // This is to prevent a memory leak with non-native
+               // event in IE.
+               handle.elem = elem;
+
+               // Handle multiple events separated by a space
+               // jQuery(...).bind("mouseover mouseout", fn);
+               types = types.split( /\s+/ );
+               var type, i=0;
+               while ( (type = types[ i++ ]) ) {
+                       // Namespaced event handlers
+                       var namespaces = type.split(".");
+                       type = namespaces.shift();
+                       handler.type = namespaces.slice(0).sort().join(".");
+
+                       // Get the current list of functions bound to this event
+                       var handlers = events[ type ],
+                               special = this.special[ type ] || {};
+
+                       
+
+                       // Init the event handler queue
+                       if ( !handlers ) {
+                               handlers = events[ type ] = {};
+
+                               // Check for a special event handler
+                               // Only use addEventListener/attachEvent if the special
+                               // events handler returns false
+                               if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
+                                       // Bind the global event handler to the element
+                                       if ( elem.addEventListener ) {
+                                               elem.addEventListener( type, handle, false );
+                                       } else if ( elem.attachEvent ) {
+                                               elem.attachEvent( "on" + type, handle );
+                                       }
+                               }
+                       }
+                       
+                       if ( special.add ) { 
+                               var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers ); 
+                               if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) { 
+                                       modifiedHandler.guid = modifiedHandler.guid || handler.guid; 
+                                       handler = modifiedHandler; 
+                               } 
+                       } 
+                       
+                       // Add the function to the element's handler list
+                       handlers[ handler.guid ] = handler;
+
+                       // Keep track of which events have been used, for global triggering
+                       this.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 ) {
+               // don't do events on text and comment nodes
+               if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+                       return;
+               }
+
+               var events = jQuery.data( elem, "events" ), ret, type, fn;
+
+               if ( events ) {
+                       // Unbind all events for the element
+                       if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
+                               for ( type in events ) {
+                                       this.remove( elem, type + (types || "") );
+                               }
+                       } else {
+                               // types is actually an event object here
+                               if ( types.type ) {
+                                       handler = types.handler;
+                                       types = types.type;
+                               }
+
+                               // Handle multiple events separated by a space
+                               // jQuery(...).unbind("mouseover mouseout", fn);
+                               types = types.split(/\s+/);
+                               var i = 0;
+                               while ( (type = types[ i++ ]) ) {
+                                       // Namespaced event handlers
+                                       var namespaces = type.split(".");
+                                       type = namespaces.shift();
+                                       var all = !namespaces.length,
+                                               cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
+                                               namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
+                                               special = this.special[ type ] || {};
+
+                                       if ( events[ type ] ) {
+                                               // remove the given handler for the given type
+                                               if ( handler ) {
+                                                       fn = events[ type ][ handler.guid ];
+                                                       delete events[ type ][ handler.guid ];
+
+                                               // remove all handlers for the given type
+                                               } else {
+                                                       for ( var handle in events[ type ] ) {
+                                                               // Handle the removal of namespaced events
+                                                               if ( all || namespace.test( events[ type ][ handle ].type ) ) {
+                                                                       delete events[ type ][ handle ];
+                                                               }
+                                                       }
+                                               }
+
+                                               if ( special.remove ) {
+                                                       special.remove.call( elem, namespaces, fn);
+                                               }
+
+                                               // remove generic event handler if no more handlers exist
+                                               for ( ret in events[ type ] ) {
+                                                       break;
+                                               }
+                                               if ( !ret ) {
+                                                       if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+                                                               if ( elem.removeEventListener ) {
+                                                                       elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
+                                                               } else if ( elem.detachEvent ) {
+                                                                       elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
+                                                               }
+                                                       }
+                                                       ret = null;
+                                                       delete events[ type ];
+                                               }
+                                       }
+                               }
+                       }
+
+                       // Remove the expando if it's no longer used
+                       for ( ret in events ) {
+                               break;
+                       }
+                       if ( !ret ) {
+                               var handle = jQuery.data( elem, "handle" );
+                               if ( handle ) {
+                                       handle.elem = null;
+                               }
+                               jQuery.removeData( elem, "events" );
+                               jQuery.removeData( elem, "handle" );
+                       }
+               }
+       },
+
+       // bubbling is internal
+       trigger: function( event, data, elem /*, bubbling */ ) {
+               // Event object or event type
+               var type = event.type || event,
+                       bubbling = arguments[3];
+
+               if ( !bubbling ) {
+                       event = typeof event === "object" ?
+                               // jQuery.Event object
+                               event[expando] ? event :
+                               // Object literal
+                               jQuery.extend( jQuery.Event(type), event ) :
+                               // Just the event type (string)
+                               jQuery.Event(type);
+
+                       if ( type.indexOf("!") >= 0 ) {
+                               event.type = type = type.slice(0, -1);
+                               event.exclusive = true;
+                       }
+
+                       // Handle a global trigger
+                       if ( !elem ) {
+                               // Don't bubble custom events when global (to avoid too much overhead)
+                               event.stopPropagation();
+
+                               // Only trigger if we've ever bound an event for it
+                               if ( this.global[ type ] ) {
+                                       jQuery.each( jQuery.cache, function() {
+                                               if ( this.events && this.events[type] ) {
+                                                       jQuery.event.trigger( event, data, this.handle.elem );
+                                               }
+                                       });
+                               }
+                       }
+
+                       // Handle triggering a single element
+
+                       // don't do events on text and comment nodes
+                       if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+                               return undefined;
+                       }
+
+                       // Clean up in case it is reused
+                       event.result = undefined;
+                       event.target = elem;
+
+                       // Clone the incoming data, if any
+                       data = jQuery.makeArray( data );
+                       data.unshift( event );
+               }
+
+               event.currentTarget = elem;
+
+               // Trigger the event, it is assumed that "handle" is a function
+               var handle = jQuery.data( elem, "handle" );
+               if ( handle ) {
+                       handle.apply( elem, data );
+               }
+
+               var nativeFn, nativeHandler;
+               try {
+                       if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+                               nativeFn = elem[ type ];
+                               nativeHandler = elem[ "on" + type ];
+                       }
+               // prevent IE from throwing an error for some elements with some event types, see #3533
+               } catch (e) {}
+
+               var isClick = jQuery.nodeName(elem, "a") && type === "click";
+
+               // Trigger the native events (except for clicks on links)
+               if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
+                       this.triggered = true;
+                       try {
+                               elem[ type ]();
+                       // prevent IE from throwing an error for some hidden elements
+                       } catch (e) {}
+
+               // Handle triggering native .onfoo handlers
+               } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
+                       event.result = false;
+               }
+
+               this.triggered = false;
+
+               if ( !event.isPropagationStopped() ) {
+                       var parent = elem.parentNode || elem.ownerDocument;
+                       if ( parent ) {
+                               jQuery.event.trigger( event, data, parent, true );
+                       }
+               }
+       },
+
+       handle: function( event ) {
+               // returned undefined or false
+               var all, handlers;
+
+               event = arguments[0] = jQuery.event.fix( event || window.event );
+               event.currentTarget = this;
+
+               // Namespaced event handlers
+               var namespaces = event.type.split(".");
+               event.type = namespaces.shift();
+
+               // Cache this now, all = true means, any handler
+               all = !namespaces.length && !event.exclusive;
+
+               var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+               handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
+
+               for ( var j in handlers ) {
+                       var handler = handlers[ j ];
+
+                       // Filter the functions by class
+                       if ( all || namespace.test(handler.type) ) {
+                               // Pass in a reference to the handler function itself
+                               // So that we can later remove it
+                               event.handler = handler;
+                               event.data = handler.data;
+
+                               var ret = handler.apply( this, arguments );
+
+                               if ( ret !== undefined ) {
+                                       event.result = ret;
+                                       if ( ret === false ) {
+                                               event.preventDefault();
+                                               event.stopPropagation();
+                                       }
+                               }
+
+                               if ( event.isImmediatePropagationStopped() ) {
+                                       break;
+                               }
+
+                       }
+               }
+
+               return event.result;
+       },
+
+       props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+       fix: function( event ) {
+               if ( event[ expando ] ) {
+                       return event;
+               }
+
+               // store a copy of the original event object
+               // and "clone" to set read-only properties
+               var originalEvent = event;
+               event = jQuery.Event( originalEvent );
+
+               for ( var i = this.props.length, prop; i; ) {
+                       prop = this.props[ --i ];
+                       event[ prop ] = originalEvent[ prop ];
+               }
+
+               // Fix target property, if necessary
+               if ( !event.target ) {
+                       event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+               }
+
+               // check if target is a textnode (safari)
+               if ( event.target.nodeType === 3 ) {
+                       event.target = event.target.parentNode;
+               }
+
+               // Add relatedTarget, if necessary
+               if ( !event.relatedTarget && event.fromElement ) {
+                       event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+               }
+
+               // Calculate pageX/Y if missing and clientX/Y available
+               if ( event.pageX == null && event.clientX != null ) {
+                       var doc = document.documentElement, body = document.body;
+                       event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+                       event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
+               }
+
+               // Add which for key events
+               if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
+                       event.which = event.charCode || event.keyCode;
+               }
+
+               // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+               if ( !event.metaKey && event.ctrlKey ) {
+                       event.metaKey = event.ctrlKey;
+               }
+
+               // Add which for click: 1 === left; 2 === middle; 3 === right
+               // Note: button is not normalized, so don't use it
+               if ( !event.which && event.button !== undefined ) {
+                       event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+               }
+
+               return event;
+       },
+
+       // Deprecated, use jQuery.guid instead
+       guid: 1E8,
+
+       // Deprecated, use jQuery.proxy instead
+       proxy: jQuery.proxy,
+
+       special: {
+               ready: {
+                       // Make sure the ready event is setup
+                       setup: jQuery.bindReady,
+                       teardown: jQuery.noop
+               },
+
+               live: {
+                       add: function( proxy, data, namespaces, live ) {
+                               jQuery.extend( proxy, data || {} );
+
+                               proxy.guid += data.selector + data.live; 
+                               jQuery.event.add( this, data.live, liveHandler, data ); 
+                               
+                       },
+
+                       remove: function( namespaces ) {
+                               if ( namespaces.length ) {
+                                       var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+                                       jQuery.each( (jQuery.data(this, "events").live || {}), function() {
+                                               if ( name.test(this.type) ) {
+                                                       remove++;
+                                               }
+                                       });
+
+                                       if ( remove < 1 ) {
+                                               jQuery.event.remove( this, namespaces[0], liveHandler );
+                                       }
+                               }
+                       },
+                       special: {}
+               },
+               beforeunload: {
+                       setup: function( data, namespaces, fn ) {
+                               // We only want to do this special case on windows
+                               if ( this.setInterval ) {
+                                       this.onbeforeunload = fn;
+                               }
+
+                               return false;
+                       },
+                       teardown: function( namespaces, fn ) {
+                               if ( this.onbeforeunload === fn ) {
+                                       this.onbeforeunload = null;
+                               }
+                       }
+               }
+       }
+};
+
+jQuery.Event = function( src ) {
+       // Allow instantiation without the 'new' keyword
+       if ( !this.preventDefault ) {
+               return new jQuery.Event( src );
+       }
+
+       // Event object
+       if ( src && src.type ) {
+               this.originalEvent = src;
+               this.type = src.type;
+       // Event type
+       } else {
+               this.type = src;
+       }
+
+       // timeStamp is buggy for some events on Firefox(#3843)
+       // So we won't rely on the native value
+       this.timeStamp = now();
+
+       // Mark it as fixed
+       this[ 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)
+               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
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+       // Check if mouse(over|out) are still within the same parent element
+       var parent = event.relatedTarget;
+
+       // Traverse up the tree
+       while ( parent && parent !== this ) {
+               // Firefox sometimes assigns relatedTarget a XUL element
+               // which we cannot access the parentNode property of
+               try {
+                       parent = parent.parentNode;
+
+               // assuming we've left the element since we most likely mousedover a xul element
+               } catch(e) {
+                       break;
+               }
+       }
+
+       if ( parent !== this ) {
+               // set the correct event type
+               event.type = event.data;
+
+               // handle event if we actually just moused on to a non sub-element
+               jQuery.event.handle.apply( this, arguments );
+       }
+
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+       event.type = event.data;
+       jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+       mouseenter: "mouseover",
+       mouseleave: "mouseout"
+}, function( orig, fix ) {
+       jQuery.event.special[ orig ] = {
+               setup: function( data ) {
+                       jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+               },
+               teardown: function( data ) {
+                       jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+               }
+       };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+jQuery.event.special.submit = {
+       setup: function( data, namespaces, fn ) {
+               if ( this.nodeName.toLowerCase() !== "form" ) {
+                       jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
+                               var elem = e.target, type = elem.type;
+
+                               if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+                                       return trigger( "submit", this, arguments );
+                               }
+                       });
+        
+                       jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
+                               var elem = e.target, type = elem.type;
+
+                               if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+                                       return trigger( "submit", this, arguments );
+                               }
+                       });
+
+               } else {
+                       return false;
+               }
+       },
+
+       remove: function( namespaces, fn ) {
+               jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
+               jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
+       }
+};
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+var formElems = /textarea|input|select/i;
+
+function getVal( elem ) {
+       var type = elem.type, val = elem.value;
+
+       if ( type === "radio" || type === "checkbox" ) {
+               val = elem.checked;
+
+       } else if ( type === "select-multiple" ) {
+               val = elem.selectedIndex > -1 ?
+                       jQuery.map( elem.options, function( elem ) {
+                               return elem.selected;
+                       }).join("-") :
+                       "";
+
+       } else if ( elem.nodeName.toLowerCase() === "select" ) {
+               val = elem.selectedIndex;
+       }
+
+       return val;
+}
+
+function testChange( e ) {
+               var elem = e.target, data, val;
+
+               if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+                       return;
+               }
+
+               data = jQuery.data( elem, "_change_data" );
+               val = getVal(elem);
+
+               if ( val === data ) {
+                       return;
+               }
+
+               // the current data will be also retrieved by beforeactivate
+               if ( e.type !== "focusout" || elem.type !== "radio" ) {
+                       jQuery.data( elem, "_change_data", val );
+               }
+
+               if ( elem.type !== "select" && (data != null || val) ) {
+                       e.type = "change";
+                       return jQuery.event.trigger( e, arguments[1], this );
+               }
+}
+
+jQuery.event.special.change = {
+       filters: {
+               focusout: testChange, 
+
+               click: function( e ) {
+                       var elem = e.target, type = elem.type;
+
+                       if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+                               return testChange.call( this, e );
+                       }
+               },
+
+               // Change has to be called before submit
+               // Keydown will be called before keypress, which is used in submit-event delegation
+               keydown: function( e ) {
+                       var elem = e.target, type = elem.type;
+
+                       if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+                               (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+                               type === "select-multiple" ) {
+                               return testChange.call( this, e );
+                       }
+               },
+
+               // Beforeactivate happens also before the previous element is blurred
+               // with this event you can't trigger a change event, but you can store
+               // information/focus[in] is not needed anymore
+               beforeactivate: function( e ) {
+                       var elem = e.target;
+
+                       if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
+                               jQuery.data( elem, "_change_data", getVal(elem) );
+                       }
+               }
+       },
+       setup: function( data, namespaces, fn ) {
+               for ( var type in changeFilters ) {
+                       jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
+               }
+
+               return formElems.test( this.nodeName );
+       },
+       remove: function( namespaces, fn ) {
+               for ( var type in changeFilters ) {
+                       jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
+               }
+
+               return formElems.test( this.nodeName );
+       }
+};
+
+var changeFilters = jQuery.event.special.change.filters;
+
+}
+
+function trigger( type, elem, args ) {
+       args[0].type = type;
+       return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+       jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+               jQuery.event.special[ fix ] = {
+                       setup: function() {
+                               this.addEventListener( orig, handler, true );
+                       }, 
+                       teardown: function() { 
+                               this.removeEventListener( orig, handler, true );
+                       }
+               };
+
+               function handler( e ) { 
+                       e = jQuery.event.fix( e );
+                       e.type = fix;
+                       return jQuery.event.handle.call( this, e );
+               }
+       });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+       jQuery.fn[ name ] = function( type, data, fn ) {
+               // Handle object literals
+               if ( typeof type === "object" ) {
+                       for ( var key in type ) {
+                               this[ name ](key, data, type[key], fn);
+                       }
+                       return this;
+               }
+               
+               if ( jQuery.isFunction( data ) ) {
+                       thisObject = fn;
+                       fn = data;
+                       data = undefined;
+               }
+
+               var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+                       jQuery( this ).unbind( event, handler );
+                       return fn.apply( this, arguments );
+               }) : fn;
+
+               return type === "unload" && name !== "one" ?
+                       this.one( type, data, fn, thisObject ) :
+                       this.each(function() {
+                               jQuery.event.add( this, type, handler, data );
+                       });
+       };
+});
+
+jQuery.fn.extend({
+       unbind: function( type, fn ) {
+               // Handle object literals
+               if ( typeof type === "object" && !type.preventDefault ) {
+                       for ( var key in type ) {
+                               this.unbind(key, type[key]);
+                       }
+                       return this;
+               }
+
+               return this.each(function() {
+                       jQuery.event.remove( this, type, fn );
+               });
+       },
+       trigger: function( type, data ) {
+               return this.each(function() {
+                       jQuery.event.trigger( type, data, this );
+               });
+       },
+
+       triggerHandler: function( type, data ) {
+               if ( this[0] ) {
+                       var event = jQuery.Event( type );
+                       event.preventDefault();
+                       event.stopPropagation();
+                       jQuery.event.trigger( event, data, this[0] );
+                       return event.result;
+               }
+       },
+
+       toggle: function( fn ) {
+               // Save reference to arguments for access in closure
+               var args = arguments, i = 1;
+
+               // link all the functions, so any of them can unbind this click handler
+               while ( i < args.length ) {
+                       jQuery.proxy( fn, args[ i++ ] );
+               }
+
+               return this.click( jQuery.proxy( fn, 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;
+               }));
+       },
+
+       hover: function( fnOver, fnOut ) {
+               return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+       },
+
+       live: function( type, data, fn ) {
+               if ( jQuery.isFunction( data ) ) {
+                       fn = data;
+                       data = undefined;
+               }
+
+               jQuery( this.context ).bind( liveConvert( type, this.selector ), {
+                       data: data, selector: this.selector, live: type
+               }, fn );
+
+               return this;
+       },
+
+       die: function( type, fn ) {
+               jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
+               return this;
+       }
+});
+
+function liveHandler( event ) {
+       var stop = true, elems = [], selectors = [], args = arguments,
+               related, match, fn, elem, j, i, data,
+               live = jQuery.extend({}, jQuery.data( this, "events" ).live);
+
+       for ( j in live ) {
+               fn = live[j];
+               if ( fn.live === event.type ||
+                               fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
+
+                       data = fn.data;
+                       if ( !(data.beforeFilter && data.beforeFilter[event.type] && 
+                                       !data.beforeFilter[event.type](event)) ) {
+                               selectors.push( fn.selector );
+                       }
+               } else {
+                       delete live[j];
+               }
+       }
+
+       match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+       for ( i = 0, l = match.length; i < l; i++ ) {
+               for ( j in live ) {
+                       fn = live[j];
+                       elem = match[i].elem;
+                       related = null;
+
+                       if ( match[i].selector === fn.selector ) {
+                               // Those two events require additional checking
+                               if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
+                                       related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
+                               }
+
+                               if ( !related || related !== elem ) {
+                                       elems.push({ elem: elem, fn: fn });
+                               }
+                       }
+               }
+       }
+
+       for ( i = 0, l = elems.length; i < l; i++ ) {
+               match = elems[i];
+               event.currentTarget = match.elem;
+               event.data = match.fn.data;
+               if ( match.fn.apply( match.elem, args ) === false ) {
+                       stop = false;
+                       break;
+               }
+       }
+
+       return stop;
+}
+
+function liveConvert( type, selector ) {
+       return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+}
+
+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").split(" "), function( i, name ) {
+
+       // Handle event binding
+       jQuery.fn[ name ] = function( fn ) {
+               return fn ? this.bind( name, fn ) : this.trigger( name );
+       };
+
+       if ( jQuery.attrFn ) {
+               jQuery.attrFn[ name ] = true;
+       }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+       window.attachEvent("onunload", function() {
+               for ( var id in jQuery.cache ) {
+                       if ( jQuery.cache[ id ].handle ) {
+                               // Try/Catch is to handle iframes being unloaded, see #4280
+                               try {
+                                       jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+                               } catch(e) {}
+                       }
+               }
+       });
+}
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ *  Copyright 2009, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+       done = 0,
+       toString = Object.prototype.toString,
+       hasDuplicate = false,
+       baseHasDuplicate = true;
+
+// 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 || [];
+       var origContext = context = context || document;
+
+       if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+               return [];
+       }
+       
+       if ( !selector || typeof selector !== "string" ) {
+               return results;
+       }
+
+       var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+               soFar = selector;
+       
+       // Reset the position of the chunker regexp (start from head)
+       while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+               soFar = m[3];
+               
+               parts.push( m[1] );
+               
+               if ( m[2] ) {
+                       extra = m[3];
+                       break;
+               }
+       }
+
+       if ( parts.length > 1 && origPOS.exec( selector ) ) {
+               if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+                       set = posProcess( parts[0] + parts[1], context );
+               } 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 );
+                       }
+               }
+       } 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]) ) {
+                       var ret = Sizzle.find( parts.shift(), context, contextXML );
+                       context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+               }
+
+               if ( context ) {
+                       var 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 ) {
+                               var 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 ) {
+               throw "Syntax error, unrecognized expression: " + (cur || selector);
+       }
+
+       if ( toString.call(checkSet) === "[object Array]" ) {
+               if ( !prune ) {
+                       results.push.apply( results, checkSet );
+               } else if ( context && context.nodeType === 1 ) {
+                       for ( var i = 0; checkSet[i] != null; i++ ) {
+                               if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+                                       results.push( set[i] );
+                               }
+                       }
+               } else {
+                       for ( var 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.find = function(expr, context, isXML){
+       var set, match;
+
+       if ( !expr ) {
+               return [];
+       }
+
+       for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+               var type = Expr.order[i], match;
+               
+               if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+                       var left = match[1];
+                       match.splice(1,1);
+
+                       if ( left.substr( left.length - 1 ) !== "\\" ) {
+                               match[1] = (match[1] || "").replace(/\\/g, "");
+                               set = Expr.find[ type ]( match, context, isXML );
+                               if ( set != null ) {
+                                       expr = expr.replace( Expr.match[ type ], "" );
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       if ( !set ) {
+               set = context.getElementsByTagName("*");
+       }
+
+       return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+       var old = expr, result = [], curLoop = set, match, anyFound,
+               isXMLFilter = set && set[0] && isXML(set[0]);
+
+       while ( expr && set.length ) {
+               for ( var type in Expr.filter ) {
+                       if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+                               var filter = Expr.filter[ type ], found, item, 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 ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+                                               if ( item ) {
+                                                       found = filter( item, match, i, curLoop );
+                                                       var 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 ) {
+                               throw "Syntax error, unrecognized expression: " + expr;
+                       } else {
+                               break;
+                       }
+               }
+
+               old = expr;
+       }
+
+       return curLoop;
+};
+
+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|)\s*\]/,
+               TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+               CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+               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");
+               }
+       },
+       relative: {
+               "+": function(checkSet, part){
+                       var isPartStr = typeof part === "string",
+                               isTag = isPartStr && !/\W/.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 isPartStr = typeof part === "string";
+
+                       if ( isPartStr && !/\W/.test(part) ) {
+                               part = part.toLowerCase();
+
+                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+                                       var elem = checkSet[i];
+                                       if ( elem ) {
+                                               var parent = elem.parentNode;
+                                               checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+                                       }
+                               }
+                       } else {
+                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+                                       var 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 doneName = done++, checkFn = dirCheck;
+
+                       if ( typeof part === "string" && !/\W/.test(part) ) {
+                               var nodeCheck = part = part.toLowerCase();
+                               checkFn = dirNodeCheck;
+                       }
+
+                       checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+               },
+               "~": function(checkSet, part, isXML){
+                       var doneName = done++, checkFn = dirCheck;
+
+                       if ( typeof part === "string" && !/\W/.test(part) ) {
+                               var nodeCheck = part = part.toLowerCase();
+                               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]);
+                               return m ? [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){
+                       return context.getElementsByTagName(match[1]);
+               }
+       },
+       preFilter: {
+               CLASS: function(match, curLoop, inplace, result, not, isXML){
+                       match = " " + match[1].replace(/\\/g, "") + " ";
+
+                       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]/g, " ").indexOf(match) >= 0) ) {
+                                               if ( !inplace ) {
+                                                       result.push( elem );
+                                               }
+                                       } else if ( inplace ) {
+                                               curLoop[i] = false;
+                                       }
+                               }
+                       }
+
+                       return false;
+               },
+               ID: function(match){
+                       return match[1].replace(/\\/g, "");
+               },
+               TAG: function(match, curLoop){
+                       return match[1].toLowerCase();
+               },
+               CHILD: function(match){
+                       if ( match[1] === "nth" ) {
+                               // 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;
+                       }
+
+                       // TODO: Move to normal caching system
+                       match[0] = done++;
+
+                       return match;
+               },
+               ATTR: function(match, curLoop, inplace, result, not, isXML){
+                       var name = match[1].replace(/\\/g, "");
+                       
+                       if ( !isXML && Expr.attrMap[name] ) {
+                               match[1] = Expr.attrMap[name];
+                       }
+
+                       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
+                       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){
+                       return "text" === elem.type;
+               },
+               radio: function(elem){
+                       return "radio" === elem.type;
+               },
+               checkbox: function(elem){
+                       return "checkbox" === elem.type;
+               },
+               file: function(elem){
+                       return "file" === elem.type;
+               },
+               password: function(elem){
+                       return "password" === elem.type;
+               },
+               submit: function(elem){
+                       return "submit" === elem.type;
+               },
+               image: function(elem){
+                       return "image" === elem.type;
+               },
+               reset: function(elem){
+                       return "reset" === elem.type;
+               },
+               button: function(elem){
+                       return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+               },
+               input: function(elem){
+                       return /input|select|textarea|button/i.test(elem.nodeName);
+               }
+       },
+       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 i = 0, l = not.length; i < l; i++ ) {
+                                       if ( not[i] === elem ) {
+                                               return false;
+                                       }
+                               }
+
+                               return true;
+                       } else {
+                               throw "Syntax error, unrecognized expression: " + name;
+                       }
+               },
+               CHILD: function(elem, match){
+                       var 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;
+                               case 'last':
+                                       while ( (node = node.nextSibling) )      {
+                                               if ( node.nodeType === 1 ) { 
+                                                       return false; 
+                                               }
+                                       }
+                                       return true;
+                               case 'nth':
+                                       var first = match[2], last = match[3];
+
+                                       if ( first === 1 && last === 0 ) {
+                                               return true;
+                                       }
+                                       
+                                       var doneName = match[0],
+                                               parent = elem.parentNode;
+       
+                                       if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+                                               var count = 0;
+                                               for ( node = parent.firstChild; node; node = node.nextSibling ) {
+                                                       if ( node.nodeType === 1 ) {
+                                                               node.nodeIndex = ++count;
+                                                       }
+                                               } 
+                                               parent.sizcache = doneName;
+                                       }
+                                       
+                                       var 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.toLowerCase() === match;
+               },
+               CLASS: function(elem, match){
+                       return (" " + (elem.className || elem.getAttribute("class")) + " ")
+                               .indexOf( match ) > -1;
+               },
+               ATTR: function(elem, match){
+                       var name = match[1],
+                               result = 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 === "=" ?
+                               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;
+
+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, function(all, num){
+               return "\\" + (num - 0 + 1);
+       }));
+}
+
+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.
+try {
+       Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+// Provide a fallback method if it does not work
+} catch(e){
+       makeArray = function(array, results) {
+               var ret = results || [];
+
+               if ( toString.call(array) === "[object Array]" ) {
+                       Array.prototype.push.apply( ret, array );
+               } else {
+                       if ( typeof array.length === "number" ) {
+                               for ( var i = 0, l = array.length; i < l; i++ ) {
+                                       ret.push( array[i] );
+                               }
+                       } else {
+                               for ( var i = 0; array[i]; i++ ) {
+                                       ret.push( array[i] );
+                               }
+                       }
+               }
+
+               return ret;
+       };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+       sortOrder = function( a, b ) {
+               if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+                       if ( a == b ) {
+                               hasDuplicate = true;
+                       }
+                       return a.compareDocumentPosition ? -1 : 1;
+               }
+
+               var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+               if ( ret === 0 ) {
+                       hasDuplicate = true;
+               }
+               return ret;
+       };
+} else if ( "sourceIndex" in document.documentElement ) {
+       sortOrder = function( a, b ) {
+               if ( !a.sourceIndex || !b.sourceIndex ) {
+                       if ( a == b ) {
+                               hasDuplicate = true;
+                       }
+                       return a.sourceIndex ? -1 : 1;
+               }
+
+               var ret = a.sourceIndex - b.sourceIndex;
+               if ( ret === 0 ) {
+                       hasDuplicate = true;
+               }
+               return ret;
+       };
+} else if ( document.createRange ) {
+       sortOrder = function( a, b ) {
+               if ( !a.ownerDocument || !b.ownerDocument ) {
+                       if ( a == b ) {
+                               hasDuplicate = true;
+                       }
+                       return a.ownerDocument ? -1 : 1;
+               }
+
+               var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+               aRange.setStart(a, 0);
+               aRange.setEnd(a, 0);
+               bRange.setStart(b, 0);
+               bRange.setEnd(b, 0);
+               var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+               if ( ret === 0 ) {
+                       hasDuplicate = true;
+               }
+               return ret;
+       };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+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;
+}
+
+// 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();
+       form.innerHTML = "<a name='" + id + "'/>";
+
+       // Inject it into the root element, check its status, and remove it quickly
+       var root = document.documentElement;
+       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 );
+       root = form = null; // release memory in IE
+})();
+
+(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);
+               };
+       }
+
+       div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+       (function(){
+               var oldSizzle = Sizzle, div = document.createElement("div");
+               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 && context.nodeType === 9 && !isXML(context) ) {
+                               try {
+                                       return makeArray( context.querySelectorAll(query), extra );
+                               } catch(e){}
+                       }
+               
+                       return oldSizzle(query, context, extra, seed);
+               };
+
+               for ( var prop in oldSizzle ) {
+                       Sizzle[ prop ] = oldSizzle[ prop ];
+               }
+
+               div = null; // release memory in IE
+       })();
+}
+
+(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]);
+               }
+       };
+
+       div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+               var elem = checkSet[i];
+               if ( elem ) {
+                       elem = elem[dir];
+                       var match = false;
+
+                       while ( elem ) {
+                               if ( elem.sizcache === doneName ) {
+                                       match = checkSet[elem.sizset];
+                                       break;
+                               }
+
+                               if ( elem.nodeType === 1 && !isXML ){
+                                       elem.sizcache = 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 ) {
+                       elem = elem[dir];
+                       var match = false;
+
+                       while ( elem ) {
+                               if ( elem.sizcache === doneName ) {
+                                       match = checkSet[elem.sizset];
+                                       break;
+                               }
+
+                               if ( elem.nodeType === 1 ) {
+                                       if ( !isXML ) {
+                                               elem.sizcache = 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;
+               }
+       }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+       return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+       return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var 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){
+       var tmpSet = [], later = "", match,
+               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 );
+       }
+
+       return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.getText = getText;
+jQuery.isXMLDoc = isXML;
+jQuery.contains = contains;
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+var runtil = /Until$/,
+       rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+       // Note: This RegExp should be improved, or likely pulled from Sizzle
+       rmultiselector = /,/,
+       slice = Array.prototype.slice;
+
+// Implement the identical functionality for filter and not
+var winnow = function( elements, qualifier, keep ) {
+       if ( jQuery.isFunction( qualifier ) ) {
+               return jQuery.grep(elements, function( elem, i ) {
+                       return !!qualifier.call( elem, i, elem ) === 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, elements );
+               }
+       }
+
+       return jQuery.grep(elements, function( elem, i ) {
+               return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+       });
+};
+
+jQuery.fn.extend({
+       find: function( selector ) {
+               var ret = this.pushStack( "", "find", selector ), length = 0;
+
+               for ( var 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 ( var n = length; n < ret.length; n++ ) {
+                                       for ( var 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 && jQuery.filter( selector, this ).length > 0;
+       },
+
+       closest: function( selectors, context ) {
+               if ( jQuery.isArray( selectors ) ) {
+                       var ret = [], cur = this[0], match, matches = {}, selector;
+
+                       if ( cur && selectors.length ) {
+                               for ( var i = 0, l = selectors.length; i < l; i++ ) {
+                                       selector = selectors[i];
+
+                                       if ( !matches[selector] ) {
+                                               matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
+                                                       jQuery( selector, context || this.context ) :
+                                                       selector;
+                                       }
+                               }
+
+                               while ( cur && cur.ownerDocument && cur !== context ) {
+                                       for ( selector in matches ) {
+                                               match = matches[selector];
+
+                                               if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+                                                       ret.push({ selector: selector, elem: cur });
+                                                       delete matches[selector];
+                                               }
+                                       }
+                                       cur = cur.parentNode;
+                               }
+                       }
+
+                       return ret;
+               }
+
+               var pos = jQuery.expr.match.POS.test( selectors ) ? 
+                       jQuery( selectors, context || this.context ) : null;
+
+               return this.map(function( i, cur ) {
+                       while ( cur && cur.ownerDocument && cur !== context ) {
+                               if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
+                                       return cur;
+                               }
+                               cur = cur.parentNode;
+                       }
+                       return null;
+               });
+       },
+       
+       // Determine the position of an element within
+       // the matched set of elements
+       index: function( elem ) {
+               if ( !elem || typeof elem === "string" ) {
+                       return jQuery.inArray( this[0],
+                               // If it receives a string, the selector is used
+                               // If it receives nothing, the siblings are used
+                               elem ? jQuery( elem ) : this.parent().children() );
+               }
+               // 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 || this.context ) :
+                               jQuery.makeArray( 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 ? 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 jQuery.find.matches(expr, elems);
+       },
+       
+       dir: function( elem, dir, until ) {
+               var matched = [], cur = elem[dir];
+               while ( cur && cur.nodeType !== 9 && (until === undefined || !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;
+       }
+});
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+       rleadingWhitespace = /^\s+/,
+       rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+       rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+       rtagName = /<([\w:]+)/,
+       rtbody = /<tbody/i,
+       rhtml = /<|&\w+;/,
+       fcloseTag = function( all, front, tag ) {
+               return rselfClosing.test( tag ) ?
+                       all :
+                       front + "></" + tag + ">";
+       },
+       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, "", "" ]
+       };
+
+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( text ) {
+               if ( jQuery.isFunction(text) ) {
+                       return this.each(function(i) {
+                               var self = jQuery(this);
+                               return self.text( text.call(this, i, self.text()) );
+                       });
+               }
+
+               if ( typeof text !== "object" && text !== undefined ) {
+                       return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+               }
+
+               return jQuery.getText( this );
+       },
+
+       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 ) {
+               return this.each(function() {
+                       var self = jQuery( this ), contents = self.contents();
+
+                       if ( contents.length ) {
+                               contents.wrapAll( html );
+
+                       } else {
+                               self.append( html );
+                       }
+               });
+       },
+
+       wrap: function( html ) {
+               return this.each(function() {
+                       jQuery( this ).wrapAll( 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(arguments[0]);
+                       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(arguments[0]).toArray() );
+                       return set;
+               }
+       },
+
+       clone: function( events ) {
+               // Do the clone
+               var ret = this.map(function() {
+                       if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+                               // IE copies events bound via attachEvent when
+                               // using cloneNode. Calling detachEvent on the
+                               // clone will also remove the events from the orignal
+                               // In order to get around this, we use innerHTML.
+                               // Unfortunately, this means some modifications to
+                               // attributes in IE that are actually only stored
+                               // as properties will not be copied (such as the
+                               // the name attribute on an input).
+                               var html = this.outerHTML, ownerDocument = this.ownerDocument;
+                               if ( !html ) {
+                                       var div = ownerDocument.createElement("div");
+                                       div.appendChild( this.cloneNode(true) );
+                                       html = div.innerHTML;
+                               }
+
+                               return jQuery.clean([html.replace(rinlinejQuery, "")
+                                       .replace(rleadingWhitespace, "")], ownerDocument)[0];
+                       } else {
+                               return this.cloneNode(true);
+                       }
+               });
+
+               // Copy the events from the original to the clone
+               if ( events === true ) {
+                       cloneCopyEvent( this, ret );
+                       cloneCopyEvent( this.find("*"), ret.find("*") );
+               }
+
+               // Return the cloned set
+               return ret;
+       },
+
+       html: function( value ) {
+               if ( value === undefined ) {
+                       return this[0] && this[0].nodeType === 1 ?
+                               this[0].innerHTML.replace(rinlinejQuery, "") :
+                               null;
+
+               // See if we can take a shortcut and just use innerHTML
+               } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+                       (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+                       !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+                       try {
+                               for ( var i = 0, l = this.length; i < l; i++ ) {
+                                       // Remove element nodes and prevent memory leaks
+                                       if ( this[i].nodeType === 1 ) {
+                                               cleanData( this[i].getElementsByTagName("*") );
+                                               this[i].innerHTML = value;
+                                       }
+                               }
+
+                       // If using innerHTML throws an exception, use the fallback method
+                       } catch(e) {
+                               this.empty().append( value );
+                       }
+
+               } else if ( jQuery.isFunction( value ) ) {
+                       this.each(function(i){
+                               var self = jQuery(this), old = self.html();
+                               self.empty().append(function(){
+                                       return value.call( this, i, old );
+                               });
+                       });
+
+               } else {
+                       this.empty().append( value );
+               }
+
+               return this;
+       },
+
+       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 ) ) {
+                               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.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+               }
+       },
+
+       detach: function( selector ) {
+               return this.remove( selector, true );
+       },
+
+       domManip: function( args, table, callback ) {
+               var results, first, value = args[0], scripts = [];
+
+               if ( jQuery.isFunction(value) ) {
+                       return this.each(function(i) {
+                               var self = jQuery(this);
+                               args[0] = value.call(this, i, table ? self.html() : undefined);
+                               return self.domManip( args, table, callback );
+                       });
+               }
+
+               if ( this[0] ) {
+                       // If we're in a fragment, just use that instead of building a new one
+                       if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
+                               results = { fragment: args[0].parentNode };
+                       } else {
+                               results = buildFragment( args, this, scripts );
+                       }
+
+                       first = results.fragment.firstChild;
+
+                       if ( first ) {
+                               table = table && jQuery.nodeName( first, "tr" );
+
+                               for ( var i = 0, l = this.length; i < l; i++ ) {
+                                       callback.call(
+                                               table ?
+                                                       root(this[i], first) :
+                                                       this[i],
+                                               results.cacheable || this.length > 1 || i > 0 ?
+                                                       results.fragment.cloneNode(true) :
+                                                       results.fragment
+                                       );
+                               }
+                       }
+
+                       if ( scripts ) {
+                               jQuery.each( scripts, evalScript );
+                       }
+               }
+
+               return this;
+
+               function root( elem, cur ) {
+                       return jQuery.nodeName(elem, "table") ?
+                               (elem.getElementsByTagName("tbody")[0] ||
+                               elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+                               elem;
+               }
+       }
+});
+
+function cloneCopyEvent(orig, ret) {
+       var i = 0;
+
+       ret.each(function() {
+               if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
+                       return;
+               }
+
+               var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+
+               if ( events ) {
+                       delete curData.handle;
+                       curData.events = {};
+
+                       for ( var type in events ) {
+                               for ( var handler in events[ type ] ) {
+                                       jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+                               }
+                       }
+               }
+       });
+}
+
+function buildFragment( args, nodes, scripts ) {
+       var fragment, cacheable, cached, cacheresults, doc;
+
+       if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
+               cacheable = true;
+               cacheresults = jQuery.fragments[ args[0] ];
+               if ( cacheresults ) {
+                       if ( cacheresults !== 1 ) {
+                               fragment = cacheresults;
+                       }
+                       cached = true;
+               }
+       }
+
+       if ( !fragment ) {
+               doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+               fragment = doc.createDocumentFragment();
+               jQuery.clean( args, doc, fragment, scripts );
+       }
+
+       if ( cacheable ) {
+               jQuery.fragments[ args[0] ] = 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 );
+
+               for ( var i = 0, l = insert.length; i < l; i++ ) {
+                       var elems = (i > 0 ? this.clone(true) : this).get();
+                       jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+                       ret = ret.concat( elems );
+               }
+               return this.pushStack( ret, name, insert.selector );
+       };
+});
+
+jQuery.each({
+       // keepData is for internal use only--do not document
+       remove: function( selector, keepData ) {
+               if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+                       if ( !keepData && this.nodeType === 1 ) {
+                               cleanData( this.getElementsByTagName("*") );
+                               cleanData( [ this ] );
+                       }
+
+                       if ( this.parentNode ) {
+                                this.parentNode.removeChild( this );
+                       }
+               }
+       },
+
+       empty: function() {
+               // Remove element nodes and prevent memory leaks
+               if ( this.nodeType === 1 ) {
+                       cleanData( this.getElementsByTagName("*") );
+               }
+
+               // Remove any remaining nodes
+               while ( this.firstChild ) {
+                       this.removeChild( this.firstChild );
+               }
+       }
+}, function( name, fn ) {
+       jQuery.fn[ name ] = function() {
+               return this.each( fn, arguments );
+       };
+});
+
+jQuery.extend({
+       clean: function( elems, context, fragment, scripts ) {
+               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;
+               }
+
+               var ret = [];
+
+               jQuery.each(elems, function( i, elem ) {
+                       if ( typeof elem === "number" ) {
+                               elem += "";
+                       }
+
+                       if ( !elem ) {
+                               return;
+                       }
+
+                       // Convert html string into DOM nodes
+                       if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+                               elem = context.createTextNode( elem );
+
+                       } else if ( typeof elem === "string" ) {
+                               // Fix "XHTML"-style tags in all browsers
+                               elem = elem.replace(rxhtmlTag, fcloseTag);
+
+                               // 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");
+
+                               // 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 ( var 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 = jQuery.makeArray( div.childNodes );
+                       }
+
+                       if ( elem.nodeType ) {
+                               ret.push( elem );
+                       } else {
+                               ret = jQuery.merge( ret, elem );
+                       }
+
+               });
+
+               if ( fragment ) {
+                       for ( var i = 0; ret[i]; i++ ) {
+                               if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+                                       scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+                               } else {
+                                       if ( ret[i].nodeType === 1 ) {
+                                               ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+                                       }
+                                       fragment.appendChild( ret[i] );
+                               }
+                       }
+               }
+
+               return ret;
+       }
+});
+
+function cleanData( elems ) {
+       for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
+               if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
+                       delete jQuery.cache[ id ];
+               }
+       }
+}
+// exclude the following css properties to add px
+var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+       ralpha = /alpha\([^)]*\)/,
+       ropacity = /opacity=([^)]*)/,
+       rfloat = /float/i,
+       rdashAlpha = /-([a-z])/ig,
+       rupper = /([A-Z])/g,
+       rnumpx = /^-?\d+(?:px)?$/i,
+       rnum = /^-?\d/,
+
+       cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+       cssWidth = [ "Left", "Right" ],
+       cssHeight = [ "Top", "Bottom" ],
+
+       // cache check for defaultView.getComputedStyle
+       getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
+       // normalize float css property
+       styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+       fcamelCase = function( all, letter ) {
+               return letter.toUpperCase();
+       };
+
+jQuery.fn.css = function( name, value ) {
+       return access( this, name, value, true, function( elem, name, value ) {
+               if ( value === undefined ) {
+                       return jQuery.curCSS( elem, name );
+               }
+               
+               if ( typeof value === "number" && !rexclude.test(name) ) {
+                       value += "px";
+               }
+
+               jQuery.style( elem, name, value );
+       });
+};
+
+jQuery.extend({
+       style: function( elem, name, value ) {
+               // don't set styles on text and comment nodes
+               if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+                       return undefined;
+               }
+
+               // ignore negative width and height values #1599
+               if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
+                       value = undefined;
+               }
+
+               var style = elem.style || elem, set = value !== undefined;
+
+               // IE uses filters for opacity
+               if ( !jQuery.support.opacity && name === "opacity" ) {
+                       if ( set ) {
+                               // IE has trouble with opacity if it does not have layout
+                               // Force it by setting the zoom level
+                               style.zoom = 1;
+
+                               // Set the alpha filter to set the opacity
+                               var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
+                               var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
+                               style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
+                       }
+
+                       return style.filter && style.filter.indexOf("opacity=") >= 0 ?
+                               (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
+                               "";
+               }
+
+               // Make sure we're using the right name for getting the float value
+               if ( rfloat.test( name ) ) {
+                       name = styleFloat;
+               }
+
+               name = name.replace(rdashAlpha, fcamelCase);
+
+               if ( set ) {
+                       style[ name ] = value;
+               }
+
+               return style[ name ];
+       },
+
+       css: function( elem, name, force, extra ) {
+               if ( name === "width" || name === "height" ) {
+                       var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
+
+                       function getWH() {
+                               val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+                               if ( extra === "border" ) {
+                                       return;
+                               }
+
+                               jQuery.each( which, function() {
+                                       if ( !extra ) {
+                                               val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+                                       }
+
+                                       if ( extra === "margin" ) {
+                                               val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+                                       } else {
+                                               val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+                                       }
+                               });
+                       }
+
+                       if ( elem.offsetWidth !== 0 ) {
+                               getWH();
+                       } else {
+                               jQuery.swap( elem, props, getWH );
+                       }
+
+                       return Math.max(0, Math.round(val));
+               }
+
+               return jQuery.curCSS( elem, name, force );
+       },
+
+       curCSS: function( elem, name, force ) {
+               var ret, style = elem.style, filter;
+
+               // IE uses filters for opacity
+               if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
+                       ret = ropacity.test(elem.currentStyle.filter || "") ?
+                               (parseFloat(RegExp.$1) / 100) + "" :
+                               "";
+
+                       return ret === "" ?
+                               "1" :
+                               ret;
+               }
+
+               // Make sure we're using the right name for getting the float value
+               if ( rfloat.test( name ) ) {
+                       name = styleFloat;
+               }
+
+               if ( !force && style && style[ name ] ) {
+                       ret = style[ name ];
+
+               } else if ( getComputedStyle ) {
+
+                       // Only "float" is needed here
+                       if ( rfloat.test( name ) ) {
+                               name = "float";
+                       }
+
+                       name = name.replace( rupper, "-$1" ).toLowerCase();
+
+                       var defaultView = elem.ownerDocument.defaultView;
+
+                       if ( !defaultView ) {
+                               return null;
+                       }
+
+                       var computedStyle = defaultView.getComputedStyle( elem, null );
+
+                       if ( computedStyle ) {
+                               ret = computedStyle.getPropertyValue( name );
+                       }
+
+                       // We should always get a number back from opacity
+                       if ( name === "opacity" && ret === "" ) {
+                               ret = "1";
+                       }
+
+               } else if ( elem.currentStyle ) {
+                       var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+                       ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+                       // 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 ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+                               // Remember the original values
+                               var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+                               // Put in the new values to get a computed value out
+                               elem.runtimeStyle.left = elem.currentStyle.left;
+                               style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+                               ret = style.pixelLeft + "px";
+
+                               // Revert the changed values
+                               style.left = left;
+                               elem.runtimeStyle.left = rsLeft;
+                       }
+               }
+
+               return ret;
+       },
+
+       // A method for quickly swapping in/out CSS properties to get correct calculations
+       swap: function( elem, options, callback ) {
+               var old = {};
+
+               // Remember the old values, and insert the new ones
+               for ( var name in options ) {
+                       old[ name ] = elem.style[ name ];
+                       elem.style[ name ] = options[ name ];
+               }
+
+               callback.call( elem );
+
+               // Revert the old values
+               for ( var name in options ) {
+                       elem.style[ name ] = old[ name ];
+               }
+       }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+       jQuery.expr.filters.hidden = function( elem ) {
+               var width = elem.offsetWidth, height = elem.offsetHeight,
+                       skip = elem.nodeName.toLowerCase() === "tr";
+
+               return width === 0 && height === 0 && !skip ?
+                       true :
+                       width > 0 && height > 0 && !skip ?
+                               false :
+                               jQuery.curCSS(elem, "display") === "none";
+       };
+
+       jQuery.expr.filters.visible = function( elem ) {
+               return !jQuery.expr.filters.hidden( elem );
+       };
+}
+var jsc = now(),
+       rscript = /<script(.|\s)*?\/script>/gi,
+       rselectTextarea = /select|textarea/i,
+       rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+       jsre = /=\?(&|$)/,
+       rquery = /\?/,
+       rts = /(\?|&)_=.*?(&|$)/,
+       rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+       r20 = /%20/g;
+
+jQuery.fn.extend({
+       // Keep a copy of the old load
+       _load: jQuery.fn.load,
+
+       load: function( url, params, callback ) {
+               if ( typeof url !== "string" ) {
+                       return this._load( url );
+
+               // 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 = null;
+
+                       // Otherwise, build a param string
+                       } else if ( typeof params === "object" ) {
+                               params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+                               type = "POST";
+                       }
+               }
+
+               // Request the remote document
+               jQuery.ajax({
+                       url: url,
+                       type: type,
+                       dataType: "html",
+                       data: params,
+                       context:this,
+                       complete: function( res, status ) {
+                               // If successful, inject the HTML into all the matched elements
+                               if ( status === "success" || status === "notmodified" ) {
+                                       // See if a selector was specified
+                                       this.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(res.responseText.replace(rscript, ""))
+
+                                                       // Locate the specified elements
+                                                       .find(selector) :
+
+                                               // If not, just inject the full result
+                                               res.responseText );
+                               }
+
+                               if ( callback ) {
+                                       this.each( callback, [res.responseText, status, res] );
+                               }
+                       }
+               });
+
+               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 };
+                                       }) :
+                                       { name: elem.name, value: val };
+               }).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.bind(o, f);
+       };
+});
+
+jQuery.extend({
+
+       get: function( url, data, callback, type ) {
+               // shift arguments if data argument was omited
+               if ( jQuery.isFunction( data ) ) {
+                       type = type || callback;
+                       callback = data;
+                       data = null;
+               }
+
+               return jQuery.ajax({
+                       type: "GET",
+                       url: url,
+                       data: data,
+                       success: callback,
+                       dataType: type
+               });
+       },
+
+       getScript: function( url, callback ) {
+               return jQuery.get(url, null, callback, "script");
+       },
+
+       getJSON: function( url, data, callback ) {
+               return jQuery.get(url, data, callback, "json");
+       },
+
+       post: function( url, data, callback, type ) {
+               // shift arguments if data argument was omited
+               if ( jQuery.isFunction( data ) ) {
+                       type = type || callback;
+                       callback = data;
+                       data = {};
+               }
+
+               return jQuery.ajax({
+                       type: "POST",
+                       url: url,
+                       data: data,
+                       success: callback,
+                       dataType: type
+               });
+       },
+
+       ajaxSetup: function( settings ) {
+               jQuery.extend( jQuery.ajaxSettings, settings );
+       },
+
+       ajaxSettings: {
+               url: location.href,
+               global: true,
+               type: "GET",
+               contentType: "application/x-www-form-urlencoded",
+               processData: true,
+               async: true,
+               /*
+               timeout: 0,
+               data: null,
+               username: null,
+               password: null,
+               traditional: false,
+               */
+               // Create the request object; Microsoft failed to properly
+               // implement the XMLHttpRequest in IE7 (can't request local files),
+               // so we use the ActiveXObject when it is available
+               // This function can be overriden by calling jQuery.ajaxSetup
+               xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
+                       function() {
+                               return new window.XMLHttpRequest();
+                       } :
+                       function() {
+                               try {
+                                       return new window.ActiveXObject("Microsoft.XMLHTTP");
+                               } catch(e) {}
+                       },
+               accepts: {
+                       xml: "application/xml, text/xml",
+                       html: "text/html",
+                       script: "text/javascript, application/javascript",
+                       json: "application/json, text/javascript",
+                       text: "text/plain",
+                       _default: "*/*"
+               }
+       },
+
+       // Last-Modified header cache for next request
+       lastModified: {},
+       etag: {},
+
+       ajax: function( origSettings ) {
+               var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+               
+               var jsonp, status, data,
+                       callbackContext = s.context || s,
+                       type = s.type.toUpperCase();
+
+               // convert data if not already a string
+               if ( s.data && s.processData && typeof s.data !== "string" ) {
+                       s.data = jQuery.param( s.data, s.traditional );
+               }
+
+               // Handle JSONP Parameter Callbacks
+               if ( s.dataType === "jsonp" ) {
+                       if ( type === "GET" ) {
+                               if ( !jsre.test( s.url ) ) {
+                                       s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+                               }
+                       } else if ( !s.data || !jsre.test(s.data) ) {
+                               s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+                       }
+                       s.dataType = "json";
+               }
+
+               // Build temporary JSONP function
+               if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
+                       jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+                       // Replace the =? sequence both in the query string and the data
+                       if ( s.data ) {
+                               s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+                       }
+
+                       s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+                       // We need to make sure
+                       // that a JSONP style response is executed properly
+                       s.dataType = "script";
+
+                       // Handle JSONP-style loading
+                       window[ jsonp ] = window[ jsonp ] || function( tmp ) {
+                               data = tmp;
+                               success();
+                               complete();
+                               // Garbage collect
+                               window[ jsonp ] = undefined;
+
+                               try {
+                                       delete window[ jsonp ];
+                               } catch(e) {}
+
+                               if ( head ) {
+                                       head.removeChild( script );
+                               }
+                       };
+               }
+
+               if ( s.dataType === "script" && s.cache === null ) {
+                       s.cache = false;
+               }
+
+               if ( s.cache === false && type === "GET" ) {
+                       var ts = now();
+
+                       // try replacing _= if it is there
+                       var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+                       // if nothing was replaced, add timestamp to the end
+                       s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
+               }
+
+               // If data is available, append data to url for get requests
+               if ( s.data && type === "GET" ) {
+                       s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+               }
+
+               // Watch for a new set of requests
+               if ( s.global && ! jQuery.active++ ) {
+                       jQuery.event.trigger( "ajaxStart" );
+               }
+
+               // Matches an absolute URL, and saves the domain
+               var parts = rurl.exec( s.url ),
+                       remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
+
+               // If we're requesting a remote document
+               // and trying to load JSON or Script with a GET
+               if ( s.dataType === "script" && type === "GET" && remote ) {
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement;
+                       var script = document.createElement("script");
+                       script.src = s.url;
+                       if ( s.scriptCharset ) {
+                               script.charset = s.scriptCharset;
+                       }
+
+                       // Handle Script loading
+                       if ( !jsonp ) {
+                               var done = false;
+
+                               // Attach handlers for all browsers
+                               script.onload = script.onreadystatechange = function() {
+                                       if ( !done && (!this.readyState ||
+                                                       this.readyState === "loaded" || this.readyState === "complete") ) {
+                                               done = true;
+                                               success();
+                                               complete();
+
+                                               // Handle memory leak in IE
+                                               script.onload = script.onreadystatechange = null;
+                                               if ( head && script.parentNode ) {
+                                                       head.removeChild( script );
+                                               }
+                                       }
+                               };
+                       }
+
+                       // 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 );
+
+                       // We handle everything using the script element injection
+                       return undefined;
+               }
+
+               var requestDone = false;
+
+               // Create the request object
+               var xhr = s.xhr();
+
+               if ( !xhr ) {
+                       return;
+               }
+
+               // Open the socket
+               // Passing null username, generates a login popup on Opera (#2865)
+               if ( s.username ) {
+                       xhr.open(type, s.url, s.async, s.username, s.password);
+               } else {
+                       xhr.open(type, s.url, s.async);
+               }
+
+               // Need an extra try/catch for cross domain requests in Firefox 3
+               try {
+                       // Set the correct header, if data is being sent
+                       if ( s.data || origSettings && origSettings.contentType ) {
+                               xhr.setRequestHeader("Content-Type", s.contentType);
+                       }
+
+                       // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+                       if ( s.ifModified ) {
+                               if ( jQuery.lastModified[s.url] ) {
+                                       xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+                               }
+
+                               if ( jQuery.etag[s.url] ) {
+                                       xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+                               }
+                       }
+
+                       // Set header so the called script knows that it's an XMLHttpRequest
+                       // Only send the header if it's not a remote XHR
+                       if ( !remote ) {
+                               xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+                       }
+
+                       // Set the Accepts header for the server, depending on the dataType
+                       xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+                               s.accepts[ s.dataType ] + ", */*" :
+                               s.accepts._default );
+               } catch(e) {}
+
+               // Allow custom headers/mimetypes and early abort
+               if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
+                       // Handle the global AJAX counter
+                       if ( s.global && ! --jQuery.active ) {
+                               jQuery.event.trigger( "ajaxStop" );
+                       }
+
+                       // close opended socket
+                       xhr.abort();
+                       return false;
+               }
+
+               if ( s.global ) {
+                       trigger("ajaxSend", [xhr, s]);
+               }
+
+               // Wait for a response to come back
+               var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
+                       // The request was aborted
+                       if ( !xhr || xhr.readyState === 0 ) {
+                               // Opera doesn't call onreadystatechange before this point
+                               // so we simulate the call
+                               if ( !requestDone ) {
+                                       complete();
+                               }
+
+                               requestDone = true;
+                               if ( xhr ) {
+                                       xhr.onreadystatechange = jQuery.noop;
+                               }
+
+                       // The transfer is complete and the data is available, or the request timed out
+                       } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
+                               requestDone = true;
+                               xhr.onreadystatechange = jQuery.noop;
+
+                               status = isTimeout === "timeout" ?
+                                       "timeout" :
+                                       !jQuery.httpSuccess( xhr ) ?
+                                               "error" :
+                                               s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
+                                                       "notmodified" :
+                                                       "success";
+
+                               if ( status === "success" ) {
+                                       // Watch for, and catch, XML document parse errors
+                                       try {
+                                               // process the data (runs the xml through httpData regardless of callback)
+                                               data = jQuery.httpData( xhr, s.dataType, s );
+                                       } catch(e) {
+                                               status = "parsererror";
+                                       }
+                               }
+
+                               // Make sure that the request was successful or notmodified
+                               if ( status === "success" || status === "notmodified" ) {
+                                       // JSONP handles its own success callback
+                                       if ( !jsonp ) {
+                                               success();
+                                       }
+                               } else {
+                                       jQuery.handleError(s, xhr, status);
+                               }
+
+                               // Fire the complete handlers
+                               complete();
+
+                               if ( isTimeout === "timeout" ) {
+                                       xhr.abort();
+                               }
+
+                               // Stop memory leaks
+                               if ( s.async ) {
+                                       xhr = null;
+                               }
+                       }
+               };
+
+               // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+               // Opera doesn't fire onreadystatechange at all on abort
+               try {
+                       var oldAbort = xhr.abort;
+                       xhr.abort = function() {
+                               if ( xhr ) {
+                                       oldAbort.call( xhr );
+                                       if ( xhr ) {
+                                               xhr.readyState = 0;
+                                       }
+                               }
+
+                               onreadystatechange();
+                       };
+               } catch(e) { }
+
+               // Timeout checker
+               if ( s.async && s.timeout > 0 ) {
+                       setTimeout(function() {
+                               // Check to see if the request is still happening
+                               if ( xhr && !requestDone ) {
+                                       onreadystatechange( "timeout" );
+                               }
+                       }, s.timeout);
+               }
+
+               // Send the data
+               try {
+                       xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
+               } catch(e) {
+                       jQuery.handleError(s, xhr, null, e);
+                       // Fire the complete handlers
+                       complete();
+               }
+
+               // firefox 1.5 doesn't fire statechange for sync requests
+               if ( !s.async ) {
+                       onreadystatechange();
+               }
+
+               function success() {
+                       // If a local callback was specified, fire it and pass it the data
+                       if ( s.success ) {
+                               s.success.call( callbackContext, data, status, xhr );
+                       }
+
+                       // Fire the global callback
+                       if ( s.global ) {
+                               trigger( "ajaxSuccess", [xhr, s] );
+                       }
+               }
+
+               function complete() {
+                       // Process result
+                       if ( s.complete ) {
+                               s.complete.call( callbackContext, xhr, status);
+                       }
+
+                       // The request was completed
+                       if ( s.global ) {
+                               trigger( "ajaxComplete", [xhr, s] );
+                       }
+
+                       // Handle the global AJAX counter
+                       if ( s.global && ! --jQuery.active ) {
+                               jQuery.event.trigger( "ajaxStop" );
+                       }
+               }
+               
+               function trigger(type, args) {
+                       (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+               }
+
+               // return XMLHttpRequest to allow aborting the request etc.
+               return xhr;
+       },
+
+       handleError: function( s, xhr, status, e ) {
+               // If a local callback was specified, fire it
+               if ( s.error ) {
+                       s.error.call( s.context || window, xhr, status, e );
+               }
+
+               // Fire the global callback
+               if ( s.global ) {
+                       (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+               }
+       },
+
+       // Counter for holding the number of active queries
+       active: 0,
+
+       // Determines if an XMLHttpRequest was successful or not
+       httpSuccess: function( xhr ) {
+               try {
+                       // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+                       return !xhr.status && location.protocol === "file:" ||
+                               // Opera returns 0 when status is 304
+                               ( xhr.status >= 200 && xhr.status < 300 ) ||
+                               xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+               } catch(e) {}
+
+               return false;
+       },
+
+       // Determines if an XMLHttpRequest returns NotModified
+       httpNotModified: function( xhr, url ) {
+               var lastModified = xhr.getResponseHeader("Last-Modified"),
+                       etag = xhr.getResponseHeader("Etag");
+
+               if ( lastModified ) {
+                       jQuery.lastModified[url] = lastModified;
+               }
+
+               if ( etag ) {
+                       jQuery.etag[url] = etag;
+               }
+
+               // Opera returns 0 when status is 304
+               return xhr.status === 304 || xhr.status === 0;
+       },
+
+       httpData: function( xhr, type, s ) {
+               var ct = xhr.getResponseHeader("content-type") || "",
+                       xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+                       data = xml ? xhr.responseXML : xhr.responseText;
+
+               if ( xml && data.documentElement.nodeName === "parsererror" ) {
+                       throw "parsererror";
+               }
+
+               // Allow a pre-filtering function to sanitize the response
+               // s is checked to keep backwards compatibility
+               if ( s && s.dataFilter ) {
+                       data = s.dataFilter( data, type );
+               }
+
+               // The filter can actually parse the response
+               if ( typeof data === "string" ) {
+                       // Get the JavaScript object, if JSON is used.
+                       if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
+                               // Make sure the incoming data is actual JSON
+                               // Logic borrowed from http://json.org/json2.js
+                               if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+                                       .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+                                       .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
+
+                                       // Try to use the native JSON parser first
+                                       if ( window.JSON && window.JSON.parse ) {
+                                               data = window.JSON.parse( data );
+
+                                       } else {
+                                               data = (new Function("return " + data))();
+                                       }
+
+                               } else {
+                                       throw "Invalid JSON: " + data;
+                               }
+
+                       // If the type is "script", eval it in global context
+                       } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
+                               jQuery.globalEval( data );
+                       }
+               }
+
+               return data;
+       },
+
+       // Serialize an array of form elements or a set of
+       // key/values into a query string
+       param: function( a, traditional ) {
+               
+               var s = [];
+               
+               // Set traditional to true for jQuery <= 1.3.2 behavior.
+               if ( traditional === undefined ) {
+                       traditional = jQuery.ajaxSettings.traditional;
+               }
+               
+               function add( 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);
+               }
+               
+               // If an array was passed in, assume that it is an array of form elements.
+               if ( jQuery.isArray(a) || a.jquery ) {
+                       // 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.
+                       jQuery.each( a, function buildParams( prefix, obj ) {
+                               
+                               if ( jQuery.isArray(obj) ) {
+                                       // Serialize array item.
+                                       jQuery.each( obj, function( i, v ) {
+                                               if ( traditional ) {
+                                                       // 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" || jQuery.isArray(v) ? i : "" ) + "]", v );
+                                               }
+                                       });
+                                       
+                               } else if ( !traditional && obj != null && typeof obj === "object" ) {
+                                       // Serialize object item.
+                                       jQuery.each( obj, function( k, v ) {
+                                               buildParams( prefix + "[" + k + "]", v );
+                                       });
+                                       
+                               } else {
+                                       // Serialize scalar item.
+                                       add( prefix, obj );
+                               }
+                       });
+               }
+               
+               // Return the resulting serialization
+               return s.join("&").replace(r20, "+");
+       }
+
+});
+var elemdisplay = {},
+       rfxtypes = /toggle|show|hide/,
+       rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+       timerId,
+       fxAttrs = [
+               // height animations
+               [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+               // width animations
+               [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+               // opacity animations
+               [ "opacity" ]
+       ];
+
+jQuery.fn.extend({
+       show: function( speed, callback ) {
+               if ( speed != null ) {
+                       return this.animate( genFx("show", 3), speed, callback);
+
+               } else {
+                       for ( var i = 0, l = this.length; i < l; i++ ) {
+                               var old = jQuery.data(this[i], "olddisplay");
+
+                               this[i].style.display = old || "";
+
+                               if ( jQuery.css(this[i], "display") === "none" ) {
+                                       var nodeName = this[i].nodeName, display;
+
+                                       if ( elemdisplay[ nodeName ] ) {
+                                               display = elemdisplay[ nodeName ];
+
+                                       } else {
+                                               var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+                                               display = elem.css("display");
+
+                                               if ( display === "none" ) {
+                                                       display = "block";
+                                               }
+
+                                               elem.remove();
+
+                                               elemdisplay[ nodeName ] = display;
+                                       }
+
+                                       jQuery.data(this[i], "olddisplay", display);
+                               }
+                       }
+
+                       // Set the display of the elements in a second loop
+                       // to avoid the constant reflow
+                       for ( var j = 0, k = this.length; j < k; j++ ) {
+                               this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+                       }
+
+                       return this;
+               }
+       },
+
+       hide: function( speed, callback ) {
+               if ( speed != null ) {
+                       return this.animate( genFx("hide", 3), speed, callback);
+
+               } else {
+                       for ( var i = 0, l = this.length; i < l; i++ ) {
+                               var old = jQuery.data(this[i], "olddisplay");
+                               if ( !old && old !== "none" ) {
+                                       jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+                               }
+                       }
+
+                       // Set the display of the elements in a second loop
+                       // to avoid the constant reflow
+                       for ( var j = 0, k = this.length; j < k; j++ ) {
+                               this[j].style.display = "none";
+                       }
+
+                       return this;
+               }
+       },
+
+       // Save the old toggle function
+       _toggle: jQuery.fn.toggle,
+
+       toggle: function( fn, fn2 ) {
+               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);
+               }
+
+               return this;
+       },
+
+       fadeTo: function( speed, to, callback ) {
+               return this.filter(":hidden").css("opacity", 0).show().end()
+                                       .animate({opacity: to}, speed, callback);
+       },
+
+       animate: function( prop, speed, easing, callback ) {
+               var optall = jQuery.speed(speed, easing, callback);
+
+               if ( jQuery.isEmptyObject( prop ) ) {
+                       return this.each( optall.complete );
+               }
+
+               return this[ optall.queue === false ? "each" : "queue" ](function() {
+                       var opt = jQuery.extend({}, optall), p,
+                               hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+                               self = this;
+
+                       for ( p in prop ) {
+                               var name = p.replace(rdashAlpha, fcamelCase);
+
+                               if ( p !== name ) {
+                                       prop[ name ] = prop[ p ];
+                                       delete prop[ p ];
+                                       p = name;
+                               }
+
+                               if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
+                                       return opt.complete.call(this);
+                               }
+
+                               if ( ( p === "height" || p === "width" ) && this.style ) {
+                                       // Store display property
+                                       opt.display = jQuery.css(this, "display");
+
+                                       // Make sure that nothing sneaks out
+                                       opt.overflow = this.style.overflow;
+                               }
+
+                               if ( jQuery.isArray( prop[p] ) ) {
+                                       // Create (if needed) and add to specialEasing
+                                       (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+                                       prop[p] = prop[p][0];
+                               }
+                       }
+
+                       if ( opt.overflow != null ) {
+                               this.style.overflow = "hidden";
+                       }
+
+                       opt.curAnim = jQuery.extend({}, prop);
+
+                       jQuery.each( prop, function( name, val ) {
+                               var e = new jQuery.fx( self, opt, name );
+
+                               if ( rfxtypes.test(val) ) {
+                                       e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+
+                               } else {
+                                       var parts = rfxnum.exec(val),
+                                               start = e.cur(true) || 0;
+
+                                       if ( parts ) {
+                                               var end = parseFloat( parts[2] ),
+                                                       unit = parts[3] || "px";
+
+                                               // We need to compute starting value
+                                               if ( unit !== "px" ) {
+                                                       self.style[ name ] = (end || 1) + unit;
+                                                       start = ((end || 1) / e.cur(true)) * start;
+                                                       self.style[ name ] = 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;
+               });
+       },
+
+       stop: function( clearQueue, gotoEnd ) {
+               var timers = jQuery.timers;
+
+               if ( clearQueue ) {
+                       this.queue([]);
+               }
+
+               this.each(function() {
+                       // go in reverse order so anything added to the queue during the loop is ignored
+                       for ( var i = timers.length - 1; i >= 0; i-- ) {
+                               if ( timers[i].elem === this ) {
+                                       if (gotoEnd) {
+                                               // force the next step to be the last
+                                               timers[i](true);
+                                       }
+
+                                       timers.splice(i, 1);
+                               }
+                       }
+               });
+
+               // start the next in the queue if the last step wasn't forced
+               if ( !gotoEnd ) {
+                       this.dequeue();
+               }
+
+               return this;
+       }
+
+});
+
+// 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" }
+}, function( name, props ) {
+       jQuery.fn[ name ] = function( speed, callback ) {
+               return this.animate( props, speed, callback );
+       };
+});
+
+jQuery.extend({
+       speed: function( speed, easing, fn ) {
+               var opt = speed && typeof speed === "object" ? 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 :
+                       jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+               // Queueing
+               opt.old = opt.complete;
+               opt.complete = function() {
+                       if ( opt.queue !== false ) {
+                               jQuery(this).dequeue();
+                       }
+                       if ( jQuery.isFunction( opt.old ) ) {
+                               opt.old.call( this );
+                       }
+               };
+
+               return opt;
+       },
+
+       easing: {
+               linear: function( p, n, firstNum, diff ) {
+                       return firstNum + diff * p;
+               },
+               swing: function( p, n, firstNum, diff ) {
+                       return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+               }
+       },
+
+       timers: [],
+
+       fx: function( elem, options, prop ) {
+               this.options = options;
+               this.elem = elem;
+               this.prop = prop;
+
+               if ( !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 );
+
+               // Set display property to block for height/width animations
+               if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
+                       this.elem.style.display = "block";
+               }
+       },
+
+       // Get the current size
+       cur: function( force ) {
+               if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+                       return this.elem[ this.prop ];
+               }
+
+               var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+               return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+       },
+
+       // Start an animation from one number to another
+       custom: function( from, to, unit ) {
+               this.startTime = now();
+               this.start = from;
+               this.end = to;
+               this.unit = unit || this.unit || "px";
+               this.now = this.start;
+               this.pos = this.state = 0;
+
+               var self = this;
+               function t( gotoEnd ) {
+                       return self.step(gotoEnd);
+               }
+
+               t.elem = this.elem;
+
+               if ( t() && jQuery.timers.push(t) && !timerId ) {
+                       timerId = setInterval(jQuery.fx.tick, 13);
+               }
+       },
+
+       // Simple 'show' function
+       show: function() {
+               // Remember where we started, so that we can go back to it later
+               this.options.orig[this.prop] = 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
+               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.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 t = now(), done = true;
+
+               if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+                       this.now = this.end;
+                       this.pos = this.state = 1;
+                       this.update();
+
+                       this.options.curAnim[ this.prop ] = true;
+
+                       for ( var i in this.options.curAnim ) {
+                               if ( this.options.curAnim[i] !== true ) {
+                                       done = false;
+                               }
+                       }
+
+                       if ( done ) {
+                               if ( this.options.display != null ) {
+                                       // Reset the overflow
+                                       this.elem.style.overflow = this.options.overflow;
+
+                                       // Reset the display
+                                       var old = jQuery.data(this.elem, "olddisplay");
+                                       this.elem.style.display = old ? old : this.options.display;
+
+                                       if ( jQuery.css(this.elem, "display") === "none" ) {
+                                               this.elem.style.display = "block";
+                                       }
+                               }
+
+                               // Hide the element if the "hide" operation was done
+                               if ( this.options.hide ) {
+                                       jQuery(this.elem).hide();
+                               }
+
+                               // Reset the properties, if the item has been hidden or shown
+                               if ( this.options.hide || this.options.show ) {
+                                       for ( var p in this.options.curAnim ) {
+                                               jQuery.style(this.elem, p, this.options.orig[p]);
+                                       }
+                               }
+
+                               // Execute the complete function
+                               this.options.complete.call( this.elem );
+                       }
+
+                       return false;
+
+               } else {
+                       var n = t - this.startTime;
+                       this.state = n / this.options.duration;
+
+                       // Perform the easing function, defaults to swing
+                       var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+                       var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+                       this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.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 timers = jQuery.timers;
+
+               for ( var i = 0; i < timers.length; i++ ) {
+                       if ( !timers[i]() ) {
+                               timers.splice(i--, 1);
+                       }
+               }
+
+               if ( !timers.length ) {
+                       jQuery.fx.stop();
+               }
+       },
+               
+       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.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+                       } else {
+                               fx.elem[ fx.prop ] = fx.now;
+                       }
+               }
+       }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+       jQuery.expr.filters.animated = function( elem ) {
+               return jQuery.grep(jQuery.timers, function( fn ) {
+                       return elem === fn.elem;
+               }).length;
+       };
+}
+
+function genFx( type, num ) {
+       var obj = {};
+
+       jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+               obj[ this ] = type;
+       });
+
+       return obj;
+}
+if ( "getBoundingClientRect" in document.documentElement ) {
+       jQuery.fn.offset = function( options ) {
+               var elem = this[0];
+
+               if ( !elem || !elem.ownerDocument ) {
+                       return null;
+               }
+
+               if ( options ) { 
+                       return this.each(function( i ) {
+                               jQuery.offset.setOffset( this, options, i );
+                       });
+               }
+
+               if ( elem === elem.ownerDocument.body ) {
+                       return jQuery.offset.bodyOffset( elem );
+               }
+
+               var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
+                       clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+                       top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
+                       left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+               return { top: top, left: left };
+       };
+
+} else {
+       jQuery.fn.offset = function( options ) {
+               var elem = this[0];
+
+               if ( !elem || !elem.ownerDocument ) {
+                       return null;
+               }
+
+               if ( options ) { 
+                       return this.each(function( i ) {
+                               jQuery.offset.setOffset( this, options, i );
+                       });
+               }
+
+               if ( elem === elem.ownerDocument.body ) {
+                       return jQuery.offset.bodyOffset( elem );
+               }
+
+               jQuery.offset.initialize();
+
+               var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+                       doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+                       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.offset.supportsFixedPosition && 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.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+                                       top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
+                                       left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+                               }
+
+                               prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+                       }
+
+                       if ( jQuery.offset.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.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+                       top  += Math.max( docElem.scrollTop, body.scrollTop );
+                       left += Math.max( docElem.scrollLeft, body.scrollLeft );
+               }
+
+               return { top: top, left: left };
+       };
+}
+
+jQuery.offset = {
+       initialize: function() {
+               var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+                       html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+               jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+               container.innerHTML = html;
+               body.insertBefore( container, body.firstChild );
+               innerDiv = container.firstChild;
+               checkDiv = innerDiv.firstChild;
+               td = innerDiv.nextSibling.firstChild.firstChild;
+
+               this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+               this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+               checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+               // safari subtracts parent border width here which is 5px
+               this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+               checkDiv.style.position = checkDiv.style.top = "";
+
+               innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+               this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+               this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+               body.removeChild( container );
+               body = container = innerDiv = checkDiv = table = td = null;
+               jQuery.offset.initialize = jQuery.noop;
+       },
+
+       bodyOffset: function( body ) {
+               var top = body.offsetTop, left = body.offsetLeft;
+
+               jQuery.offset.initialize();
+
+               if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+                       top  += parseFloat( jQuery.curCSS(body, "marginTop",  true) ) || 0;
+                       left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+               }
+
+               return { top: top, left: left };
+       },
+       
+       setOffset: function( elem, options, i ) {
+               // set position first, in-case top/left are set even on static elem
+               if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+                       elem.style.position = "relative";
+               }
+               var curElem   = jQuery( elem ),
+                       curOffset = curElem.offset(),
+                       curTop    = parseInt( jQuery.curCSS( elem, "top",  true ), 10 ) || 0,
+                       curLeft   = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+
+               if ( jQuery.isFunction( options ) ) {
+                       options = options.call( elem, i, curOffset );
+               }
+
+               var props = {
+                       top:  (options.top  - curOffset.top)  + curTop,
+                       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 = /^body|html$/i.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.curCSS(elem, "marginTop",  true) ) || 0;
+               offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+
+               // Add offsetParent borders
+               parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth",  true) ) || 0;
+               parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 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 && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+                               offsetParent = offsetParent.offsetParent;
+                       }
+                       return offsetParent;
+               });
+       }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+       var method = "scroll" + name;
+
+       jQuery.fn[ method ] = function(val) {
+               var elem = this[0], win;
+               
+               if ( !elem ) {
+                       return null;
+               }
+
+               if ( val !== undefined ) {
+                       // Set the scroll offset
+                       return this.each(function() {
+                               win = getWindow( this );
+
+                               if ( win ) {
+                                       win.scrollTo(
+                                               !i ? val : jQuery(win).scrollLeft(),
+                                                i ? val : jQuery(win).scrollTop()
+                                       );
+
+                               } else {
+                                       this[ method ] = val;
+                               }
+                       });
+               } else {
+                       win = getWindow( elem );
+
+                       // Return the scroll offset
+                       return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+                               jQuery.support.boxModel && win.document.documentElement[ method ] ||
+                                       win.document.body[ method ] :
+                               elem[ method ];
+               }
+       };
+});
+
+function getWindow( elem ) {
+       return ("scrollTo" in elem && elem.document) ?
+               elem :
+               elem.nodeType === 9 ?
+                       elem.defaultView || elem.parentWindow :
+                       false;
+}
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+       var type = name.toLowerCase();
+
+       // innerHeight and innerWidth
+       jQuery.fn["inner" + name] = function() {
+               return this[0] ?
+                       jQuery.css( this[0], type, false, "padding" ) :
+                       null;
+       };
+
+       // outerHeight and outerWidth
+       jQuery.fn["outer" + name] = function( margin ) {
+               return this[0] ?
+                       jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+                       null;
+       };
+
+       jQuery.fn[ type ] = function( size ) {
+               // Get window width or height
+               var elem = this[0];
+               if ( !elem ) {
+                       return size == null ? null : this;
+               }
+
+               return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+                       // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+                       elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+                       elem.document.body[ "client" + name ] :
+
+                       // Get document width or height
+                       (elem.nodeType === 9) ? // is it a document
+                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+                               Math.max(
+                                       elem.documentElement["client" + name],
+                                       elem.body["scroll" + name], elem.documentElement["scroll" + name],
+                                       elem.body["offset" + name], elem.documentElement["offset" + name]
+                               ) :
+
+                               // Get or set width or height on the element
+                               size === undefined ?
+                                       // Get width or height on the element
+                                       jQuery.css( elem, type ) :
+
+                                       // Set the width or height on the element (default to pixels if value is unitless)
+                                       this.css( type, typeof size === "string" ? size : size + "px" );
+       };
+
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+})(window);
diff --git a/ricoClient/js/baselibs/jquery.js b/ricoClient/js/baselibs/jquery.js
new file mode 100644 (file)
index 0000000..5c70e4c
--- /dev/null
@@ -0,0 +1,151 @@
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
+ */
+(function(A,w){function oa(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(oa,1);return}c.ready()}}function La(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function $(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var o in b)$(a,o,b[o],f,e,d);return a}if(d!==w){f=!i&&f&&c.isFunction(d);for(o=0;o<j;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,i);return a}return j?
+e(a[0],b):null}function K(){return(new Date).getTime()}function aa(){return false}function ba(){return true}function pa(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function qa(a){var b=true,d=[],f=[],e=arguments,i,j,o,p,n,t=c.extend({},c.data(this,"events").live);for(p in t){j=t[p];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete t[p]}i=c(a.target).closest(f,a.currentTarget);
+n=0;for(l=i.length;n<l;n++)for(p in t){j=t[p];o=i[n].elem;f=null;if(i[n].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==o)d.push({elem:o,fn:j})}}n=0;for(l=d.length;n<l;n++){i=d[n];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}function ra(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"&")].join(".")}function sa(a){return!a||!a.parentNode||a.parentNode.nodeType===
+11}function ta(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ua(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:s;f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=
+i?f:1;return{fragment:f,cacheable:e}}function T(a){for(var b=0,d,f;(d=a[b])!=null;b++)if(!c.noData[d.nodeName.toLowerCase()]&&(f=d[H]))delete c.cache[f]}function L(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ma=A.jQuery,Na=A.$,s=A.document,U,Oa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Pa=/^.[^:#\[\.,]*$/,Qa=/\S/,
+Ra=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Sa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],M,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty,ea=Array.prototype.push,R=Array.prototype.slice,V=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Oa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Sa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];
+c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ua([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return U.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a)}else return!b||b.jquery?(b||U).find(a):c(b).find(a);else if(c.isFunction(a))return U.ready(a);if(a.selector!==w){this.selector=a.selector;
+this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,this)},selector:"",jquery:"1.4",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=
+0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||
+c(null)},push:ea,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];o=e[i];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(o)?[]:{};a[i]=c.extend(f,j,o)}else if(o!==w)a[i]=
+o}return a};c.extend({noConflict:function(a){A.$=Na;if(a)A.jQuery=Ma;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",M,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",
+M);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&oa()}}},isFunction:function(a){return ca.call(a)==="[object Function]"},isArray:function(a){return ca.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||ca.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!da.call(a,"constructor")&&!da.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===w||da.call(a,b)},
+isEmptyObject:function(a){for(var b in a)return false;return true},noop:function(){},globalEval:function(a){if(a&&Qa.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===w||c.isFunction(a);
+if(d)if(j)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Ra,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ea.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=
+0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b===
+"string"){d=a;a=d[b];b=w}else if(b&&!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/version/.test(a)?/version[\/ ]([\w.]+)/:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&
+!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||[0,"0"])[1];return b},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=true;if(V)c.inArray=function(a,b){return V.call(b,a)};U=c(s);if(s.addEventListener)M=function(){s.removeEventListener("DOMContentLoaded",M,false);c.ready()};else if(s.attachEvent)M=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",
+M);c.ready()}};if(V)c.inArray=function(a,b){return V.call(b,a)};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+K();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,
+htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,
+a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function o(){c.support.noCloneEvent=false;d.detachEvent("onclick",o)});d.cloneNode(true).fireEvent("onclick")}c(function(){var o=s.createElement("div");o.style.width=o.style.paddingLeft="1px";s.body.appendChild(o);c.boxModel=c.support.boxModel=o.offsetWidth===2;s.body.removeChild(o).style.display="none"});a=function(o){var p=s.createElement("div");o="on"+o;var n=o in
+p;if(!n){p.setAttribute(o,"return;");n=typeof p[o]==="function"}return n};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var H="jQuery"+K(),Ta=0,ya={},Ua={};c.extend({cache:{},expando:H,noData:{embed:true,object:true,applet:true},data:function(a,
+b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var f=a[H],e=c.cache;if(!b&&!f)return null;f||(f=++Ta);if(typeof b==="object"){a[H]=f;e=e[f]=c.extend(true,{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Ua:(e[f]={});if(d!==w){a[H]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var d=a[H],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[H]}catch(i){a.removeAttribute&&
+a.removeAttribute(H)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,
+a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,
+a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var za=/[\n\t]/g,fa=/\s+/,Va=/\r/g,Wa=/href|src|style/,Xa=/(button|input)/i,Ya=/(button|input|object|select|textarea)/i,Za=/^(a|area)$/i,Aa=/radio|checkbox/;c.fn.extend({attr:function(a,
+b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,o=b.length;j<o;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=
+" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.removeClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var i=(" "+e.className+" ").replace(za," "),j=0,o=b.length;j<o;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,
+b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),o=b,p=a.split(fa);e=p[i++];){o=f?o:!j.hasClass(e);j[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=
+" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(za," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(Aa.test(b.type)&&
+!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Va,"")}return w}var o=c.isFunction(a);return this.each(function(p){var n=c(this),t=a;if(this.nodeType===1){if(o)t=a.call(this,p,n.val());if(typeof t==="number")t+="";if(c.isArray(t)&&Aa.test(this.type))this.checked=c.inArray(n.val(),t)>=0;else if(c.nodeName(this,"select")){var z=c.makeArray(t);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),z)>=0});if(!z.length)this.selectedIndex=
+-1}else this.value=t}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Wa.test(b);if(b in a&&f&&!i){if(e){if(b==="type"&&Xa.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;
+if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Ya.test(a.nodeName)||Za.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var $a=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===
+3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;if(!d.guid)d.guid=c.guid++;if(f!==w){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):w};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var o,p=0;o=b[p++];){var n=o.split(".");o=n.shift();d.type=n.slice(0).sort().join(".");var t=e[o],z=this.special[o]||{};if(!t){t=e[o]={};
+if(!z.setup||z.setup.call(a,f,n,d)===false)if(a.addEventListener)a.addEventListener(o,i,false);else a.attachEvent&&a.attachEvent("on"+o,i)}if(z.add)if((n=z.add.call(a,d,f,n,t))&&c.isFunction(n)){n.guid=n.guid||d.guid;d=n}t[d.guid]=d;this.global[o]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===w||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);
+for(var o=0;i=b[o++];){var p=i.split(".");i=p.shift();var n=!p.length,t=c.map(p.slice(0).sort(),$a);t=new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.)?")+"(\\.|$)");var z=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var B in f[i])if(n||t.test(f[i][B].type))delete f[i][B];z.remove&&z.remove.call(a,p,j);for(e in f[i])break;if(!e){if(!z.teardown||z.teardown.call(a,p)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+
+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(B=c.data(a,"handle"))B.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[H]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
+8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;var i=c.data(d,"handle");i&&i.apply(d,b);var j,o;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){j=d[e];o=d["on"+e]}}catch(p){}i=c.nodeName(d,"a")&&e==="click";if(!f&&j&&!a.isDefaultPrevented()&&!i){this.triggered=true;try{d[e]()}catch(n){}}else if(o&&d["on"+e].apply(d,b)===false)a.result=false;this.triggered=false;if(!a.isPropagationStopped())(d=d.parentNode||d.ownerDocument)&&c.event.trigger(a,b,d,true)},
+handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},
+props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[H])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||
+s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&
+a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;c.event.add(this,b.live,qa,b)},remove:function(a){if(a.length){var b=0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],qa)}},special:{}},beforeunload:{setup:function(a,
+b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=K();this[H]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=
+ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:aa,isPropagationStopped:aa,isImmediatePropagationStopped:aa};var Ba=function(a){for(var b=a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ca=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",
+mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+
+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>
+-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ha(a,b){var d=a.target,f,e;if(!(!ga.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Da(d);if(e!==f){if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(d.type!=="select"&&(f!=null||e)){a.type="change";return c.event.trigger(a,b,this)}}}}c.event.special.change={filters:{focusout:ha,click:function(a){var b=a.target,d=b.type;if(d===
+"radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ha.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ha.call(this,a)},beforeactivate:function(a){a=a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Da(a))}},setup:function(a,b,d){for(var f in W)c.event.add(this,f+".specialChange."+d.guid,W[f]);return ga.test(this.nodeName)},
+remove:function(a,b){for(var d in W)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),W[d]);return ga.test(this.nodeName)}};var W=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,
+f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){thisObject=e;e=f;f=w}var j=b==="one"?c.proxy(e,function(o){c(this).unbind(o,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e,thisObject):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,
+b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||
+a)},live:function(a,b,d){if(c.isFunction(b)){d=b;b=w}c(this.context).bind(ra(a,this.selector),{data:b,selector:this.selector,live:a},d);return this},die:function(a,b){c(this.context).unbind(ra(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.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".split(" "),function(a,b){c.fn[b]=function(d){return d?
+this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",k,m=0;g[m];m++){k=g[m];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===
+k){y=m[u.sizset];break}if(u.nodeType===1&&!q){u.sizcache=k;u.sizset=r}if(u.nodeName.toLowerCase()===h){y=u;break}u=u[g]}m[r]=y}}}function d(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===k){y=m[u.sizset];break}if(u.nodeType===1){if(!q){u.sizcache=k;u.sizset=r}if(typeof h!=="string"){if(u===h){y=true;break}}else if(p.filter(h,[u]).length>0){y=u;break}}u=u[g]}m[r]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,i=Object.prototype.toString,j=false,o=true;[0,0].sort(function(){o=false;return 0});var p=function(g,h,k,m){k=k||[];var r=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return k;for(var q=[],v,u,y,S,I=true,N=x(h),J=g;(f.exec(""),v=f.exec(J))!==null;){J=v[3];q.push(v[1]);if(v[2]){S=v[3];break}}if(q.length>1&&t.exec(g))if(q.length===2&&n.relative[q[0]])u=ia(q[0]+q[1],h);else for(u=n.relative[q[0]]?[h]:p(q.shift(),h);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();
+u=ia(g,u)}else{if(!m&&q.length>1&&h.nodeType===9&&!N&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){v=p.find(q.shift(),h,N);h=v.expr?p.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:q.pop(),set:B(m)}:p.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&h.parentNode?h.parentNode:h,N);u=v.expr?p.filter(v.expr,v.set):v.set;if(q.length>0)y=B(u);else I=false;for(;q.length;){var E=q.pop();v=E;if(n.relative[E])v=q.pop();else E="";if(v==null)v=h;n.relative[E](y,v,N)}}else y=[]}y||(y=u);if(!y)throw"Syntax error, unrecognized expression: "+
+(E||g);if(i.call(y)==="[object Array]")if(I)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&F(h,y[g])))k.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&k.push(u[g]);else k.push.apply(k,y);else B(y,k);if(S){p(S,r,k,m);p.uniqueSort(k)}return k};p.uniqueSort=function(g){if(D){j=o;g.sort(D);if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};p.matches=function(g,h){return p(g,null,null,h)};p.find=function(g,h,k){var m,r;if(!g)return[];
+for(var q=0,v=n.order.length;q<v;q++){var u=n.order[q];if(r=n.leftMatch[u].exec(g)){var y=r[1];r.splice(1,1);if(y.substr(y.length-1)!=="\\"){r[1]=(r[1]||"").replace(/\\/g,"");m=n.find[u](r,h,k);if(m!=null){g=g.replace(n.match[u],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};p.filter=function(g,h,k,m){for(var r=g,q=[],v=h,u,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var I in n.filter)if((u=n.leftMatch[I].exec(g))!=null&&u[2]){var N=n.filter[I],J,E;E=u[1];y=false;u.splice(1,1);if(E.substr(E.length-
+1)!=="\\"){if(v===q)q=[];if(n.preFilter[I])if(u=n.preFilter[I](u,v,k,q,m,S)){if(u===true)continue}else y=J=true;if(u)for(var X=0;(E=v[X])!=null;X++)if(E){J=N(E,u,X,v);var Ea=m^!!J;if(k&&J!=null)if(Ea)y=true;else v[X]=false;else if(Ea){q.push(E);y=true}}if(J!==w){k||(v=q);g=g.replace(n.match[I],"");if(!y)return[];break}}}if(g===r)if(y==null)throw"Syntax error, unrecognized expression: "+g;else break;r=g}return v};var n=p.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
+relative:{"+":function(g,h){var k=typeof h==="string",m=k&&!/\W/.test(h);k=k&&!m;if(m)h=h.toLowerCase();m=0;for(var r=g.length,q;m<r;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=k||q&&q.nodeName.toLowerCase()===h?q||false:q===h}k&&p.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,r=g.length;m<r;m++){var q=g[m];if(q){k=q.parentNode;g[m]=k.nodeName.toLowerCase()===h?k:false}}}else{m=0;for(r=g.length;m<r;m++)if(q=g[m])g[m]=
+k?q.parentNode:q.parentNode===h;k&&p.filter(h,g,true)}},"":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("parentNode",h,m,g,q,k)},"~":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("previousSibling",h,m,g,q,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];
+h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,m,r,q){h=g[1].replace(/\\/g,"");if(!q&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,m,r){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=p(g[3],null,null,h);else{g=p.filter(g[3],h,k,true^r);k||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,k,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,m){var r=h[1],q=n.filters[r];if(q)return q(g,k,h,m);else if(r==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(r==="not"){h=
+h[3];k=0;for(m=h.length;k<m;k++)if(h[k]===g)return false;return true}else throw"Syntax error, unrecognized expression: "+r;},CHILD:function(g,h){var k=h[1],m=g;switch(k){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(k==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":k=h[2];var r=h[3];if(k===1&&r===0)return true;h=h[0];var q=g.parentNode;if(q&&(q.sizcache!==h||!g.nodeIndex)){var v=0;for(m=q.firstChild;m;m=
+m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;q.sizcache=h}g=g.nodeIndex-r;return k===0?g===0:g%k===0&&g/k>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=n.attrHandle[k]?n.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?k===h:m==="*="?k.indexOf(h)>=0:m==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:m==="!="?k!==h:m==="^="?k.indexOf(h)===0:m==="$="?k.substr(k.length-h.length)===h:m==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,m){var r=n.setFilters[h[2]];if(r)return r(g,k,h,m)}}},t=n.match.POS;for(var z in n.match){n.match[z]=new RegExp(n.match[z].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[z]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[z].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var B=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){B=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,m=g.length;k<m;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var D;if(s.documentElement.compareDocumentPosition)D=function(g,h){if(!g.compareDocumentPosition||
+!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)j=true;return g};else if("sourceIndex"in s.documentElement)D=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(s.createRange)D=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),m=
+h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)j=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=s.documentElement;k.insertBefore(g,k.firstChild);if(s.getElementById(h)){n.find.ID=function(m,r,q){if(typeof r.getElementById!=="undefined"&&!q)return(r=r.getElementById(m[1]))?r.id===m[1]||typeof r.getAttributeNode!=="undefined"&&
+r.getAttributeNode("id").nodeValue===m[1]?[r]:w:[]};n.filter.ID=function(m,r){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===r}}k.removeChild(g);k=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;k[m];m++)k[m].nodeType===1&&h.push(k[m]);k=h}return k};g.innerHTML="<a href='#'></a>";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=p,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){p=function(m,r,q,v){r=r||s;if(!v&&r.nodeType===9&&!x(r))try{return B(r.querySelectorAll(m),q)}catch(u){}return g(m,r,q,v)};for(var k in g)p[k]=g[k];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,k,m){if(typeof k.getElementsByClassName!=="undefined"&&!m)return k.getElementsByClassName(h[1])};g=null}}})();var F=s.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,
+h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r<q;r++)p(g,h[r],k);return p.filter(m,k)};c.find=p;c.expr=p.selectors;c.expr[":"]=c.expr.filters;c.unique=p.uniqueSort;c.getText=a;c.isXMLDoc=x;c.contains=F})();var ab=/Until$/,bb=/^(?:parents|prevUntil|prevAll)/,
+cb=/,/;R=Array.prototype.slice;var Fa=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Pa.test(b))return c.filter(b,f,!d);else b=c.filter(b,a)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
+c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Fa(this,a,false),"not",a)},filter:function(a){return this.pushStack(Fa(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i=
+{},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,hb=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},G={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,"",""]};G.optgroup=G.option;G.tbody=G.tfoot=G.colgroup=G.caption=G.thead;G.th=G.td;if(!c.support.htmlSerialize)G._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);
+return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&
+this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,
+"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===
+1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!Y.test(a))&&!G[(Ha.exec(a)||["",""])[1].toLowerCase()])try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){T(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
+this[0].parentNode){c.isFunction(a)||(a=c(a).detach());return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(t){return c.nodeName(t,"table")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}var e,i,j=a[0],o=[];if(c.isFunction(j))return this.each(function(t){var z=
+c(this);a[0]=j.call(this,t,b?z.html():w);return z.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ua(a,this,o);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for(var p=0,n=this.length;p<n;p++)d.call(b?f(this[p],i):this[p],e.cacheable||this.length>1||p>0?e.fragment.cloneNode(true):e.fragment)}o&&c.each(o,La)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},
+function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for(var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if(!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){T(this.getElementsByTagName("*"));T([this])}this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(this.nodeType===1&&T(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},
+function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j==="string"){j=j.replace(db,hb);var o=(Ha.exec(j)||["",""])[1].toLowerCase(),p=G[o]||G._default,n=p[0];i=b.createElement("div");for(i.innerHTML=p[1]+j+p[2];n--;)i=i.lastChild;
+if(!c.support.tbody){n=fb.test(j);o=o==="table"&&!n?i.firstChild&&i.firstChild.childNodes:p[1]==="<table>"&&!n?i.childNodes:[];for(p=o.length-1;p>=0;--p)c.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!c.support.leadingWhitespace&&Y.test(j)&&i.insertBefore(b.createTextNode(Y.exec(j)[0]),i.firstChild);j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()===
+"text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e}});var ib=/z-?index|font-?weight|opacity|zoom|line-?height/i,Ia=/alpha\([^)]*\)/,Ja=/opacity=([^)]*)/,ja=/float/i,ka=/-([a-z])/ig,jb=/([A-Z])/g,kb=/^-?\d+(?:px)?$/i,lb=/^-?\d/,mb={position:"absolute",visibility:"hidden",display:"block"},nb=["Left","Right"],ob=["Top","Bottom"],pb=s.defaultView&&
+s.defaultView.getComputedStyle,Ka=c.support.cssFloat?"cssFloat":"styleFloat",la=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return $(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!ib.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""===
+"NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ia.test(a)?a.replace(Ia,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ja.exec(f.filter)[1])/100+"":""}if(ja.test(b))b=Ka;b=b.replace(ka,la);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,i=b==="width"?nb:ob;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=
+parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,mb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Ja.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ja.test(b))b=Ka;if(!d&&e&&e[b])f=e[b];else if(pb){if(ja.test(b))b="float";b=b.replace(jb,"-$1").toLowerCase();e=
+a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ka,la);f=a.currentStyle[b]||a.currentStyle[d];if(!kb.test(f)&&lb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=
+f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var qb=K(),rb=/<script(.|\s)*?\/script>/gi,sb=/select|textarea/i,tb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,O=/=\?(&|$)/,ma=/\?/,ub=/(\?|&)_=.*?(&|$)/,vb=/^(\w+:)?\/\/([^\/?#]+)/,
+wb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}c.ajax({url:a,type:f,dataType:"html",data:b,context:this,complete:function(i,j){if(j==="success"||j==="notmodified")this.html(e?c("<div />").append(i.responseText.replace(rb,
+"")).find(e):i.responseText);d&&this.each(d,[i.responseText,j,i])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||sb.test(this.nodeName)||tb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});
+c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},
+ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",
+text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(p,o,j,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(p,x,j);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(r,q){(e.context?c(e.context):c.event).trigger(r,q)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,o,p=e.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,
+e.traditional);if(e.dataType==="jsonp"){if(n==="GET")O.test(e.url)||(e.url+=(ma.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!O.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&O.test(e.data)||O.test(e.url))){i=e.jsonpCallback||"jsonp"+qb++;if(e.data)e.data=(e.data+"").replace(O,"="+i+"$1");e.url=e.url.replace(O,"="+i+"$1");e.dataType="script";A[i]=A[i]||function(r){o=r;b();d();A[i]=w;try{delete A[i]}catch(q){}B&&
+B.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&n==="GET"){var t=K(),z=e.url.replace(ub,"$1_="+t+"$2");e.url=z+(z===e.url?(ma.test(e.url)?"&":"?")+"_="+t:"")}if(e.data&&n==="GET")e.url+=(ma.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");t=(t=vb.exec(e.url))&&(t[1]&&t[1]!==location.protocol||t[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&t){var B=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");
+C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!i){var D=false;C.onload=C.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;b();d();C.onload=C.onreadystatechange=null;B&&C.parentNode&&B.removeChild(C)}}}B.insertBefore(C,B.firstChild);return w}var F=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",
+e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}t||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ia){}if(e.beforeSend&&e.beforeSend.call(p,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",
+[x,e]);var g=x.onreadystatechange=function(r){if(!x||x.readyState===0){F||d();F=true;if(x)x.onreadystatechange=c.noop}else if(!F&&x&&(x.readyState===4||r==="timeout")){F=true;x.onreadystatechange=c.noop;j=r==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";if(j==="success")try{o=c.httpData(x,e.dataType,e)}catch(q){j="parsererror"}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,x,j);d();r==="timeout"&&x.abort();if(e.async)x=
+null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol===
+"file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&&
+d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))a=A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();else throw"Invalid JSON: "+a;else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(e,i){i=
+c.isFunction(i)?i():i;f[f.length]=encodeURIComponent(e)+"="+encodeURIComponent(i)}var f=[];if(b===w)b=c.ajaxSettings.traditional;c.isArray(a)||a.jquery?c.each(a,function(){d(this.name,this.value)}):c.each(a,function e(i,j){if(c.isArray(j))c.each(j,function(o,p){b?d(i,p):e(i+"["+(typeof p==="object"||c.isArray(p)?o:"")+"]",p)});else!b&&j!=null&&typeof j==="object"?c.each(j,function(o,p){e(i+"["+o+"]",p)}):d(i,j)});return f.join("&").replace(wb,"+")}});var na={},xb=/toggle|show|hide/,yb=/^([+-]=)?([\d+-.]+)(.*)$/,
+Z,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a!=null)return this.animate(L("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(na[d])f=na[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();
+na[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a!=null)return this.animate(L("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&
+c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(L("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,o=this.nodeType===1&&c(this).is(":hidden"),
+p=this;for(j in a){var n=j.replace(ka,la);if(j!==n){a[n]=a[j];delete a[j];j=n}if(a[j]==="hide"&&o||a[j]==="show"&&!o)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(t,z){var B=new c.fx(p,i,t);if(xb.test(z))B[z==="toggle"?o?"show":"hide":z](a);
+else{var C=yb.exec(z),D=B.cur(true)||0;if(C){z=parseFloat(C[2]);var F=C[3]||"px";if(F!=="px"){p.style[t]=(z||1)+F;D=(z||1)/B.cur(true)*D;p.style[t]=D+F}if(C[1])z=(C[1]==="-="?-1:1)*z+D;B.custom(D,z,F)}else B.custom(D,z,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:L("show",1),slideUp:L("hide",1),slideToggle:L("toggle",
+1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,
+b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
+null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
+"width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=K(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=
+this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=
+c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(Z);Z=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=
+null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),
+f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(t){c.offset.setOffset(this,a,t)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=
+b,e=b.ownerDocument,i,j=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var p=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==j;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;p-=b.scrollTop;n-=b.scrollLeft;if(b===d){p+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){p+=parseFloat(i.borderTopWidth)||
+0;n+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){p+=parseFloat(i.borderTopWidth)||0;n+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){p+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){p+=Math.max(j.scrollTop,o.scrollTop);n+=Math.max(j.scrollLeft,o.scrollLeft)}return{top:p,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),
+d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);
+d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop},
+bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left-
+e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=
+this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if(!e)return null;if(f!==w)return this.each(function(){if(i=wa(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=wa(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}});
+c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+
+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/ricoClient/js/baselibs/mootools.js b/ricoClient/js/baselibs/mootools.js
new file mode 100644 (file)
index 0000000..0098571
--- /dev/null
@@ -0,0 +1,4329 @@
+/*
+---
+
+script: Core.js
+
+description: The core of MooTools, contains all the base functions and the Native and Hash implementations. Required by all the other scripts.
+
+license: MIT-style license.
+
+copyright: Copyright (c) 2006-2008 [Valerio Proietti](http://mad4milk.net/).
+
+authors: The MooTools production team (http://mootools.net/developers/)
+
+inspiration:
+- Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php)
+- Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php)
+
+provides: [Mootools, Native, Hash.base, Array.each, $util]
+
+...
+*/
+
+var MooTools = {
+       'version': '1.2.4',
+       'build': '0d9113241a90b9cd5643b926795852a2026710d4'
+};
+
+var Native = function(options){
+       options = options || {};
+       var name = options.name;
+       var legacy = options.legacy;
+       var protect = options.protect;
+       var methods = options.implement;
+       var generics = options.generics;
+       var initialize = options.initialize;
+       var afterImplement = options.afterImplement || function(){};
+       var object = initialize || legacy;
+       generics = generics !== false;
+
+       object.constructor = Native;
+       object.$family = {name: 'native'};
+       if (legacy && initialize) object.prototype = legacy.prototype;
+       object.prototype.constructor = object;
+
+       if (name){
+               var family = name.toLowerCase();
+               object.prototype.$family = {name: family};
+               Native.typize(object, family);
+       }
+
+       var add = function(obj, name, method, force){
+               if (!protect || force || !obj.prototype[name]) obj.prototype[name] = method;
+               if (generics) Native.genericize(obj, name, protect);
+               afterImplement.call(obj, name, method);
+               return obj;
+       };
+
+       object.alias = function(a1, a2, a3){
+               if (typeof a1 == 'string'){
+                       var pa1 = this.prototype[a1];
+                       if ((a1 = pa1)) return add(this, a2, a1, a3);
+               }
+               for (var a in a1) this.alias(a, a1[a], a2);
+               return this;
+       };
+
+       object.implement = function(a1, a2, a3){
+               if (typeof a1 == 'string') return add(this, a1, a2, a3);
+               for (var p in a1) add(this, p, a1[p], a2);
+               return this;
+       };
+
+       if (methods) object.implement(methods);
+
+       return object;
+};
+
+Native.genericize = function(object, property, check){
+       if ((!check || !object[property]) && typeof object.prototype[property] == 'function') object[property] = function(){
+               var args = Array.prototype.slice.call(arguments);
+               return object.prototype[property].apply(args.shift(), args);
+       };
+};
+
+Native.implement = function(objects, properties){
+       for (var i = 0, l = objects.length; i < l; i++) objects[i].implement(properties);
+};
+
+Native.typize = function(object, family){
+       if (!object.type) object.type = function(item){
+               return ($type(item) === family);
+       };
+};
+
+(function(){
+       var natives = {'Array': Array, 'Date': Date, 'Function': Function, 'Number': Number, 'RegExp': RegExp, 'String': String};
+       for (var n in natives) new Native({name: n, initialize: natives[n], protect: true});
+
+       var types = {'boolean': Boolean, 'native': Native, 'object': Object};
+       for (var t in types) Native.typize(types[t], t);
+
+       var generics = {
+               'Array': ["concat", "indexOf", "join", "lastIndexOf", "pop", "push", "reverse", "shift", "slice", "sort", "splice", "toString", "unshift", "valueOf"],
+               'String': ["charAt", "charCodeAt", "concat", "indexOf", "lastIndexOf", "match", "replace", "search", "slice", "split", "substr", "substring", "toLowerCase", "toUpperCase", "valueOf"]
+       };
+       for (var g in generics){
+               for (var i = generics[g].length; i--;) Native.genericize(natives[g], generics[g][i], true);
+       }
+})();
+
+var Hash = new Native({
+
+       name: 'Hash',
+
+       initialize: function(object){
+               if ($type(object) == 'hash') object = $unlink(object.getClean());
+               for (var key in object) this[key] = object[key];
+               return this;
+       }
+
+});
+
+Hash.implement({
+
+       forEach: function(fn, bind){
+               for (var key in this){
+                       if (this.hasOwnProperty(key)) fn.call(bind, this[key], key, this);
+               }
+       },
+
+       getClean: function(){
+               var clean = {};
+               for (var key in this){
+                       if (this.hasOwnProperty(key)) clean[key] = this[key];
+               }
+               return clean;
+       },
+
+       getLength: function(){
+               var length = 0;
+               for (var key in this){
+                       if (this.hasOwnProperty(key)) length++;
+               }
+               return length;
+       }
+
+});
+
+Hash.alias('forEach', 'each');
+
+Array.implement({
+
+       forEach: function(fn, bind){
+               for (var i = 0, l = this.length; i < l; i++) fn.call(bind, this[i], i, this);
+       }
+
+});
+
+Array.alias('forEach', 'each');
+
+function $A(iterable){
+       if (iterable.item){
+               var l = iterable.length, array = new Array(l);
+               while (l--) array[l] = iterable[l];
+               return array;
+       }
+       return Array.prototype.slice.call(iterable);
+};
+
+function $arguments(i){
+       return function(){
+               return arguments[i];
+       };
+};
+
+function $chk(obj){
+       return !!(obj || obj === 0);
+};
+
+function $clear(timer){
+       clearTimeout(timer);
+       clearInterval(timer);
+       return null;
+};
+
+function $defined(obj){
+       return (obj != undefined);
+};
+
+function $each(iterable, fn, bind){
+       var type = $type(iterable);
+       ((type == 'arguments' || type == 'collection' || type == 'array') ? Array : Hash).each(iterable, fn, bind);
+};
+
+function $empty(){};
+
+function $extend(original, extended){
+       for (var key in (extended || {})) original[key] = extended[key];
+       return original;
+};
+
+function $H(object){
+       return new Hash(object);
+};
+
+function $lambda(value){
+       return ($type(value) == 'function') ? value : function(){
+               return value;
+       };
+};
+
+function $merge(){
+       var args = Array.slice(arguments);
+       args.unshift({});
+       return $mixin.apply(null, args);
+};
+
+function $mixin(mix){
+       for (var i = 1, l = arguments.length; i < l; i++){
+               var object = arguments[i];
+               if ($type(object) != 'object') continue;
+               for (var key in object){
+                       var op = object[key], mp = mix[key];
+                       mix[key] = (mp && $type(op) == 'object' && $type(mp) == 'object') ? $mixin(mp, op) : $unlink(op);
+               }
+       }
+       return mix;
+};
+
+function $pick(){
+       for (var i = 0, l = arguments.length; i < l; i++){
+               if (arguments[i] != undefined) return arguments[i];
+       }
+       return null;
+};
+
+function $random(min, max){
+       return Math.floor(Math.random() * (max - min + 1) + min);
+};
+
+function $splat(obj){
+       var type = $type(obj);
+       return (type) ? ((type != 'array' && type != 'arguments') ? [obj] : obj) : [];
+};
+
+var $time = Date.now || function(){
+       return +new Date;
+};
+
+function $try(){
+       for (var i = 0, l = arguments.length; i < l; i++){
+               try {
+                       return arguments[i]();
+               } catch(e){}
+       }
+       return null;
+};
+
+function $type(obj){
+       if (obj == undefined) return false;
+       if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;
+       if (obj.nodeName){
+               switch (obj.nodeType){
+                       case 1: return 'element';
+                       case 3: return (/\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';
+               }
+       } else if (typeof obj.length == 'number'){
+               if (obj.callee) return 'arguments';
+               else if (obj.item) return 'collection';
+       }
+       return typeof obj;
+};
+
+function $unlink(object){
+       var unlinked;
+       switch ($type(object)){
+               case 'object':
+                       unlinked = {};
+                       for (var p in object) unlinked[p] = $unlink(object[p]);
+               break;
+               case 'hash':
+                       unlinked = new Hash(object);
+               break;
+               case 'array':
+                       unlinked = [];
+                       for (var i = 0, l = object.length; i < l; i++) unlinked[i] = $unlink(object[i]);
+               break;
+               default: return object;
+       }
+       return unlinked;
+};
+
+
+/*
+---
+
+script: Browser.js
+
+description: The Browser Core. Contains Browser initialization, Window and Document, and the Browser Hash.
+
+license: MIT-style license.
+
+requires: 
+- /Native
+- /$util
+
+provides: [Browser, Window, Document, $exec]
+
+...
+*/
+
+var Browser = $merge({
+
+       Engine: {name: 'unknown', version: 0},
+
+       Platform: {name: (window.orientation != undefined) ? 'ipod' : (navigator.platform.match(/mac|win|linux/i) || ['other'])[0].toLowerCase()},
+
+       Features: {xpath: !!(document.evaluate), air: !!(window.runtime), query: !!(document.querySelector)},
+
+       Plugins: {},
+
+       Engines: {
+
+               presto: function(){
+                       return (!window.opera) ? false : ((arguments.callee.caller) ? 960 : ((document.getElementsByClassName) ? 950 : 925));
+               },
+
+               trident: function(){
+                       return (!window.ActiveXObject) ? false : ((window.XMLHttpRequest) ? ((document.querySelectorAll) ? 6 : 5) : 4);
+               },
+
+               webkit: function(){
+                       return (navigator.taintEnabled) ? false : ((Browser.Features.xpath) ? ((Browser.Features.query) ? 525 : 420) : 419);
+               },
+
+               gecko: function(){
+                       return (!document.getBoxObjectFor && window.mozInnerScreenX == null) ? false : ((document.getElementsByClassName) ? 19 : 18);
+               }
+
+       }
+
+}, Browser || {});
+
+Browser.Platform[Browser.Platform.name] = true;
+
+Browser.detect = function(){
+
+       for (var engine in this.Engines){
+               var version = this.Engines[engine]();
+               if (version){
+                       this.Engine = {name: engine, version: version};
+                       this.Engine[engine] = this.Engine[engine + version] = true;
+                       break;
+               }
+       }
+
+       return {name: engine, version: version};
+
+};
+
+Browser.detect();
+
+Browser.Request = function(){
+       return $try(function(){
+               return new XMLHttpRequest();
+       }, function(){
+               return new ActiveXObject('MSXML2.XMLHTTP');
+       }, function(){
+               return new ActiveXObject('Microsoft.XMLHTTP');
+       });
+};
+
+Browser.Features.xhr = !!(Browser.Request());
+
+Browser.Plugins.Flash = (function(){
+       var version = ($try(function(){
+               return navigator.plugins['Shockwave Flash'].description;
+       }, function(){
+               return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
+       }) || '0 r0').match(/\d+/g);
+       return {version: parseInt(version[0] || 0 + '.' + version[1], 10) || 0, build: parseInt(version[2], 10) || 0};
+})();
+
+function $exec(text){
+       if (!text) return text;
+       if (window.execScript){
+               window.execScript(text);
+       } else {
+               var script = document.createElement('script');
+               script.setAttribute('type', 'text/javascript');
+               script[(Browser.Engine.webkit && Browser.Engine.version < 420) ? 'innerText' : 'text'] = text;
+               document.head.appendChild(script);
+               document.head.removeChild(script);
+       }
+       return text;
+};
+
+Native.UID = 1;
+
+var $uid = (Browser.Engine.trident) ? function(item){
+       return (item.uid || (item.uid = [Native.UID++]))[0];
+} : function(item){
+       return item.uid || (item.uid = Native.UID++);
+};
+
+var Window = new Native({
+
+       name: 'Window',
+
+       legacy: (Browser.Engine.trident) ? null: window.Window,
+
+       initialize: function(win){
+               $uid(win);
+               if (!win.Element){
+                       win.Element = $empty;
+                       if (Browser.Engine.webkit) win.document.createElement("iframe"); //fixes safari 2
+                       win.Element.prototype = (Browser.Engine.webkit) ? window["[[DOMElement.prototype]]"] : {};
+               }
+               win.document.window = win;
+               return $extend(win, Window.Prototype);
+       },
+
+       afterImplement: function(property, value){
+               window[property] = Window.Prototype[property] = value;
+       }
+
+});
+
+Window.Prototype = {$family: {name: 'window'}};
+
+new Window(window);
+
+var Document = new Native({
+
+       name: 'Document',
+
+       legacy: (Browser.Engine.trident) ? null: window.Document,
+
+       initialize: function(doc){
+               $uid(doc);
+               doc.head = doc.getElementsByTagName('head')[0];
+               doc.html = doc.getElementsByTagName('html')[0];
+               if (Browser.Engine.trident && Browser.Engine.version <= 4) $try(function(){
+                       doc.execCommand("BackgroundImageCache", false, true);
+               });
+               if (Browser.Engine.trident) doc.window.attachEvent('onunload', function(){
+                       doc.window.detachEvent('onunload', arguments.callee);
+                       doc.head = doc.html = doc.window = null;
+               });
+               return $extend(doc, Document.Prototype);
+       },
+
+       afterImplement: function(property, value){
+               document[property] = Document.Prototype[property] = value;
+       }
+
+});
+
+Document.Prototype = {$family: {name: 'document'}};
+
+new Document(document);
+
+
+/*
+---
+
+script: Array.js
+
+description: Contains Array Prototypes like each, contains, and erase.
+
+license: MIT-style license.
+
+requires:
+- /$util
+- /Array.each
+
+provides: [Array]
+
+...
+*/
+
+Array.implement({
+
+       every: function(fn, bind){
+               for (var i = 0, l = this.length; i < l; i++){
+                       if (!fn.call(bind, this[i], i, this)) return false;
+               }
+               return true;
+       },
+
+       filter: function(fn, bind){
+               var results = [];
+               for (var i = 0, l = this.length; i < l; i++){
+                       if (fn.call(bind, this[i], i, this)) results.push(this[i]);
+               }
+               return results;
+       },
+
+       clean: function(){
+               return this.filter($defined);
+       },
+
+       indexOf: function(item, from){
+               var len = this.length;
+               for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){
+                       if (this[i] === item) return i;
+               }
+               return -1;
+       },
+
+       map: function(fn, bind){
+               var results = [];
+               for (var i = 0, l = this.length; i < l; i++) results[i] = fn.call(bind, this[i], i, this);
+               return results;
+       },
+
+       some: function(fn, bind){
+               for (var i = 0, l = this.length; i < l; i++){
+                       if (fn.call(bind, this[i], i, this)) return true;
+               }
+               return false;
+       },
+
+       associate: function(keys){
+               var obj = {}, length = Math.min(this.length, keys.length);
+               for (var i = 0; i < length; i++) obj[keys[i]] = this[i];
+               return obj;
+       },
+
+       link: function(object){
+               var result = {};
+               for (var i = 0, l = this.length; i < l; i++){
+                       for (var key in object){
+                               if (object[key](this[i])){
+                                       result[key] = this[i];
+                                       delete object[key];
+                                       break;
+                               }
+                       }
+               }
+               return result;
+       },
+
+       contains: function(item, from){
+               return this.indexOf(item, from) != -1;
+       },
+
+       extend: function(array){
+               for (var i = 0, j = array.length; i < j; i++) this.push(array[i]);
+               return this;
+       },
+       
+       getLast: function(){
+               return (this.length) ? this[this.length - 1] : null;
+       },
+
+       getRandom: function(){
+               return (this.length) ? this[$random(0, this.length - 1)] : null;
+       },
+
+       include: function(item){
+               if (!this.contains(item)) this.push(item);
+               return this;
+       },
+
+       combine: function(array){
+               for (var i = 0, l = array.length; i < l; i++) this.include(array[i]);
+               return this;
+       },
+
+       erase: function(item){
+               for (var i = this.length; i--; i){
+                       if (this[i] === item) this.splice(i, 1);
+               }
+               return this;
+       },
+
+       empty: function(){
+               this.length = 0;
+               return this;
+       },
+
+       flatten: function(){
+               var array = [];
+               for (var i = 0, l = this.length; i < l; i++){
+                       var type = $type(this[i]);
+                       if (!type) continue;
+                       array = array.concat((type == 'array' || type == 'collection' || type == 'arguments') ? Array.flatten(this[i]) : this[i]);
+               }
+               return array;
+       },
+
+       hexToRgb: function(array){
+               if (this.length != 3) return null;
+               var rgb = this.map(function(value){
+                       if (value.length == 1) value += value;
+                       return value.toInt(16);
+               });
+               return (array) ? rgb : 'rgb(' + rgb + ')';
+       },
+
+       rgbToHex: function(array){
+               if (this.length < 3) return null;
+               if (this.length == 4 && this[3] == 0 && !array) return 'transparent';
+               var hex = [];
+               for (var i = 0; i < 3; i++){
+                       var bit = (this[i] - 0).toString(16);
+                       hex.push((bit.length == 1) ? '0' + bit : bit);
+               }
+               return (array) ? hex : '#' + hex.join('');
+       }
+
+});
+
+
+/*
+---
+
+script: Function.js
+
+description: Contains Function Prototypes like create, bind, pass, and delay.
+
+license: MIT-style license.
+
+requires:
+- /Native
+- /$util
+
+provides: [Function]
+
+...
+*/
+
+Function.implement({
+
+       extend: function(properties){
+               for (var property in properties) this[property] = properties[property];
+               return this;
+       },
+
+       create: function(options){
+               var self = this;
+               options = options || {};
+               return function(event){
+                       var args = options.arguments;
+                       args = (args != undefined) ? $splat(args) : Array.slice(arguments, (options.event) ? 1 : 0);
+                       if (options.event) args = [event || window.event].extend(args);
+                       var returns = function(){
+                               return self.apply(options.bind || null, args);
+                       };
+                       if (options.delay) return setTimeout(returns, options.delay);
+                       if (options.periodical) return setInterval(returns, options.periodical);
+                       if (options.attempt) return $try(returns);
+                       return returns();
+               };
+       },
+
+       run: function(args, bind){
+               return this.apply(bind, $splat(args));
+       },
+
+       pass: function(args, bind){
+               return this.create({bind: bind, arguments: args});
+       },
+
+       bind: function(bind, args){
+               return this.create({bind: bind, arguments: args});
+       },
+
+       bindWithEvent: function(bind, args){
+               return this.create({bind: bind, arguments: args, event: true});
+       },
+
+       attempt: function(args, bind){
+               return this.create({bind: bind, arguments: args, attempt: true})();
+       },
+
+       delay: function(delay, bind, args){
+               return this.create({bind: bind, arguments: args, delay: delay})();
+       },
+
+       periodical: function(periodical, bind, args){
+               return this.create({bind: bind, arguments: args, periodical: periodical})();
+       }
+
+});
+
+
+/*
+---
+
+script: Number.js
+
+description: Contains Number Prototypes like limit, round, times, and ceil.
+
+license: MIT-style license.
+
+requires:
+- /Native
+- /$util
+
+provides: [Number]
+
+...
+*/
+
+Number.implement({
+
+       limit: function(min, max){
+               return Math.min(max, Math.max(min, this));
+       },
+
+       round: function(precision){
+               precision = Math.pow(10, precision || 0);
+               return Math.round(this * precision) / precision;
+       },
+
+       times: function(fn, bind){
+               for (var i = 0; i < this; i++) fn.call(bind, i, this);
+       },
+
+       toFloat: function(){
+               return parseFloat(this);
+       },
+
+       toInt: function(base){
+               return parseInt(this, base || 10);
+       }
+
+});
+
+Number.alias('times', 'each');
+
+(function(math){
+       var methods = {};
+       math.each(function(name){
+               if (!Number[name]) methods[name] = function(){
+                       return Math[name].apply(null, [this].concat($A(arguments)));
+               };
+       });
+       Number.implement(methods);
+})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']);
+
+
+/*
+---
+
+script: String.js
+
+description: Contains String Prototypes like camelCase, capitalize, test, and toInt.
+
+license: MIT-style license.
+
+requires:
+- /Native
+
+provides: [String]
+
+...
+*/
+
+String.implement({
+
+       test: function(regex, params){
+               return ((typeof regex == 'string') ? new RegExp(regex, params) : regex).test(this);
+       },
+
+       contains: function(string, separator){
+               return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : this.indexOf(string) > -1;
+       },
+
+       trim: function(){
+               return this.replace(/^\s+|\s+$/g, '');
+       },
+
+       clean: function(){
+               return this.replace(/\s+/g, ' ').trim();
+       },
+
+       camelCase: function(){
+               return this.replace(/-\D/g, function(match){
+                       return match.charAt(1).toUpperCase();
+               });
+       },
+
+       hyphenate: function(){
+               return this.replace(/[A-Z]/g, function(match){
+                       return ('-' + match.charAt(0).toLowerCase());
+               });
+       },
+
+       capitalize: function(){
+               return this.replace(/\b[a-z]/g, function(match){
+                       return match.toUpperCase();
+               });
+       },
+
+       escapeRegExp: function(){
+               return this.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1');
+       },
+
+       toInt: function(base){
+               return parseInt(this, base || 10);
+       },
+
+       toFloat: function(){
+               return parseFloat(this);
+       },
+
+       hexToRgb: function(array){
+               var hex = this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
+               return (hex) ? hex.slice(1).hexToRgb(array) : null;
+       },
+
+       rgbToHex: function(array){
+               var rgb = this.match(/\d{1,3}/g);
+               return (rgb) ? rgb.rgbToHex(array) : null;
+       },
+
+       stripScripts: function(option){
+               var scripts = '';
+               var text = this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){
+                       scripts += arguments[1] + '\n';
+                       return '';
+               });
+               if (option === true) $exec(scripts);
+               else if ($type(option) == 'function') option(scripts, text);
+               return text;
+       },
+
+       substitute: function(object, regexp){
+               return this.replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
+                       if (match.charAt(0) == '\\') return match.slice(1);
+                       return (object[name] != undefined) ? object[name] : '';
+               });
+       }
+
+});
+
+
+/*
+---
+
+script: Hash.js
+
+description: Contains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects.
+
+license: MIT-style license.
+
+requires:
+- /Hash.base
+
+provides: [Hash]
+
+...
+*/
+
+Hash.implement({
+
+       has: Object.prototype.hasOwnProperty,
+
+       keyOf: function(value){
+               for (var key in this){
+                       if (this.hasOwnProperty(key) && this[key] === value) return key;
+               }
+               return null;
+       },
+
+       hasValue: function(value){
+               return (Hash.keyOf(this, value) !== null);
+       },
+
+       extend: function(properties){
+               Hash.each(properties || {}, function(value, key){
+                       Hash.set(this, key, value);
+               }, this);
+               return this;
+       },
+
+       combine: function(properties){
+               Hash.each(properties || {}, function(value, key){
+                       Hash.include(this, key, value);
+               }, this);
+               return this;
+       },
+
+       erase: function(key){
+               if (this.hasOwnProperty(key)) delete this[key];
+               return this;
+       },
+
+       get: function(key){
+               return (this.hasOwnProperty(key)) ? this[key] : null;
+       },
+
+       set: function(key, value){
+               if (!this[key] || this.hasOwnProperty(key)) this[key] = value;
+               return this;
+       },
+
+       empty: function(){
+               Hash.each(this, function(value, key){
+                       delete this[key];
+               }, this);
+               return this;
+       },
+
+       include: function(key, value){
+               if (this[key] == undefined) this[key] = value;
+               return this;
+       },
+
+       map: function(fn, bind){
+               var results = new Hash;
+               Hash.each(this, function(value, key){
+                       results.set(key, fn.call(bind, value, key, this));
+               }, this);
+               return results;
+       },
+
+       filter: function(fn, bind){
+               var results = new Hash;
+               Hash.each(this, function(value, key){
+                       if (fn.call(bind, value, key, this)) results.set(key, value);
+               }, this);
+               return results;
+       },
+
+       every: function(fn, bind){
+               for (var key in this){
+                       if (this.hasOwnProperty(key) && !fn.call(bind, this[key], key)) return false;
+               }
+               return true;
+       },
+
+       some: function(fn, bind){
+               for (var key in this){
+                       if (this.hasOwnProperty(key) && fn.call(bind, this[key], key)) return true;
+               }
+               return false;
+       },
+
+       getKeys: function(){
+               var keys = [];
+               Hash.each(this, function(value, key){
+                       keys.push(key);
+               });
+               return keys;
+       },
+
+       getValues: function(){
+               var values = [];
+               Hash.each(this, function(value){
+                       values.push(value);
+               });
+               return values;
+       },
+
+       toQueryString: function(base){
+               var queryString = [];
+               Hash.each(this, function(value, key){
+                       if (base) key = base + '[' + key + ']';
+                       var result;
+                       switch ($type(value)){
+                               case 'object': result = Hash.toQueryString(value, key); break;
+                               case 'array':
+                                       var qs = {};
+                                       value.each(function(val, i){
+                                               qs[i] = val;
+                                       });
+                                       result = Hash.toQueryString(qs, key);
+                               break;
+                               default: result = key + '=' + encodeURIComponent(value);
+                       }
+                       if (value != undefined) queryString.push(result);
+               });
+
+               return queryString.join('&');
+       }
+
+});
+
+Hash.alias({keyOf: 'indexOf', hasValue: 'contains'});
+
+
+/*
+---
+
+script: Event.js
+
+description: Contains the Event Class, to make the event object cross-browser.
+
+license: MIT-style license.
+
+requires:
+- /Window
+- /Document
+- /Hash
+- /Array
+- /Function
+- /String
+
+provides: [Event]
+
+...
+*/
+
+var Event = new Native({
+
+       name: 'Event',
+
+       initialize: function(event, win){
+               win = win || window;
+               var doc = win.document;
+               event = event || win.event;
+               if (event.$extended) return event;
+               this.$extended = true;
+               var type = event.type;
+               var target = event.target || event.srcElement;
+               while (target && target.nodeType == 3) target = target.parentNode;
+
+               if (type.test(/key/)){
+                       var code = event.which || event.keyCode;
+                       var key = Event.Keys.keyOf(code);
+                       if (type == 'keydown'){
+                               var fKey = code - 111;
+                               if (fKey > 0 && fKey < 13) key = 'f' + fKey;
+                       }
+                       key = key || String.fromCharCode(code).toLowerCase();
+               } else if (type.match(/(click|mouse|menu)/i)){
+                       doc = (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body;
+                       var page = {
+                               x: event.pageX || event.clientX + doc.scrollLeft,
+                               y: event.pageY || event.clientY + doc.scrollTop
+                       };
+                       var client = {
+                               x: (event.pageX) ? event.pageX - win.pageXOffset : event.clientX,
+                               y: (event.pageY) ? event.pageY - win.pageYOffset : event.clientY
+                       };
+                       if (type.match(/DOMMouseScroll|mousewheel/)){
+                               var wheel = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;
+                       }
+                       var rightClick = (event.which == 3) || (event.button == 2);
+                       var related = null;
+                       if (type.match(/over|out/)){
+                               switch (type){
+                                       case 'mouseover': related = event.relatedTarget || event.fromElement; break;
+                                       case 'mouseout': related = event.relatedTarget || event.toElement;
+                               }
+                               if (!(function(){
+                                       while (related && related.nodeType == 3) related = related.parentNode;
+                                       return true;
+                               }).create({attempt: Browser.Engine.gecko})()) related = false;
+                       }
+               }
+
+               return $extend(this, {
+                       event: event,
+                       type: type,
+
+                       page: page,
+                       client: client,
+                       rightClick: rightClick,
+
+                       wheel: wheel,
+
+                       relatedTarget: related,
+                       target: target,
+
+                       code: code,
+                       key: key,
+
+                       shift: event.shiftKey,
+                       control: event.ctrlKey,
+                       alt: event.altKey,
+                       meta: event.metaKey
+               });
+       }
+
+});
+
+Event.Keys = new Hash({
+       'enter': 13,
+       'up': 38,
+       'down': 40,
+       'left': 37,
+       'right': 39,
+       'esc': 27,
+       'space': 32,
+       'backspace': 8,
+       'tab': 9,
+       'delete': 46
+});
+
+Event.implement({
+
+       stop: function(){
+               return this.stopPropagation().preventDefault();
+       },
+
+       stopPropagation: function(){
+               if (this.event.stopPropagation) this.event.stopPropagation();
+               else this.event.cancelBubble = true;
+               return this;
+       },
+
+       preventDefault: function(){
+               if (this.event.preventDefault) this.event.preventDefault();
+               else this.event.returnValue = false;
+               return this;
+       }
+
+});
+
+
+/*
+---
+
+script: Class.js
+
+description: Contains the Class Function for easily creating, extending, and implementing reusable Classes.
+
+license: MIT-style license.
+
+requires:
+- /$util
+- /Native
+- /Array
+- /String
+- /Function
+- /Number
+- /Hash
+
+provides: [Class]
+
+...
+*/
+
+function Class(params){
+       
+       if (params instanceof Function) params = {initialize: params};
+       
+       var newClass = function(){
+               Object.reset(this);
+               if (newClass._prototyping) return this;
+               this._current = $empty;
+               var value = (this.initialize) ? this.initialize.apply(this, arguments) : this;
+               delete this._current; delete this.caller;
+               return value;
+       }.extend(this);
+       
+       newClass.implement(params);
+       
+       newClass.constructor = Class;
+       newClass.prototype.constructor = newClass;
+
+       return newClass;
+
+};
+
+Function.prototype.protect = function(){
+       this._protected = true;
+       return this;
+};
+
+Object.reset = function(object, key){
+               
+       if (key == null){
+               for (var p in object) Object.reset(object, p);
+               return object;
+       }
+       
+       delete object[key];
+       
+       switch ($type(object[key])){
+               case 'object':
+                       var F = function(){};
+                       F.prototype = object[key];
+                       var i = new F;
+                       object[key] = Object.reset(i);
+               break;
+               case 'array': object[key] = $unlink(object[key]); break;
+       }
+       
+       return object;
+       
+};
+
+new Native({name: 'Class', initialize: Class}).extend({
+
+       instantiate: function(F){
+               F._prototyping = true;
+               var proto = new F;
+               delete F._prototyping;
+               return proto;
+       },
+       
+       wrap: function(self, key, method){
+               if (method._origin) method = method._origin;
+               
+               return function(){
+                       if (method._protected && this._current == null) throw new Error('The method "' + key + '" cannot be called.');
+                       var caller = this.caller, current = this._current;
+                       this.caller = current; this._current = arguments.callee;
+                       var result = method.apply(this, arguments);
+                       this._current = current; this.caller = caller;
+                       return result;
+               }.extend({_owner: self, _origin: method, _name: key});
+
+       }
+       
+});
+
+Class.implement({
+       
+       implement: function(key, value){
+               
+               if ($type(key) == 'object'){
+                       for (var p in key) this.implement(p, key[p]);
+                       return this;
+               }
+               
+               var mutator = Class.Mutators[key];
+               
+               if (mutator){
+                       value = mutator.call(this, value);
+                       if (value == null) return this;
+               }
+               
+               var proto = this.prototype;
+
+               switch ($type(value)){
+                       
+                       case 'function':
+                               if (value._hidden) return this;
+                               proto[key] = Class.wrap(this, key, value);
+                       break;
+                       
+                       case 'object':
+                               var previous = proto[key];
+                               if ($type(previous) == 'object') $mixin(previous, value);
+                               else proto[key] = $unlink(value);
+                       break;
+                       
+                       case 'array':
+                               proto[key] = $unlink(value);
+                       break;
+                       
+                       default: proto[key] = value;
+
+               }
+               
+               return this;
+
+       }
+       
+});
+
+Class.Mutators = {
+       
+       Extends: function(parent){
+
+               this.parent = parent;
+               this.prototype = Class.instantiate(parent);
+
+               this.implement('parent', function(){
+                       var name = this.caller._name, previous = this.caller._owner.parent.prototype[name];
+                       if (!previous) throw new Error('The method "' + name + '" has no parent.');
+                       return previous.apply(this, arguments);
+               }.protect());
+
+       },
+
+       Implements: function(items){
+               $splat(items).each(function(item){
+                       if (item instanceof Function) item = Class.instantiate(item);
+                       this.implement(item);
+               }, this);
+
+       }
+       
+};
+
+
+/*
+---
+
+script: Class.Extras.js
+
+description: Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.
+
+license: MIT-style license.
+
+requires:
+- /Class
+
+provides: [Chain, Events, Options]
+
+...
+*/
+
+var Chain = new Class({
+
+       $chain: [],
+
+       chain: function(){
+               this.$chain.extend(Array.flatten(arguments));
+               return this;
+       },
+
+       callChain: function(){
+               return (this.$chain.length) ? this.$chain.shift().apply(this, arguments) : false;
+       },
+
+       clearChain: function(){
+               this.$chain.empty();
+               return this;
+       }
+
+});
+
+var Events = new Class({
+
+       $events: {},
+
+       addEvent: function(type, fn, internal){
+               type = Events.removeOn(type);
+               if (fn != $empty){
+                       this.$events[type] = this.$events[type] || [];
+                       this.$events[type].include(fn);
+                       if (internal) fn.internal = true;
+               }
+               return this;
+       },
+
+       addEvents: function(events){
+               for (var type in events) this.addEvent(type, events[type]);
+               return this;
+       },
+
+       fireEvent: function(type, args, delay){
+               type = Events.removeOn(type);
+               if (!this.$events || !this.$events[type]) return this;
+               this.$events[type].each(function(fn){
+                       fn.create({'bind': this, 'delay': delay, 'arguments': args})();
+               }, this);
+               return this;
+       },
+
+       removeEvent: function(type, fn){
+               type = Events.removeOn(type);
+               if (!this.$events[type]) return this;
+               if (!fn.internal) this.$events[type].erase(fn);
+               return this;
+       },
+
+       removeEvents: function(events){
+               var type;
+               if ($type(events) == 'object'){
+                       for (type in events) this.removeEvent(type, events[type]);
+                       return this;
+               }
+               if (events) events = Events.removeOn(events);
+               for (type in this.$events){
+                       if (events && events != type) continue;
+                       var fns = this.$events[type];
+                       for (var i = fns.length; i--; i) this.removeEvent(type, fns[i]);
+               }
+               return this;
+       }
+
+});
+
+Events.removeOn = function(string){
+       return string.replace(/^on([A-Z])/, function(full, first){
+               return first.toLowerCase();
+       });
+};
+
+var Options = new Class({
+
+       setOptions: function(){
+               this.options = $merge.run([this.options].extend(arguments));
+               if (!this.addEvent) return this;
+               for (var option in this.options){
+                       if ($type(this.options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue;
+                       this.addEvent(option, this.options[option]);
+                       delete this.options[option];
+               }
+               return this;
+       }
+
+});
+
+
+/*
+---
+
+script: Element.js
+
+description: One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements.
+
+license: MIT-style license.
+
+requires:
+- /Window
+- /Document
+- /Array
+- /String
+- /Function
+- /Number
+- /Hash
+
+provides: [Element, Elements, $, $$, Iframe]
+
+...
+*/
+
+var Element = new Native({
+
+       name: 'Element',
+
+       legacy: window.Element,
+
+       initialize: function(tag, props){
+               var konstructor = Element.Constructors.get(tag);
+               if (konstructor) return konstructor(props);
+               if (typeof tag == 'string') return document.newElement(tag, props);
+               return document.id(tag).set(props);
+       },
+
+       afterImplement: function(key, value){
+               Element.Prototype[key] = value;
+               if (Array[key]) return;
+               Elements.implement(key, function(){
+                       var items = [], elements = true;
+                       for (var i = 0, j = this.length; i < j; i++){
+                               var returns = this[i][key].apply(this[i], arguments);
+                               items.push(returns);
+                               if (elements) elements = ($type(returns) == 'element');
+                       }
+                       return (elements) ? new Elements(items) : items;
+               });
+       }
+
+});
+
+Element.Prototype = {$family: {name: 'element'}};
+
+Element.Constructors = new Hash;
+
+var IFrame = new Native({
+
+       name: 'IFrame',
+
+       generics: false,
+
+       initialize: function(){
+               var params = Array.link(arguments, {properties: Object.type, iframe: $defined});
+               var props = params.properties || {};
+               var iframe = document.id(params.iframe);
+               var onload = props.onload || $empty;
+               delete props.onload;
+               props.id = props.name = $pick(props.id, props.name, iframe ? (iframe.id || iframe.name) : 'IFrame_' + $time());
+               iframe = new Element(iframe || 'iframe', props);
+               var onFrameLoad = function(){
+                       var host = $try(function(){
+                               return iframe.contentWindow.location.host;
+                       });
+                       if (!host || host == window.location.host){
+                               var win = new Window(iframe.contentWindow);
+                               new Document(iframe.contentWindow.document);
+                               $extend(win.Element.prototype, Element.Prototype);
+                       }
+                       onload.call(iframe.contentWindow, iframe.contentWindow.document);
+               };
+               var contentWindow = $try(function(){
+                       return iframe.contentWindow;
+               });
+               ((contentWindow && contentWindow.document.body) || window.frames[props.id]) ? onFrameLoad() : iframe.addListener('load', onFrameLoad);
+               return iframe;
+       }
+
+});
+
+var Elements = new Native({
+
+       initialize: function(elements, options){
+               options = $extend({ddup: true, cash: true}, options);
+               elements = elements || [];
+               if (options.ddup || options.cash){
+                       var uniques = {}, returned = [];
+                       for (var i = 0, l = elements.length; i < l; i++){
+                               var el = document.id(elements[i], !options.cash);
+                               if (options.ddup){
+                                       if (uniques[el.uid]) continue;
+                                       uniques[el.uid] = true;
+                               }
+                               if (el) returned.push(el);
+                       }
+                       elements = returned;
+               }
+               return (options.cash) ? $extend(elements, this) : elements;
+       }
+
+});
+
+Elements.implement({
+
+       filter: function(filter, bind){
+               if (!filter) return this;
+               return new Elements(Array.filter(this, (typeof filter == 'string') ? function(item){
+                       return item.match(filter);
+               } : filter, bind));
+       }
+
+});
+
+Document.implement({
+
+       newElement: function(tag, props){
+               if (Browser.Engine.trident && props){
+                       ['name', 'type', 'checked'].each(function(attribute){
+                               if (!props[attribute]) return;
+                               tag += ' ' + attribute + '="' + props[attribute] + '"';
+                               if (attribute != 'checked') delete props[attribute];
+                       });
+                       tag = '<' + tag + '>';
+               }
+               return document.id(this.createElement(tag)).set(props);
+       },
+
+       newTextNode: function(text){
+               return this.createTextNode(text);
+       },
+
+       getDocument: function(){
+               return this;
+       },
+
+       getWindow: function(){
+               return this.window;
+       },
+       
+       id: (function(){
+               
+               var types = {
+
+                       string: function(id, nocash, doc){
+                               id = doc.getElementById(id);
+                               return (id) ? types.element(id, nocash) : null;
+                       },
+                       
+                       element: function(el, nocash){
+                               $uid(el);
+                               if (!nocash && !el.$family && !(/^object|embed$/i).test(el.tagName)){
+                                       var proto = Element.Prototype;
+                                       for (var p in proto) el[p] = proto[p];
+                               };
+                               return el;
+                       },
+                       
+                       object: function(obj, nocash, doc){
+                               if (obj.toElement) return types.element(obj.toElement(doc), nocash);
+                               return null;
+                       }
+                       
+               };
+
+               types.textnode = types.whitespace = types.window = types.document = $arguments(0);
+               
+               return function(el, nocash, doc){
+                       if (el && el.$family && el.uid) return el;
+                       var type = $type(el);
+                       return (types[type]) ? types[type](el, nocash, doc || document) : null;
+               };
+
+       })()
+
+});
+
+if (window.$ == null) Window.implement({
+       $: function(el, nc){
+               return document.id(el, nc, this.document);
+       }
+});
+
+Window.implement({
+
+       $$: function(selector){
+               if (arguments.length == 1 && typeof selector == 'string') return this.document.getElements(selector);
+               var elements = [];
+               var args = Array.flatten(arguments);
+               for (var i = 0, l = args.length; i < l; i++){
+                       var item = args[i];
+                       switch ($type(item)){
+                               case 'element': elements.push(item); break;
+                               case 'string': elements.extend(this.document.getElements(item, true));
+                       }
+               }
+               return new Elements(elements);
+       },
+
+       getDocument: function(){
+               return this.document;
+       },
+
+       getWindow: function(){
+               return this;
+       }
+
+});
+
+Native.implement([Element, Document], {
+
+       getElement: function(selector, nocash){
+               return document.id(this.getElements(selector, true)[0] || null, nocash);
+       },
+
+       getElements: function(tags, nocash){
+               tags = tags.split(',');
+               var elements = [];
+               var ddup = (tags.length > 1);
+               tags.each(function(tag){
+                       var partial = this.getElementsByTagName(tag.trim());
+                       (ddup) ? elements.extend(partial) : elements = partial;
+               }, this);
+               return new Elements(elements, {ddup: ddup, cash: !nocash});
+       }
+
+});
+
+(function(){
+
+var collected = {}, storage = {};
+var props = {input: 'checked', option: 'selected', textarea: (Browser.Engine.webkit && Browser.Engine.version < 420) ? 'innerHTML' : 'value'};
+
+var get = function(uid){
+       return (storage[uid] || (storage[uid] = {}));
+};
+
+var clean = function(item, retain){
+       if (!item) return;
+       var uid = item.uid;
+       if (Browser.Engine.trident){
+               if (item.clearAttributes){
+                       var clone = retain && item.cloneNode(false);
+                       item.clearAttributes();
+                       if (clone) item.mergeAttributes(clone);
+               } else if (item.removeEvents){
+                       item.removeEvents();
+               }
+               if ((/object/i).test(item.tagName)){
+                       for (var p in item){
+                               if (typeof item[p] == 'function') item[p] = $empty;
+                       }
+                       Element.dispose(item);
+               }
+       }       
+       if (!uid) return;
+       collected[uid] = storage[uid] = null;
+};
+
+var purge = function(){
+       Hash.each(collected, clean);
+       if (Browser.Engine.trident) $A(document.getElementsByTagName('object')).each(clean);
+       if (window.CollectGarbage) CollectGarbage();
+       collected = storage = null;
+};
+
+var walk = function(element, walk, start, match, all, nocash){
+       var el = element[start || walk];
+       var elements = [];
+       while (el){
+               if (el.nodeType == 1 && (!match || Element.match(el, match))){
+                       if (!all) return document.id(el, nocash);
+                       elements.push(el);
+               }
+               el = el[walk];
+       }
+       return (all) ? new Elements(elements, {ddup: false, cash: !nocash}) : null;
+};
+
+var attributes = {
+       'html': 'innerHTML',
+       'class': 'className',
+       'for': 'htmlFor',
+       'defaultValue': 'defaultValue',
+       'text': (Browser.Engine.trident || (Browser.Engine.webkit && Browser.Engine.version < 420)) ? 'innerText' : 'textContent'
+};
+var bools = ['compact', 'nowrap', 'ismap', 'declare', 'noshade', 'checked', 'disabled', 'readonly', 'multiple', 'selected', 'noresize', 'defer'];
+var camels = ['value', 'type', 'defaultValue', 'accessKey', 'cellPadding', 'cellSpacing', 'colSpan', 'frameBorder', 'maxLength', 'readOnly', 'rowSpan', 'tabIndex', 'useMap'];
+
+bools = bools.associate(bools);
+
+Hash.extend(attributes, bools);
+Hash.extend(attributes, camels.associate(camels.map(String.toLowerCase)));
+
+var inserters = {
+
+       before: function(context, element){
+               if (element.parentNode) element.parentNode.insertBefore(context, element);
+       },
+
+       after: function(context, element){
+               if (!element.parentNode) return;
+               var next = element.nextSibling;
+               (next) ? element.parentNode.insertBefore(context, next) : element.parentNode.appendChild(context);
+       },
+
+       bottom: function(context, element){
+               element.appendChild(context);
+       },
+
+       top: function(context, element){
+               var first = element.firstChild;
+               (first) ? element.insertBefore(context, first) : element.appendChild(context);
+       }
+
+};
+
+inserters.inside = inserters.bottom;
+
+Hash.each(inserters, function(inserter, where){
+
+       where = where.capitalize();
+
+       Element.implement('inject' + where, function(el){
+               inserter(this, document.id(el, true));
+               return this;
+       });
+
+       Element.implement('grab' + where, function(el){
+               inserter(document.id(el, true), this);
+               return this;
+       });
+
+});
+
+Element.implement({
+
+       set: function(prop, value){
+               switch ($type(prop)){
+                       case 'object':
+                               for (var p in prop) this.set(p, prop[p]);
+                               break;
+                       case 'string':
+                               var property = Element.Properties.get(prop);
+                               (property && property.set) ? property.set.apply(this, Array.slice(arguments, 1)) : this.setProperty(prop, value);
+               }
+               return this;
+       },
+
+       get: function(prop){
+               var property = Element.Properties.get(prop);
+               return (property && property.get) ? property.get.apply(this, Array.slice(arguments, 1)) : this.getProperty(prop);
+       },
+
+       erase: function(prop){
+               var property = Element.Properties.get(prop);
+               (property && property.erase) ? property.erase.apply(this) : this.removeProperty(prop);
+               return this;
+       },
+
+       setProperty: function(attribute, value){
+               var key = attributes[attribute];
+               if (value == undefined) return this.removeProperty(attribute);
+               if (key && bools[attribute]) value = !!value;
+               (key) ? this[key] = value : this.setAttribute(attribute, '' + value);
+               return this;
+       },
+
+       setProperties: function(attributes){
+               for (var attribute in attributes) this.setProperty(attribute, attributes[attribute]);
+               return this;
+       },
+
+       getProperty: function(attribute){
+               var key = attributes[attribute];
+               var value = (key) ? this[key] : this.getAttribute(attribute, 2);
+               return (bools[attribute]) ? !!value : (key) ? value : value || null;
+       },
+
+       getProperties: function(){
+               var args = $A(arguments);
+               return args.map(this.getProperty, this).associate(args);
+       },
+
+       removeProperty: function(attribute){
+               var key = attributes[attribute];
+               (key) ? this[key] = (key && bools[attribute]) ? false : '' : this.removeAttribute(attribute);
+               return this;
+       },
+
+       removeProperties: function(){
+               Array.each(arguments, this.removeProperty, this);
+               return this;
+       },
+
+       hasClass: function(className){
+               return this.className.contains(className, ' ');
+       },
+
+       addClass: function(className){
+               if (!this.hasClass(className)) this.className = (this.className + ' ' + className).clean();
+               return this;
+       },
+
+       removeClass: function(className){
+               this.className = this.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)'), '$1');
+               return this;
+       },
+
+       toggleClass: function(className){
+               return this.hasClass(className) ? this.removeClass(className) : this.addClass(className);
+       },
+
+       adopt: function(){
+               Array.flatten(arguments).each(function(element){
+                       element = document.id(element, true);
+                       if (element) this.appendChild(element);
+               }, this);
+               return this;
+       },
+
+       appendText: function(text, where){
+               return this.grab(this.getDocument().newTextNode(text), where);
+       },
+
+       grab: function(el, where){
+               inserters[where || 'bottom'](document.id(el, true), this);
+               return this;
+       },
+
+       inject: function(el, where){
+               inserters[where || 'bottom'](this, document.id(el, true));
+               return this;
+       },
+
+       replaces: function(el){
+               el = document.id(el, true);
+               el.parentNode.replaceChild(this, el);
+               return this;
+       },
+
+       wraps: function(el, where){
+               el = document.id(el, true);
+               return this.replaces(el).grab(el, where);
+       },
+
+       getPrevious: function(match, nocash){
+               return walk(this, 'previousSibling', null, match, false, nocash);
+       },
+
+       getAllPrevious: function(match, nocash){
+               return walk(this, 'previousSibling', null, match, true, nocash);
+       },
+
+       getNext: function(match, nocash){
+               return walk(this, 'nextSibling', null, match, false, nocash);
+       },
+
+       getAllNext: function(match, nocash){
+               return walk(this, 'nextSibling', null, match, true, nocash);
+       },
+
+       getFirst: function(match, nocash){
+               return walk(this, 'nextSibling', 'firstChild', match, false, nocash);
+       },
+
+       getLast: function(match, nocash){
+               return walk(this, 'previousSibling', 'lastChild', match, false, nocash);
+       },
+
+       getParent: function(match, nocash){
+               return walk(this, 'parentNode', null, match, false, nocash);
+       },
+
+       getParents: function(match, nocash){
+               return walk(this, 'parentNode', null, match, true, nocash);
+       },
+       
+       getSiblings: function(match, nocash){
+               return this.getParent().getChildren(match, nocash).erase(this);
+       },
+
+       getChildren: function(match, nocash){
+               return walk(this, 'nextSibling', 'firstChild', match, true, nocash);
+       },
+
+       getWindow: function(){
+               return this.ownerDocument.window;
+       },
+
+       getDocument: function(){
+               return this.ownerDocument;
+       },
+
+       getElementById: function(id, nocash){
+               var el = this.ownerDocument.getElementById(id);
+               if (!el) return null;
+               for (var parent = el.parentNode; parent != this; parent = parent.parentNode){
+                       if (!parent) return null;
+               }
+               return document.id(el, nocash);
+       },
+
+       getSelected: function(){
+               return new Elements($A(this.options).filter(function(option){
+                       return option.selected;
+               }));
+       },
+
+       getComputedStyle: function(property){
+               if (this.currentStyle) return this.currentStyle[property.camelCase()];
+               var computed = this.getDocument().defaultView.getComputedStyle(this, null);
+               return (computed) ? computed.getPropertyValue([property.hyphenate()]) : null;
+       },
+
+       toQueryString: function(){
+               var queryString = [];
+               this.getElements('input, select, textarea', true).each(function(el){
+                       if (!el.name || el.disabled || el.type == 'submit' || el.type == 'reset' || el.type == 'file') return;
+                       var value = (el.tagName.toLowerCase() == 'select') ? Element.getSelected(el).map(function(opt){
+                               return opt.value;
+                       }) : ((el.type == 'radio' || el.type == 'checkbox') && !el.checked) ? null : el.value;
+                       $splat(value).each(function(val){
+                               if (typeof val != 'undefined') queryString.push(el.name + '=' + encodeURIComponent(val));
+                       });
+               });
+               return queryString.join('&');
+       },
+
+       clone: function(contents, keepid){
+               contents = contents !== false;
+               var clone = this.cloneNode(contents);
+               var clean = function(node, element){
+                       if (!keepid) node.removeAttribute('id');
+                       if (Browser.Engine.trident){
+                               node.clearAttributes();
+                               node.mergeAttributes(element);
+                               node.removeAttribute('uid');
+                               if (node.options){
+                                       var no = node.options, eo = element.options;
+                                       for (var j = no.length; j--;) no[j].selected = eo[j].selected;
+                               }
+                       }
+                       var prop = props[element.tagName.toLowerCase()];
+                       if (prop && element[prop]) node[prop] = element[prop];
+               };
+
+               if (contents){
+                       var ce = clone.getElementsByTagName('*'), te = this.getElementsByTagName('*');
+                       for (var i = ce.length; i--;) clean(ce[i], te[i]);
+               }
+
+               clean(clone, this);
+               return document.id(clone);
+       },
+
+       destroy: function(){
+               Element.empty(this);
+               Element.dispose(this);
+               clean(this, true);
+               return null;
+       },
+
+       empty: function(){
+               $A(this.childNodes).each(function(node){
+                       Element.destroy(node);
+               });
+               return this;
+       },
+
+       dispose: function(){
+               return (this.parentNode) ? this.parentNode.removeChild(this) : this;
+       },
+
+       hasChild: function(el){
+               el = document.id(el, true);
+               if (!el) return false;
+               if (Browser.Engine.webkit && Browser.Engine.version < 420) return $A(this.getElementsByTagName(el.tagName)).contains(el);
+               return (this.contains) ? (this != el && this.contains(el)) : !!(this.compareDocumentPosition(el) & 16);
+       },
+
+       match: function(tag){
+               return (!tag || (tag == this) || (Element.get(this, 'tag') == tag));
+       }
+
+});
+
+Native.implement([Element, Window, Document], {
+
+       addListener: function(type, fn){
+               if (type == 'unload'){
+                       var old = fn, self = this;
+                       fn = function(){
+                               self.removeListener('unload', fn);
+                               old();
+                       };
+               } else {
+                       collected[this.uid] = this;
+               }
+               if (this.addEventListener) this.addEventListener(type, fn, false);
+               else this.attachEvent('on' + type, fn);
+               return this;
+       },
+
+       removeListener: function(type, fn){
+               if (this.removeEventListener) this.removeEventListener(type, fn, false);
+               else this.detachEvent('on' + type, fn);
+               return this;
+       },
+
+       retrieve: function(property, dflt){
+               var storage = get(this.uid), prop = storage[property];
+               if (dflt != undefined && prop == undefined) prop = storage[property] = dflt;
+               return $pick(prop);
+       },
+
+       store: function(property, value){
+               var storage = get(this.uid);
+               storage[property] = value;
+               return this;
+       },
+
+       eliminate: function(property){
+               var storage = get(this.uid);
+               delete storage[property];
+               return this;
+       }
+
+});
+
+window.addListener('unload', purge);
+
+})();
+
+Element.Properties = new Hash;
+
+Element.Properties.style = {
+
+       set: function(style){
+               this.style.cssText = style;
+       },
+
+       get: function(){
+               return this.style.cssText;
+       },
+
+       erase: function(){
+               this.style.cssText = '';
+       }
+
+};
+
+Element.Properties.tag = {
+
+       get: function(){
+               return this.tagName.toLowerCase();
+       }
+
+};
+
+Element.Properties.html = (function(){
+       var wrapper = document.createElement('div');
+
+       var translations = {
+               table: [1, '<table>', '</table>'],
+               select: [1, '<select>', '</select>'],
+               tbody: [2, '<table><tbody>', '</tbody></table>'],
+               tr: [3, '<table><tbody><tr>', '</tr></tbody></table>']
+       };
+       translations.thead = translations.tfoot = translations.tbody;
+
+       var html = {
+               set: function(){
+                       var html = Array.flatten(arguments).join('');
+                       var wrap = Browser.Engine.trident && translations[this.get('tag')];
+                       if (wrap){
+                               var first = wrapper;
+                               first.innerHTML = wrap[1] + html + wrap[2];
+                               for (var i = wrap[0]; i--;) first = first.firstChild;
+                               this.empty().adopt(first.childNodes);
+                       } else {
+                               this.innerHTML = html;
+                       }
+               }
+       };
+
+       html.erase = html.set;
+
+       return html;
+})();
+
+if (Browser.Engine.webkit && Browser.Engine.version < 420) Element.Properties.text = {
+       get: function(){
+               if (this.innerText) return this.innerText;
+               var temp = this.ownerDocument.newElement('div', {html: this.innerHTML}).inject(this.ownerDocument.body);
+               var text = temp.innerText;
+               temp.destroy();
+               return text;
+       }
+};
+
+
+/*
+---
+
+script: Element.Event.js
+
+description: Contains Element methods for dealing with events. This file also includes mouseenter and mouseleave custom Element Events.
+
+license: MIT-style license.
+
+requires: 
+- /Element
+- /Event
+
+provides: [Element.Event]
+
+...
+*/
+
+Element.Properties.events = {set: function(events){
+       this.addEvents(events);
+}};
+
+Native.implement([Element, Window, Document], {
+
+       addEvent: function(type, fn){
+               var events = this.retrieve('events', {});
+               events[type] = events[type] || {'keys': [], 'values': []};
+               if (events[type].keys.contains(fn)) return this;
+               events[type].keys.push(fn);
+               var realType = type, custom = Element.Events.get(type), condition = fn, self = this;
+               if (custom){
+                       if (custom.onAdd) custom.onAdd.call(this, fn);
+                       if (custom.condition){
+                               condition = function(event){
+                                       if (custom.condition.call(this, event)) return fn.call(this, event);
+                                       return true;
+                               };
+                       }
+                       realType = custom.base || realType;
+               }
+               var defn = function(){
+                       return fn.call(self);
+               };
+               var nativeEvent = Element.NativeEvents[realType];
+               if (nativeEvent){
+                       if (nativeEvent == 2){
+                               defn = function(event){
+                                       event = new Event(event, self.getWindow());
+                                       if (condition.call(self, event) === false) event.stop();
+                               };
+                       }
+                       this.addListener(realType, defn);
+               }
+               events[type].values.push(defn);
+               return this;
+       },
+
+       removeEvent: function(type, fn){
+               var events = this.retrieve('events');
+               if (!events || !events[type]) return this;
+               var pos = events[type].keys.indexOf(fn);
+               if (pos == -1) return this;
+               events[type].keys.splice(pos, 1);
+               var value = events[type].values.splice(pos, 1)[0];
+               var custom = Element.Events.get(type);
+               if (custom){
+                       if (custom.onRemove) custom.onRemove.call(this, fn);
+                       type = custom.base || type;
+               }
+               return (Element.NativeEvents[type]) ? this.removeListener(type, value) : this;
+       },
+
+       addEvents: function(events){
+               for (var event in events) this.addEvent(event, events[event]);
+               return this;
+       },
+
+       removeEvents: function(events){
+               var type;
+               if ($type(events) == 'object'){
+                       for (type in events) this.removeEvent(type, events[type]);
+                       return this;
+               }
+               var attached = this.retrieve('events');
+               if (!attached) return this;
+               if (!events){
+                       for (type in attached) this.removeEvents(type);
+                       this.eliminate('events');
+               } else if (attached[events]){
+                       while (attached[events].keys[0]) this.removeEvent(events, attached[events].keys[0]);
+                       attached[events] = null;
+               }
+               return this;
+       },
+
+       fireEvent: function(type, args, delay){
+               var events = this.retrieve('events');
+               if (!events || !events[type]) return this;
+               events[type].keys.each(function(fn){
+                       fn.create({'bind': this, 'delay': delay, 'arguments': args})();
+               }, this);
+               return this;
+       },
+
+       cloneEvents: function(from, type){
+               from = document.id(from);
+               var fevents = from.retrieve('events');
+               if (!fevents) return this;
+               if (!type){
+                       for (var evType in fevents) this.cloneEvents(from, evType);
+               } else if (fevents[type]){
+                       fevents[type].keys.each(function(fn){
+                               this.addEvent(type, fn);
+                       }, this);
+               }
+               return this;
+       }
+
+});
+
+Element.NativeEvents = {
+       click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttons
+       mousewheel: 2, DOMMouseScroll: 2, //mouse wheel
+       mouseover: 2, mouseout: 2, mousemove: 2, selectstart: 2, selectend: 2, //mouse movement
+       keydown: 2, keypress: 2, keyup: 2, //keyboard
+       focus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, //form elements
+       load: 1, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window
+       error: 1, abort: 1, scroll: 1 //misc
+};
+
+(function(){
+
+var $check = function(event){
+       var related = event.relatedTarget;
+       if (related == undefined) return true;
+       if (related === false) return false;
+       return ($type(this) != 'document' && related != this && related.prefix != 'xul' && !this.hasChild(related));
+};
+
+Element.Events = new Hash({
+
+       mouseenter: {
+               base: 'mouseover',
+               condition: $check
+       },
+
+       mouseleave: {
+               base: 'mouseout',
+               condition: $check
+       },
+
+       mousewheel: {
+               base: (Browser.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel'
+       }
+
+});
+
+})();
+
+
+/*
+---
+
+script: Element.Style.js
+
+description: Contains methods for interacting with the styles of Elements in a fashionable way.
+
+license: MIT-style license.
+
+requires:
+- /Element
+
+provides: [Element.Style]
+
+...
+*/
+
+Element.Properties.styles = {set: function(styles){
+       this.setStyles(styles);
+}};
+
+Element.Properties.opacity = {
+
+       set: function(opacity, novisibility){
+               if (!novisibility){
+                       if (opacity == 0){
+                               if (this.style.visibility != 'hidden') this.style.visibility = 'hidden';
+                       } else {
+                               if (this.style.visibility != 'visible') this.style.visibility = 'visible';
+                       }
+               }
+               if (!this.currentStyle || !this.currentStyle.hasLayout) this.style.zoom = 1;
+               if (Browser.Engine.trident) this.style.filter = (opacity == 1) ? '' : 'alpha(opacity=' + opacity * 100 + ')';
+               this.style.opacity = opacity;
+               this.store('opacity', opacity);
+       },
+
+       get: function(){
+               return this.retrieve('opacity', 1);
+       }
+
+};
+
+Element.implement({
+
+       setOpacity: function(value){
+               return this.set('opacity', value, true);
+       },
+
+       getOpacity: function(){
+               return this.get('opacity');
+       },
+
+       setStyle: function(property, value){
+               switch (property){
+                       case 'opacity': return this.set('opacity', parseFloat(value));
+                       case 'float': property = (Browser.Engine.trident) ? 'styleFloat' : 'cssFloat';
+               }
+               property = property.camelCase();
+               if ($type(value) != 'string'){
+                       var map = (Element.Styles.get(property) || '@').split(' ');
+                       value = $splat(value).map(function(val, i){
+                               if (!map[i]) return '';
+                               return ($type(val) == 'number') ? map[i].replace('@', Math.round(val)) : val;
+                       }).join(' ');
+               } else if (value == String(Number(value))){
+                       value = Math.round(value);
+               }
+               this.style[property] = value;
+               return this;
+       },
+
+       getStyle: function(property){
+               switch (property){
+                       case 'opacity': return this.get('opacity');
+                       case 'float': property = (Browser.Engine.trident) ? 'styleFloat' : 'cssFloat';
+               }
+               property = property.camelCase();
+               var result = this.style[property];
+               if (!$chk(result)){
+                       result = [];
+                       for (var style in Element.ShortStyles){
+                               if (property != style) continue;
+                               for (var s in Element.ShortStyles[style]) result.push(this.getStyle(s));
+                               return result.join(' ');
+                       }
+                       result = this.getComputedStyle(property);
+               }
+               if (result){
+                       result = String(result);
+                       var color = result.match(/rgba?\([\d\s,]+\)/);
+                       if (color) result = result.replace(color[0], color[0].rgbToHex());
+               }
+               if (Browser.Engine.presto || (Browser.Engine.trident && !$chk(parseInt(result, 10)))){
+                       if (property.test(/^(height|width)$/)){
+                               var values = (property == 'width') ? ['left', 'right'] : ['top', 'bottom'], size = 0;
+                               values.each(function(value){
+                                       size += this.getStyle('border-' + value + '-width').toInt() + this.getStyle('padding-' + value).toInt();
+                               }, this);
+                               return this['offset' + property.capitalize()] - size + 'px';
+                       }
+                       if ((Browser.Engine.presto) && String(result).test('px')) return result;
+                       if (property.test(/(border(.+)Width|margin|padding)/)) return '0px';
+               }
+               return result;
+       },
+
+       setStyles: function(styles){
+               for (var style in styles) this.setStyle(style, styles[style]);
+               return this;
+       },
+
+       getStyles: function(){
+               var result = {};
+               Array.flatten(arguments).each(function(key){
+                       result[key] = this.getStyle(key);
+               }, this);
+               return result;
+       }
+
+});
+
+Element.Styles = new Hash({
+       left: '@px', top: '@px', bottom: '@px', right: '@px',
+       width: '@px', height: '@px', maxWidth: '@px', maxHeight: '@px', minWidth: '@px', minHeight: '@px',
+       backgroundColor: 'rgb(@, @, @)', backgroundPosition: '@px @px', color: 'rgb(@, @, @)',
+       fontSize: '@px', letterSpacing: '@px', lineHeight: '@px', clip: 'rect(@px @px @px @px)',
+       margin: '@px @px @px @px', padding: '@px @px @px @px', border: '@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)',
+       borderWidth: '@px @px @px @px', borderStyle: '@ @ @ @', borderColor: 'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)',
+       zIndex: '@', 'zoom': '@', fontWeight: '@', textIndent: '@px', opacity: '@'
+});
+
+Element.ShortStyles = {margin: {}, padding: {}, border: {}, borderWidth: {}, borderStyle: {}, borderColor: {}};
+
+['Top', 'Right', 'Bottom', 'Left'].each(function(direction){
+       var Short = Element.ShortStyles;
+       var All = Element.Styles;
+       ['margin', 'padding'].each(function(style){
+               var sd = style + direction;
+               Short[style][sd] = All[sd] = '@px';
+       });
+       var bd = 'border' + direction;
+       Short.border[bd] = All[bd] = '@px @ rgb(@, @, @)';
+       var bdw = bd + 'Width', bds = bd + 'Style', bdc = bd + 'Color';
+       Short[bd] = {};
+       Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = '@px';
+       Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@';
+       Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)';
+});
+
+
+/*
+---
+
+script: Element.Dimensions.js
+
+description: Contains methods to work with size, scroll, or positioning of Elements and the window object.
+
+license: MIT-style license.
+
+credits:
+- Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html).
+- Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html).
+
+requires:
+- /Element
+
+provides: [Element.Dimensions]
+
+...
+*/
+
+(function(){
+
+Element.implement({
+
+       scrollTo: function(x, y){
+               if (isBody(this)){
+                       this.getWindow().scrollTo(x, y);
+               } else {
+                       this.scrollLeft = x;
+                       this.scrollTop = y;
+               }
+               return this;
+       },
+
+       getSize: function(){
+               if (isBody(this)) return this.getWindow().getSize();
+               return {x: this.offsetWidth, y: this.offsetHeight};
+       },
+
+       getScrollSize: function(){
+               if (isBody(this)) return this.getWindow().getScrollSize();
+               return {x: this.scrollWidth, y: this.scrollHeight};
+       },
+
+       getScroll: function(){
+               if (isBody(this)) return this.getWindow().getScroll();
+               return {x: this.scrollLeft, y: this.scrollTop};
+       },
+
+       getScrolls: function(){
+               var element = this, position = {x: 0, y: 0};
+               while (element && !isBody(element)){
+                       position.x += element.scrollLeft;
+                       position.y += element.scrollTop;
+                       element = element.parentNode;
+               }
+               return position;
+       },
+
+       getOffsetParent: function(){
+               var element = this;
+               if (isBody(element)) return null;
+               if (!Browser.Engine.trident) return element.offsetParent;
+               while ((element = element.parentNode) && !isBody(element)){
+                       if (styleString(element, 'position') != 'static') return element;
+               }
+               return null;
+       },
+
+       getOffsets: function(){
+               if (this.getBoundingClientRect){
+                       var bound = this.getBoundingClientRect(),
+                               html = document.id(this.getDocument().documentElement),
+                               htmlScroll = html.getScroll(),
+                               elemScrolls = this.getScrolls(),
+                               elemScroll = this.getScroll(),
+                               isFixed = (styleString(this, 'position') == 'fixed');
+
+                       return {
+                               x: bound.left.toInt() + elemScrolls.x - elemScroll.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft,
+                               y: bound.top.toInt()  + elemScrolls.y - elemScroll.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop
+                       };
+               }
+
+               var element = this, position = {x: 0, y: 0};
+               if (isBody(this)) return position;
+
+               while (element && !isBody(element)){
+                       position.x += element.offsetLeft;
+                       position.y += element.offsetTop;
+
+                       if (Browser.Engine.gecko){
+                               if (!borderBox(element)){
+                                       position.x += leftBorder(element);
+                                       position.y += topBorder(element);
+                               }
+                               var parent = element.parentNode;
+                               if (parent && styleString(parent, 'overflow') != 'visible'){
+                                       position.x += leftBorder(parent);
+                                       position.y += topBorder(parent);
+                               }
+                       } else if (element != this && Browser.Engine.webkit){
+                               position.x += leftBorder(element);
+                               position.y += topBorder(element);
+                       }
+
+                       element = element.offsetParent;
+               }
+               if (Browser.Engine.gecko && !borderBox(this)){
+                       position.x -= leftBorder(this);
+                       position.y -= topBorder(this);
+               }
+               return position;
+       },
+
+       getPosition: function(relative){
+               if (isBody(this)) return {x: 0, y: 0};
+               var offset = this.getOffsets(),
+                               scroll = this.getScrolls();
+               var position = {
+                       x: offset.x - scroll.x,
+                       y: offset.y - scroll.y
+               };
+               var relativePosition = (relative && (relative = document.id(relative))) ? relative.getPosition() : {x: 0, y: 0};
+               return {x: position.x - relativePosition.x, y: position.y - relativePosition.y};
+       },
+
+       getCoordinates: function(element){
+               if (isBody(this)) return this.getWindow().getCoordinates();
+               var position = this.getPosition(element),
+                               size = this.getSize();
+               var obj = {
+                       left: position.x,
+                       top: position.y,
+                       width: size.x,
+                       height: size.y
+               };
+               obj.right = obj.left + obj.width;
+               obj.bottom = obj.top + obj.height;
+               return obj;
+       },
+
+       computePosition: function(obj){
+               return {
+                       left: obj.x - styleNumber(this, 'margin-left'),
+                       top: obj.y - styleNumber(this, 'margin-top')
+               };
+       },
+
+       setPosition: function(obj){
+               return this.setStyles(this.computePosition(obj));
+       }
+
+});
+
+
+Native.implement([Document, Window], {
+
+       getSize: function(){
+               if (Browser.Engine.presto || Browser.Engine.webkit){
+                       var win = this.getWindow();
+                       return {x: win.innerWidth, y: win.innerHeight};
+               }
+               var doc = getCompatElement(this);
+               return {x: doc.clientWidth, y: doc.clientHeight};
+       },
+
+       getScroll: function(){
+               var win = this.getWindow(), doc = getCompatElement(this);
+               return {x: win.pageXOffset || doc.scrollLeft, y: win.pageYOffset || doc.scrollTop};
+       },
+
+       getScrollSize: function(){
+               var doc = getCompatElement(this), min = this.getSize();
+               return {x: Math.max(doc.scrollWidth, min.x), y: Math.max(doc.scrollHeight, min.y)};
+       },
+
+       getPosition: function(){
+               return {x: 0, y: 0};
+       },
+
+       getCoordinates: function(){
+               var size = this.getSize();
+               return {top: 0, left: 0, bottom: size.y, right: size.x, height: size.y, width: size.x};
+       }
+
+});
+
+// private methods
+
+var styleString = Element.getComputedStyle;
+
+function styleNumber(element, style){
+       return styleString(element, style).toInt() || 0;
+};
+
+function borderBox(element){
+       return styleString(element, '-moz-box-sizing') == 'border-box';
+};
+
+function topBorder(element){
+       return styleNumber(element, 'border-top-width');
+};
+
+function leftBorder(element){
+       return styleNumber(element, 'border-left-width');
+};
+
+function isBody(element){
+       return (/^(?:body|html)$/i).test(element.tagName);
+};
+
+function getCompatElement(element){
+       var doc = element.getDocument();
+       return (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body;
+};
+
+})();
+
+//aliases
+Element.alias('setPosition', 'position'); //compatability
+
+Native.implement([Window, Document, Element], {
+
+       getHeight: function(){
+               return this.getSize().y;
+       },
+
+       getWidth: function(){
+               return this.getSize().x;
+       },
+
+       getScrollTop: function(){
+               return this.getScroll().y;
+       },
+
+       getScrollLeft: function(){
+               return this.getScroll().x;
+       },
+
+       getScrollHeight: function(){
+               return this.getScrollSize().y;
+       },
+
+       getScrollWidth: function(){
+               return this.getScrollSize().x;
+       },
+
+       getTop: function(){
+               return this.getPosition().y;
+       },
+
+       getLeft: function(){
+               return this.getPosition().x;
+       }
+
+});
+
+
+/*
+---
+
+script: Selectors.js
+
+description: Adds advanced CSS-style querying capabilities for targeting HTML Elements. Includes pseudo selectors.
+
+license: MIT-style license.
+
+requires:
+- /Element
+
+provides: [Selectors]
+
+...
+*/
+
+Native.implement([Document, Element], {
+
+       getElements: function(expression, nocash){
+               expression = expression.split(',');
+               var items, local = {};
+               for (var i = 0, l = expression.length; i < l; i++){
+                       var selector = expression[i], elements = Selectors.Utils.search(this, selector, local);
+                       if (i != 0 && elements.item) elements = $A(elements);
+                       items = (i == 0) ? elements : (items.item) ? $A(items).concat(elements) : items.concat(elements);
+               }
+               return new Elements(items, {ddup: (expression.length > 1), cash: !nocash});
+       }
+
+});
+
+Element.implement({
+
+       match: function(selector){
+               if (!selector || (selector == this)) return true;
+               var tagid = Selectors.Utils.parseTagAndID(selector);
+               var tag = tagid[0], id = tagid[1];
+               if (!Selectors.Filters.byID(this, id) || !Selectors.Filters.byTag(this, tag)) return false;
+               var parsed = Selectors.Utils.parseSelector(selector);
+               return (parsed) ? Selectors.Utils.filter(this, parsed, {}) : true;
+       }
+
+});
+
+var Selectors = {Cache: {nth: {}, parsed: {}}};
+
+Selectors.RegExps = {
+       id: (/#([\w-]+)/),
+       tag: (/^(\w+|\*)/),
+       quick: (/^(\w+|\*)$/),
+       splitter: (/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),
+       combined: (/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)
+};
+
+Selectors.Utils = {
+
+       chk: function(item, uniques){
+               if (!uniques) return true;
+               var uid = $uid(item);
+               if (!uniques[uid]) return uniques[uid] = true;
+               return false;
+       },
+
+       parseNthArgument: function(argument){
+               if (Selectors.Cache.nth[argument]) return Selectors.Cache.nth[argument];
+               var parsed = argument.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);
+               if (!parsed) return false;
+               var inta = parseInt(parsed[1], 10);
+               var a = (inta || inta === 0) ? inta : 1;
+               var special = parsed[2] || false;
+               var b = parseInt(parsed[3], 10) || 0;
+               if (a != 0){
+                       b--;
+                       while (b < 1) b += a;
+                       while (b >= a) b -= a;
+               } else {
+                       a = b;
+                       special = 'index';
+               }
+               switch (special){
+                       case 'n': parsed = {a: a, b: b, special: 'n'}; break;
+                       case 'odd': parsed = {a: 2, b: 0, special: 'n'}; break;
+                       case 'even': parsed = {a: 2, b: 1, special: 'n'}; break;
+                       case 'first': parsed = {a: 0, special: 'index'}; break;
+                       case 'last': parsed = {special: 'last-child'}; break;
+                       case 'only': parsed = {special: 'only-child'}; break;
+                       default: parsed = {a: (a - 1), special: 'index'};
+               }
+
+               return Selectors.Cache.nth[argument] = parsed;
+       },
+
+       parseSelector: function(selector){
+               if (Selectors.Cache.parsed[selector]) return Selectors.Cache.parsed[selector];
+               var m, parsed = {classes: [], pseudos: [], attributes: []};
+               while ((m = Selectors.RegExps.combined.exec(selector))){
+                       var cn = m[1], an = m[2], ao = m[3], av = m[5], pn = m[6], pa = m[7];
+                       if (cn){
+                               parsed.classes.push(cn);
+                       } else if (pn){
+                               var parser = Selectors.Pseudo.get(pn);
+                               if (parser) parsed.pseudos.push({parser: parser, argument: pa});
+                               else parsed.attributes.push({name: pn, operator: '=', value: pa});
+                       } else if (an){
+                               parsed.attributes.push({name: an, operator: ao, value: av});
+                       }
+               }
+               if (!parsed.classes.length) delete parsed.classes;
+               if (!parsed.attributes.length) delete parsed.attributes;
+               if (!parsed.pseudos.length) delete parsed.pseudos;
+               if (!parsed.classes && !parsed.attributes && !parsed.pseudos) parsed = null;
+               return Selectors.Cache.parsed[selector] = parsed;
+       },
+
+       parseTagAndID: function(selector){
+               var tag = selector.match(Selectors.RegExps.tag);
+               var id = selector.match(Selectors.RegExps.id);
+               return [(tag) ? tag[1] : '*', (id) ? id[1] : false];
+       },
+
+       filter: function(item, parsed, local){
+               var i;
+               if (parsed.classes){
+                       for (i = parsed.classes.length; i--; i){
+                               var cn = parsed.classes[i];
+                               if (!Selectors.Filters.byClass(item, cn)) return false;
+                       }
+               }
+               if (parsed.attributes){
+                       for (i = parsed.attributes.length; i--; i){
+                               var att = parsed.attributes[i];
+                               if (!Selectors.Filters.byAttribute(item, att.name, att.operator, att.value)) return false;
+                       }
+               }
+               if (parsed.pseudos){
+                       for (i = parsed.pseudos.length; i--; i){
+                               var psd = parsed.pseudos[i];
+                               if (!Selectors.Filters.byPseudo(item, psd.parser, psd.argument, local)) return false;
+                       }
+               }
+               return true;
+       },
+
+       getByTagAndID: function(ctx, tag, id){
+               if (id){
+                       var item = (ctx.getElementById) ? ctx.getElementById(id, true) : Element.getElementById(ctx, id, true);
+                       return (item && Selectors.Filters.byTag(item, tag)) ? [item] : [];
+               } else {
+                       return ctx.getElementsByTagName(tag);
+               }
+       },
+
+       search: function(self, expression, local){
+               var splitters = [];
+
+               var selectors = expression.trim().replace(Selectors.RegExps.splitter, function(m0, m1, m2){
+                       splitters.push(m1);
+                       return ':)' + m2;
+               }).split(':)');
+
+               var items, filtered, item;
+
+               for (var i = 0, l = selectors.length; i < l; i++){
+
+                       var selector = selectors[i];
+
+                       if (i == 0 && Selectors.RegExps.quick.test(selector)){
+                               items = self.getElementsByTagName(selector);
+                               continue;
+                       }
+
+                       var splitter = splitters[i - 1];
+
+                       var tagid = Selectors.Utils.parseTagAndID(selector);
+                       var tag = tagid[0], id = tagid[1];
+
+                       if (i == 0){
+                               items = Selectors.Utils.getByTagAndID(self, tag, id);
+                       } else {
+                               var uniques = {}, found = [];
+                               for (var j = 0, k = items.length; j < k; j++) found = Selectors.Getters[splitter](found, items[j], tag, id, uniques);
+                               items = found;
+                       }
+
+                       var parsed = Selectors.Utils.parseSelector(selector);
+
+                       if (parsed){
+                               filtered = [];
+                               for (var m = 0, n = items.length; m < n; m++){
+                                       item = items[m];
+                                       if (Selectors.Utils.filter(item, parsed, local)) filtered.push(item);
+                               }
+                               items = filtered;
+                       }
+
+               }
+
+               return items;
+
+       }
+
+};
+
+Selectors.Getters = {
+
+       ' ': function(found, self, tag, id, uniques){
+               var items = Selectors.Utils.getByTagAndID(self, tag, id);
+               for (var i = 0, l = items.length; i < l; i++){
+                       var item = items[i];
+                       if (Selectors.Utils.chk(item, uniques)) found.push(item);
+               }
+               return found;
+       },
+
+       '>': function(found, self, tag, id, uniques){
+               var children = Selectors.Utils.getByTagAndID(self, tag, id);
+               for (var i = 0, l = children.length; i < l; i++){
+                       var child = children[i];
+                       if (child.parentNode == self && Selectors.Utils.chk(child, uniques)) found.push(child);
+               }
+               return found;
+       },
+
+       '+': function(found, self, tag, id, uniques){
+               while ((self = self.nextSibling)){
+                       if (self.nodeType == 1){
+                               if (Selectors.Utils.chk(self, uniques) && Selectors.Filters.byTag(self, tag) && Selectors.Filters.byID(self, id)) found.push(self);
+                               break;
+                       }
+               }
+               return found;
+       },
+
+       '~': function(found, self, tag, id, uniques){
+               while ((self = self.nextSibling)){
+                       if (self.nodeType == 1){
+                               if (!Selectors.Utils.chk(self, uniques)) break;
+                               if (Selectors.Filters.byTag(self, tag) && Selectors.Filters.byID(self, id)) found.push(self);
+                       }
+               }
+               return found;
+       }
+
+};
+
+Selectors.Filters = {
+
+       byTag: function(self, tag){
+               return (tag == '*' || (self.tagName && self.tagName.toLowerCase() == tag));
+       },
+
+       byID: function(self, id){
+               return (!id || (self.id && self.id == id));
+       },
+
+       byClass: function(self, klass){
+               return (self.className && self.className.contains && self.className.contains(klass, ' '));
+       },
+
+       byPseudo: function(self, parser, argument, local){
+               return parser.call(self, argument, local);
+       },
+
+       byAttribute: function(self, name, operator, value){
+               var result = Element.prototype.getProperty.call(self, name);
+               if (!result) return (operator == '!=');
+               if (!operator || value == undefined) return true;
+               switch (operator){
+                       case '=': return (result == value);
+                       case '*=': return (result.contains(value));
+                       case '^=': return (result.substr(0, value.length) == value);
+                       case '$=': return (result.substr(result.length - value.length) == value);
+                       case '!=': return (result != value);
+                       case '~=': return result.contains(value, ' ');
+                       case '|=': return result.contains(value, '-');
+               }
+               return false;
+       }
+
+};
+
+Selectors.Pseudo = new Hash({
+
+       // w3c pseudo selectors
+
+       checked: function(){
+               return this.checked;
+       },
+       
+       empty: function(){
+               return !(this.innerText || this.textContent || '').length;
+       },
+
+       not: function(selector){
+               return !Element.match(this, selector);
+       },
+
+       contains: function(text){
+               return (this.innerText || this.textContent || '').contains(text);
+       },
+
+       'first-child': function(){
+               return Selectors.Pseudo.index.call(this, 0);
+       },
+
+       'last-child': function(){
+               var element = this;
+               while ((element = element.nextSibling)){
+                       if (element.nodeType == 1) return false;
+               }
+               return true;
+       },
+
+       'only-child': function(){
+               var prev = this;
+               while ((prev = prev.previousSibling)){
+                       if (prev.nodeType == 1) return false;
+               }
+               var next = this;
+               while ((next = next.nextSibling)){
+                       if (next.nodeType == 1) return false;
+               }
+               return true;
+       },
+
+       'nth-child': function(argument, local){
+               argument = (argument == undefined) ? 'n' : argument;
+               var parsed = Selectors.Utils.parseNthArgument(argument);
+               if (parsed.special != 'n') return Selectors.Pseudo[parsed.special].call(this, parsed.a, local);
+               var count = 0;
+               local.positions = local.positions || {};
+               var uid = $uid(this);
+               if (!local.positions[uid]){
+                       var self = this;
+                       while ((self = self.previousSibling)){
+                               if (self.nodeType != 1) continue;
+                               count ++;
+                               var position = local.positions[$uid(self)];
+                               if (position != undefined){
+                                       count = position + count;
+                                       break;
+                               }
+                       }
+                       local.positions[uid] = count;
+               }
+               return (local.positions[uid] % parsed.a == parsed.b);
+       },
+
+       // custom pseudo selectors
+
+       index: function(index){
+               var element = this, count = 0;
+               while ((element = element.previousSibling)){
+                       if (element.nodeType == 1 && ++count > index) return false;
+               }
+               return (count == index);
+       },
+
+       even: function(argument, local){
+               return Selectors.Pseudo['nth-child'].call(this, '2n+1', local);
+       },
+
+       odd: function(argument, local){
+               return Selectors.Pseudo['nth-child'].call(this, '2n', local);
+       },
+       
+       selected: function(){
+               return this.selected;
+       },
+       
+       enabled: function(){
+               return (this.disabled === false);
+       }
+
+});
+
+
+/*
+---
+
+script: DomReady.js
+
+description: Contains the custom event domready.
+
+license: MIT-style license.
+
+requires:
+- /Element.Event
+
+provides: [DomReady]
+
+...
+*/
+
+Element.Events.domready = {
+
+       onAdd: function(fn){
+               if (Browser.loaded) fn.call(this);
+       }
+
+};
+
+(function(){
+
+       var domready = function(){
+               if (Browser.loaded) return;
+               Browser.loaded = true;
+               window.fireEvent('domready');
+               document.fireEvent('domready');
+       };
+       
+       window.addEvent('load', domready);
+
+       if (Browser.Engine.trident){
+               var temp = document.createElement('div');
+               (function(){
+                       ($try(function(){
+                               temp.doScroll(); // Technique by Diego Perini
+                               return document.id(temp).inject(document.body).set('html', 'temp').dispose();
+                       })) ? domready() : arguments.callee.delay(50);
+               })();
+       } else if (Browser.Engine.webkit && Browser.Engine.version < 525){
+               (function(){
+                       (['loaded', 'complete'].contains(document.readyState)) ? domready() : arguments.callee.delay(50);
+               })();
+       } else {
+               document.addEvent('DOMContentLoaded', domready);
+       }
+
+})();
+
+
+/*
+---
+
+script: JSON.js
+
+description: JSON encoder and decoder.
+
+license: MIT-style license.
+
+See Also: <http://www.json.org/>
+
+requires:
+- /Array
+- /String
+- /Number
+- /Function
+- /Hash
+
+provides: [JSON]
+
+...
+*/
+
+var JSON = new Hash(this.JSON && {
+       stringify: JSON.stringify,
+       parse: JSON.parse
+}).extend({
+       
+       $specialChars: {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'},
+
+       $replaceChars: function(chr){
+               return JSON.$specialChars[chr] || '\\u00' + Math.floor(chr.charCodeAt() / 16).toString(16) + (chr.charCodeAt() % 16).toString(16);
+       },
+
+       encode: function(obj){
+               switch ($type(obj)){
+                       case 'string':
+                               return '"' + obj.replace(/[\x00-\x1f\\"]/g, JSON.$replaceChars) + '"';
+                       case 'array':
+                               return '[' + String(obj.map(JSON.encode).clean()) + ']';
+                       case 'object': case 'hash':
+                               var string = [];
+                               Hash.each(obj, function(value, key){
+                                       var json = JSON.encode(value);
+                                       if (json) string.push(JSON.encode(key) + ':' + json);
+                               });
+                               return '{' + string + '}';
+                       case 'number': case 'boolean': return String(obj);
+                       case false: return 'null';
+               }
+               return null;
+       },
+
+       decode: function(string, secure){
+               if ($type(string) != 'string' || !string.length) return null;
+               if (secure && !(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''))) return null;
+               return eval('(' + string + ')');
+       }
+
+});
+
+Native.implement([Hash, Array, String, Number], {
+
+       toJSON: function(){
+               return JSON.encode(this);
+       }
+
+});
+
+
+/*
+---
+
+script: Cookie.js
+
+description: Class for creating, reading, and deleting browser Cookies.
+
+license: MIT-style license.
+
+credits:
+- Based on the functions by Peter-Paul Koch (http://quirksmode.org).
+
+requires:
+- /Options
+
+provides: [Cookie]
+
+...
+*/
+
+var Cookie = new Class({
+
+       Implements: Options,
+
+       options: {
+               path: false,
+               domain: false,
+               duration: false,
+               secure: false,
+               document: document
+       },
+
+       initialize: function(key, options){
+               this.key = key;
+               this.setOptions(options);
+       },
+
+       write: function(value){
+               value = encodeURIComponent(value);
+               if (this.options.domain) value += '; domain=' + this.options.domain;
+               if (this.options.path) value += '; path=' + this.options.path;
+               if (this.options.duration){
+                       var date = new Date();
+                       date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000);
+                       value += '; expires=' + date.toGMTString();
+               }
+               if (this.options.secure) value += '; secure';
+               this.options.document.cookie = this.key + '=' + value;
+               return this;
+       },
+
+       read: function(){
+               var value = this.options.document.cookie.match('(?:^|;)\\s*' + this.key.escapeRegExp() + '=([^;]*)');
+               return (value) ? decodeURIComponent(value[1]) : null;
+       },
+
+       dispose: function(){
+               new Cookie(this.key, $merge(this.options, {duration: -1})).write('');
+               return this;
+       }
+
+});
+
+Cookie.write = function(key, value, options){
+       return new Cookie(key, options).write(value);
+};
+
+Cookie.read = function(key){
+       return new Cookie(key).read();
+};
+
+Cookie.dispose = function(key, options){
+       return new Cookie(key, options).dispose();
+};
+
+
+/*
+---
+
+script: Swiff.js
+
+description: Wrapper for embedding SWF movies. Supports External Interface Communication.
+
+license: MIT-style license.
+
+credits: 
+- Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject.
+
+requires:
+- /Options
+- /$util
+
+provides: [Swiff]
+
+...
+*/
+
+var Swiff = new Class({
+
+       Implements: [Options],
+
+       options: {
+               id: null,
+               height: 1,
+               width: 1,
+               container: null,
+               properties: {},
+               params: {
+                       quality: 'high',
+                       allowScriptAccess: 'always',
+                       wMode: 'transparent',
+                       swLiveConnect: true
+               },
+               callBacks: {},
+               vars: {}
+       },
+
+       toElement: function(){
+               return this.object;
+       },
+
+       initialize: function(path, options){
+               this.instance = 'Swiff_' + $time();
+
+               this.setOptions(options);
+               options = this.options;
+               var id = this.id = options.id || this.instance;
+               var container = document.id(options.container);
+
+               Swiff.CallBacks[this.instance] = {};
+
+               var params = options.params, vars = options.vars, callBacks = options.callBacks;
+               var properties = $extend({height: options.height, width: options.width}, options.properties);
+
+               var self = this;
+
+               for (var callBack in callBacks){
+                       Swiff.CallBacks[this.instance][callBack] = (function(option){
+                               return function(){
+                                       return option.apply(self.object, arguments);
+                               };
+                       })(callBacks[callBack]);
+                       vars[callBack] = 'Swiff.CallBacks.' + this.instance + '.' + callBack;
+               }
+
+               params.flashVars = Hash.toQueryString(vars);
+               if (Browser.Engine.trident){
+                       properties.classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
+                       params.movie = path;
+               } else {
+                       properties.type = 'application/x-shockwave-flash';
+                       properties.data = path;
+               }
+               var build = '<object id="' + id + '"';
+               for (var property in properties) build += ' ' + property + '="' + properties[property] + '"';
+               build += '>';
+               for (var param in params){
+                       if (params[param]) build += '<param name="' + param + '" value="' + params[param] + '" />';
+               }
+               build += '</object>';
+               this.object = ((container) ? container.empty() : new Element('div')).set('html', build).firstChild;
+       },
+
+       replaces: function(element){
+               element = document.id(element, true);
+               element.parentNode.replaceChild(this.toElement(), element);
+               return this;
+       },
+
+       inject: function(element){
+               document.id(element, true).appendChild(this.toElement());
+               return this;
+       },
+
+       remote: function(){
+               return Swiff.remote.apply(Swiff, [this.toElement()].extend(arguments));
+       }
+
+});
+
+Swiff.CallBacks = {};
+
+Swiff.remote = function(obj, fn){
+       var rs = obj.CallFunction('<invoke name="' + fn + '" returntype="javascript">' + __flash__argumentsToXML(arguments, 2) + '</invoke>');
+       return eval(rs);
+};
+
+
+/*
+---
+
+script: Fx.js
+
+description: Contains the basic animation logic to be extended by all other Fx Classes.
+
+license: MIT-style license.
+
+requires:
+- /Chain
+- /Events
+- /Options
+
+provides: [Fx]
+
+...
+*/
+
+var Fx = new Class({
+
+       Implements: [Chain, Events, Options],
+
+       options: {
+               /*
+               onStart: $empty,
+               onCancel: $empty,
+               onComplete: $empty,
+               */
+               fps: 50,
+               unit: false,
+               duration: 500,
+               link: 'ignore'
+       },
+
+       initialize: function(options){
+               this.subject = this.subject || this;
+               this.setOptions(options);
+               this.options.duration = Fx.Durations[this.options.duration] || this.options.duration.toInt();
+               var wait = this.options.wait;
+               if (wait === false) this.options.link = 'cancel';
+       },
+
+       getTransition: function(){
+               return function(p){
+                       return -(Math.cos(Math.PI * p) - 1) / 2;
+               };
+       },
+
+       step: function(){
+               var time = $time();
+               if (time < this.time + this.options.duration){
+                       var delta = this.transition((time - this.time) / this.options.duration);
+                       this.set(this.compute(this.from, this.to, delta));
+               } else {
+                       this.set(this.compute(this.from, this.to, 1));
+                       this.complete();
+               }
+       },
+
+       set: function(now){
+               return now;
+       },
+
+       compute: function(from, to, delta){
+               return Fx.compute(from, to, delta);
+       },
+
+       check: function(){
+               if (!this.timer) return true;
+               switch (this.options.link){
+                       case 'cancel': this.cancel(); return true;
+                       case 'chain': this.chain(this.caller.bind(this, arguments)); return false;
+               }
+               return false;
+       },
+
+       start: function(from, to){
+               if (!this.check(from, to)) return this;
+               this.from = from;
+               this.to = to;
+               this.time = 0;
+               this.transition = this.getTransition();
+               this.startTimer();
+               this.onStart();
+               return this;
+       },
+
+       complete: function(){
+               if (this.stopTimer()) this.onComplete();
+               return this;
+       },
+
+       cancel: function(){
+               if (this.stopTimer()) this.onCancel();
+               return this;
+       },
+
+       onStart: function(){
+               this.fireEvent('start', this.subject);
+       },
+
+       onComplete: function(){
+               this.fireEvent('complete', this.subject);
+               if (!this.callChain()) this.fireEvent('chainComplete', this.subject);
+       },
+
+       onCancel: function(){
+               this.fireEvent('cancel', this.subject).clearChain();
+       },
+
+       pause: function(){
+               this.stopTimer();
+               return this;
+       },
+
+       resume: function(){
+               this.startTimer();
+               return this;
+       },
+
+       stopTimer: function(){
+               if (!this.timer) return false;
+               this.time = $time() - this.time;
+               this.timer = $clear(this.timer);
+               return true;
+       },
+
+       startTimer: function(){
+               if (this.timer) return false;
+               this.time = $time() - this.time;
+               this.timer = this.step.periodical(Math.round(1000 / this.options.fps), this);
+               return true;
+       }
+
+});
+
+Fx.compute = function(from, to, delta){
+       return (to - from) * delta + from;
+};
+
+Fx.Durations = {'short': 250, 'normal': 500, 'long': 1000};
+
+
+/*
+---
+
+script: Fx.CSS.js
+
+description: Contains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements.
+
+license: MIT-style license.
+
+requires:
+- /Fx
+- /Element.Style
+
+provides: [Fx.CSS]
+
+...
+*/
+
+Fx.CSS = new Class({
+
+       Extends: Fx,
+
+       //prepares the base from/to object
+
+       prepare: function(element, property, values){
+               values = $splat(values);
+               var values1 = values[1];
+               if (!$chk(values1)){
+                       values[1] = values[0];
+                       values[0] = element.getStyle(property);
+               }
+               var parsed = values.map(this.parse);
+               return {from: parsed[0], to: parsed[1]};
+       },
+
+       //parses a value into an array
+
+       parse: function(value){
+               value = $lambda(value)();
+               value = (typeof value == 'string') ? value.split(' ') : $splat(value);
+               return value.map(function(val){
+                       val = String(val);
+                       var found = false;
+                       Fx.CSS.Parsers.each(function(parser, key){
+                               if (found) return;
+                               var parsed = parser.parse(val);
+                               if ($chk(parsed)) found = {value: parsed, parser: parser};
+                       });
+                       found = found || {value: val, parser: Fx.CSS.Parsers.String};
+                       return found;
+               });
+       },
+
+       //computes by a from and to prepared objects, using their parsers.
+
+       compute: function(from, to, delta){
+               var computed = [];
+               (Math.min(from.length, to.length)).times(function(i){
+                       computed.push({value: from[i].parser.compute(from[i].value, to[i].value, delta), parser: from[i].parser});
+               });
+               computed.$family = {name: 'fx:css:value'};
+               return computed;
+       },
+
+       //serves the value as settable
+
+       serve: function(value, unit){
+               if ($type(value) != 'fx:css:value') value = this.parse(value);
+               var returned = [];
+               value.each(function(bit){
+                       returned = returned.concat(bit.parser.serve(bit.value, unit));
+               });
+               return returned;
+       },
+
+       //renders the change to an element
+
+       render: function(element, property, value, unit){
+               element.setStyle(property, this.serve(value, unit));
+       },
+
+       //searches inside the page css to find the values for a selector
+
+       search: function(selector){
+               if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector];
+               var to = {};
+               Array.each(document.styleSheets, function(sheet, j){
+                       var href = sheet.href;
+                       if (href && href.contains('://') && !href.contains(document.domain)) return;
+                       var rules = sheet.rules || sheet.cssRules;
+                       Array.each(rules, function(rule, i){
+                               if (!rule.style) return;
+                               var selectorText = (rule.selectorText) ? rule.selectorText.replace(/^\w+/, function(m){
+                                       return m.toLowerCase();
+                               }) : null;
+                               if (!selectorText || !selectorText.test('^' + selector + '$')) return;
+                               Element.Styles.each(function(value, style){
+                                       if (!rule.style[style] || Element.ShortStyles[style]) return;
+                                       value = String(rule.style[style]);
+                                       to[style] = (value.test(/^rgb/)) ? value.rgbToHex() : value;
+                               });
+                       });
+               });
+               return Fx.CSS.Cache[selector] = to;
+       }
+
+});
+
+Fx.CSS.Cache = {};
+
+Fx.CSS.Parsers = new Hash({
+
+       Color: {
+               parse: function(value){
+                       if (value.match(/^#[0-9a-f]{3,6}$/i)) return value.hexToRgb(true);
+                       return ((value = value.match(/(\d+),\s*(\d+),\s*(\d+)/))) ? [value[1], value[2], value[3]] : false;
+               },
+               compute: function(from, to, delta){
+                       return from.map(function(value, i){
+                               return Math.round(Fx.compute(from[i], to[i], delta));
+                       });
+               },
+               serve: function(value){
+                       return value.map(Number);
+               }
+       },
+
+       Number: {
+               parse: parseFloat,
+               compute: Fx.compute,
+               serve: function(value, unit){
+                       return (unit) ? value + unit : value;
+               }
+       },
+
+       String: {
+               parse: $lambda(false),
+               compute: $arguments(1),
+               serve: $arguments(0)
+       }
+
+});
+
+
+/*
+---
+
+script: Fx.Tween.js
+
+description: Formerly Fx.Style, effect to transition any CSS property for an element.
+
+license: MIT-style license.
+
+requires: 
+- /Fx.CSS
+
+provides: [Fx.Tween, Element.fade, Element.highlight]
+
+...
+*/
+
+Fx.Tween = new Class({
+
+       Extends: Fx.CSS,
+
+       initialize: function(element, options){
+               this.element = this.subject = document.id(element);
+               this.parent(options);
+       },
+
+       set: function(property, now){
+               if (arguments.length == 1){
+                       now = property;
+                       property = this.property || this.options.property;
+               }
+               this.render(this.element, property, now, this.options.unit);
+               return this;
+       },
+
+       start: function(property, from, to){
+               if (!this.check(property, from, to)) return this;
+               var args = Array.flatten(arguments);
+               this.property = this.options.property || args.shift();
+               var parsed = this.prepare(this.element, this.property, args);
+               return this.parent(parsed.from, parsed.to);
+       }
+
+});
+
+Element.Properties.tween = {
+
+       set: function(options){
+               var tween = this.retrieve('tween');
+               if (tween) tween.cancel();
+               return this.eliminate('tween').store('tween:options', $extend({link: 'cancel'}, options));
+       },
+
+       get: function(options){
+               if (options || !this.retrieve('tween')){
+                       if (options || !this.retrieve('tween:options')) this.set('tween', options);
+                       this.store('tween', new Fx.Tween(this, this.retrieve('tween:options')));
+               }
+               return this.retrieve('tween');
+       }
+
+};
+
+Element.implement({
+
+       tween: function(property, from, to){
+               this.get('tween').start(arguments);
+               return this;
+       },
+
+       fade: function(how){
+               var fade = this.get('tween'), o = 'opacity', toggle;
+               how = $pick(how, 'toggle');
+               switch (how){
+                       case 'in': fade.start(o, 1); break;
+                       case 'out': fade.start(o, 0); break;
+                       case 'show': fade.set(o, 1); break;
+                       case 'hide': fade.set(o, 0); break;
+                       case 'toggle':
+                               var flag = this.retrieve('fade:flag', this.get('opacity') == 1);
+                               fade.start(o, (flag) ? 0 : 1);
+                               this.store('fade:flag', !flag);
+                               toggle = true;
+                       break;
+                       default: fade.start(o, arguments);
+               }
+               if (!toggle) this.eliminate('fade:flag');
+               return this;
+       },
+
+       highlight: function(start, end){
+               if (!end){
+                       end = this.retrieve('highlight:original', this.getStyle('background-color'));
+                       end = (end == 'transparent') ? '#fff' : end;
+               }
+               var tween = this.get('tween');
+               tween.start('background-color', start || '#ffff88', end).chain(function(){
+                       this.setStyle('background-color', this.retrieve('highlight:original'));
+                       tween.callChain();
+               }.bind(this));
+               return this;
+       }
+
+});
+
+
+/*
+---
+
+script: Fx.Morph.js
+
+description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
+
+license: MIT-style license.
+
+requires:
+- /Fx.CSS
+
+provides: [Fx.Morph]
+
+...
+*/
+
+Fx.Morph = new Class({
+
+       Extends: Fx.CSS,
+
+       initialize: function(element, options){
+               this.element = this.subject = document.id(element);
+               this.parent(options);
+       },
+
+       set: function(now){
+               if (typeof now == 'string') now = this.search(now);
+               for (var p in now) this.render(this.element, p, now[p], this.options.unit);
+               return this;
+       },
+
+       compute: function(from, to, delta){
+               var now = {};
+               for (var p in from) now[p] = this.parent(from[p], to[p], delta);
+               return now;
+       },
+
+       start: function(properties){
+               if (!this.check(properties)) return this;
+               if (typeof properties == 'string') properties = this.search(properties);
+               var from = {}, to = {};
+               for (var p in properties){
+                       var parsed = this.prepare(this.element, p, properties[p]);
+                       from[p] = parsed.from;
+                       to[p] = parsed.to;
+               }
+               return this.parent(from, to);
+       }
+
+});
+
+Element.Properties.morph = {
+
+       set: function(options){
+               var morph = this.retrieve('morph');
+               if (morph) morph.cancel();
+               return this.eliminate('morph').store('morph:options', $extend({link: 'cancel'}, options));
+       },
+
+       get: function(options){
+               if (options || !this.retrieve('morph')){
+                       if (options || !this.retrieve('morph:options')) this.set('morph', options);
+                       this.store('morph', new Fx.Morph(this, this.retrieve('morph:options')));
+               }
+               return this.retrieve('morph');
+       }
+
+};
+
+Element.implement({
+
+       morph: function(props){
+               this.get('morph').start(props);
+               return this;
+       }
+
+});
+
+
+/*
+---
+
+script: Fx.Transitions.js
+
+description: Contains a set of advanced transitions to be used with any of the Fx Classes.
+
+license: MIT-style license.
+
+credits:
+- Easing Equations by Robert Penner, <http://www.robertpenner.com/easing/>, modified and optimized to be used with MooTools.
+
+requires:
+- /Fx
+
+provides: [Fx.Transitions]
+
+...
+*/
+
+Fx.implement({
+
+       getTransition: function(){
+               var trans = this.options.transition || Fx.Transitions.Sine.easeInOut;
+               if (typeof trans == 'string'){
+                       var data = trans.split(':');
+                       trans = Fx.Transitions;
+                       trans = trans[data[0]] || trans[data[0].capitalize()];
+                       if (data[1]) trans = trans['ease' + data[1].capitalize() + (data[2] ? data[2].capitalize() : '')];
+               }
+               return trans;
+       }
+
+});
+
+Fx.Transition = function(transition, params){
+       params = $splat(params);
+       return $extend(transition, {
+               easeIn: function(pos){
+                       return transition(pos, params);
+               },
+               easeOut: function(pos){
+                       return 1 - transition(1 - pos, params);
+               },
+               easeInOut: function(pos){
+                       return (pos <= 0.5) ? transition(2 * pos, params) / 2 : (2 - transition(2 * (1 - pos), params)) / 2;
+               }
+       });
+};
+
+Fx.Transitions = new Hash({
+
+       linear: $arguments(0)
+
+});
+
+Fx.Transitions.extend = function(transitions){
+       for (var transition in transitions) Fx.Transitions[transition] = new Fx.Transition(transitions[transition]);
+};
+
+Fx.Transitions.extend({
+
+       Pow: function(p, x){
+               return Math.pow(p, x[0] || 6);
+       },
+
+       Expo: function(p){
+               return Math.pow(2, 8 * (p - 1));
+       },
+
+       Circ: function(p){
+               return 1 - Math.sin(Math.acos(p));
+       },
+
+       Sine: function(p){
+               return 1 - Math.sin((1 - p) * Math.PI / 2);
+       },
+
+       Back: function(p, x){
+               x = x[0] || 1.618;
+               return Math.pow(p, 2) * ((x + 1) * p - x);
+       },
+
+       Bounce: function(p){
+               var value;
+               for (var a = 0, b = 1; 1; a += b, b /= 2){
+                       if (p >= (7 - 4 * a) / 11){
+                               value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2);
+                               break;
+                       }
+               }
+               return value;
+       },
+
+       Elastic: function(p, x){
+               return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x[0] || 1) / 3);
+       }
+
+});
+
+['Quad', 'Cubic', 'Quart', 'Quint'].each(function(transition, i){
+       Fx.Transitions[transition] = new Fx.Transition(function(p){
+               return Math.pow(p, [i + 2]);
+       });
+});
+
+
+/*
+---
+
+script: Request.js
+
+description: Powerful all purpose Request Class. Uses XMLHTTPRequest.
+
+license: MIT-style license.
+
+requires:
+- /Element
+- /Chain
+- /Events
+- /Options
+- /Browser
+
+provides: [Request]
+
+...
+*/
+
+var Request = new Class({
+
+       Implements: [Chain, Events, Options],
+
+       options: {/*
+               onRequest: $empty,
+               onComplete: $empty,
+               onCancel: $empty,
+               onSuccess: $empty,
+               onFailure: $empty,
+               onException: $empty,*/
+               url: '',
+               data: '',
+               headers: {
+                       'X-Requested-With': 'XMLHttpRequest',
+                       'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+               },
+               async: true,
+               format: false,
+               method: 'post',
+               link: 'ignore',
+               isSuccess: null,
+               emulation: true,
+               urlEncoded: true,
+               encoding: 'utf-8',
+               evalScripts: false,
+               evalResponse: false,
+               noCache: false
+       },
+
+       initialize: function(options){
+               this.xhr = new Browser.Request();
+               this.setOptions(options);
+               this.options.isSuccess = this.options.isSuccess || this.isSuccess;
+               this.headers = new Hash(this.options.headers);
+       },
+
+       onStateChange: function(){
+               if (this.xhr.readyState != 4 || !this.running) return;
+               this.running = false;
+               this.status = 0;
+               $try(function(){
+                       this.status = this.xhr.status;
+               }.bind(this));
+               this.xhr.onreadystatechange = $empty;
+               if (this.options.isSuccess.call(this, this.status)){
+                       this.response = {text: this.xhr.responseText, xml: this.xhr.responseXML};
+                       this.success(this.response.text, this.response.xml);
+               } else {
+                       this.response = {text: null, xml: null};
+                       this.failure();
+               }
+       },
+
+       isSuccess: function(){
+               return ((this.status >= 200) && (this.status < 300));
+       },
+
+       processScripts: function(text){
+               if (this.options.evalResponse || (/(ecma|java)script/).test(this.getHeader('Content-type'))) return $exec(text);
+               return text.stripScripts(this.options.evalScripts);
+       },
+
+       success: function(text, xml){
+               this.onSuccess(this.processScripts(text), xml);
+       },
+
+       onSuccess: function(){
+               this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain();
+       },
+
+       failure: function(){
+               this.onFailure();
+       },
+
+       onFailure: function(){
+               this.fireEvent('complete').fireEvent('failure', this.xhr);
+       },
+
+       setHeader: function(name, value){
+               this.headers.set(name, value);
+               return this;
+       },
+
+       getHeader: function(name){
+               return $try(function(){
+                       return this.xhr.getResponseHeader(name);
+               }.bind(this));
+       },
+
+       check: function(){
+               if (!this.running) return true;
+               switch (this.options.link){
+                       case 'cancel': this.cancel(); return true;
+                       case 'chain': this.chain(this.caller.bind(this, arguments)); return false;
+               }
+               return false;
+       },
+
+       send: function(options){
+               if (!this.check(options)) return this;
+               this.running = true;
+
+               var type = $type(options);
+               if (type == 'string' || type == 'element') options = {data: options};
+
+               var old = this.options;
+               options = $extend({data: old.data, url: old.url, method: old.method}, options);
+               var data = options.data, url = String(options.url), method = options.method.toLowerCase();
+
+               switch ($type(data)){
+                       case 'element': data = document.id(data).toQueryString(); break;
+                       case 'object': case 'hash': data = Hash.toQueryString(data);
+               }
+
+               if (this.options.format){
+                       var format = 'format=' + this.options.format;
+                       data = (data) ? format + '&' + data : format;
+               }
+
+               if (this.options.emulation && !['get', 'post'].contains(method)){
+                       var _method = '_method=' + method;
+                       data = (data) ? _method + '&' + data : _method;
+                       method = 'post';
+               }
+
+               if (this.options.urlEncoded && method == 'post'){
+                       var encoding = (this.options.encoding) ? '; charset=' + this.options.encoding : '';
+                       this.headers.set('Content-type', 'application/x-www-form-urlencoded' + encoding);
+               }
+
+               if (this.options.noCache){
+                       var noCache = 'noCache=' + new Date().getTime();
+                       data = (data) ? noCache + '&' + data : noCache;
+               }
+
+               var trimPosition = url.lastIndexOf('/');
+               if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition);
+
+               if (data && method == 'get'){
+                       url = url + (url.contains('?') ? '&' : '?') + data;
+                       data = null;
+               }
+
+               this.xhr.open(method.toUpperCase(), url, this.options.async);
+
+               this.xhr.onreadystatechange = this.onStateChange.bind(this);
+
+               this.headers.each(function(value, key){
+                       try {
+                               this.xhr.setRequestHeader(key, value);
+                       } catch (e){
+                               this.fireEvent('exception', [key, value]);
+                       }
+               }, this);
+
+               this.fireEvent('request');
+               this.xhr.send(data);
+               if (!this.options.async) this.onStateChange();
+               return this;
+       },
+
+       cancel: function(){
+               if (!this.running) return this;
+               this.running = false;
+               this.xhr.abort();
+               this.xhr.onreadystatechange = $empty;
+               this.xhr = new Browser.Request();
+               this.fireEvent('cancel');
+               return this;
+       }
+
+});
+
+(function(){
+
+var methods = {};
+['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){
+       methods[method] = function(){
+               var params = Array.link(arguments, {url: String.type, data: $defined});
+               return this.send($extend(params, {method: method}));
+       };
+});
+
+Request.implement(methods);
+
+})();
+
+Element.Properties.send = {
+
+       set: function(options){
+               var send = this.retrieve('send');
+               if (send) send.cancel();
+               return this.eliminate('send').store('send:options', $extend({
+                       data: this, link: 'cancel', method: this.get('method') || 'post', url: this.get('action')
+               }, options));
+       },
+
+       get: function(options){
+               if (options || !this.retrieve('send')){
+                       if (options || !this.retrieve('send:options')) this.set('send', options);
+                       this.store('send', new Request(this.retrieve('send:options')));
+               }
+               return this.retrieve('send');
+       }
+
+};
+
+Element.implement({
+
+       send: function(url){
+               var sender = this.get('send');
+               sender.send({data: this, url: url || sender.options.url});
+               return this;
+       }
+
+});
+
+
+/*
+---
+
+script: Request.HTML.js
+
+description: Extends the basic Request Class with additional methods for interacting with HTML responses.
+
+license: MIT-style license.
+
+requires:
+- /Request
+- /Element
+
+provides: [Request.HTML]
+
+...
+*/
+
+Request.HTML = new Class({
+
+       Extends: Request,
+
+       options: {
+               update: false,
+               append: false,
+               evalScripts: true,
+               filter: false
+       },
+
+       processHTML: function(text){
+               var match = text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
+               text = (match) ? match[1] : text;
+
+               var container = new Element('div');
+
+               return $try(function(){
+                       var root = '<root>' + text + '</root>', doc;
+                       if (Browser.Engine.trident){
+                               doc = new ActiveXObject('Microsoft.XMLDOM');
+                               doc.async = false;
+                               doc.loadXML(root);
+                       } else {
+                               doc = new DOMParser().parseFromString(root, 'text/xml');
+                       }
+                       root = doc.getElementsByTagName('root')[0];
+                       if (!root) return null;
+                       for (var i = 0, k = root.childNodes.length; i < k; i++){
+                               var child = Element.clone(root.childNodes[i], true, true);
+                               if (child) container.grab(child);
+                       }
+                       return container;
+               }) || container.set('html', text);
+       },
+
+       success: function(text){
+               var options = this.options, response = this.response;
+
+               response.html = text.stripScripts(function(script){
+                       response.javascript = script;
+               });
+
+               var temp = this.processHTML(response.html);
+
+               response.tree = temp.childNodes;
+               response.elements = temp.getElements('*');
+
+               if (options.filter) response.tree = response.elements.filter(options.filter);
+               if (options.update) document.id(options.update).empty().set('html', response.html);
+               else if (options.append) document.id(options.append).adopt(temp.getChildren());
+               if (options.evalScripts) $exec(response.javascript);
+
+               this.onSuccess(response.tree, response.elements, response.html, response.javascript);
+       }
+
+});
+
+Element.Properties.load = {
+
+       set: function(options){
+               var load = this.retrieve('load');
+               if (load) load.cancel();
+               return this.eliminate('load').store('load:options', $extend({data: this, link: 'cancel', update: this, method: 'get'}, options));
+       },
+
+       get: function(options){
+               if (options || ! this.retrieve('load')){
+                       if (options || !this.retrieve('load:options')) this.set('load', options);
+                       this.store('load', new Request.HTML(this.retrieve('load:options')));
+               }
+               return this.retrieve('load');
+       }
+
+};
+
+Element.implement({
+
+       load: function(){
+               this.get('load').send(Array.link(arguments, {data: Object.type, url: String.type}));
+               return this;
+       }
+
+});
+
+
+/*
+---
+
+script: Request.JSON.js
+
+description: Extends the basic Request Class with additional methods for sending and receiving JSON data.
+
+license: MIT-style license.
+
+requires:
+- /Request JSON
+
+provides: [Request.HTML]
+
+...
+*/
+
+Request.JSON = new Class({
+
+       Extends: Request,
+
+       options: {
+               secure: true
+       },
+
+       initialize: function(options){
+               this.parent(options);
+               this.headers.extend({'Accept': 'application/json', 'X-Request': 'JSON'});
+       },
+
+       success: function(text){
+               this.response.json = JSON.decode(text, this.options.secure);
+               this.onSuccess(this.response.json, text);
+       }
+
+});
diff --git a/ricoClient/js/baselibs/prototype.js b/ricoClient/js/baselibs/prototype.js
new file mode 100644 (file)
index 0000000..9fe6e12
--- /dev/null
@@ -0,0 +1,4874 @@
+/*  Prototype JavaScript framework, version 1.6.1
+ *  (c) 2005-2009 Sam Stephenson
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *  For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+  Version: '1.6.1',
+
+  Browser: (function(){
+    var ua = navigator.userAgent;
+    var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
+    return {
+      IE:             !!window.attachEvent && !isOpera,
+      Opera:          isOpera,
+      WebKit:         ua.indexOf('AppleWebKit/') > -1,
+      Gecko:          ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
+      MobileSafari:   /Apple.*Mobile.*Safari/.test(ua)
+    }
+  })(),
+
+  BrowserFeatures: {
+    XPath: !!document.evaluate,
+    SelectorsAPI: !!document.querySelector,
+    ElementExtensions: (function() {
+      var constructor = window.Element || window.HTMLElement;
+      return !!(constructor && constructor.prototype);
+    })(),
+    SpecificElementExtensions: (function() {
+      if (typeof window.HTMLDivElement !== 'undefined')
+        return true;
+
+      var div = document.createElement('div');
+      var form = document.createElement('form');
+      var isSupported = false;
+
+      if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
+        isSupported = true;
+      }
+
+      div = form = null;
+
+      return isSupported;
+    })()
+  },
+
+  ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+  JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+  emptyFunction: function() { },
+  K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+  Prototype.BrowserFeatures.SpecificElementExtensions = false;
+
+
+var Abstract = { };
+
+
+var Try = {
+  these: function() {
+    var returnValue;
+
+    for (var i = 0, length = arguments.length; i < length; i++) {
+      var lambda = arguments[i];
+      try {
+        returnValue = lambda();
+        break;
+      } catch (e) { }
+    }
+
+    return returnValue;
+  }
+};
+
+/* Based on Alex Arnell's inheritance implementation. */
+
+var Class = (function() {
+  function subclass() {};
+  function create() {
+    var parent = null, properties = $A(arguments);
+    if (Object.isFunction(properties[0]))
+      parent = properties.shift();
+
+    function klass() {
+      this.initialize.apply(this, arguments);
+    }
+
+    Object.extend(klass, Class.Methods);
+    klass.superclass = parent;
+    klass.subclasses = [];
+
+    if (parent) {
+      subclass.prototype = parent.prototype;
+      klass.prototype = new subclass;
+      parent.subclasses.push(klass);
+    }
+
+    for (var i = 0; i < properties.length; i++)
+      klass.addMethods(properties[i]);
+
+    if (!klass.prototype.initialize)
+      klass.prototype.initialize = Prototype.emptyFunction;
+
+    klass.prototype.constructor = klass;
+    return klass;
+  }
+
+  function addMethods(source) {
+    var ancestor   = this.superclass && this.superclass.prototype;
+    var properties = Object.keys(source);
+
+    if (!Object.keys({ toString: true }).length) {
+      if (source.toString != Object.prototype.toString)
+        properties.push("toString");
+      if (source.valueOf != Object.prototype.valueOf)
+        properties.push("valueOf");
+    }
+
+    for (var i = 0, length = properties.length; i < length; i++) {
+      var property = properties[i], value = source[property];
+      if (ancestor && Object.isFunction(value) &&
+          value.argumentNames().first() == "$super") {
+        var method = value;
+        value = (function(m) {
+          return function() { return ancestor[m].apply(this, arguments); };
+        })(property).wrap(method);
+
+        value.valueOf = method.valueOf.bind(method);
+        value.toString = method.toString.bind(method);
+      }
+      this.prototype[property] = value;
+    }
+
+    return this;
+  }
+
+  return {
+    create: create,
+    Methods: {
+      addMethods: addMethods
+    }
+  };
+})();
+(function() {
+
+  var _toString = Object.prototype.toString;
+
+  function extend(destination, source) {
+    for (var property in source)
+      destination[property] = source[property];
+    return destination;
+  }
+
+  function inspect(object) {
+    try {
+      if (isUndefined(object)) return 'undefined';
+      if (object === null) return 'null';
+      return object.inspect ? object.inspect() : String(object);
+    } catch (e) {
+      if (e instanceof RangeError) return '...';
+      throw e;
+    }
+  }
+
+  function toJSON(object) {
+    var type = typeof object;
+    switch (type) {
+      case 'undefined':
+      case 'function':
+      case 'unknown': return;
+      case 'boolean': return object.toString();
+    }
+
+    if (object === null) return 'null';
+    if (object.toJSON) return object.toJSON();
+    if (isElement(object)) return;
+
+    var results = [];
+    for (var property in object) {
+      var value = toJSON(object[property]);
+      if (!isUndefined(value))
+        results.push(property.toJSON() + ': ' + value);
+    }
+
+    return '{' + results.join(', ') + '}';
+  }
+
+  function toQueryString(object) {
+    return $H(object).toQueryString();
+  }
+
+  function toHTML(object) {
+    return object && object.toHTML ? object.toHTML() : String.interpret(object);
+  }
+
+  function keys(object) {
+    var results = [];
+    for (var property in object)
+      results.push(property);
+    return results;
+  }
+
+  function values(object) {
+    var results = [];
+    for (var property in object)
+      results.push(object[property]);
+    return results;
+  }
+
+  function clone(object) {
+    return extend({ }, object);
+  }
+
+  function isElement(object) {
+    return !!(object && object.nodeType == 1);
+  }
+
+  function isArray(object) {
+    return _toString.call(object) == "[object Array]";
+  }
+
+
+  function isHash(object) {
+    return object instanceof Hash;
+  }
+
+  function isFunction(object) {
+    return typeof object === "function";
+  }
+
+  function isString(object) {
+    return _toString.call(object) == "[object String]";
+  }
+
+  function isNumber(object) {
+    return _toString.call(object) == "[object Number]";
+  }
+
+  function isUndefined(object) {
+    return typeof object === "undefined";
+  }
+
+  extend(Object, {
+    extend:        extend,
+    inspect:       inspect,
+    toJSON:        toJSON,
+    toQueryString: toQueryString,
+    toHTML:        toHTML,
+    keys:          keys,
+    values:        values,
+    clone:         clone,
+    isElement:     isElement,
+    isArray:       isArray,
+    isHash:        isHash,
+    isFunction:    isFunction,
+    isString:      isString,
+    isNumber:      isNumber,
+    isUndefined:   isUndefined
+  });
+})();
+Object.extend(Function.prototype, (function() {
+  var slice = Array.prototype.slice;
+
+  function update(array, args) {
+    var arrayLength = array.length, length = args.length;
+    while (length--) array[arrayLength + length] = args[length];
+    return array;
+  }
+
+  function merge(array, args) {
+    array = slice.call(array, 0);
+    return update(array, args);
+  }
+
+  function argumentNames() {
+    var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
+      .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
+      .replace(/\s+/g, '').split(',');
+    return names.length == 1 && !names[0] ? [] : names;
+  }
+
+  function bind(context) {
+    if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
+    var __method = this, args = slice.call(arguments, 1);
+    return function() {
+      var a = merge(args, arguments);
+      return __method.apply(context, a);
+    }
+  }
+
+  function bindAsEventListener(context) {
+    var __method = this, args = slice.call(arguments, 1);
+    return function(event) {
+      var a = update([event || window.event], args);
+      return __method.apply(context, a);
+    }
+  }
+
+  function curry() {
+    if (!arguments.length) return this;
+    var __method = this, args = slice.call(arguments, 0);
+    return function() {
+      var a = merge(args, arguments);
+      return __method.apply(this, a);
+    }
+  }
+
+  function delay(timeout) {
+    var __method = this, args = slice.call(arguments, 1);
+    timeout = timeout * 1000
+    return window.setTimeout(function() {
+      return __method.apply(__method, args);
+    }, timeout);
+  }
+
+  function defer() {
+    var args = update([0.01], arguments);
+    return this.delay.apply(this, args);
+  }
+
+  function wrap(wrapper) {
+    var __method = this;
+    return function() {
+      var a = update([__method.bind(this)], arguments);
+      return wrapper.apply(this, a);
+    }
+  }
+
+  function methodize() {
+    if (this._methodized) return this._methodized;
+    var __method = this;
+    return this._methodized = function() {
+      var a = update([this], arguments);
+      return __method.apply(null, a);
+    };
+  }
+
+  return {
+    argumentNames:       argumentNames,
+    bind:                bind,
+    bindAsEventListener: bindAsEventListener,
+    curry:               curry,
+    delay:               delay,
+    defer:               defer,
+    wrap:                wrap,
+    methodize:           methodize
+  }
+})());
+
+
+Date.prototype.toJSON = function() {
+  return '"' + this.getUTCFullYear() + '-' +
+    (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+    this.getUTCDate().toPaddedString(2) + 'T' +
+    this.getUTCHours().toPaddedString(2) + ':' +
+    this.getUTCMinutes().toPaddedString(2) + ':' +
+    this.getUTCSeconds().toPaddedString(2) + 'Z"';
+};
+
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+  return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+var PeriodicalExecuter = Class.create({
+  initialize: function(callback, frequency) {
+    this.callback = callback;
+    this.frequency = frequency;
+    this.currentlyExecuting = false;
+
+    this.registerCallback();
+  },
+
+  registerCallback: function() {
+    this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+  },
+
+  execute: function() {
+    this.callback(this);
+  },
+
+  stop: function() {
+    if (!this.timer) return;
+    clearInterval(this.timer);
+    this.timer = null;
+  },
+
+  onTimerEvent: function() {
+    if (!this.currentlyExecuting) {
+      try {
+        this.currentlyExecuting = true;
+        this.execute();
+        this.currentlyExecuting = false;
+      } catch(e) {
+        this.currentlyExecuting = false;
+        throw e;
+      }
+    }
+  }
+});
+Object.extend(String, {
+  interpret: function(value) {
+    return value == null ? '' : String(value);
+  },
+  specialChar: {
+    '\b': '\\b',
+    '\t': '\\t',
+    '\n': '\\n',
+    '\f': '\\f',
+    '\r': '\\r',
+    '\\': '\\\\'
+  }
+});
+
+Object.extend(String.prototype, (function() {
+
+  function prepareReplacement(replacement) {
+    if (Object.isFunction(replacement)) return replacement;
+    var template = new Template(replacement);
+    return function(match) { return template.evaluate(match) };
+  }
+
+  function gsub(pattern, replacement) {
+    var result = '', source = this, match;
+    replacement = prepareReplacement(replacement);
+
+    if (Object.isString(pattern))
+      pattern = RegExp.escape(pattern);
+
+    if (!(pattern.length || pattern.source)) {
+      replacement = replacement('');
+      return replacement + source.split('').join(replacement) + replacement;
+    }
+
+    while (source.length > 0) {
+      if (match = source.match(pattern)) {
+        result += source.slice(0, match.index);
+        result += String.interpret(replacement(match));
+        source  = source.slice(match.index + match[0].length);
+      } else {
+        result += source, source = '';
+      }
+    }
+    return result;
+  }
+
+  function sub(pattern, replacement, count) {
+    replacement = prepareReplacement(replacement);
+    count = Object.isUndefined(count) ? 1 : count;
+
+    return this.gsub(pattern, function(match) {
+      if (--count < 0) return match[0];
+      return replacement(match);
+    });
+  }
+
+  function scan(pattern, iterator) {
+    this.gsub(pattern, iterator);
+    return String(this);
+  }
+
+  function truncate(length, truncation) {
+    length = length || 30;
+    truncation = Object.isUndefined(truncation) ? '...' : truncation;
+    return this.length > length ?
+      this.slice(0, length - truncation.length) + truncation : String(this);
+  }
+
+  function strip() {
+    return this.replace(/^\s+/, '').replace(/\s+$/, '');
+  }
+
+  function stripTags() {
+    return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
+  }
+
+  function stripScripts() {
+    return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+  }
+
+  function extractScripts() {
+    var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+    return (this.match(matchAll) || []).map(function(scriptTag) {
+      return (scriptTag.match(matchOne) || ['', ''])[1];
+    });
+  }
+
+  function evalScripts() {
+    return this.extractScripts().map(function(script) { return eval(script) });
+  }
+
+  function escapeHTML() {
+    return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+  }
+
+  function unescapeHTML() {
+    return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');
+  }
+
+
+  function toQueryParams(separator) {
+    var match = this.strip().match(/([^?#]*)(#.*)?$/);
+    if (!match) return { };
+
+    return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+      if ((pair = pair.split('='))[0]) {
+        var key = decodeURIComponent(pair.shift());
+        var value = pair.length > 1 ? pair.join('=') : pair[0];
+        if (value != undefined) value = decodeURIComponent(value);
+
+        if (key in hash) {
+          if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+          hash[key].push(value);
+        }
+        else hash[key] = value;
+      }
+      return hash;
+    });
+  }
+
+  function toArray() {
+    return this.split('');
+  }
+
+  function succ() {
+    return this.slice(0, this.length - 1) +
+      String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+  }
+
+  function times(count) {
+    return count < 1 ? '' : new Array(count + 1).join(this);
+  }
+
+  function camelize() {
+    var parts = this.split('-'), len = parts.length;
+    if (len == 1) return parts[0];
+
+    var camelized = this.charAt(0) == '-'
+      ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+      : parts[0];
+
+    for (var i = 1; i < len; i++)
+      camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+    return camelized;
+  }
+
+  function capitalize() {
+    return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+  }
+
+  function underscore() {
+    return this.replace(/::/g, '/')
+               .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
+               .replace(/([a-z\d])([A-Z])/g, '$1_$2')
+               .replace(/-/g, '_')
+               .toLowerCase();
+  }
+
+  function dasherize() {
+    return this.replace(/_/g, '-');
+  }
+
+  function inspect(useDoubleQuotes) {
+    var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
+      if (character in String.specialChar) {
+        return String.specialChar[character];
+      }
+      return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
+    });
+    if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+    return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+  }
+
+  function toJSON() {
+    return this.inspect(true);
+  }
+
+  function unfilterJSON(filter) {
+    return this.replace(filter || Prototype.JSONFilter, '$1');
+  }
+
+  function isJSON() {
+    var str = this;
+    if (str.blank()) return false;
+    str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
+    return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
+  }
+
+  function evalJSON(sanitize) {
+    var json = this.unfilterJSON();
+    try {
+      if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+    } catch (e) { }
+    throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+  }
+
+  function include(pattern) {
+    return this.indexOf(pattern) > -1;
+  }
+
+  function startsWith(pattern) {
+    return this.indexOf(pattern) === 0;
+  }
+
+  function endsWith(pattern) {
+    var d = this.length - pattern.length;
+    return d >= 0 && this.lastIndexOf(pattern) === d;
+  }
+
+  function empty() {
+    return this == '';
+  }
+
+  function blank() {
+    return /^\s*$/.test(this);
+  }
+
+  function interpolate(object, pattern) {
+    return new Template(this, pattern).evaluate(object);
+  }
+
+  return {
+    gsub:           gsub,
+    sub:            sub,
+    scan:           scan,
+    truncate:       truncate,
+    strip:          String.prototype.trim ? String.prototype.trim : strip,
+    stripTags:      stripTags,
+    stripScripts:   stripScripts,
+    extractScripts: extractScripts,
+    evalScripts:    evalScripts,
+    escapeHTML:     escapeHTML,
+    unescapeHTML:   unescapeHTML,
+    toQueryParams:  toQueryParams,
+    parseQuery:     toQueryParams,
+    toArray:        toArray,
+    succ:           succ,
+    times:          times,
+    camelize:       camelize,
+    capitalize:     capitalize,
+    underscore:     underscore,
+    dasherize:      dasherize,
+    inspect:        inspect,
+    toJSON:         toJSON,
+    unfilterJSON:   unfilterJSON,
+    isJSON:         isJSON,
+    evalJSON:       evalJSON,
+    include:        include,
+    startsWith:     startsWith,
+    endsWith:       endsWith,
+    empty:          empty,
+    blank:          blank,
+    interpolate:    interpolate
+  };
+})());
+
+var Template = Class.create({
+  initialize: function(template, pattern) {
+    this.template = template.toString();
+    this.pattern = pattern || Template.Pattern;
+  },
+
+  evaluate: function(object) {
+    if (object && Object.isFunction(object.toTemplateReplacements))
+      object = object.toTemplateReplacements();
+
+    return this.template.gsub(this.pattern, function(match) {
+      if (object == null) return (match[1] + '');
+
+      var before = match[1] || '';
+      if (before == '\\') return match[2];
+
+      var ctx = object, expr = match[3];
+      var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+      match = pattern.exec(expr);
+      if (match == null) return before;
+
+      while (match != null) {
+        var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
+        ctx = ctx[comp];
+        if (null == ctx || '' == match[3]) break;
+        expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+        match = pattern.exec(expr);
+      }
+
+      return before + String.interpret(ctx);
+    });
+  }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = (function() {
+  function each(iterator, context) {
+    var index = 0;
+    try {
+      this._each(function(value) {
+        iterator.call(context, value, index++);
+      });
+    } catch (e) {
+      if (e != $break) throw e;
+    }
+    return this;
+  }
+
+  function eachSlice(number, iterator, context) {
+    var index = -number, slices = [], array = this.toArray();
+    if (number < 1) return array;
+    while ((index += number) < array.length)
+      slices.push(array.slice(index, index+number));
+    return slices.collect(iterator, context);
+  }
+
+  function all(iterator, context) {
+    iterator = iterator || Prototype.K;
+    var result = true;
+    this.each(function(value, index) {
+      result = result && !!iterator.call(context, value, index);
+      if (!result) throw $break;
+    });
+    return result;
+  }
+
+  function any(iterator, context) {
+    iterator = iterator || Prototype.K;
+    var result = false;
+    this.each(function(value, index) {
+      if (result = !!iterator.call(context, value, index))
+        throw $break;
+    });
+    return result;
+  }
+
+  function collect(iterator, context) {
+    iterator = iterator || Prototype.K;
+    var results = [];
+    this.each(function(value, index) {
+      results.push(iterator.call(context, value, index));
+    });
+    return results;
+  }
+
+  function detect(iterator, context) {
+    var result;
+    this.each(function(value, index) {
+      if (iterator.call(context, value, index)) {
+        result = value;
+        throw $break;
+      }
+    });
+    return result;
+  }
+
+  function findAll(iterator, context) {
+    var results = [];
+    this.each(function(value, index) {
+      if (iterator.call(context, value, index))
+        results.push(value);
+    });
+    return results;
+  }
+
+  function grep(filter, iterator, context) {
+    iterator = iterator || Prototype.K;
+    var results = [];
+
+    if (Object.isString(filter))
+      filter = new RegExp(RegExp.escape(filter));
+
+    this.each(function(value, index) {
+      if (filter.match(value))
+        results.push(iterator.call(context, value, index));
+    });
+    return results;
+  }
+
+  function include(object) {
+    if (Object.isFunction(this.indexOf))
+      if (this.indexOf(object) != -1) return true;
+
+    var found = false;
+    this.each(function(value) {
+      if (value == object) {
+        found = true;
+        throw $break;
+      }
+    });
+    return found;
+  }
+
+  function inGroupsOf(number, fillWith) {
+    fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+    return this.eachSlice(number, function(slice) {
+      while(slice.length < number) slice.push(fillWith);
+      return slice;
+    });
+  }
+
+  function inject(memo, iterator, context) {
+    this.each(function(value, index) {
+      memo = iterator.call(context, memo, value, index);
+    });
+    return memo;
+  }
+
+  function invoke(method) {
+    var args = $A(arguments).slice(1);
+    return this.map(function(value) {
+      return value[method].apply(value, args);
+    });
+  }
+
+  function max(iterator, context) {
+    iterator = iterator || Prototype.K;
+    var result;
+    this.each(function(value, index) {
+      value = iterator.call(context, value, index);
+      if (result == null || value >= result)
+        result = value;
+    });
+    return result;
+  }
+
+  function min(iterator, context) {
+    iterator = iterator || Prototype.K;
+    var result;
+    this.each(function(value, index) {
+      value = iterator.call(context, value, index);
+      if (result == null || value < result)
+        result = value;
+    });
+    return result;
+  }
+
+  function partition(iterator, context) {
+    iterator = iterator || Prototype.K;
+    var trues = [], falses = [];
+    this.each(function(value, index) {
+      (iterator.call(context, value, index) ?
+        trues : falses).push(value);
+    });
+    return [trues, falses];
+  }
+
+  function pluck(property) {
+    var results = [];
+    this.each(function(value) {
+      results.push(value[property]);
+    });
+    return results;
+  }
+
+  function reject(iterator, context) {
+    var results = [];
+    this.each(function(value, index) {
+      if (!iterator.call(context, value, index))
+        results.push(value);
+    });
+    return results;
+  }
+
+  function sortBy(iterator, context) {
+    return this.map(function(value, index) {
+      return {
+        value: value,
+        criteria: iterator.call(context, value, index)
+      };
+    }).sort(function(left, right) {
+      var a = left.criteria, b = right.criteria;
+      return a < b ? -1 : a > b ? 1 : 0;
+    }).pluck('value');
+  }
+
+  function toArray() {
+    return this.map();
+  }
+
+  function zip() {
+    var iterator = Prototype.K, args = $A(arguments);
+    if (Object.isFunction(args.last()))
+      iterator = args.pop();
+
+    var collections = [this].concat(args).map($A);
+    return this.map(function(value, index) {
+      return iterator(collections.pluck(index));
+    });
+  }
+
+  function size() {
+    return this.toArray().length;
+  }
+
+  function inspect() {
+    return '#<Enumerable:' + this.toArray().inspect() + '>';
+  }
+
+
+
+
+
+
+
+
+
+  return {
+    each:       each,
+    eachSlice:  eachSlice,
+    all:        all,
+    every:      all,
+    any:        any,
+    some:       any,
+    collect:    collect,
+    map:        collect,
+    detect:     detect,
+    findAll:    findAll,
+    select:     findAll,
+    filter:     findAll,
+    grep:       grep,
+    include:    include,
+    member:     include,
+    inGroupsOf: inGroupsOf,
+    inject:     inject,
+    invoke:     invoke,
+    max:        max,
+    min:        min,
+    partition:  partition,
+    pluck:      pluck,
+    reject:     reject,
+    sortBy:     sortBy,
+    toArray:    toArray,
+    entries:    toArray,
+    zip:        zip,
+    size:       size,
+    inspect:    inspect,
+    find:       detect
+  };
+})();
+function $A(iterable) {
+  if (!iterable) return [];
+  if ('toArray' in Object(iterable)) return iterable.toArray();
+  var length = iterable.length || 0, results = new Array(length);
+  while (length--) results[length] = iterable[length];
+  return results;
+}
+
+function $w(string) {
+  if (!Object.isString(string)) return [];
+  string = string.strip();
+  return string ? string.split(/\s+/) : [];
+}
+
+Array.from = $A;
+
+
+(function() {
+  var arrayProto = Array.prototype,
+      slice = arrayProto.slice,
+      _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
+
+  function each(iterator) {
+    for (var i = 0, length = this.length; i < length; i++)
+      iterator(this[i]);
+  }
+  if (!_each) _each = each;
+
+  function clear() {
+    this.length = 0;
+    return this;
+  }
+
+  function first() {
+    return this[0];
+  }
+
+  function last() {
+    return this[this.length - 1];
+  }
+
+  function compact() {
+    return this.select(function(value) {
+      return value != null;
+    });
+  }
+
+  function flatten() {
+    return this.inject([], function(array, value) {
+      if (Object.isArray(value))
+        return array.concat(value.flatten());
+      array.push(value);
+      return array;
+    });
+  }
+
+  function without() {
+    var values = slice.call(arguments, 0);
+    return this.select(function(value) {
+      return !values.include(value);
+    });
+  }
+
+  function reverse(inline) {
+    return (inline !== false ? this : this.toArray())._reverse();
+  }
+
+  function uniq(sorted) {
+    return this.inject([], function(array, value, index) {
+      if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+        array.push(value);
+      return array;
+    });
+  }
+
+  function intersect(array) {
+    return this.uniq().findAll(function(item) {
+      return array.detect(function(value) { return item === value });
+    });
+  }
+
+
+  function clone() {
+    return slice.call(this, 0);
+  }
+
+  function size() {
+    return this.length;
+  }
+
+  function inspect() {
+    return '[' + this.map(Object.inspect).join(', ') + ']';
+  }
+
+  function toJSON() {
+    var results = [];
+    this.each(function(object) {
+      var value = Object.toJSON(object);
+      if (!Object.isUndefined(value)) results.push(value);
+    });
+    return '[' + results.join(', ') + ']';
+  }
+
+  function indexOf(item, i) {
+    i || (i = 0);
+    var length = this.length;
+    if (i < 0) i = length + i;
+    for (; i < length; i++)
+      if (this[i] === item) return i;
+    return -1;
+  }
+
+  function lastIndexOf(item, i) {
+    i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+    var n = this.slice(0, i).reverse().indexOf(item);
+    return (n < 0) ? n : i - n - 1;
+  }
+
+  function concat() {
+    var array = slice.call(this, 0), item;
+    for (var i = 0, length = arguments.length; i < length; i++) {
+      item = arguments[i];
+      if (Object.isArray(item) && !('callee' in item)) {
+        for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
+          array.push(item[j]);
+      } else {
+        array.push(item);
+      }
+    }
+    return array;
+  }
+
+  Object.extend(arrayProto, Enumerable);
+
+  if (!arrayProto._reverse)
+    arrayProto._reverse = arrayProto.reverse;
+
+  Object.extend(arrayProto, {
+    _each:     _each,
+    clear:     clear,
+    first:     first,
+    last:      last,
+    compact:   compact,
+    flatten:   flatten,
+    without:   without,
+    reverse:   reverse,
+    uniq:      uniq,
+    intersect: intersect,
+    clone:     clone,
+    toArray:   clone,
+    size:      size,
+    inspect:   inspect,
+    toJSON:    toJSON
+  });
+
+  var CONCAT_ARGUMENTS_BUGGY = (function() {
+    return [].concat(arguments)[0][0] !== 1;
+  })(1,2)
+
+  if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
+
+  if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
+  if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
+})();
+function $H(object) {
+  return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+  function initialize(object) {
+    this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+  }
+
+  function _each(iterator) {
+    for (var key in this._object) {
+      var value = this._object[key], pair = [key, value];
+      pair.key = key;
+      pair.value = value;
+      iterator(pair);
+    }
+  }
+
+  function set(key, value) {
+    return this._object[key] = value;
+  }
+
+  function get(key) {
+    if (this._object[key] !== Object.prototype[key])
+      return this._object[key];
+  }
+
+  function unset(key) {
+    var value = this._object[key];
+    delete this._object[key];
+    return value;
+  }
+
+  function toObject() {
+    return Object.clone(this._object);
+  }
+
+  function keys() {
+    return this.pluck('key');
+  }
+
+  function values() {
+    return this.pluck('value');
+  }
+
+  function index(value) {
+    var match = this.detect(function(pair) {
+      return pair.value === value;
+    });
+    return match && match.key;
+  }
+
+  function merge(object) {
+    return this.clone().update(object);
+  }
+
+  function update(object) {
+    return new Hash(object).inject(this, function(result, pair) {
+      result.set(pair.key, pair.value);
+      return result;
+    });
+  }
+
+  function toQueryPair(key, value) {
+    if (Object.isUndefined(value)) return key;
+    return key + '=' + encodeURIComponent(String.interpret(value));
+  }
+
+  function toQueryString() {
+    return this.inject([], function(results, pair) {
+      var key = encodeURIComponent(pair.key), values = pair.value;
+
+      if (values && typeof values == 'object') {
+        if (Object.isArray(values))
+          return results.concat(values.map(toQueryPair.curry(key)));
+      } else results.push(toQueryPair(key, values));
+      return results;
+    }).join('&');
+  }
+
+  function inspect() {
+    return '#<Hash:{' + this.map(function(pair) {
+      return pair.map(Object.inspect).join(': ');
+    }).join(', ') + '}>';
+  }
+
+  function toJSON() {
+    return Object.toJSON(this.toObject());
+  }
+
+  function clone() {
+    return new Hash(this);
+  }
+
+  return {
+    initialize:             initialize,
+    _each:                  _each,
+    set:                    set,
+    get:                    get,
+    unset:                  unset,
+    toObject:               toObject,
+    toTemplateReplacements: toObject,
+    keys:                   keys,
+    values:                 values,
+    index:                  index,
+    merge:                  merge,
+    update:                 update,
+    toQueryString:          toQueryString,
+    inspect:                inspect,
+    toJSON:                 toJSON,
+    clone:                  clone
+  };
+})());
+
+Hash.from = $H;
+Object.extend(Number.prototype, (function() {
+  function toColorPart() {
+    return this.toPaddedString(2, 16);
+  }
+
+  function succ() {
+    return this + 1;
+  }
+
+  function times(iterator, context) {
+    $R(0, this, true).each(iterator, context);
+    return this;
+  }
+
+  function toPaddedString(length, radix) {
+    var string = this.toString(radix || 10);
+    return '0'.times(length - string.length) + string;
+  }
+
+  function toJSON() {
+    return isFinite(this) ? this.toString() : 'null';
+  }
+
+  function abs() {
+    return Math.abs(this);
+  }
+
+  function round() {
+    return Math.round(this);
+  }
+
+  function ceil() {
+    return Math.ceil(this);
+  }
+
+  function floor() {
+    return Math.floor(this);
+  }
+
+  return {
+    toColorPart:    toColorPart,
+    succ:           succ,
+    times:          times,
+    toPaddedString: toPaddedString,
+    toJSON:         toJSON,
+    abs:            abs,
+    round:          round,
+    ceil:           ceil,
+    floor:          floor
+  };
+})());
+
+function $R(start, end, exclusive) {
+  return new ObjectRange(start, end, exclusive);
+}
+
+var ObjectRange = Class.create(Enumerable, (function() {
+  function initialize(start, end, exclusive) {
+    this.start = start;
+    this.end = end;
+    this.exclusive = exclusive;
+  }
+
+  function _each(iterator) {
+    var value = this.start;
+    while (this.include(value)) {
+      iterator(value);
+      value = value.succ();
+    }
+  }
+
+  function include(value) {
+    if (value < this.start)
+      return false;
+    if (this.exclusive)
+      return value < this.end;
+    return value <= this.end;
+  }
+
+  return {
+    initialize: initialize,
+    _each:      _each,
+    include:    include
+  };
+})());
+
+
+
+var Ajax = {
+  getTransport: function() {
+    return Try.these(
+      function() {return new XMLHttpRequest()},
+      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+      function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+    ) || false;
+  },
+
+  activeRequestCount: 0
+};
+
+Ajax.Responders = {
+  responders: [],
+
+  _each: function(iterator) {
+    this.responders._each(iterator);
+  },
+
+  register: function(responder) {
+    if (!this.include(responder))
+      this.responders.push(responder);
+  },
+
+  unregister: function(responder) {
+    this.responders = this.responders.without(responder);
+  },
+
+  dispatch: function(callback, request, transport, json) {
+    this.each(function(responder) {
+      if (Object.isFunction(responder[callback])) {
+        try {
+          responder[callback].apply(responder, [request, transport, json]);
+        } catch (e) { }
+      }
+    });
+  }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+  onCreate:   function() { Ajax.activeRequestCount++ },
+  onComplete: function() { Ajax.activeRequestCount-- }
+});
+Ajax.Base = Class.create({
+  initialize: function(options) {
+    this.options = {
+      method:       'post',
+      asynchronous: true,
+      contentType:  'application/x-www-form-urlencoded',
+      encoding:     'UTF-8',
+      parameters:   '',
+      evalJSON:     true,
+      evalJS:       true
+    };
+    Object.extend(this.options, options || { });
+
+    this.options.method = this.options.method.toLowerCase();
+
+    if (Object.isString(this.options.parameters))
+      this.options.parameters = this.options.parameters.toQueryParams();
+    else if (Object.isHash(this.options.parameters))
+      this.options.parameters = this.options.parameters.toObject();
+  }
+});
+Ajax.Request = Class.create(Ajax.Base, {
+  _complete: false,
+
+  initialize: function($super, url, options) {
+    $super(options);
+    this.transport = Ajax.getTransport();
+    this.request(url);
+  },
+
+  request: function(url) {
+    this.url = url;
+    this.method = this.options.method;
+    var params = Object.clone(this.options.parameters);
+
+    if (!['get', 'post'].include(this.method)) {
+      params['_method'] = this.method;
+      this.method = 'post';
+    }
+
+    this.parameters = params;
+
+    if (params = Object.toQueryString(params)) {
+      if (this.method == 'get')
+        this.url += (this.url.include('?') ? '&' : '?') + params;
+      else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+        params += '&_=';
+    }
+
+    try {
+      var response = new Ajax.Response(this);
+      if (this.options.onCreate) this.options.onCreate(response);
+      Ajax.Responders.dispatch('onCreate', this, response);
+
+      this.transport.open(this.method.toUpperCase(), this.url,
+        this.options.asynchronous);
+
+      if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+      this.transport.onreadystatechange = this.onStateChange.bind(this);
+      this.setRequestHeaders();
+
+      this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+      this.transport.send(this.body);
+
+      /* Force Firefox to handle ready state 4 for synchronous requests */
+      if (!this.options.asynchronous && this.transport.overrideMimeType)
+        this.onStateChange();
+
+    }
+    catch (e) {
+      this.dispatchException(e);
+    }
+  },
+
+  onStateChange: function() {
+    var readyState = this.transport.readyState;
+    if (readyState > 1 && !((readyState == 4) && this._complete))
+      this.respondToReadyState(this.transport.readyState);
+  },
+
+  setRequestHeaders: function() {
+    var headers = {
+      'X-Requested-With': 'XMLHttpRequest',
+      'X-Prototype-Version': Prototype.Version,
+      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+    };
+
+    if (this.method == 'post') {
+      headers['Content-type'] = this.options.contentType +
+        (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+      /* Force "Connection: close" for older Mozilla browsers to work
+       * around a bug where XMLHttpRequest sends an incorrect
+       * Content-length header. See Mozilla Bugzilla #246651.
+       */
+      if (this.transport.overrideMimeType &&
+          (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+            headers['Connection'] = 'close';
+    }
+
+    if (typeof this.options.requestHeaders == 'object') {
+      var extras = this.options.requestHeaders;
+
+      if (Object.isFunction(extras.push))
+        for (var i = 0, length = extras.length; i < length; i += 2)
+          headers[extras[i]] = extras[i+1];
+      else
+        $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+    }
+
+    for (var name in headers)
+      this.transport.setRequestHeader(name, headers[name]);
+  },
+
+  success: function() {
+    var status = this.getStatus();
+    return !status || (status >= 200 && status < 300);
+  },
+
+  getStatus: function() {
+    try {
+      return this.transport.status || 0;
+    } catch (e) { return 0 }
+  },
+
+  respondToReadyState: function(readyState) {
+    var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+    if (state == 'Complete') {
+      try {
+        this._complete = true;
+        (this.options['on' + response.status]
+         || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+         || Prototype.emptyFunction)(response, response.headerJSON);
+      } catch (e) {
+        this.dispatchException(e);
+      }
+
+      var contentType = response.getHeader('Content-type');
+      if (this.options.evalJS == 'force'
+          || (this.options.evalJS && this.isSameOrigin() && contentType
+          && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+        this.evalResponse();
+    }
+
+    try {
+      (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+      Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+    } catch (e) {
+      this.dispatchException(e);
+    }
+
+    if (state == 'Complete') {
+      this.transport.onreadystatechange = Prototype.emptyFunction;
+    }
+  },
+
+  isSameOrigin: function() {
+    var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+    return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+      protocol: location.protocol,
+      domain: document.domain,
+      port: location.port ? ':' + location.port : ''
+    }));
+  },
+
+  getHeader: function(name) {
+    try {
+      return this.transport.getResponseHeader(name) || null;
+    } catch (e) { return null; }
+  },
+
+  evalResponse: function() {
+    try {
+      return eval((this.transport.responseText || '').unfilterJSON());
+    } catch (e) {
+      this.dispatchException(e);
+    }
+  },
+
+  dispatchException: function(exception) {
+    (this.options.onException || Prototype.emptyFunction)(this, exception);
+    Ajax.Responders.dispatch('onException', this, exception);
+  }
+});
+
+Ajax.Request.Events =
+  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+
+
+
+
+
+
+
+Ajax.Response = Class.create({
+  initialize: function(request){
+    this.request = request;
+    var transport  = this.transport  = request.transport,
+        readyState = this.readyState = transport.readyState;
+
+    if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+      this.status       = this.getStatus();
+      this.statusText   = this.getStatusText();
+      this.responseText = String.interpret(transport.responseText);
+      this.headerJSON   = this._getHeaderJSON();
+    }
+
+    if(readyState == 4) {
+      var xml = transport.responseXML;
+      this.responseXML  = Object.isUndefined(xml) ? null : xml;
+      this.responseJSON = this._getResponseJSON();
+    }
+  },
+
+  status:      0,
+
+  statusText: '',
+
+  getStatus: Ajax.Request.prototype.getStatus,
+
+  getStatusText: function() {
+    try {
+      return this.transport.statusText || '';
+    } catch (e) { return '' }
+  },
+
+  getHeader: Ajax.Request.prototype.getHeader,
+
+  getAllHeaders: function() {
+    try {
+      return this.getAllResponseHeaders();
+    } catch (e) { return null }
+  },
+
+  getResponseHeader: function(name) {
+    return this.transport.getResponseHeader(name);
+  },
+
+  getAllResponseHeaders: function() {
+    return this.transport.getAllResponseHeaders();
+  },
+
+  _getHeaderJSON: function() {
+    var json = this.getHeader('X-JSON');
+    if (!json) return null;
+    json = decodeURIComponent(escape(json));
+    try {
+      return json.evalJSON(this.request.options.sanitizeJSON ||
+        !this.request.isSameOrigin());
+    } catch (e) {
+      this.request.dispatchException(e);
+    }
+  },
+
+  _getResponseJSON: function() {
+    var options = this.request.options;
+    if (!options.evalJSON || (options.evalJSON != 'force' &&
+      !(this.getHeader('Content-type') || '').include('application/json')) ||
+        this.responseText.blank())
+          return null;
+    try {
+      return this.responseText.evalJSON(options.sanitizeJSON ||
+        !this.request.isSameOrigin());
+    } catch (e) {
+      this.request.dispatchException(e);
+    }
+  }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+  initialize: function($super, container, url, options) {
+    this.container = {
+      success: (container.success || container),
+      failure: (container.failure || (container.success ? null : container))
+    };
+
+    options = Object.clone(options);
+    var onComplete = options.onComplete;
+    options.onComplete = (function(response, json) {
+      this.updateContent(response.responseText);
+      if (Object.isFunction(onComplete)) onComplete(response, json);
+    }).bind(this);
+
+    $super(url, options);
+  },
+
+  updateContent: function(responseText) {
+    var receiver = this.container[this.success() ? 'success' : 'failure'],
+        options = this.options;
+
+    if (!options.evalScripts) responseText = responseText.stripScripts();
+
+    if (receiver = $(receiver)) {
+      if (options.insertion) {
+        if (Object.isString(options.insertion)) {
+          var insertion = { }; insertion[options.insertion] = responseText;
+          receiver.insert(insertion);
+        }
+        else options.insertion(receiver, responseText);
+      }
+      else receiver.update(responseText);
+    }
+  }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+  initialize: function($super, container, url, options) {
+    $super(options);
+    this.onComplete = this.options.onComplete;
+
+    this.frequency = (this.options.frequency || 2);
+    this.decay = (this.options.decay || 1);
+
+    this.updater = { };
+    this.container = container;
+    this.url = url;
+
+    this.start();
+  },
+
+  start: function() {
+    this.options.onComplete = this.updateComplete.bind(this);
+    this.onTimerEvent();
+  },
+
+  stop: function() {
+    this.updater.options.onComplete = undefined;
+    clearTimeout(this.timer);
+    (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+  },
+
+  updateComplete: function(response) {
+    if (this.options.decay) {
+      this.decay = (response.responseText == this.lastText ?
+        this.decay * this.options.decay : 1);
+
+      this.lastText = response.responseText;
+    }
+    this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+  },
+
+  onTimerEvent: function() {
+    this.updater = new Ajax.Updater(this.container, this.url, this.options);
+  }
+});
+
+
+
+function $(element) {
+  if (arguments.length > 1) {
+    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+      elements.push($(arguments[i]));
+    return elements;
+  }
+  if (Object.isString(element))
+    element = document.getElementById(element);
+  return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+  document._getElementsByXPath = function(expression, parentElement) {
+    var results = [];
+    var query = document.evaluate(expression, $(parentElement) || document,
+      null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+    for (var i = 0, length = query.snapshotLength; i < length; i++)
+      results.push(Element.extend(query.snapshotItem(i)));
+    return results;
+  };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+  Object.extend(Node, {
+    ELEMENT_NODE: 1,
+    ATTRIBUTE_NODE: 2,
+    TEXT_NODE: 3,
+    CDATA_SECTION_NODE: 4,
+    ENTITY_REFERENCE_NODE: 5,
+    ENTITY_NODE: 6,
+    PROCESSING_INSTRUCTION_NODE: 7,
+    COMMENT_NODE: 8,
+    DOCUMENT_NODE: 9,
+    DOCUMENT_TYPE_NODE: 10,
+    DOCUMENT_FRAGMENT_NODE: 11,
+    NOTATION_NODE: 12
+  });
+}
+
+
+(function(global) {
+
+  var SETATTRIBUTE_IGNORES_NAME = (function(){
+    var elForm = document.createElement("form");
+    var elInput = document.createElement("input");
+    var root = document.documentElement;
+    elInput.setAttribute("name", "test");
+    elForm.appendChild(elInput);
+    root.appendChild(elForm);
+    var isBuggy = elForm.elements
+      ? (typeof elForm.elements.test == "undefined")
+      : null;
+    root.removeChild(elForm);
+    elForm = elInput = null;
+    return isBuggy;
+  })();
+
+  var element = global.Element;
+  global.Element = function(tagName, attributes) {
+    attributes = attributes || { };
+    tagName = tagName.toLowerCase();
+    var cache = Element.cache;
+    if (SETATTRIBUTE_IGNORES_NAME && attributes.name) {
+      tagName = '<' + tagName + ' name="' + attributes.name + '">';
+      delete attributes.name;
+      return Element.writeAttribute(document.createElement(tagName), attributes);
+    }
+    if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+    return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
+  };
+  Object.extend(global.Element, element || { });
+  if (element) global.Element.prototype = element.prototype;
+})(this);
+
+Element.cache = { };
+Element.idCounter = 1;
+
+Element.Methods = {
+  visible: function(element) {
+    return $(element).style.display != 'none';
+  },
+
+  toggle: function(element) {
+    element = $(element);
+    Element[Element.visible(element) ? 'hide' : 'show'](element);
+    return element;
+  },
+
+
+  hide: function(element) {
+    element = $(element);
+    element.style.display = 'none';
+    return element;
+  },
+
+  show: function(element) {
+    element = $(element);
+    element.style.display = '';
+    return element;
+  },
+
+  remove: function(element) {
+    element = $(element);
+    element.parentNode.removeChild(element);
+    return element;
+  },
+
+  update: (function(){
+
+    var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
+      var el = document.createElement("select"),
+          isBuggy = true;
+      el.innerHTML = "<option value=\"test\">test</option>";
+      if (el.options && el.options[0]) {
+        isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
+      }
+      el = null;
+      return isBuggy;
+    })();
+
+    var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
+      try {
+        var el = document.createElement("table");
+        if (el && el.tBodies) {
+          el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
+          var isBuggy = typeof el.tBodies[0] == "undefined";
+          el = null;
+          return isBuggy;
+        }
+      } catch (e) {
+        return true;
+      }
+    })();
+
+    var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
+      var s = document.createElement("script"),
+          isBuggy = false;
+      try {
+        s.appendChild(document.createTextNode(""));
+        isBuggy = !s.firstChild ||
+          s.firstChild && s.firstChild.nodeType !== 3;
+      } catch (e) {
+        isBuggy = true;
+      }
+      s = null;
+      return isBuggy;
+    })();
+
+    function update(element, content) {
+      element = $(element);
+
+      if (content && content.toElement)
+        content = content.toElement();
+
+      if (Object.isElement(content))
+        return element.update().insert(content);
+
+      content = Object.toHTML(content);
+
+      var tagName = element.tagName.toUpperCase();
+
+      if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
+        element.text = content;
+        return element;
+      }
+
+      if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) {
+        if (tagName in Element._insertionTranslations.tags) {
+          while (element.firstChild) {
+            element.removeChild(element.firstChild);
+          }
+          Element._getContentFromAnonymousElement(tagName, content.stripScripts())
+            .each(function(node) {
+              element.appendChild(node)
+            });
+        }
+        else {
+          element.innerHTML = content.stripScripts();
+        }
+      }
+      else {
+        element.innerHTML = content.stripScripts();
+      }
+
+      content.evalScripts.bind(content).defer();
+      return element;
+    }
+
+    return update;
+  })(),
+
+  replace: function(element, content) {
+    element = $(element);
+    if (content && content.toElement) content = content.toElement();
+    else if (!Object.isElement(content)) {
+      content = Object.toHTML(content);
+      var range = element.ownerDocument.createRange();
+      range.selectNode(element);
+      content.evalScripts.bind(content).defer();
+      content = range.createContextualFragment(content.stripScripts());
+    }
+    element.parentNode.replaceChild(content, element);
+    return element;
+  },
+
+  insert: function(element, insertions) {
+    element = $(element);
+
+    if (Object.isString(insertions) || Object.isNumber(insertions) ||
+        Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+          insertions = {bottom:insertions};
+
+    var content, insert, tagName, childNodes;
+
+    for (var position in insertions) {
+      content  = insertions[position];
+      position = position.toLowerCase();
+      insert = Element._insertionTranslations[position];
+
+      if (content && content.toElement) content = content.toElement();
+      if (Object.isElement(content)) {
+        insert(element, content);
+        continue;
+      }
+
+      content = Object.toHTML(content);
+
+      tagName = ((position == 'before' || position == 'after')
+        ? element.parentNode : element).tagName.toUpperCase();
+
+      childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+
+      if (position == 'top' || position == 'after') childNodes.reverse();
+      childNodes.each(insert.curry(element));
+
+      content.evalScripts.bind(content).defer();
+    }
+
+    return element;
+  },
+
+  wrap: function(element, wrapper, attributes) {
+    element = $(element);
+    if (Object.isElement(wrapper))
+      $(wrapper).writeAttribute(attributes || { });
+    else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+    else wrapper = new Element('div', wrapper);
+    if (element.parentNode)
+      element.parentNode.replaceChild(wrapper, element);
+    wrapper.appendChild(element);
+    return wrapper;
+  },
+
+  inspect: function(element) {
+    element = $(element);
+    var result = '<' + element.tagName.toLowerCase();
+    $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+      var property = pair.first(), attribute = pair.last();
+      var value = (element[property] || '').toString();
+      if (value) result += ' ' + attribute + '=' + value.inspect(true);
+    });
+    return result + '>';
+  },
+
+  recursivelyCollect: function(element, property) {
+    element = $(element);
+    var elements = [];
+    while (element = element[property])
+      if (element.nodeType == 1)
+        elements.push(Element.extend(element));
+    return elements;
+  },
+
+  ancestors: function(element) {
+    return Element.recursivelyCollect(element, 'parentNode');
+  },
+
+  descendants: function(element) {
+    return Element.select(element, "*");
+  },
+
+  firstDescendant: function(element) {
+    element = $(element).firstChild;
+    while (element && element.nodeType != 1) element = element.nextSibling;
+    return $(element);
+  },
+
+  immediateDescendants: function(element) {
+    if (!(element = $(element).firstChild)) return [];
+    while (element && element.nodeType != 1) element = element.nextSibling;
+    if (element) return [element].concat($(element).nextSiblings());
+    return [];
+  },
+
+  previousSiblings: function(element) {
+    return Element.recursivelyCollect(element, 'previousSibling');
+  },
+
+  nextSiblings: function(element) {
+    return Element.recursivelyCollect(element, 'nextSibling');
+  },
+
+  siblings: function(element) {
+    element = $(element);
+    return Element.previousSiblings(element).reverse()
+      .concat(Element.nextSiblings(element));
+  },
+
+  match: function(element, selector) {
+    if (Object.isString(selector))
+      selector = new Selector(selector);
+    return selector.match($(element));
+  },
+
+  up: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return $(element.parentNode);
+    var ancestors = Element.ancestors(element);
+    return Object.isNumber(expression) ? ancestors[expression] :
+      Selector.findElement(ancestors, expression, index);
+  },
+
+  down: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return Element.firstDescendant(element);
+    return Object.isNumber(expression) ? Element.descendants(element)[expression] :
+      Element.select(element, expression)[index || 0];
+  },
+
+  previous: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+    var previousSiblings = Element.previousSiblings(element);
+    return Object.isNumber(expression) ? previousSiblings[expression] :
+      Selector.findElement(previousSiblings, expression, index);
+  },
+
+  next: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+    var nextSiblings = Element.nextSiblings(element);
+    return Object.isNumber(expression) ? nextSiblings[expression] :
+      Selector.findElement(nextSiblings, expression, index);
+  },
+
+
+  select: function(element) {
+    var args = Array.prototype.slice.call(arguments, 1);
+    return Selector.findChildElements(element, args);
+  },
+
+  adjacent: function(element) {
+    var args = Array.prototype.slice.call(arguments, 1);
+    return Selector.findChildElements(element.parentNode, args).without(element);
+  },
+
+  identify: function(element) {
+    element = $(element);
+    var id = Element.readAttribute(element, 'id');
+    if (id) return id;
+    do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
+    Element.writeAttribute(element, 'id', id);
+    return id;
+  },
+
+  readAttribute: function(element, name) {
+    element = $(element);
+    if (Prototype.Browser.IE) {
+      var t = Element._attributeTranslations.read;
+      if (t.values[name]) return t.values[name](element, name);
+      if (t.names[name]) name = t.names[name];
+      if (name.include(':')) {
+        return (!element.attributes || !element.attributes[name]) ? null :
+         element.attributes[name].value;
+      }
+    }
+    return element.getAttribute(name);
+  },
+
+  writeAttribute: function(element, name, value) {
+    element = $(element);
+    var attributes = { }, t = Element._attributeTranslations.write;
+
+    if (typeof name == 'object') attributes = name;
+    else attributes[name] = Object.isUndefined(value) ? true : value;
+
+    for (var attr in attributes) {
+      name = t.names[attr] || attr;
+      value = attributes[attr];
+      if (t.values[attr]) name = t.values[attr](element, value);
+      if (value === false || value === null)
+        element.removeAttribute(name);
+      else if (value === true)
+        element.setAttribute(name, name);
+      else element.setAttribute(name, value);
+    }
+    return element;
+  },
+
+  getHeight: function(element) {
+    return Element.getDimensions(element).height;
+  },
+
+  getWidth: function(element) {
+    return Element.getDimensions(element).width;
+  },
+
+  classNames: function(element) {
+    return new Element.ClassNames(element);
+  },
+
+  hasClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    var elementClassName = element.className;
+    return (elementClassName.length > 0 && (elementClassName == className ||
+      new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+  },
+
+  addClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    if (!Element.hasClassName(element, className))
+      element.className += (element.className ? ' ' : '') + className;
+    return element;
+  },
+
+  removeClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    element.className = element.className.replace(
+      new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
+    return element;
+  },
+
+  toggleClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    return Element[Element.hasClassName(element, className) ?
+      'removeClassName' : 'addClassName'](element, className);
+  },
+
+  cleanWhitespace: function(element) {
+    element = $(element);
+    var node = element.firstChild;
+    while (node) {
+      var nextNode = node.nextSibling;
+      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+        element.removeChild(node);
+      node = nextNode;
+    }
+    return element;
+  },
+
+  empty: function(element) {
+    return $(element).innerHTML.blank();
+  },
+
+  descendantOf: function(element, ancestor) {
+    element = $(element), ancestor = $(ancestor);
+
+    if (element.compareDocumentPosition)
+      return (element.compareDocumentPosition(ancestor) & 8) === 8;
+
+    if (ancestor.contains)
+      return ancestor.contains(element) && ancestor !== element;
+
+    while (element = element.parentNode)
+      if (element == ancestor) return true;
+
+    return false;
+  },
+
+  scrollTo: function(element) {
+    element = $(element);
+    var pos = Element.cumulativeOffset(element);
+    window.scrollTo(pos[0], pos[1]);
+    return element;
+  },
+
+  getStyle: function(element, style) {
+    element = $(element);
+    style = style == 'float' ? 'cssFloat' : style.camelize();
+    var value = element.style[style];
+    if (!value || value == 'auto') {
+      var css = document.defaultView.getComputedStyle(element, null);
+      value = css ? css[style] : null;
+    }
+    if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+    return value == 'auto' ? null : value;
+  },
+
+  getOpacity: function(element) {
+    return $(element).getStyle('opacity');
+  },
+
+  setStyle: function(element, styles) {
+    element = $(element);
+    var elementStyle = element.style, match;
+    if (Object.isString(styles)) {
+      element.style.cssText += ';' + styles;
+      return styles.include('opacity') ?
+        element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
+    }
+    for (var property in styles)
+      if (property == 'opacity') element.setOpacity(styles[property]);
+      else
+        elementStyle[(property == 'float' || property == 'cssFloat') ?
+          (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
+            property] = styles[property];
+
+    return element;
+  },
+
+  setOpacity: function(element, value) {
+    element = $(element);
+    element.style.opacity = (value == 1 || value === '') ? '' :
+      (value < 0.00001) ? 0 : value;
+    return element;
+  },
+
+  getDimensions: function(element) {
+    element = $(element);
+    var display = Element.getStyle(element, 'display');
+    if (display != 'none' && display != null) // Safari bug
+      return {width: element.offsetWidth, height: element.offsetHeight};
+
+    var els = element.style;
+    var originalVisibility = els.visibility;
+    var originalPosition = els.position;
+    var originalDisplay = els.display;
+    els.visibility = 'hidden';
+    if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari
+      els.position = 'absolute';
+    els.display = 'block';
+    var originalWidth = element.clientWidth;
+    var originalHeight = element.clientHeight;
+    els.display = originalDisplay;
+    els.position = originalPosition;
+    els.visibility = originalVisibility;
+    return {width: originalWidth, height: originalHeight};
+  },
+
+  makePositioned: function(element) {
+    element = $(element);
+    var pos = Element.getStyle(element, 'position');
+    if (pos == 'static' || !pos) {
+      element._madePositioned = true;
+      element.style.position = 'relative';
+      if (Prototype.Browser.Opera) {
+        element.style.top = 0;
+        element.style.left = 0;
+      }
+    }
+    return element;
+  },
+
+  undoPositioned: function(element) {
+    element = $(element);
+    if (element._madePositioned) {
+      element._madePositioned = undefined;
+      element.style.position =
+        element.style.top =
+        element.style.left =
+        element.style.bottom =
+        element.style.right = '';
+    }
+    return element;
+  },
+
+  makeClipping: function(element) {
+    element = $(element);
+    if (element._overflow) return element;
+    element._overflow = Element.getStyle(element, 'overflow') || 'auto';
+    if (element._overflow !== 'hidden')
+      element.style.overflow = 'hidden';
+    return element;
+  },
+
+  undoClipping: function(element) {
+    element = $(element);
+    if (!element._overflow) return element;
+    element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+    element._overflow = null;
+    return element;
+  },
+
+  cumulativeOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      element = element.offsetParent;
+    } while (element);
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  positionedOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      element = element.offsetParent;
+      if (element) {
+        if (element.tagName.toUpperCase() == 'BODY') break;
+        var p = Element.getStyle(element, 'position');
+        if (p !== 'static') break;
+      }
+    } while (element);
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  absolutize: function(element) {
+    element = $(element);
+    if (Element.getStyle(element, 'position') == 'absolute') return element;
+
+    var offsets = Element.positionedOffset(element);
+    var top     = offsets[1];
+    var left    = offsets[0];
+    var width   = element.clientWidth;
+    var height  = element.clientHeight;
+
+    element._originalLeft   = left - parseFloat(element.style.left  || 0);
+    element._originalTop    = top  - parseFloat(element.style.top || 0);
+    element._originalWidth  = element.style.width;
+    element._originalHeight = element.style.height;
+
+    element.style.position = 'absolute';
+    element.style.top    = top + 'px';
+    element.style.left   = left + 'px';
+    element.style.width  = width + 'px';
+    element.style.height = height + 'px';
+    return element;
+  },
+
+  relativize: function(element) {
+    element = $(element);
+    if (Element.getStyle(element, 'position') == 'relative') return element;
+
+    element.style.position = 'relative';
+    var top  = parseFloat(element.style.top  || 0) - (element._originalTop || 0);
+    var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+    element.style.top    = top + 'px';
+    element.style.left   = left + 'px';
+    element.style.height = element._originalHeight;
+    element.style.width  = element._originalWidth;
+    return element;
+  },
+
+  cumulativeScrollOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.scrollTop  || 0;
+      valueL += element.scrollLeft || 0;
+      element = element.parentNode;
+    } while (element);
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  getOffsetParent: function(element) {
+    if (element.offsetParent) return $(element.offsetParent);
+    if (element == document.body) return $(element);
+
+    while ((element = element.parentNode) && element != document.body)
+      if (Element.getStyle(element, 'position') != 'static')
+        return $(element);
+
+    return $(document.body);
+  },
+
+  viewportOffset: function(forElement) {
+    var valueT = 0, valueL = 0;
+
+    var element = forElement;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+
+      if (element.offsetParent == document.body &&
+        Element.getStyle(element, 'position') == 'absolute') break;
+
+    } while (element = element.offsetParent);
+
+    element = forElement;
+    do {
+      if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) {
+        valueT -= element.scrollTop  || 0;
+        valueL -= element.scrollLeft || 0;
+      }
+    } while (element = element.parentNode);
+
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  clonePosition: function(element, source) {
+    var options = Object.extend({
+      setLeft:    true,
+      setTop:     true,
+      setWidth:   true,
+      setHeight:  true,
+      offsetTop:  0,
+      offsetLeft: 0
+    }, arguments[2] || { });
+
+    source = $(source);
+    var p = Element.viewportOffset(source);
+
+    element = $(element);
+    var delta = [0, 0];
+    var parent = null;
+    if (Element.getStyle(element, 'position') == 'absolute') {
+      parent = Element.getOffsetParent(element);
+      delta = Element.viewportOffset(parent);
+    }
+
+    if (parent == document.body) {
+      delta[0] -= document.body.offsetLeft;
+      delta[1] -= document.body.offsetTop;
+    }
+
+    if (options.setLeft)   element.style.left  = (p[0] - delta[0] + options.offsetLeft) + 'px';
+    if (options.setTop)    element.style.top   = (p[1] - delta[1] + options.offsetTop) + 'px';
+    if (options.setWidth)  element.style.width = source.offsetWidth + 'px';
+    if (options.setHeight) element.style.height = source.offsetHeight + 'px';
+    return element;
+  }
+};
+
+Object.extend(Element.Methods, {
+  getElementsBySelector: Element.Methods.select,
+
+  childElements: Element.Methods.immediateDescendants
+});
+
+Element._attributeTranslations = {
+  write: {
+    names: {
+      className: 'class',
+      htmlFor:   'for'
+    },
+    values: { }
+  }
+};
+
+if (Prototype.Browser.Opera) {
+  Element.Methods.getStyle = Element.Methods.getStyle.wrap(
+    function(proceed, element, style) {
+      switch (style) {
+        case 'left': case 'top': case 'right': case 'bottom':
+          if (proceed(element, 'position') === 'static') return null;
+        case 'height': case 'width':
+          if (!Element.visible(element)) return null;
+
+          var dim = parseInt(proceed(element, style), 10);
+
+          if (dim !== element['offset' + style.capitalize()])
+            return dim + 'px';
+
+          var properties;
+          if (style === 'height') {
+            properties = ['border-top-width', 'padding-top',
+             'padding-bottom', 'border-bottom-width'];
+          }
+          else {
+            properties = ['border-left-width', 'padding-left',
+             'padding-right', 'border-right-width'];
+          }
+          return properties.inject(dim, function(memo, property) {
+            var val = proceed(element, property);
+            return val === null ? memo : memo - parseInt(val, 10);
+          }) + 'px';
+        default: return proceed(element, style);
+      }
+    }
+  );
+
+  Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
+    function(proceed, element, attribute) {
+      if (attribute === 'title') return element.title;
+      return proceed(element, attribute);
+    }
+  );
+}
+
+else if (Prototype.Browser.IE) {
+  Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap(
+    function(proceed, element) {
+      element = $(element);
+      try { element.offsetParent }
+      catch(e) { return $(document.body) }
+      var position = element.getStyle('position');
+      if (position !== 'static') return proceed(element);
+      element.setStyle({ position: 'relative' });
+      var value = proceed(element);
+      element.setStyle({ position: position });
+      return value;
+    }
+  );
+
+  $w('positionedOffset viewportOffset').each(function(method) {
+    Element.Methods[method] = Element.Methods[method].wrap(
+      function(proceed, element) {
+        element = $(element);
+        try { element.offsetParent }
+        catch(e) { return Element._returnOffset(0,0) }
+        var position = element.getStyle('position');
+        if (position !== 'static') return proceed(element);
+        var offsetParent = element.getOffsetParent();
+        if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+          offsetParent.setStyle({ zoom: 1 });
+        element.setStyle({ position: 'relative' });
+        var value = proceed(element);
+        element.setStyle({ position: position });
+        return value;
+      }
+    );
+  });
+
+  Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap(
+    function(proceed, element) {
+      try { element.offsetParent }
+      catch(e) { return Element._returnOffset(0,0) }
+      return proceed(element);
+    }
+  );
+
+  Element.Methods.getStyle = function(element, style) {
+    element = $(element);
+    style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+    var value = element.style[style];
+    if (!value && element.currentStyle) value = element.currentStyle[style];
+
+    if (style == 'opacity') {
+      if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+        if (value[1]) return parseFloat(value[1]) / 100;
+      return 1.0;
+    }
+
+    if (value == 'auto') {
+      if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+        return element['offset' + style.capitalize()] + 'px';
+      return null;
+    }
+    return value;
+  };
+
+  Element.Methods.setOpacity = function(element, value) {
+    function stripAlpha(filter){
+      return filter.replace(/alpha\([^\)]*\)/gi,'');
+    }
+    element = $(element);
+    var currentStyle = element.currentStyle;
+    if ((currentStyle && !currentStyle.hasLayout) ||
+      (!currentStyle && element.style.zoom == 'normal'))
+        element.style.zoom = 1;
+
+    var filter = element.getStyle('filter'), style = element.style;
+    if (value == 1 || value === '') {
+      (filter = stripAlpha(filter)) ?
+        style.filter = filter : style.removeAttribute('filter');
+      return element;
+    } else if (value < 0.00001) value = 0;
+    style.filter = stripAlpha(filter) +
+      'alpha(opacity=' + (value * 100) + ')';
+    return element;
+  };
+
+  Element._attributeTranslations = (function(){
+
+    var classProp = 'className';
+    var forProp = 'for';
+
+    var el = document.createElement('div');
+
+    el.setAttribute(classProp, 'x');
+
+    if (el.className !== 'x') {
+      el.setAttribute('class', 'x');
+      if (el.className === 'x') {
+        classProp = 'class';
+      }
+    }
+    el = null;
+
+    el = document.createElement('label');
+    el.setAttribute(forProp, 'x');
+    if (el.htmlFor !== 'x') {
+      el.setAttribute('htmlFor', 'x');
+      if (el.htmlFor === 'x') {
+        forProp = 'htmlFor';
+      }
+    }
+    el = null;
+
+    return {
+      read: {
+        names: {
+          'class':      classProp,
+          'className':  classProp,
+          'for':        forProp,
+          'htmlFor':    forProp
+        },
+        values: {
+          _getAttr: function(element, attribute) {
+            return element.getAttribute(attribute);
+          },
+          _getAttr2: function(element, attribute) {
+            return element.getAttribute(attribute, 2);
+          },
+          _getAttrNode: function(element, attribute) {
+            var node = element.getAttributeNode(attribute);
+            return node ? node.value : "";
+          },
+          _getEv: (function(){
+
+            var el = document.createElement('div');
+            el.onclick = Prototype.emptyFunction;
+            var value = el.getAttribute('onclick');
+            var f;
+
+            if (String(value).indexOf('{') > -1) {
+              f = function(element, attribute) {
+                attribute = element.getAttribute(attribute);
+                if (!attribute) return null;
+                attribute = attribute.toString();
+                attribute = attribute.split('{')[1];
+                attribute = attribute.split('}')[0];
+                return attribute.strip();
+              };
+            }
+            else if (value === '') {
+              f = function(element, attribute) {
+                attribute = element.getAttribute(attribute);
+                if (!attribute) return null;
+                return attribute.strip();
+              };
+            }
+            el = null;
+            return f;
+          })(),
+          _flag: function(element, attribute) {
+            return $(element).hasAttribute(attribute) ? attribute : null;
+          },
+          style: function(element) {
+            return element.style.cssText.toLowerCase();
+          },
+          title: function(element) {
+            return element.title;
+          }
+        }
+      }
+    }
+  })();
+
+  Element._attributeTranslations.write = {
+    names: Object.extend({
+      cellpadding: 'cellPadding',
+      cellspacing: 'cellSpacing'
+    }, Element._attributeTranslations.read.names),
+    values: {
+      checked: function(element, value) {
+        element.checked = !!value;
+      },
+
+      style: function(element, value) {
+        element.style.cssText = value ? value : '';
+      }
+    }
+  };
+
+  Element._attributeTranslations.has = {};
+
+  $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
+      'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
+    Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
+    Element._attributeTranslations.has[attr.toLowerCase()] = attr;
+  });
+
+  (function(v) {
+    Object.extend(v, {
+      href:        v._getAttr2,
+      src:         v._getAttr2,
+      type:        v._getAttr,
+      action:      v._getAttrNode,
+      disabled:    v._flag,
+      checked:     v._flag,
+      readonly:    v._flag,
+      multiple:    v._flag,
+      onload:      v._getEv,
+      onunload:    v._getEv,
+      onclick:     v._getEv,
+      ondblclick:  v._getEv,
+      onmousedown: v._getEv,
+      onmouseup:   v._getEv,
+      onmouseover: v._getEv,
+      onmousemove: v._getEv,
+      onmouseout:  v._getEv,
+      onfocus:     v._getEv,
+      onblur:      v._getEv,
+      onkeypress:  v._getEv,
+      onkeydown:   v._getEv,
+      onkeyup:     v._getEv,
+      onsubmit:    v._getEv,
+      onreset:     v._getEv,
+      onselect:    v._getEv,
+      onchange:    v._getEv
+    });
+  })(Element._attributeTranslations.read.values);
+
+  if (Prototype.BrowserFeatures.ElementExtensions) {
+    (function() {
+      function _descendants(element) {
+        var nodes = element.getElementsByTagName('*'), results = [];
+        for (var i = 0, node; node = nodes[i]; i++)
+          if (node.tagName !== "!") // Filter out comment nodes.
+            results.push(node);
+        return results;
+      }
+
+      Element.Methods.down = function(element, expression, index) {
+        element = $(element);
+        if (arguments.length == 1) return element.firstDescendant();
+        return Object.isNumber(expression) ? _descendants(element)[expression] :
+          Element.select(element, expression)[index || 0];
+      }
+    })();
+  }
+
+}
+
+else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
+  Element.Methods.setOpacity = function(element, value) {
+    element = $(element);
+    element.style.opacity = (value == 1) ? 0.999999 :
+      (value === '') ? '' : (value < 0.00001) ? 0 : value;
+    return element;
+  };
+}
+
+else if (Prototype.Browser.WebKit) {
+  Element.Methods.setOpacity = function(element, value) {
+    element = $(element);
+    element.style.opacity = (value == 1 || value === '') ? '' :
+      (value < 0.00001) ? 0 : value;
+
+    if (value == 1)
+      if(element.tagName.toUpperCase() == 'IMG' && element.width) {
+        element.width++; element.width--;
+      } else try {
+        var n = document.createTextNode(' ');
+        element.appendChild(n);
+        element.removeChild(n);
+      } catch (e) { }
+
+    return element;
+  };
+
+  Element.Methods.cumulativeOffset = function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      if (element.offsetParent == document.body)
+        if (Element.getStyle(element, 'position') == 'absolute') break;
+
+      element = element.offsetParent;
+    } while (element);
+
+    return Element._returnOffset(valueL, valueT);
+  };
+}
+
+if ('outerHTML' in document.documentElement) {
+  Element.Methods.replace = function(element, content) {
+    element = $(element);
+
+    if (content && content.toElement) content = content.toElement();
+    if (Object.isElement(content)) {
+      element.parentNode.replaceChild(content, element);
+      return element;
+    }
+
+    content = Object.toHTML(content);
+    var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+    if (Element._insertionTranslations.tags[tagName]) {
+      var nextSibling = element.next();
+      var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+      parent.removeChild(element);
+      if (nextSibling)
+        fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+      else
+        fragments.each(function(node) { parent.appendChild(node) });
+    }
+    else element.outerHTML = content.stripScripts();
+
+    content.evalScripts.bind(content).defer();
+    return element;
+  };
+}
+
+Element._returnOffset = function(l, t) {
+  var result = [l, t];
+  result.left = l;
+  result.top = t;
+  return result;
+};
+
+Element._getContentFromAnonymousElement = function(tagName, html) {
+  var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
+  if (t) {
+    div.innerHTML = t[0] + html + t[1];
+    t[2].times(function() { div = div.firstChild });
+  } else div.innerHTML = html;
+  return $A(div.childNodes);
+};
+
+Element._insertionTranslations = {
+  before: function(element, node) {
+    element.parentNode.insertBefore(node, element);
+  },
+  top: function(element, node) {
+    element.insertBefore(node, element.firstChild);
+  },
+  bottom: function(element, node) {
+    element.appendChild(node);
+  },
+  after: function(element, node) {
+    element.parentNode.insertBefore(node, element.nextSibling);
+  },
+  tags: {
+    TABLE:  ['<table>',                '</table>',                   1],
+    TBODY:  ['<table><tbody>',         '</tbody></table>',           2],
+    TR:     ['<table><tbody><tr>',     '</tr></tbody></table>',      3],
+    TD:     ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+    SELECT: ['<select>',               '</select>',                  1]
+  }
+};
+
+(function() {
+  var tags = Element._insertionTranslations.tags;
+  Object.extend(tags, {
+    THEAD: tags.TBODY,
+    TFOOT: tags.TBODY,
+    TH:    tags.TD
+  });
+})();
+
+Element.Methods.Simulated = {
+  hasAttribute: function(element, attribute) {
+    attribute = Element._attributeTranslations.has[attribute] || attribute;
+    var node = $(element).getAttributeNode(attribute);
+    return !!(node && node.specified);
+  }
+};
+
+Element.Methods.ByTag = { };
+
+Object.extend(Element, Element.Methods);
+
+(function(div) {
+
+  if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) {
+    window.HTMLElement = { };
+    window.HTMLElement.prototype = div['__proto__'];
+    Prototype.BrowserFeatures.ElementExtensions = true;
+  }
+
+  div = null;
+
+})(document.createElement('div'))
+
+Element.extend = (function() {
+
+  function checkDeficiency(tagName) {
+    if (typeof window.Element != 'undefined') {
+      var proto = window.Element.prototype;
+      if (proto) {
+        var id = '_' + (Math.random()+'').slice(2);
+        var el = document.createElement(tagName);
+        proto[id] = 'x';
+        var isBuggy = (el[id] !== 'x');
+        delete proto[id];
+        el = null;
+        return isBuggy;
+      }
+    }
+    return false;
+  }
+
+  function extendElementWith(element, methods) {
+    for (var property in methods) {
+      var value = methods[property];
+      if (Object.isFunction(value) && !(property in element))
+        element[property] = value.methodize();
+    }
+  }
+
+  var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object');
+
+  if (Prototype.BrowserFeatures.SpecificElementExtensions) {
+    if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) {
+      return function(element) {
+        if (element && typeof element._extendedByPrototype == 'undefined') {
+          var t = element.tagName;
+          if (t && (/^(?:object|applet|embed)$/i.test(t))) {
+            extendElementWith(element, Element.Methods);
+            extendElementWith(element, Element.Methods.Simulated);
+            extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
+          }
+        }
+        return element;
+      }
+    }
+    return Prototype.K;
+  }
+
+  var Methods = { }, ByTag = Element.Methods.ByTag;
+
+  var extend = Object.extend(function(element) {
+    if (!element || typeof element._extendedByPrototype != 'undefined' ||
+        element.nodeType != 1 || element == window) return element;
+
+    var methods = Object.clone(Methods),
+        tagName = element.tagName.toUpperCase();
+
+    if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+    extendElementWith(element, methods);
+
+    element._extendedByPrototype = Prototype.emptyFunction;
+    return element;
+
+  }, {
+    refresh: function() {
+      if (!Prototype.BrowserFeatures.ElementExtensions) {
+        Object.extend(Methods, Element.Methods);
+        Object.extend(Methods, Element.Methods.Simulated);
+      }
+    }
+  });
+
+  extend.refresh();
+  return extend;
+})();
+
+Element.hasAttribute = function(element, attribute) {
+  if (element.hasAttribute) return element.hasAttribute(attribute);
+  return Element.Methods.Simulated.hasAttribute(element, attribute);
+};
+
+Element.addMethods = function(methods) {
+  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+
+  if (!methods) {
+    Object.extend(Form, Form.Methods);
+    Object.extend(Form.Element, Form.Element.Methods);
+    Object.extend(Element.Methods.ByTag, {
+      "FORM":     Object.clone(Form.Methods),
+      "INPUT":    Object.clone(Form.Element.Methods),
+      "SELECT":   Object.clone(Form.Element.Methods),
+      "TEXTAREA": Object.clone(Form.Element.Methods)
+    });
+  }
+
+  if (arguments.length == 2) {
+    var tagName = methods;
+    methods = arguments[1];
+  }
+
+  if (!tagName) Object.extend(Element.Methods, methods || { });
+  else {
+    if (Object.isArray(tagName)) tagName.each(extend);
+    else extend(tagName);
+  }
+
+  function extend(tagName) {
+    tagName = tagName.toUpperCase();
+    if (!Element.Methods.ByTag[tagName])
+      Element.Methods.ByTag[tagName] = { };
+    Object.extend(Element.Methods.ByTag[tagName], methods);
+  }
+
+  function copy(methods, destination, onlyIfAbsent) {
+    onlyIfAbsent = onlyIfAbsent || false;
+    for (var property in methods) {
+      var value = methods[property];
+      if (!Object.isFunction(value)) continue;
+      if (!onlyIfAbsent || !(property in destination))
+        destination[property] = value.methodize();
+    }
+  }
+
+  function findDOMClass(tagName) {
+    var klass;
+    var trans = {
+      "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+      "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+      "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+      "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+      "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+      "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+      "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+      "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+      "FrameSet", "IFRAME": "IFrame"
+    };
+    if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+    if (window[klass]) return window[klass];
+    klass = 'HTML' + tagName + 'Element';
+    if (window[klass]) return window[klass];
+    klass = 'HTML' + tagName.capitalize() + 'Element';
+    if (window[klass]) return window[klass];
+
+    var element = document.createElement(tagName);
+    var proto = element['__proto__'] || element.constructor.prototype;
+    element = null;
+    return proto;
+  }
+
+  var elementPrototype = window.HTMLElement ? HTMLElement.prototype :
+   Element.prototype;
+
+  if (F.ElementExtensions) {
+    copy(Element.Methods, elementPrototype);
+    copy(Element.Methods.Simulated, elementPrototype, true);
+  }
+
+  if (F.SpecificElementExtensions) {
+    for (var tag in Element.Methods.ByTag) {
+      var klass = findDOMClass(tag);
+      if (Object.isUndefined(klass)) continue;
+      copy(T[tag], klass.prototype);
+    }
+  }
+
+  Object.extend(Element, Element.Methods);
+  delete Element.ByTag;
+
+  if (Element.extend.refresh) Element.extend.refresh();
+  Element.cache = { };
+};
+
+
+document.viewport = {
+
+  getDimensions: function() {
+    return { width: this.getWidth(), height: this.getHeight() };
+  },
+
+  getScrollOffsets: function() {
+    return Element._returnOffset(
+      window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
+      window.pageYOffset || document.documentElement.scrollTop  || document.body.scrollTop);
+  }
+};
+
+(function(viewport) {
+  var B = Prototype.Browser, doc = document, element, property = {};
+
+  function getRootElement() {
+    if (B.WebKit && !doc.evaluate)
+      return document;
+
+    if (B.Opera && window.parseFloat(window.opera.version()) < 9.5)
+      return document.body;
+
+    return document.documentElement;
+  }
+
+  function define(D) {
+    if (!element) element = getRootElement();
+
+    property[D] = 'client' + D;
+
+    viewport['get' + D] = function() { return element[property[D]] };
+    return viewport['get' + D]();
+  }
+
+  viewport.getWidth  = define.curry('Width');
+
+  viewport.getHeight = define.curry('Height');
+})(document.viewport);
+
+
+Element.Storage = {
+  UID: 1
+};
+
+Element.addMethods({
+  getStorage: function(element) {
+    if (!(element = $(element))) return;
+
+    var uid;
+    if (element === window) {
+      uid = 0;
+    } else {
+      if (typeof element._prototypeUID === "undefined")
+        element._prototypeUID = [Element.Storage.UID++];
+      uid = element._prototypeUID[0];
+    }
+
+    if (!Element.Storage[uid])
+      Element.Storage[uid] = $H();
+
+    return Element.Storage[uid];
+  },
+
+  store: function(element, key, value) {
+    if (!(element = $(element))) return;
+
+    if (arguments.length === 2) {
+      Element.getStorage(element).update(key);
+    } else {
+      Element.getStorage(element).set(key, value);
+    }
+
+    return element;
+  },
+
+  retrieve: function(element, key, defaultValue) {
+    if (!(element = $(element))) return;
+    var hash = Element.getStorage(element), value = hash.get(key);
+
+    if (Object.isUndefined(value)) {
+      hash.set(key, defaultValue);
+      value = defaultValue;
+    }
+
+    return value;
+  },
+
+  clone: function(element, deep) {
+    if (!(element = $(element))) return;
+    var clone = element.cloneNode(deep);
+    clone._prototypeUID = void 0;
+    if (deep) {
+      var descendants = Element.select(clone, '*'),
+          i = descendants.length;
+      while (i--) {
+        descendants[i]._prototypeUID = void 0;
+      }
+    }
+    return Element.extend(clone);
+  }
+});
+/* Portions of the Selector class are derived from Jack Slocum's DomQuery,
+ * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
+ * license.  Please see http://www.yui-ext.com/ for more information. */
+
+var Selector = Class.create({
+  initialize: function(expression) {
+    this.expression = expression.strip();
+
+    if (this.shouldUseSelectorsAPI()) {
+      this.mode = 'selectorsAPI';
+    } else if (this.shouldUseXPath()) {
+      this.mode = 'xpath';
+      this.compileXPathMatcher();
+    } else {
+      this.mode = "normal";
+      this.compileMatcher();
+    }
+
+  },
+
+  shouldUseXPath: (function() {
+
+    var IS_DESCENDANT_SELECTOR_BUGGY = (function(){
+      var isBuggy = false;
+      if (document.evaluate && window.XPathResult) {
+        var el = document.createElement('div');
+        el.innerHTML = '<ul><li></li></ul><div><ul><li></li></ul></div>';
+
+        var xpath = ".//*[local-name()='ul' or local-name()='UL']" +
+          "//*[local-name()='li' or local-name()='LI']";
+
+        var result = document.evaluate(xpath, el, null,
+          XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+
+        isBuggy = (result.snapshotLength !== 2);
+        el = null;
+      }
+      return isBuggy;
+    })();
+
+    return function() {
+      if (!Prototype.BrowserFeatures.XPath) return false;
+
+      var e = this.expression;
+
+      if (Prototype.Browser.WebKit &&
+       (e.include("-of-type") || e.include(":empty")))
+        return false;
+
+      if ((/(\[[\w-]*?:|:checked)/).test(e))
+        return false;
+
+      if (IS_DESCENDANT_SELECTOR_BUGGY) return false;
+
+      return true;
+    }
+
+  })(),
+
+  shouldUseSelectorsAPI: function() {
+    if (!Prototype.BrowserFeatures.SelectorsAPI) return false;
+
+    if (Selector.CASE_INSENSITIVE_CLASS_NAMES) return false;
+
+    if (!Selector._div) Selector._div = new Element('div');
+
+    try {
+      Selector._div.querySelector(this.expression);
+    } catch(e) {
+      return false;
+    }
+
+    return true;
+  },
+
+  compileMatcher: function() {
+    var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
+        c = Selector.criteria, le, p, m, len = ps.length, name;
+
+    if (Selector._cache[e]) {
+      this.matcher = Selector._cache[e];
+      return;
+    }
+
+    this.matcher = ["this.matcher = function(root) {",
+                    "var r = root, h = Selector.handlers, c = false, n;"];
+
+    while (e && le != e && (/\S/).test(e)) {
+      le = e;
+      for (var i = 0; i<len; i++) {
+        p = ps[i].re;
+        name = ps[i].name;
+        if (m = e.match(p)) {
+          this.matcher.push(Object.isFunction(c[name]) ? c[name](m) :
+            new Template(c[name]).evaluate(m));
+          e = e.replace(m[0], '');
+          break;
+        }
+      }
+    }
+
+    this.matcher.push("return h.unique(n);\n}");
+    eval(this.matcher.join('\n'));
+    Selector._cache[this.expression] = this.matcher;
+  },
+
+  compileXPathMatcher: function() {
+    var e = this.expression, ps = Selector.patterns,
+        x = Selector.xpath, le, m, len = ps.length, name;
+
+    if (Selector._cache[e]) {
+      this.xpath = Selector._cache[e]; return;
+    }
+
+    this.matcher = ['.//*'];
+    while (e && le != e && (/\S/).test(e)) {
+      le = e;
+      for (var i = 0; i<len; i++) {
+        name = ps[i].name;
+        if (m = e.match(ps[i].re)) {
+          this.matcher.push(Object.isFunction(x[name]) ? x[name](m) :
+            new Template(x[name]).evaluate(m));
+          e = e.replace(m[0], '');
+          break;
+        }
+      }
+    }
+
+    this.xpath = this.matcher.join('');
+    Selector._cache[this.expression] = this.xpath;
+  },
+
+  findElements: function(root) {
+    root = root || document;
+    var e = this.expression, results;
+
+    switch (this.mode) {
+      case 'selectorsAPI':
+        if (root !== document) {
+          var oldId = root.id, id = $(root).identify();
+          id = id.replace(/([\.:])/g, "\\$1");
+          e = "#" + id + " " + e;
+        }
+
+        results = $A(root.querySelectorAll(e)).map(Element.extend);
+        root.id = oldId;
+
+        return results;
+      case 'xpath':
+        return document._getElementsByXPath(this.xpath, root);
+      default:
+       return this.matcher(root);
+    }
+  },
+
+  match: function(element) {
+    this.tokens = [];
+
+    var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
+    var le, p, m, len = ps.length, name;
+
+    while (e && le !== e && (/\S/).test(e)) {
+      le = e;
+      for (var i = 0; i<len; i++) {
+        p = ps[i].re;
+        name = ps[i].name;
+        if (m = e.match(p)) {
+          if (as[name]) {
+            this.tokens.push([name, Object.clone(m)]);
+            e = e.replace(m[0], '');
+          } else {
+            return this.findElements(document).include(element);
+          }
+        }
+      }
+    }
+
+    var match = true, name, matches;
+    for (var i = 0, token; token = this.tokens[i]; i++) {
+      name = token[0], matches = token[1];
+      if (!Selector.assertions[name](element, matches)) {
+        match = false; break;
+      }
+    }
+
+    return match;
+  },
+
+  toString: function() {
+    return this.expression;
+  },
+
+  inspect: function() {
+    return "#<Selector:" + this.expression.inspect() + ">";
+  }
+});
+
+if (Prototype.BrowserFeatures.SelectorsAPI &&
+ document.compatMode === 'BackCompat') {
+  Selector.CASE_INSENSITIVE_CLASS_NAMES = (function(){
+    var div = document.createElement('div'),
+     span = document.createElement('span');
+
+    div.id = "prototype_test_id";
+    span.className = 'Test';
+    div.appendChild(span);
+    var isIgnored = (div.querySelector('#prototype_test_id .test') !== null);
+    div = span = null;
+    return isIgnored;
+  })();
+}
+
+Object.extend(Selector, {
+  _cache: { },
+
+  xpath: {
+    descendant:   "//*",
+    child:        "/*",
+    adjacent:     "/following-sibling::*[1]",
+    laterSibling: '/following-sibling::*',
+    tagName:      function(m) {
+      if (m[1] == '*') return '';
+      return "[local-name()='" + m[1].toLowerCase() +
+             "' or local-name()='" + m[1].toUpperCase() + "']";
+    },
+    className:    "[contains(concat(' ', @class, ' '), ' #{1} ')]",
+    id:           "[@id='#{1}']",
+    attrPresence: function(m) {
+      m[1] = m[1].toLowerCase();
+      return new Template("[@#{1}]").evaluate(m);
+    },
+    attr: function(m) {
+      m[1] = m[1].toLowerCase();
+      m[3] = m[5] || m[6];
+      return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+    },
+    pseudo: function(m) {
+      var h = Selector.xpath.pseudos[m[1]];
+      if (!h) return '';
+      if (Object.isFunction(h)) return h(m);
+      return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
+    },
+    operators: {
+      '=':  "[@#{1}='#{3}']",
+      '!=': "[@#{1}!='#{3}']",
+      '^=': "[starts-with(@#{1}, '#{3}')]",
+      '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
+      '*=': "[contains(@#{1}, '#{3}')]",
+      '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
+      '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
+    },
+    pseudos: {
+      'first-child': '[not(preceding-sibling::*)]',
+      'last-child':  '[not(following-sibling::*)]',
+      'only-child':  '[not(preceding-sibling::* or following-sibling::*)]',
+      'empty':       "[count(*) = 0 and (count(text()) = 0)]",
+      'checked':     "[@checked]",
+      'disabled':    "[(@disabled) and (@type!='hidden')]",
+      'enabled':     "[not(@disabled) and (@type!='hidden')]",
+      'not': function(m) {
+        var e = m[6], p = Selector.patterns,
+            x = Selector.xpath, le, v, len = p.length, name;
+
+        var exclusion = [];
+        while (e && le != e && (/\S/).test(e)) {
+          le = e;
+          for (var i = 0; i<len; i++) {
+            name = p[i].name
+            if (m = e.match(p[i].re)) {
+              v = Object.isFunction(x[name]) ? x[name](m) : new Template(x[name]).evaluate(m);
+              exclusion.push("(" + v.substring(1, v.length - 1) + ")");
+              e = e.replace(m[0], '');
+              break;
+            }
+          }
+        }
+        return "[not(" + exclusion.join(" and ") + ")]";
+      },
+      'nth-child':      function(m) {
+        return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+      },
+      'nth-last-child': function(m) {
+        return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+      },
+      'nth-of-type':    function(m) {
+        return Selector.xpath.pseudos.nth("position() ", m);
+      },
+      'nth-last-of-type': function(m) {
+        return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+      },
+      'first-of-type':  function(m) {
+        m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
+      },
+      'last-of-type':   function(m) {
+        m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
+      },
+      'only-of-type':   function(m) {
+        var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
+      },
+      nth: function(fragment, m) {
+        var mm, formula = m[6], predicate;
+        if (formula == 'even') formula = '2n+0';
+        if (formula == 'odd')  formula = '2n+1';
+        if (mm = formula.match(/^(\d+)$/)) // digit only
+          return '[' + fragment + "= " + mm[1] + ']';
+        if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+          if (mm[1] == "-") mm[1] = -1;
+          var a = mm[1] ? Number(mm[1]) : 1;
+          var b = mm[2] ? Number(mm[2]) : 0;
+          predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
+          "((#{fragment} - #{b}) div #{a} >= 0)]";
+          return new Template(predicate).evaluate({
+            fragment: fragment, a: a, b: b });
+        }
+      }
+    }
+  },
+
+  criteria: {
+    tagName:      'n = h.tagName(n, r, "#{1}", c);      c = false;',
+    className:    'n = h.className(n, r, "#{1}", c);    c = false;',
+    id:           'n = h.id(n, r, "#{1}", c);           c = false;',
+    attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;',
+    attr: function(m) {
+      m[3] = (m[5] || m[6]);
+      return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);
+    },
+    pseudo: function(m) {
+      if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
+      return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
+    },
+    descendant:   'c = "descendant";',
+    child:        'c = "child";',
+    adjacent:     'c = "adjacent";',
+    laterSibling: 'c = "laterSibling";'
+  },
+
+  patterns: [
+    { name: 'laterSibling', re: /^\s*~\s*/ },
+    { name: 'child',        re: /^\s*>\s*/ },
+    { name: 'adjacent',     re: /^\s*\+\s*/ },
+    { name: 'descendant',   re: /^\s/ },
+
+    { name: 'tagName',      re: /^\s*(\*|[\w\-]+)(\b|$)?/ },
+    { name: 'id',           re: /^#([\w\-\*]+)(\b|$)/ },
+    { name: 'className',    re: /^\.([\w\-\*]+)(\b|$)/ },
+    { name: 'pseudo',       re: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/ },
+    { name: 'attrPresence', re: /^\[((?:[\w-]+:)?[\w-]+)\]/ },
+    { name: 'attr',         re: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ }
+  ],
+
+  assertions: {
+    tagName: function(element, matches) {
+      return matches[1].toUpperCase() == element.tagName.toUpperCase();
+    },
+
+    className: function(element, matches) {
+      return Element.hasClassName(element, matches[1]);
+    },
+
+    id: function(element, matches) {
+      return element.id === matches[1];
+    },
+
+    attrPresence: function(element, matches) {
+      return Element.hasAttribute(element, matches[1]);
+    },
+
+    attr: function(element, matches) {
+      var nodeValue = Element.readAttribute(element, matches[1]);
+      return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]);
+    }
+  },
+
+  handlers: {
+    concat: function(a, b) {
+      for (var i = 0, node; node = b[i]; i++)
+        a.push(node);
+      return a;
+    },
+
+    mark: function(nodes) {
+      var _true = Prototype.emptyFunction;
+      for (var i = 0, node; node = nodes[i]; i++)
+        node._countedByPrototype = _true;
+      return nodes;
+    },
+
+    unmark: (function(){
+
+      var PROPERTIES_ATTRIBUTES_MAP = (function(){
+        var el = document.createElement('div'),
+            isBuggy = false,
+            propName = '_countedByPrototype',
+            value = 'x'
+        el[propName] = value;
+        isBuggy = (el.getAttribute(propName) === value);
+        el = null;
+        return isBuggy;
+      })();
+
+      return PROPERTIES_ATTRIBUTES_MAP ?
+        function(nodes) {
+          for (var i = 0, node; node = nodes[i]; i++)
+            node.removeAttribute('_countedByPrototype');
+          return nodes;
+        } :
+        function(nodes) {
+          for (var i = 0, node; node = nodes[i]; i++)
+            node._countedByPrototype = void 0;
+          return nodes;
+        }
+    })(),
+
+    index: function(parentNode, reverse, ofType) {
+      parentNode._countedByPrototype = Prototype.emptyFunction;
+      if (reverse) {
+        for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
+          var node = nodes[i];
+          if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
+        }
+      } else {
+        for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
+          if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
+      }
+    },
+
+    unique: function(nodes) {
+      if (nodes.length == 0) return nodes;
+      var results = [], n;
+      for (var i = 0, l = nodes.length; i < l; i++)
+        if (typeof (n = nodes[i])._countedByPrototype == 'undefined') {
+          n._countedByPrototype = Prototype.emptyFunction;
+          results.push(Element.extend(n));
+        }
+      return Selector.handlers.unmark(results);
+    },
+
+    descendant: function(nodes) {
+      var h = Selector.handlers;
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        h.concat(results, node.getElementsByTagName('*'));
+      return results;
+    },
+
+    child: function(nodes) {
+      var h = Selector.handlers;
+      for (var i = 0, results = [], node; node = nodes[i]; i++) {
+        for (var j = 0, child; child = node.childNodes[j]; j++)
+          if (child.nodeType == 1 && child.tagName != '!') results.push(child);
+      }
+      return results;
+    },
+
+    adjacent: function(nodes) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++) {
+        var next = this.nextElementSibling(node);
+        if (next) results.push(next);
+      }
+      return results;
+    },
+
+    laterSibling: function(nodes) {
+      var h = Selector.handlers;
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        h.concat(results, Element.nextSiblings(node));
+      return results;
+    },
+
+    nextElementSibling: function(node) {
+      while (node = node.nextSibling)
+        if (node.nodeType == 1) return node;
+      return null;
+    },
+
+    previousElementSibling: function(node) {
+      while (node = node.previousSibling)
+        if (node.nodeType == 1) return node;
+      return null;
+    },
+
+    tagName: function(nodes, root, tagName, combinator) {
+      var uTagName = tagName.toUpperCase();
+      var results = [], h = Selector.handlers;
+      if (nodes) {
+        if (combinator) {
+          if (combinator == "descendant") {
+            for (var i = 0, node; node = nodes[i]; i++)
+              h.concat(results, node.getElementsByTagName(tagName));
+            return results;
+          } else nodes = this[combinator](nodes);
+          if (tagName == "*") return nodes;
+        }
+        for (var i = 0, node; node = nodes[i]; i++)
+          if (node.tagName.toUpperCase() === uTagName) results.push(node);
+        return results;
+      } else return root.getElementsByTagName(tagName);
+    },
+
+    id: function(nodes, root, id, combinator) {
+      var targetNode = $(id), h = Selector.handlers;
+
+      if (root == document) {
+        if (!targetNode) return [];
+        if (!nodes) return [targetNode];
+      } else {
+        if (!root.sourceIndex || root.sourceIndex < 1) {
+          var nodes = root.getElementsByTagName('*');
+          for (var j = 0, node; node = nodes[j]; j++) {
+            if (node.id === id) return [node];
+          }
+        }
+      }
+
+      if (nodes) {
+        if (combinator) {
+          if (combinator == 'child') {
+            for (var i = 0, node; node = nodes[i]; i++)
+              if (targetNode.parentNode == node) return [targetNode];
+          } else if (combinator == 'descendant') {
+            for (var i = 0, node; node = nodes[i]; i++)
+              if (Element.descendantOf(targetNode, node)) return [targetNode];
+          } else if (combinator == 'adjacent') {
+            for (var i = 0, node; node = nodes[i]; i++)
+              if (Selector.handlers.previousElementSibling(targetNode) == node)
+                return [targetNode];
+          } else nodes = h[combinator](nodes);
+        }
+        for (var i = 0, node; node = nodes[i]; i++)
+          if (node == targetNode) return [targetNode];
+        return [];
+      }
+      return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
+    },
+
+    className: function(nodes, root, className, combinator) {
+      if (nodes && combinator) nodes = this[combinator](nodes);
+      return Selector.handlers.byClassName(nodes, root, className);
+    },
+
+    byClassName: function(nodes, root, className) {
+      if (!nodes) nodes = Selector.handlers.descendant([root]);
+      var needle = ' ' + className + ' ';
+      for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
+        nodeClassName = node.className;
+        if (nodeClassName.length == 0) continue;
+        if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
+          results.push(node);
+      }
+      return results;
+    },
+
+    attrPresence: function(nodes, root, attr, combinator) {
+      if (!nodes) nodes = root.getElementsByTagName("*");
+      if (nodes && combinator) nodes = this[combinator](nodes);
+      var results = [];
+      for (var i = 0, node; node = nodes[i]; i++)
+        if (Element.hasAttribute(node, attr)) results.push(node);
+      return results;
+    },
+
+    attr: function(nodes, root, attr, value, operator, combinator) {
+      if (!nodes) nodes = root.getElementsByTagName("*");
+      if (nodes && combinator) nodes = this[combinator](nodes);
+      var handler = Selector.operators[operator], results = [];
+      for (var i = 0, node; node = nodes[i]; i++) {
+        var nodeValue = Element.readAttribute(node, attr);
+        if (nodeValue === null) continue;
+        if (handler(nodeValue, value)) results.push(node);
+      }
+      return results;
+    },
+
+    pseudo: function(nodes, name, value, root, combinator) {
+      if (nodes && combinator) nodes = this[combinator](nodes);
+      if (!nodes) nodes = root.getElementsByTagName("*");
+      return Selector.pseudos[name](nodes, value, root);
+    }
+  },
+
+  pseudos: {
+    'first-child': function(nodes, value, root) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++) {
+        if (Selector.handlers.previousElementSibling(node)) continue;
+          results.push(node);
+      }
+      return results;
+    },
+    'last-child': function(nodes, value, root) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++) {
+        if (Selector.handlers.nextElementSibling(node)) continue;
+          results.push(node);
+      }
+      return results;
+    },
+    'only-child': function(nodes, value, root) {
+      var h = Selector.handlers;
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
+          results.push(node);
+      return results;
+    },
+    'nth-child':        function(nodes, formula, root) {
+      return Selector.pseudos.nth(nodes, formula, root);
+    },
+    'nth-last-child':   function(nodes, formula, root) {
+      return Selector.pseudos.nth(nodes, formula, root, true);
+    },
+    'nth-of-type':      function(nodes, formula, root) {
+      return Selector.pseudos.nth(nodes, formula, root, false, true);
+    },
+    'nth-last-of-type': function(nodes, formula, root) {
+      return Selector.pseudos.nth(nodes, formula, root, true, true);
+    },
+    'first-of-type':    function(nodes, formula, root) {
+      return Selector.pseudos.nth(nodes, "1", root, false, true);
+    },
+    'last-of-type':     function(nodes, formula, root) {
+      return Selector.pseudos.nth(nodes, "1", root, true, true);
+    },
+    'only-of-type':     function(nodes, formula, root) {
+      var p = Selector.pseudos;
+      return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
+    },
+
+    getIndices: function(a, b, total) {
+      if (a == 0) return b > 0 ? [b] : [];
+      return $R(1, total).inject([], function(memo, i) {
+        if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
+        return memo;
+      });
+    },
+
+    nth: function(nodes, formula, root, reverse, ofType) {
+      if (nodes.length == 0) return [];
+      if (formula == 'even') formula = '2n+0';
+      if (formula == 'odd')  formula = '2n+1';
+      var h = Selector.handlers, results = [], indexed = [], m;
+      h.mark(nodes);
+      for (var i = 0, node; node = nodes[i]; i++) {
+        if (!node.parentNode._countedByPrototype) {
+          h.index(node.parentNode, reverse, ofType);
+          indexed.push(node.parentNode);
+        }
+      }
+      if (formula.match(/^\d+$/)) { // just a number
+        formula = Number(formula);
+        for (var i = 0, node; node = nodes[i]; i++)
+          if (node.nodeIndex == formula) results.push(node);
+      } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+        if (m[1] == "-") m[1] = -1;
+        var a = m[1] ? Number(m[1]) : 1;
+        var b = m[2] ? Number(m[2]) : 0;
+        var indices = Selector.pseudos.getIndices(a, b, nodes.length);
+        for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
+          for (var j = 0; j < l; j++)
+            if (node.nodeIndex == indices[j]) results.push(node);
+        }
+      }
+      h.unmark(nodes);
+      h.unmark(indexed);
+      return results;
+    },
+
+    'empty': function(nodes, value, root) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++) {
+        if (node.tagName == '!' || node.firstChild) continue;
+        results.push(node);
+      }
+      return results;
+    },
+
+    'not': function(nodes, selector, root) {
+      var h = Selector.handlers, selectorType, m;
+      var exclusions = new Selector(selector).findElements(root);
+      h.mark(exclusions);
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        if (!node._countedByPrototype) results.push(node);
+      h.unmark(exclusions);
+      return results;
+    },
+
+    'enabled': function(nodes, value, root) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        if (!node.disabled && (!node.type || node.type !== 'hidden'))
+          results.push(node);
+      return results;
+    },
+
+    'disabled': function(nodes, value, root) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        if (node.disabled) results.push(node);
+      return results;
+    },
+
+    'checked': function(nodes, value, root) {
+      for (var i = 0, results = [], node; node = nodes[i]; i++)
+        if (node.checked) results.push(node);
+      return results;
+    }
+  },
+
+  operators: {
+    '=':  function(nv, v) { return nv == v; },
+    '!=': function(nv, v) { return nv != v; },
+    '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); },
+    '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); },
+    '*=': function(nv, v) { return nv == v || nv && nv.include(v); },
+    '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
+    '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() +
+     '-').include('-' + (v || "").toUpperCase() + '-'); }
+  },
+
+  split: function(expression) {
+    var expressions = [];
+    expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
+      expressions.push(m[1].strip());
+    });
+    return expressions;
+  },
+
+  matchElements: function(elements, expression) {
+    var matches = $$(expression), h = Selector.handlers;
+    h.mark(matches);
+    for (var i = 0, results = [], element; element = elements[i]; i++)
+      if (element._countedByPrototype) results.push(element);
+    h.unmark(matches);
+    return results;
+  },
+
+  findElement: function(elements, expression, index) {
+    if (Object.isNumber(expression)) {
+      index = expression; expression = false;
+    }
+    return Selector.matchElements(elements, expression || '*')[index || 0];
+  },
+
+  findChildElements: function(element, expressions) {
+    expressions = Selector.split(expressions.join(','));
+    var results = [], h = Selector.handlers;
+    for (var i = 0, l = expressions.length, selector; i < l; i++) {
+      selector = new Selector(expressions[i].strip());
+      h.concat(results, selector.findElements(element));
+    }
+    return (l > 1) ? h.unique(results) : results;
+  }
+});
+
+if (Prototype.Browser.IE) {
+  Object.extend(Selector.handlers, {
+    concat: function(a, b) {
+      for (var i = 0, node; node = b[i]; i++)
+        if (node.tagName !== "!") a.push(node);
+      return a;
+    }
+  });
+}
+
+function $$() {
+  return Selector.findChildElements(document, $A(arguments));
+}
+
+var Form = {
+  reset: function(form) {
+    form = $(form);
+    form.reset();
+    return form;
+  },
+
+  serializeElements: function(elements, options) {
+    if (typeof options != 'object') options = { hash: !!options };
+    else if (Object.isUndefined(options.hash)) options.hash = true;
+    var key, value, submitted = false, submit = options.submit;
+
+    var data = elements.inject({ }, function(result, element) {
+      if (!element.disabled && element.name) {
+        key = element.name; value = $(element).getValue();
+        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
+            submit !== false && (!submit || key == submit) && (submitted = true)))) {
+          if (key in result) {
+            if (!Object.isArray(result[key])) result[key] = [result[key]];
+            result[key].push(value);
+          }
+          else result[key] = value;
+        }
+      }
+      return result;
+    });
+
+    return options.hash ? data : Object.toQueryString(data);
+  }
+};
+
+Form.Methods = {
+  serialize: function(form, options) {
+    return Form.serializeElements(Form.getElements(form), options);
+  },
+
+  getElements: function(form) {
+    var elements = $(form).getElementsByTagName('*'),
+        element,
+        arr = [ ],
+        serializers = Form.Element.Serializers;
+    for (var i = 0; element = elements[i]; i++) {
+      arr.push(element);
+    }
+    return arr.inject([], function(elements, child) {
+      if (serializers[child.tagName.toLowerCase()])
+        elements.push(Element.extend(child));
+      return elements;
+    })
+  },
+
+  getInputs: function(form, typeName, name) {
+    form = $(form);
+    var inputs = form.getElementsByTagName('input');
+
+    if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+    for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+      var input = inputs[i];
+      if ((typeName && input.type != typeName) || (name && input.name != name))
+        continue;
+      matchingInputs.push(Element.extend(input));
+    }
+
+    return matchingInputs;
+  },
+
+  disable: function(form) {
+    form = $(form);
+    Form.getElements(form).invoke('disable');
+    return form;
+  },
+
+  enable: function(form) {
+    form = $(form);
+    Form.getElements(form).invoke('enable');
+    return form;
+  },
+
+  findFirstElement: function(form) {
+    var elements = $(form).getElements().findAll(function(element) {
+      return 'hidden' != element.type && !element.disabled;
+    });
+    var firstByIndex = elements.findAll(function(element) {
+      return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
+    }).sortBy(function(element) { return element.tabIndex }).first();
+
+    return firstByIndex ? firstByIndex : elements.find(function(element) {
+      return /^(?:input|select|textarea)$/i.test(element.tagName);
+    });
+  },
+
+  focusFirstElement: function(form) {
+    form = $(form);
+    form.findFirstElement().activate();
+    return form;
+  },
+
+  request: function(form, options) {
+    form = $(form), options = Object.clone(options || { });
+
+    var params = options.parameters, action = form.readAttribute('action') || '';
+    if (action.blank()) action = window.location.href;
+    options.parameters = form.serialize(true);
+
+    if (params) {
+      if (Object.isString(params)) params = params.toQueryParams();
+      Object.extend(options.parameters, params);
+    }
+
+    if (form.hasAttribute('method') && !options.method)
+      options.method = form.method;
+
+    return new Ajax.Request(action, options);
+  }
+};
+
+/*--------------------------------------------------------------------------*/
+
+
+Form.Element = {
+  focus: function(element) {
+    $(element).focus();
+    return element;
+  },
+
+  select: function(element) {
+    $(element).select();
+    return element;
+  }
+};
+
+Form.Element.Methods = {
+
+  serialize: function(element) {
+    element = $(element);
+    if (!element.disabled && element.name) {
+      var value = element.getValue();
+      if (value != undefined) {
+        var pair = { };
+        pair[element.name] = value;
+        return Object.toQueryString(pair);
+      }
+    }
+    return '';
+  },
+
+  getValue: function(element) {
+    element = $(element);
+    var method = element.tagName.toLowerCase();
+    return Form.Element.Serializers[method](element);
+  },
+
+  setValue: function(element, value) {
+    element = $(element);
+    var method = element.tagName.toLowerCase();
+    Form.Element.Serializers[method](element, value);
+    return element;
+  },
+
+  clear: function(element) {
+    $(element).value = '';
+    return element;
+  },
+
+  present: function(element) {
+    return $(element).value != '';
+  },
+
+  activate: function(element) {
+    element = $(element);
+    try {
+      element.focus();
+      if (element.select && (element.tagName.toLowerCase() != 'input' ||
+          !(/^(?:button|reset|submit)$/i.test(element.type))))
+        element.select();
+    } catch (e) { }
+    return element;
+  },
+
+  disable: function(element) {
+    element = $(element);
+    element.disabled = true;
+    return element;
+  },
+
+  enable: function(element) {
+    element = $(element);
+    element.disabled = false;
+    return element;
+  }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+
+var $F = Form.Element.Methods.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = {
+  input: function(element, value) {
+    switch (element.type.toLowerCase()) {
+      case 'checkbox':
+      case 'radio':
+        return Form.Element.Serializers.inputSelector(element, value);
+      default:
+        return Form.Element.Serializers.textarea(element, value);
+    }
+  },
+
+  inputSelector: function(element, value) {
+    if (Object.isUndefined(value)) return element.checked ? element.value : null;
+    else element.checked = !!value;
+  },
+
+  textarea: function(element, value) {
+    if (Object.isUndefined(value)) return element.value;
+    else element.value = value;
+  },
+
+  select: function(element, value) {
+    if (Object.isUndefined(value))
+      return this[element.type == 'select-one' ?
+        'selectOne' : 'selectMany'](element);
+    else {
+      var opt, currentValue, single = !Object.isArray(value);
+      for (var i = 0, length = element.length; i < length; i++) {
+        opt = element.options[i];
+        currentValue = this.optionValue(opt);
+        if (single) {
+          if (currentValue == value) {
+            opt.selected = true;
+            return;
+          }
+        }
+        else opt.selected = value.include(currentValue);
+      }
+    }
+  },
+
+  selectOne: function(element) {
+    var index = element.selectedIndex;
+    return index >= 0 ? this.optionValue(element.options[index]) : null;
+  },
+
+  selectMany: function(element) {
+    var values, length = element.length;
+    if (!length) return null;
+
+    for (var i = 0, values = []; i < length; i++) {
+      var opt = element.options[i];
+      if (opt.selected) values.push(this.optionValue(opt));
+    }
+    return values;
+  },
+
+  optionValue: function(opt) {
+    return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+  }
+};
+
+/*--------------------------------------------------------------------------*/
+
+
+Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
+  initialize: function($super, element, frequency, callback) {
+    $super(callback, frequency);
+    this.element   = $(element);
+    this.lastValue = this.getValue();
+  },
+
+  execute: function() {
+    var value = this.getValue();
+    if (Object.isString(this.lastValue) && Object.isString(value) ?
+        this.lastValue != value : String(this.lastValue) != String(value)) {
+      this.callback(this.element, value);
+      this.lastValue = value;
+    }
+  }
+});
+
+Form.Element.Observer = Class.create(Abstract.TimedObserver, {
+  getValue: function() {
+    return Form.Element.getValue(this.element);
+  }
+});
+
+Form.Observer = Class.create(Abstract.TimedObserver, {
+  getValue: function() {
+    return Form.serialize(this.element);
+  }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = Class.create({
+  initialize: function(element, callback) {
+    this.element  = $(element);
+    this.callback = callback;
+
+    this.lastValue = this.getValue();
+    if (this.element.tagName.toLowerCase() == 'form')
+      this.registerFormCallbacks();
+    else
+      this.registerCallback(this.element);
+  },
+
+  onElementEvent: function() {
+    var value = this.getValue();
+    if (this.lastValue != value) {
+      this.callback(this.element, value);
+      this.lastValue = value;
+    }
+  },
+
+  registerFormCallbacks: function() {
+    Form.getElements(this.element).each(this.registerCallback, this);
+  },
+
+  registerCallback: function(element) {
+    if (element.type) {
+      switch (element.type.toLowerCase()) {
+        case 'checkbox':
+        case 'radio':
+          Event.observe(element, 'click', this.onElementEvent.bind(this));
+          break;
+        default:
+          Event.observe(element, 'change', this.onElementEvent.bind(this));
+          break;
+      }
+    }
+  }
+});
+
+Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
+  getValue: function() {
+    return Form.Element.getValue(this.element);
+  }
+});
+
+Form.EventObserver = Class.create(Abstract.EventObserver, {
+  getValue: function() {
+    return Form.serialize(this.element);
+  }
+});
+(function() {
+
+  var Event = {
+    KEY_BACKSPACE: 8,
+    KEY_TAB:       9,
+    KEY_RETURN:   13,
+    KEY_ESC:      27,
+    KEY_LEFT:     37,
+    KEY_UP:       38,
+    KEY_RIGHT:    39,
+    KEY_DOWN:     40,
+    KEY_DELETE:   46,
+    KEY_HOME:     36,
+    KEY_END:      35,
+    KEY_PAGEUP:   33,
+    KEY_PAGEDOWN: 34,
+    KEY_INSERT:   45,
+
+    cache: {}
+  };
+
+  var docEl = document.documentElement;
+  var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
+    && 'onmouseleave' in docEl;
+
+  var _isButton;
+  if (Prototype.Browser.IE) {
+    var buttonMap = { 0: 1, 1: 4, 2: 2 };
+    _isButton = function(event, code) {
+      return event.button === buttonMap[code];
+    };
+  } else if (Prototype.Browser.WebKit) {
+    _isButton = function(event, code) {
+      switch (code) {
+        case 0: return event.which == 1 && !event.metaKey;
+        case 1: return event.which == 1 && event.metaKey;
+        default: return false;
+      }
+    };
+  } else {
+    _isButton = function(event, code) {
+      return event.which ? (event.which === code + 1) : (event.button === code);
+    };
+  }
+
+  function isLeftClick(event)   { return _isButton(event, 0) }
+
+  function isMiddleClick(event) { return _isButton(event, 1) }
+
+  function isRightClick(event)  { return _isButton(event, 2) }
+
+  function element(event) {
+    event = Event.extend(event);
+
+    var node = event.target, type = event.type,
+     currentTarget = event.currentTarget;
+
+    if (currentTarget && currentTarget.tagName) {
+      if (type === 'load' || type === 'error' ||
+        (type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
+          && currentTarget.type === 'radio'))
+            node = currentTarget;
+    }
+
+    if (node.nodeType == Node.TEXT_NODE)
+      node = node.parentNode;
+
+    return Element.extend(node);
+  }
+
+  function findElement(event, expression) {
+    var element = Event.element(event);
+    if (!expression) return element;
+    var elements = [element].concat(element.ancestors());
+    return Selector.findElement(elements, expression, 0);
+  }
+
+  function pointer(event) {
+    return { x: pointerX(event), y: pointerY(event) };
+  }
+
+  function pointerX(event) {
+    var docElement = document.documentElement,
+     body = document.body || { scrollLeft: 0 };
+
+    return event.pageX || (event.clientX +
+      (docElement.scrollLeft || body.scrollLeft) -
+      (docElement.clientLeft || 0));
+  }
+
+  function pointerY(event) {
+    var docElement = document.documentElement,
+     body = document.body || { scrollTop: 0 };
+
+    return  event.pageY || (event.clientY +
+       (docElement.scrollTop || body.scrollTop) -
+       (docElement.clientTop || 0));
+  }
+
+
+  function stop(event) {
+    Event.extend(event);
+    event.preventDefault();
+    event.stopPropagation();
+
+    event.stopped = true;
+  }
+
+  Event.Methods = {
+    isLeftClick: isLeftClick,
+    isMiddleClick: isMiddleClick,
+    isRightClick: isRightClick,
+
+    element: element,
+    findElement: findElement,
+
+    pointer: pointer,
+    pointerX: pointerX,
+    pointerY: pointerY,
+
+    stop: stop
+  };
+
+
+  var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
+    m[name] = Event.Methods[name].methodize();
+    return m;
+  });
+
+  if (Prototype.Browser.IE) {
+    function _relatedTarget(event) {
+      var element;
+      switch (event.type) {
+        case 'mouseover': element = event.fromElement; break;
+        case 'mouseout':  element = event.toElement;   break;
+        default: return null;
+      }
+      return Element.extend(element);
+    }
+
+    Object.extend(methods, {
+      stopPropagation: function() { this.cancelBubble = true },
+      preventDefault:  function() { this.returnValue = false },
+      inspect: function() { return '[object Event]' }
+    });
+
+    Event.extend = function(event, element) {
+      if (!event) return false;
+      if (event._extendedByPrototype) return event;
+
+      event._extendedByPrototype = Prototype.emptyFunction;
+      var pointer = Event.pointer(event);
+
+      Object.extend(event, {
+        target: event.srcElement || element,
+        relatedTarget: _relatedTarget(event),
+        pageX:  pointer.x,
+        pageY:  pointer.y
+      });
+
+      return Object.extend(event, methods);
+    };
+  } else {
+    Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
+    Object.extend(Event.prototype, methods);
+    Event.extend = Prototype.K;
+  }
+
+  function _createResponder(element, eventName, handler) {
+    var registry = Element.retrieve(element, 'prototype_event_registry');
+
+    if (Object.isUndefined(registry)) {
+      CACHE.push(element);
+      registry = Element.retrieve(element, 'prototype_event_registry', $H());
+    }
+
+    var respondersForEvent = registry.get(eventName);
+    if (Object.isUndefined(respondersForEvent)) {
+      respondersForEvent = [];
+      registry.set(eventName, respondersForEvent);
+    }
+
+    if (respondersForEvent.pluck('handler').include(handler)) return false;
+
+    var responder;
+    if (eventName.include(":")) {
+      responder = function(event) {
+        if (Object.isUndefined(event.eventName))
+          return false;
+
+        if (event.eventName !== eventName)
+          return false;
+
+        Event.extend(event, element);
+        handler.call(element, event);
+      };
+    } else {
+      if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
+       (eventName === "mouseenter" || eventName === "mouseleave")) {
+        if (eventName === "mouseenter" || eventName === "mouseleave") {
+          responder = function(event) {
+            Event.extend(event, element);
+
+            var parent = event.relatedTarget;
+            while (parent && parent !== element) {
+              try { parent = parent.parentNode; }
+              catch(e) { parent = element; }
+            }
+
+            if (parent === element) return;
+
+            handler.call(element, event);
+          };
+        }
+      } else {
+        responder = function(event) {
+          Event.extend(event, element);
+          handler.call(element, event);
+        };
+      }
+    }
+
+    responder.handler = handler;
+    respondersForEvent.push(responder);
+    return responder;
+  }
+
+  function _destroyCache() {
+    for (var i = 0, length = CACHE.length; i < length; i++) {
+      Event.stopObserving(CACHE[i]);
+      CACHE[i] = null;
+    }
+  }
+
+  var CACHE = [];
+
+  if (Prototype.Browser.IE)
+    window.attachEvent('onunload', _destroyCache);
+
+  if (Prototype.Browser.WebKit)
+    window.addEventListener('unload', Prototype.emptyFunction, false);
+
+
+  var _getDOMEventName = Prototype.K;
+
+  if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
+    _getDOMEventName = function(eventName) {
+      var translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
+      return eventName in translations ? translations[eventName] : eventName;
+    };
+  }
+
+  function observe(element, eventName, handler) {
+    element = $(element);
+
+    var responder = _createResponder(element, eventName, handler);
+
+    if (!responder) return element;
+
+    if (eventName.include(':')) {
+      if (element.addEventListener)
+        element.addEventListener("dataavailable", responder, false);
+      else {
+        element.attachEvent("ondataavailable", responder);
+        element.attachEvent("onfilterchange", responder);
+      }
+    } else {
+      var actualEventName = _getDOMEventName(eventName);
+
+      if (element.addEventListener)
+        element.addEventListener(actualEventName, responder, false);
+      else
+        element.attachEvent("on" + actualEventName, responder);
+    }
+
+    return element;
+  }
+
+  function stopObserving(element, eventName, handler) {
+    element = $(element);
+
+    var registry = Element.retrieve(element, 'prototype_event_registry');
+
+    if (Object.isUndefined(registry)) return element;
+
+    if (eventName && !handler) {
+      var responders = registry.get(eventName);
+
+      if (Object.isUndefined(responders)) return element;
+
+      responders.each( function(r) {
+        Element.stopObserving(element, eventName, r.handler);
+      });
+      return element;
+    } else if (!eventName) {
+      registry.each( function(pair) {
+        var eventName = pair.key, responders = pair.value;
+
+        responders.each( function(r) {
+          Element.stopObserving(element, eventName, r.handler);
+        });
+      });
+      return element;
+    }
+
+    var responders = registry.get(eventName);
+
+    if (!responders) return;
+
+    var responder = responders.find( function(r) { return r.handler === handler; });
+    if (!responder) return element;
+
+    var actualEventName = _getDOMEventName(eventName);
+
+    if (eventName.include(':')) {
+      if (element.removeEventListener)
+        element.removeEventListener("dataavailable", responder, false);
+      else {
+        element.detachEvent("ondataavailable", responder);
+        element.detachEvent("onfilterchange",  responder);
+      }
+    } else {
+      if (element.removeEventListener)
+        element.removeEventListener(actualEventName, responder, false);
+      else
+        element.detachEvent('on' + actualEventName, responder);
+    }
+
+    registry.set(eventName, responders.without(responder));
+
+    return element;
+  }
+
+  function fire(element, eventName, memo, bubble) {
+    element = $(element);
+
+    if (Object.isUndefined(bubble))
+      bubble = true;
+
+    if (element == document && document.createEvent && !element.dispatchEvent)
+      element = document.documentElement;
+
+    var event;
+    if (document.createEvent) {
+      event = document.createEvent('HTMLEvents');
+      event.initEvent('dataavailable', true, true);
+    } else {
+      event = document.createEventObject();
+      event.eventType = bubble ? 'ondataavailable' : 'onfilterchange';
+    }
+
+    event.eventName = eventName;
+    event.memo = memo || { };
+
+    if (document.createEvent)
+      element.dispatchEvent(event);
+    else
+      element.fireEvent(event.eventType, event);
+
+    return Event.extend(event);
+  }
+
+
+  Object.extend(Event, Event.Methods);
+
+  Object.extend(Event, {
+    fire:          fire,
+    observe:       observe,
+    stopObserving: stopObserving
+  });
+
+  Element.addMethods({
+    fire:          fire,
+
+    observe:       observe,
+
+    stopObserving: stopObserving
+  });
+
+  Object.extend(document, {
+    fire:          fire.methodize(),
+
+    observe:       observe.methodize(),
+
+    stopObserving: stopObserving.methodize(),
+
+    loaded:        false
+  });
+
+  if (window.Event) Object.extend(window.Event, Event);
+  else window.Event = Event;
+})();
+
+(function() {
+  /* Support for the DOMContentLoaded event is based on work by Dan Webb,
+     Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
+
+  var timer;
+
+  function fireContentLoadedEvent() {
+    if (document.loaded) return;
+    if (timer) window.clearTimeout(timer);
+    document.loaded = true;
+    document.fire('dom:loaded');
+  }
+
+  function checkReadyState() {
+    if (document.readyState === 'complete') {
+      document.stopObserving('readystatechange', checkReadyState);
+      fireContentLoadedEvent();
+    }
+  }
+
+  function pollDoScroll() {
+    try { document.documentElement.doScroll('left'); }
+    catch(e) {
+      timer = pollDoScroll.defer();
+      return;
+    }
+    fireContentLoadedEvent();
+  }
+
+  if (document.addEventListener) {
+    document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
+  } else {
+    document.observe('readystatechange', checkReadyState);
+    if (window == top)
+      timer = pollDoScroll.defer();
+  }
+
+  Event.observe(window, 'load', fireContentLoadedEvent);
+})();
+
+Element.addMethods();
+
+/*------------------------------- DEPRECATED -------------------------------*/
+
+Hash.toQueryString = Object.toQueryString;
+
+var Toggle = { display: Element.toggle };
+
+Element.Methods.childOf = Element.Methods.descendantOf;
+
+var Insertion = {
+  Before: function(element, content) {
+    return Element.insert(element, {before:content});
+  },
+
+  Top: function(element, content) {
+    return Element.insert(element, {top:content});
+  },
+
+  Bottom: function(element, content) {
+    return Element.insert(element, {bottom:content});
+  },
+
+  After: function(element, content) {
+    return Element.insert(element, {after:content});
+  }
+};
+
+var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
+
+var Position = {
+  includeScrollOffsets: false,
+
+  prepare: function() {
+    this.deltaX =  window.pageXOffset
+                || document.documentElement.scrollLeft
+                || document.body.scrollLeft
+                || 0;
+    this.deltaY =  window.pageYOffset
+                || document.documentElement.scrollTop
+                || document.body.scrollTop
+                || 0;
+  },
+
+  within: function(element, x, y) {
+    if (this.includeScrollOffsets)
+      return this.withinIncludingScrolloffsets(element, x, y);
+    this.xcomp = x;
+    this.ycomp = y;
+    this.offset = Element.cumulativeOffset(element);
+
+    return (y >= this.offset[1] &&
+            y <  this.offset[1] + element.offsetHeight &&
+            x >= this.offset[0] &&
+            x <  this.offset[0] + element.offsetWidth);
+  },
+
+  withinIncludingScrolloffsets: function(element, x, y) {
+    var offsetcache = Element.cumulativeScrollOffset(element);
+
+    this.xcomp = x + offsetcache[0] - this.deltaX;
+    this.ycomp = y + offsetcache[1] - this.deltaY;
+    this.offset = Element.cumulativeOffset(element);
+
+    return (this.ycomp >= this.offset[1] &&
+            this.ycomp <  this.offset[1] + element.offsetHeight &&
+            this.xcomp >= this.offset[0] &&
+            this.xcomp <  this.offset[0] + element.offsetWidth);
+  },
+
+  overlap: function(mode, element) {
+    if (!mode) return 0;
+    if (mode == 'vertical')
+      return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+        element.offsetHeight;
+    if (mode == 'horizontal')
+      return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+        element.offsetWidth;
+  },
+
+
+  cumulativeOffset: Element.Methods.cumulativeOffset,
+
+  positionedOffset: Element.Methods.positionedOffset,
+
+  absolutize: function(element) {
+    Position.prepare();
+    return Element.absolutize(element);
+  },
+
+  relativize: function(element) {
+    Position.prepare();
+    return Element.relativize(element);
+  },
+
+  realOffset: Element.Methods.cumulativeScrollOffset,
+
+  offsetParent: Element.Methods.getOffsetParent,
+
+  page: Element.Methods.viewportOffset,
+
+  clone: function(source, target, options) {
+    options = options || { };
+    return Element.clonePosition(target, source, options);
+  }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
+  function iter(name) {
+    return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
+  }
+
+  instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
+  function(element, className) {
+    className = className.toString().strip();
+    var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
+    return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
+  } : function(element, className) {
+    className = className.toString().strip();
+    var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
+    if (!classNames && !className) return elements;
+
+    var nodes = $(element).getElementsByTagName('*');
+    className = ' ' + className + ' ';
+
+    for (var i = 0, child, cn; child = nodes[i]; i++) {
+      if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
+          (classNames && classNames.all(function(name) {
+            return !name.toString().blank() && cn.include(' ' + name + ' ');
+          }))))
+        elements.push(Element.extend(child));
+    }
+    return elements;
+  };
+
+  return function(className, parentElement) {
+    return $(parentElement || document.body).getElementsByClassName(className);
+  };
+}(Element.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+  initialize: function(element) {
+    this.element = $(element);
+  },
+
+  _each: function(iterator) {
+    this.element.className.split(/\s+/).select(function(name) {
+      return name.length > 0;
+    })._each(iterator);
+  },
+
+  set: function(className) {
+    this.element.className = className;
+  },
+
+  add: function(classNameToAdd) {
+    if (this.include(classNameToAdd)) return;
+    this.set($A(this).concat(classNameToAdd).join(' '));
+  },
+
+  remove: function(classNameToRemove) {
+    if (!this.include(classNameToRemove)) return;
+    this.set($A(this).without(classNameToRemove).join(' '));
+  },
+
+  toString: function() {
+    return $A(this).join(' ');
+  }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+
+/*--------------------------------------------------------------------------*/
diff --git a/ricoClient/js/export-owc.html b/ricoClient/js/export-owc.html
new file mode 100644 (file)
index 0000000..4cde157
--- /dev/null
@@ -0,0 +1,34 @@
+<html>\r
+<head>\r
+<title>Export</title>\r
+<SCRIPT TYPE="text/javascript">\r
+function getdata() {\r
+  if (!window.opener || window.opener.closed) {\r
+    alert('Error! Parent window is closed');\r
+    return;\r
+  }\r
+  var divID=window.location.search;\r
+  if (divID.length<2) {\r
+    alert('Error! Invalid id');\r
+    return;\r
+  }\r
+  divID=divID.substring(1);\r
+  var oDiv=window.opener.document.getElementById(divID);\r
+  if (!oDiv) {\r
+    alert('Error! Can not find \"'+divID+'\"');\r
+    return;\r
+  }\r
+  var oSS=document.getElementById('ss')\r
+  if (!oSS) {\r
+    alert('Error! Can not find spreadsheet');\r
+    return;\r
+  }\r
+  oSS.HTMLData=oDiv.innerHTML.replace(/<td>/ig,"<td>'");  // force everything to come in as text\r
+}\r
+window.onload=getdata;\r
+</SCRIPT>\r
+</head>\r
+<body>\r
+<object id="ss" classid="CLSID:0002E559-0000-0000-C000-000000000046" style="width:100%;height:100%"></object>\r
+</body>\r
+</html>\r
diff --git a/ricoClient/js/export-plain.html b/ricoClient/js/export-plain.html
new file mode 100644 (file)
index 0000000..de8a617
--- /dev/null
@@ -0,0 +1,33 @@
+<html>\r
+<head>\r
+<title>Export</title>\r
+<script type="text/javascript">\r
+function getdata() {\r
+  if (!window.opener || window.opener.closed) {\r
+    alert('Error! Parent window is closed');\r
+    return;\r
+  }\r
+  var divID=window.location.search;\r
+  if (divID.length<2) {\r
+    alert('Error! Invalid id');\r
+    return;\r
+  }\r
+  divID=divID.substring(1);\r
+  var oDiv=window.opener.document.getElementById(divID);\r
+  if (!oDiv) {\r
+    alert('Error! Can not find \"'+divID+'\"');\r
+    return;\r
+  }\r
+  document.body.innerHTML=oDiv.innerHTML;\r
+}\r
+window.onload=getdata;\r
+</script>\r
+<style type="text/css">\r
+tbody tr {\r
+  vertical-align:top;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+</body>\r
+</html>\r
diff --git a/ricoClient/js/rico.js b/ricoClient/js/rico.js
new file mode 100644 (file)
index 0000000..8ed20c2
--- /dev/null
@@ -0,0 +1,897 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+/**
+ * @namespace Main Rico object
+ */
+var Rico = {
+  Version: '3.0b1',
+  loadRequested: 1,
+  loadComplete: 2,
+  theme: {},
+
+  init : function() {
+    try {  // fix IE background image flicker (credit: www.mister-pixel.com)
+      document.execCommand("BackgroundImageCache", false, true);
+    } catch(err) {}
+    if (typeof Rico_CONFIG == 'object') {
+      this.setPaths(Rico_CONFIG.jsDir,Rico_CONFIG.cssDir,Rico_CONFIG.imgDir);
+      if (Rico_CONFIG.enableLogging) this.enableLogging();
+    }
+    this.preloadMsgs='';
+    this.baseHref= location.protocol + "//" + location.host;
+    this.loadedFiles={};
+    this.windowIsLoaded=false;
+    this.onLoadCallbacks=[];
+    var onloadAction=Rico.bind(this,'windowLoaded');
+    if (window.addEventListener)
+      window.addEventListener('load', onloadAction, false);
+    else if (window.attachEvent)
+      window.attachEvent('onload', onloadAction);
+    this.onLoad(function() { Rico.log('Pre-load messages:\n'+Rico.preloadMsgs); });
+  },
+
+  setPaths : function(jsDir,cssDir,imgDir,htmDir) {
+    this.jsDir = jsDir;
+    this.cssDir = cssDir;
+    this.imgDir = imgDir;
+    this.htmDir = htmDir || jsDir;
+  },
+
+  // Array entries can reference a javascript file or css stylesheet
+  // A dependency on another module can be indicated with a plus-sign prefix: '+DependsOnModule'
+  moduleDependencies : {
+    DragAndDrop: ['ricoDragDrop.js'],
+    Calendar   : ['ricoCalendar.js'],
+    SearchBox  : ['ricoSearch.js'],
+    Tree       : ['ricoTree.js'],
+    ColorPicker: ['ricoColorPicker.js'],
+    SimpleGrid : ['ricoGridCommon.js', 'ricoSimpleGrid.js'],
+    LiveGridBasic : ['ricoGridCommon.js', 'ricoLiveGrid.js'],
+    LiveGrid      : ['+LiveGridBasic', 'ricoLiveGridControls.js'],
+    LiveGridMenu  : ['ricoLiveGridMenu.js'],
+    LiveGridAjax  : ['+LiveGrid', 'ricoLiveGridAjax.js'],
+    LiveGridJSON  : ['+LiveGridAjax', 'ricoLiveGridJSON.js'],
+    LiveGridForms : ['+LiveGridAjax', '+LiveGridMenu', 'ricoLiveGridForms.js']
+  },
+
+  languages : {
+    de: "translations/ricoLocale_de.js",
+    en: "translations/ricoLocale_en.js",
+    es: "translations/ricoLocale_es.js",
+    fr: "translations/ricoLocale_fr.js",
+    it: "translations/ricoLocale_it.js",
+    ja: "translations/ricoLocale_ja.js",
+    ko: "translations/ricoLocale_ko.js",
+    pt: "translations/ricoLocale_pt.js",
+    zh: "translations/ricoLocale_zh.js"
+  },
+
+  languageInclude : function(lang2) {
+    var filename=this.languages[lang2];
+    if (filename) this.include(filename);
+    return !!filename;\r
+  },
+
+  acceptLanguage : function(acceptLang) {
+    var arLang=acceptLang.toLowerCase().split(',');\r
+    for (var i=0; i<arLang.length; i++) {\r
+      var lang2=arLang[i].match(/\w\w/);
+      if (!lang2) continue;\r
+      if (this.languageInclude(lang2)) return true;\r
+    }
+    return false;\r
+  },
+
+  /**
+   *  Expects one or more module or file names and loads
+   *  the appropriate files.
+   *  MUST call Rico.setPaths() before calling this method
+   */
+  loadModule : function() {
+    for (var a=0, length=arguments.length; a<length; a++) {
+      var name=arguments[a];
+      var dep=this.moduleDependencies[name];
+      if (dep) {
+        for (var i=0; i<dep.length; i++) {
+          if (dep[i].substring(0,1)=='+') {
+            this.loadModule(dep[i].slice(1));
+          } else {
+            this.include(dep[i]);
+          }
+        }
+      } else {
+        this.include(name);
+      }
+    }
+  },
+
+  include : function(filename) {
+    if (this.loadedFiles[filename]) return;
+    this.addPreloadMsg('include: '+filename);
+    var ext = filename.substr(filename.lastIndexOf('.')+1);
+    switch (ext.toLowerCase()) {
+      case 'js':
+        this.loadedFiles[filename]=filename.substring(0,4)=='rico' ? this.loadRequested : this.loadComplete;
+        var el = document.createElement('script');
+        el.type = 'text/javascript';
+        el.src = this.jsDir+filename;
+        document.getElementsByTagName('head')[0].appendChild(el);
+        break;
+      case 'css':
+        var el = document.createElement('link');
+        el.type = 'text/css';
+        el.rel = 'stylesheet';
+        el.href = this.cssDir+filename;
+        this.loadedFiles[filename]=this.loadComplete;
+        document.getElementsByTagName('head')[0].appendChild(el);
+        break;
+    }
+  },
+
+  // called after a script file has finished loading
+  includeLoaded: function(filename) {
+    this.loadedFiles[filename]=this.loadComplete;
+    this.checkIfComplete();
+  },
+
+  // called by the document onload event
+  windowLoaded: function() {
+    this.windowIsLoaded=true;
+    this.checkIfComplete();
+  },
+
+  checkIfComplete: function() {
+    var waitingFor=this.windowIsLoaded ? '' : 'window';
+    for(var filename in  this.loadedFiles) {
+      if (this.loadedFiles[filename]==this.loadRequested)
+        waitingFor+=' '+filename;
+    }
+    //window.status='waitingFor: '+waitingFor;
+    this.addPreloadMsg('waitingFor: '+waitingFor);
+    if (waitingFor.length==0) {
+      this.addPreloadMsg('Processing callbacks');
+      while (this.onLoadCallbacks.length > 0) {
+        var callback=this.onLoadCallbacks.shift();
+        if (callback) callback();
+      }
+    }
+  },
+
+  onLoad: function(callback,frontOfQ) {
+    if (frontOfQ)
+      this.onLoadCallbacks.unshift(callback);
+    else
+      this.onLoadCallbacks.push(callback);
+    this.checkIfComplete();
+  },
+
+  isKonqueror : navigator.userAgent.toLowerCase().indexOf("konqueror") > -1,
+  isIE:  !!(window.attachEvent && navigator.userAgent.indexOf('Opera') === -1),
+  isOpera: navigator.userAgent.indexOf('Opera') > -1,
+  isWebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+  isGecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') === -1,
+  ieVersion: /MSIE (\d+\.\d+);/.test(navigator.userAgent) ? new Number(RegExp.$1) : null,
+
+  // logging funtions
+
+  startTime : new Date(),
+
+  timeStamp: function() {
+    var stamp = new Date();
+    return (stamp.getTime()-this.startTime.getTime())+": ";
+  },
+
+setDebugArea: function(id, forceit) {
+  if (!this.debugArea || forceit) {
+    var newarea=document.getElementById(id);
+    if (!newarea) return;
+    this.debugArea=newarea;
+    newarea.value='';
+  }
+},
+
+addPreloadMsg: function(msg) {
+  this.preloadMsgs+=this.timeStamp()+msg+"\n";
+},
+
+log: function() {},
+
+enableLogging: function() {
+  if (this.debugArea) {
+    this.log = function(msg, resetFlag) {
+      if (resetFlag) this.debugArea.value='';
+      this.debugArea.value+=this.timeStamp()+msg+"\n";
+    };
+  } else if (window.console) {
+    if (window.console.firebug)
+      this.log = function(msg) { window.console.log(this.timeStamp(),msg); };
+    else
+      this.log = function(msg) { window.console.log(this.timeStamp()+msg); };\r
+  } else if (window.opera) {
+    this.log = function(msg) { window.opera.postError(this.timeStamp()+msg); };
+  }
+},
+
+$: function(e) {
+  return typeof e == 'string' ? document.getElementById(e) : e;
+},
+
+bind: function() {
+  var binderArgs = Array.prototype.slice.call(arguments);
+  var object = binderArgs.shift();
+  var method = binderArgs.shift();
+  return function() {
+    var callerArgs = Array.prototype.slice.call(arguments);
+    return object[method].apply(object,binderArgs.concat(callerArgs));
+  };
+},
+
+runLater: function() {
+  var args = Array.prototype.slice.call(arguments);
+  var msec = args.shift();
+  var object = args.shift();
+  var method = args.shift();
+  return setTimeout(function() { object[method].apply(object,args); },msec);
+},
+
+visible: function(element) {
+  return Rico.getStyle(element,"display") != 'none';
+},
+
+show: function(element) {
+  element.style.display = '';
+},
+
+hide: function(element) {
+  element.style.display = 'none';
+},
+
+toggle: function(element) {
+  element.style.display = element.style.display == 'none' ? '' : 'none';
+},
+
+viewportOffset: function(element) {
+  var offset=Rico.cumulativeOffset(element);
+  offset.left -= this.docScrollLeft();
+  offset.top -= this.docScrollTop();
+  return offset;
+},
+
+/**
+ * Return text within an html element
+ * @param el DOM node
+ * @param xImg true to exclude img tag info
+ * @param xForm true to exclude input, select, and textarea tags
+ * @param xClass exclude elements with a class name of xClass
+ */
+getInnerText: function(el,xImg,xForm,xClass) {
+  switch (typeof el) {
+    case 'string': return el;
+    case 'undefined': return el;
+    case 'number': return el.toString();
+  }
+  var cs = el.childNodes;
+  var l = cs.length;
+  var str = "";
+  for (var i = 0; i < l; i++) {
+    switch (cs[i].nodeType) {
+    case 1: //ELEMENT_NODE
+      if (this.getStyle(cs[i],'display')=='none') continue;
+      if (xClass && this.hasClass(cs[i],xClass)) continue;
+      switch (cs[i].tagName.toLowerCase()) {
+        case 'img':   if (!xImg) str += cs[i].alt || cs[i].title || cs[i].src; break;
+        case 'input': if (!xForm && !cs[i].disabled && cs[i].type.toLowerCase()=='text') str += cs[i].value; break;
+        case 'select': if (!xForm && cs[i].selectedIndex>=0) str += cs[i].options[cs[i].selectedIndex].text; break;
+        case 'textarea': if (!xForm && !cs[i].disabled) str += cs[i].value; break;
+        default:      str += this.getInnerText(cs[i],xImg,xForm,xClass); break;
+      }
+      break;
+    case 3: //TEXT_NODE
+      str += cs[i].nodeValue;
+      break;
+    }
+  }
+  return str;
+},
+
+/**
+ * Return value of a node in an XML response.
+ * For Konqueror 3.5, isEncoded must be true.
+ */
+getContentAsString: function( parentNode, isEncoded ) {
+  if (isEncoded) return this._getEncodedContent(parentNode);
+  if (typeof parentNode.xml != 'undefined') return this._getContentAsStringIE(parentNode);
+  return this._getContentAsStringMozilla(parentNode);
+},
+
+_getEncodedContent: function(parentNode) {
+  if (parentNode.innerHTML) return parentNode.innerHTML;
+  switch (parentNode.childNodes.length) {
+    case 0:  return "";
+    case 1:  return parentNode.firstChild.nodeValue;
+    default: return parentNode.childNodes[1].nodeValue;
+  }
+},
+
+_getContentAsStringIE: function(parentNode) {
+  var contentStr = "";
+  for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
+     var n = parentNode.childNodes[i];
+     contentStr += (n.nodeType == 4) ? n.nodeValue : n.xml;
+  }
+  return contentStr;
+},
+
+_getContentAsStringMozilla: function(parentNode) {
+   var xmlSerializer = new XMLSerializer();
+   var contentStr = "";
+   for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
+        var n = parentNode.childNodes[i];
+        if (n.nodeType == 4) { // CDATA node
+            contentStr += n.nodeValue;
+        }
+        else {
+          contentStr += xmlSerializer.serializeToString(n);
+      }
+   }
+   return contentStr;
+},
+
+/**
+ * @param n a number (or a string to be converted using parseInt)
+ * @returns the integer value of n, or 0 if n is not a number
+ */
+nan2zero: function(n) {
+  if (typeof(n)=='string') n=parseInt(n,10);
+  return isNaN(n) || typeof(n)=='undefined' ? 0 : n;
+},
+
+stripTags: function(s) {
+  return s.replace(/<\/?[^>]+>/gi, '');
+},
+
+truncate: function(s,length) {
+  return s.length > length ? s.substr(0, length - 3) + '...' : s;
+},
+
+zFill: function(n,slen, radix) {
+  var s=n.toString(radix || 10);
+  while (s.length<slen) s='0'+s;
+  return s;
+},
+
+keys: function(obj) {
+  var objkeys=[];
+  for(var k in obj)
+    objkeys.push[k];
+  return objkeys;
+},
+
+/**
+ * @param e event object
+ * @returns the key code stored in the event
+ */
+eventKey: function(e) {
+  if( typeof( e.keyCode ) == 'number'  ) {
+    return e.keyCode; //DOM
+  } else if( typeof( e.which ) == 'number' ) {
+    return e.which;   //NS 4 compatible
+  } else if( typeof( e.charCode ) == 'number'  ) {
+    return e.charCode; //also NS 6+, Mozilla 0.9+
+  }
+  return -1;  //total failure, we have no way of obtaining the key code
+},
+
+eventLeftClick: function(e) {
+  return (((e.which) && (e.which == 1)) ||
+          ((e.button) && (e.button == 1)));
+},
+
+eventRelatedTarget: function(e) {
+  return e.relatedTarget;
+},
+
+  /**
+ * Return the previous sibling that has the specified tagName
+ */
+ getPreviosSiblingByTagName: function(el,tagName) {
+       var sib=el.previousSibling;
+       while (sib) {
+               if ((sib.tagName==tagName) && (sib.style.display!='none')) return sib;
+               sib=sib.previousSibling;
+       }
+       return null;
+ },
+
+/**
+ * Return the parent of el that has the specified tagName.
+ * @param el DOM node
+ * @param tagName tag to search for
+ * @param className optional
+ */
+getParentByTagName: function(el,tagName,className) {
+  var par=el;
+  tagName=tagName.toLowerCase();
+  while (par) {
+    if (par.tagName && par.tagName.toLowerCase()==tagName) {
+      if (!className || par.className.indexOf(className)>=0) return par;
+    }
+       par=par.parentNode;
+  }
+  return null;
+},
+
+/**
+ * Wrap the children of a DOM element in a new element
+ * @param el the element whose children are to be wrapped
+ * @param cls class name of the wrapper (optional)
+ * @param id id of the wrapper (optional)
+ * @param wrapperTag type of wrapper element to be created (optional, defaults to DIV)
+ * @returns new wrapper element
+ */
+wrapChildren: function(el,cls,id,wrapperTag) {
+  var wrapper = document.createElement(wrapperTag || 'div');
+  if (id) wrapper.id=id;
+  if (cls) wrapper.className=cls;
+  while (el.firstChild) {
+    wrapper.appendChild(el.firstChild);
+  }
+  el.appendChild(wrapper);
+  return wrapper;
+},
+
+/**
+ * Positions ctl over icon
+ * @param ctl (div with position:absolute)
+ * @param icon element (img, button, etc) that ctl should be displayed next to
+ */
+positionCtlOverIcon: function(ctl,icon) {
+  icon=this.$(icon);
+  var offsets=this.cumulativeOffset(icon);
+  var scrTop=this.docScrollTop();
+  var winHt=this.windowHeight();
+  if (ctl.style.display=='none') ctl.style.display='block';
+  //var correction=this.isIE ? 1 : 2;  // based on a 1px border
+  var correction=2;  // based on a 1px border
+  var lpad=this.nan2zero(this.getStyle(icon,'paddingLeft'));
+  ctl.style.left = (offsets.left+lpad+correction)+'px';
+  var newTop=offsets.top + correction;// + scrTop;
+  var ctlht=ctl.offsetHeight;
+  var iconht=icon.offsetHeight;
+  var margin=10;  // account for shadow
+  if (newTop+iconht+ctlht+margin < winHt+scrTop) {
+    newTop+=iconht;  // display below icon
+  } else {
+    newTop=Math.max(newTop-ctlht,scrTop);  // display above icon
+  }
+  ctl.style.top = newTop+'px';
+},
+
+/**
+ * Creates a form element
+ * @param parent new element will be appended to this node
+ * @param elemTag element to be created (input, button, select, textarea, ...)
+ * @param elemType for input tag this specifies the type (checkbox, radio, text, ...)
+ * @param id id for new element
+ * @param name name for new element, if not specified then name will be the same as the id
+ * @returns new element
+ */
+createFormField: function(parent,elemTag,elemType,id,name) {
+  var field;
+  if (typeof name!='string') name=id;
+  if (this.isIE) {
+    // IE cannot set NAME attribute on dynamically created elements
+    var s=elemTag+' id="'+id+'"';
+    if (elemType) {
+      s+=' type="'+elemType+'"';
+    }
+    if (elemTag.match(/^(form|input|select|textarea|object|button|img)$/)) {
+      s+=' name="'+name+'"';
+    }
+    field=document.createElement('<'+s+' />');
+  } else {
+    field=document.createElement(elemTag);
+    if (elemType) {
+      field.type=elemType;
+    }
+    field.id=id;
+    if (typeof field.name=='string') {
+      field.name=name;
+    }
+  }
+  parent.appendChild(field);
+  return field;
+},
+
+/**
+ * Adds a new option to the end of a select list
+ * @returns new option element
+ */
+addSelectOption: function(elem,value,text) {
+  var opt=document.createElement('option');
+  if (typeof value=='string') opt.value=value;
+  opt.text=text;
+  if (this.isIE) {
+    elem.add(opt);
+  } else {
+    elem.add(opt,null);
+  }
+  return opt;
+},
+
+/**
+ * @returns the value of the specified cookie (or null if it doesn't exist)
+ */
+getCookie: function(itemName) {
+  var arg = itemName+'=';
+  var alen = arg.length;
+  var clen = document.cookie.length;
+  var i = 0;
+  while (i < clen) {
+    var j = i + alen;
+    if (document.cookie.substring(i, j) == arg) {
+      var endstr = document.cookie.indexOf (';', j);
+      if (endstr == -1) {
+        endstr=document.cookie.length;
+      }
+      return unescape(document.cookie.substring(j, endstr));
+    }
+    i = document.cookie.indexOf(' ', i) + 1;
+    if (i == 0) break;
+  }
+  return null;
+},
+
+getTBody: function(tab) {
+  return tab.tBodies.length==0 ? tab.appendChild(document.createElement("tbody")) : tab.tBodies[0];
+},
+
+/**
+ * Write information to a cookie.
+ * For cookies to be retained for the current session only, set daysToKeep=null.
+ * To erase a cookie, pass a negative daysToKeep value.
+ * @see <a href="http://www.quirksmode.org/js/cookies.html">Quirksmode article</a> for more information about cookies.
+ */
+setCookie: function(itemName,itemValue,daysToKeep,cookiePath,cookieDomain) {
+       var c = itemName+"="+escape(itemValue);
+       if (typeof(daysToKeep)=='number') {
+               var date = new Date();
+               date.setTime(date.getTime()+(daysToKeep*24*60*60*1000));
+               c+="; expires="+date.toGMTString();
+       }
+       if (typeof(cookiePath)=='string') {
+    c+="; path="+cookiePath;
+  }
+       if (typeof(cookieDomain)=='string') {
+    c+="; domain="+cookieDomain;
+  }
+  document.cookie = c;
+},
+
+phrasesById : {},
+/** thousands separator for number formatting */
+thouSep : ",",
+/** decimal point for number formatting */
+decPoint: ".",
+/** target language (2 character code) */
+langCode: "en",
+/** date format */
+dateFmt : "mm/dd/yyyy",
+/** time format */
+timeFmt : "hh:nn:ss a/pm",
+/** month name array (Jan is at index 0) */
+monthNames: ['January','February','March','April','May','June',
+             'July','August','September','October','November','December'],
+/** day of week array (Sunday is at index 0) */
+dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
+
+/**
+ * @param monthIdx 0-11
+ * @returns month abbreviation
+ */
+monthAbbr: function(monthIdx) {
+  return this.monthNamesShort ? this.monthNamesShort[monthIdx] : this.monthNames[monthIdx].substr(0,3);
+},
+
+/**
+ * @param dayIdx 0-6 (Sunday=0)
+ * @returns day of week abbreviation
+ */
+dayAbbr: function(dayIdx) {
+  return this.dayNamesShort ? this.dayNamesShort[dayIdx] : this.dayNames[dayIdx].substr(0,3);
+},
+
+addPhraseId: function(phraseId, phrase) {
+  this.phrasesById[phraseId]=phrase;
+},
+
+getPhraseById: function(phraseId) {
+  var phrase=this.phrasesById[phraseId];
+  if (!phrase) {
+    alert('Error: missing phrase for '+phraseId);
+    return '';
+  }
+  if (arguments.length <= 1) return phrase;
+  var a=arguments;
+  return phrase.replace(/(\$\d)/g,
+    function($1) {
+      var idx=parseInt($1.charAt(1),10);
+      return (idx < a.length) ? a[idx] : '';
+    }
+  );
+},
+
+/**
+ * Format a positive number (integer or float)
+ * @param posnum number to format
+ * @param decPlaces the number of digits to display after the decimal point
+ * @param thouSep the character to use as the thousands separator
+ * @param decPoint the character to use as the decimal point
+ * @returns formatted string
+ */
+formatPosNumber: function(posnum,decPlaces,thouSep,decPoint) {
+  var a=posnum.toFixed(decPlaces).split(/\./);
+  if (thouSep) {
+    var rgx = /(\d+)(\d{3})/;
+    while (rgx.test(a[0])) {
+      a[0]=a[0].replace(rgx, '$1'+thouSep+'$2');
+    }
+  }
+  return a.join(decPoint);
+},
+
+/**
+ * Format a number according to the specs in fmt object.
+ * @returns string, wrapped in a span element with a class of: negNumber, zeroNumber, posNumber
+ * These classes can be set in CSS to display negative numbers in red, for example.
+ *
+ * @param n number to be formatted
+ * @param fmt may contain any of the following:<dl>
+ *   <dt>multiplier </dt><dd> the original number is multiplied by this amount before formatting</dd>
+ *   <dt>decPlaces  </dt><dd> number of digits to the right of the decimal point</dd>
+ *   <dt>decPoint   </dt><dd> character to be used as the decimal point</dd>
+ *   <dt>thouSep    </dt><dd> character to use as the thousands separator</dd>
+ *   <dt>prefix     </dt><dd> string added to the beginning of the result (e.g. a currency symbol)</dd>
+ *   <dt>suffix     </dt><dd> string added to the end of the result (e.g. % symbol)</dd>
+ *   <dt>negSign    </dt><dd> specifies format for negative numbers: L=leading minus, T=trailing minus, P=parens</dd>
+ *</dl>
+ */
+formatNumber : function(n,fmt) {
+  if (typeof n=='string') n=parseFloat(n.replace(/,/,'.'),10);
+  if (isNaN(n)) return 'NaN';
+  if (typeof fmt.multiplier=='number') n*=fmt.multiplier;
+  var decPlaces=typeof fmt.decPlaces=='number' ? fmt.decPlaces : 0;
+  var thouSep=typeof fmt.thouSep=='string' ? fmt.thouSep : this.thouSep;
+  var decPoint=typeof fmt.decPoint=='string' ? fmt.decPoint : this.decPoint;
+  var prefix=fmt.prefix || "";
+  var suffix=fmt.suffix || "";
+  var negSign=typeof fmt.negSign=='string' ? fmt.negSign : "L";
+  negSign=negSign.toUpperCase();
+  var s,cls;
+  if (n<0.0) {
+    s=this.formatPosNumber(-n,decPlaces,thouSep,decPoint);
+    if (negSign=="P") s="("+s+")";
+    s=prefix+s;
+    if (negSign=="L") s="-"+s;
+    if (negSign=="T") s+="-";
+    cls='negNumber';
+  } else {
+    cls=n==0.0 ? 'zeroNumber' : 'posNumber';
+    s=prefix+this.formatPosNumber(n,decPlaces,thouSep,decPoint);
+  }
+  return "<span class='"+cls+"'>"+s+suffix+"</span>";
+},
+
+/**
+ * Converts a date to a string according to specs in fmt
+ * @returns formatted string
+ * @param d date to be formatted
+ * @param fmt string specifying the output format, may be one of the following:<dl>
+ * <dt>locale or localeDateTime</dt>
+ *   <dd>use javascript's built-in toLocaleString() function</dd>
+ * <dt>localeDate</dt>
+ *   <dd>use javascript's built-in toLocaleDateString() function</dd>
+ * <dt>translate or translateDateTime</dt>
+ *   <dd>use the formats specified in the Rico.dateFmt and Rico.timeFmt properties</dd>
+ * <dt>translateDate</dt>
+ *   <dd>use the date format specified in the Rico.dateFmt property</dd>
+ * <dt>Otherwise</dt>
+ *   <dd>Any combination of: yyyy, yy, mmmm, mmm, mm, m, hh, h, HH, H, nn, ss, a/p</dd>
+ *</dl>
+ */
+formatDate : function(d,fmt) {
+  var datefmt=(typeof fmt=='string') ? fmt : 'translateDate';
+  switch (datefmt) {
+    case 'locale':
+    case 'localeDateTime':
+      return d.toLocaleString();
+    case 'localeDate':
+      return d.toLocaleDateString();
+    case 'translate':
+    case 'translateDateTime':
+      datefmt=this.dateFmt+' '+this.timeFmt;
+      break;
+    case 'translateDate':
+      datefmt=this.dateFmt;
+      break;
+  }
+  return datefmt.replace(/(yyyy|yy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi,
+    function($1) {
+      var h;
+      switch ($1) {
+      case 'yyyy': return d.getFullYear();
+      case 'yy':   return d.getFullYear().toString().substr(2);
+      case 'mmmm': return Rico.monthNames[d.getMonth()];
+      case 'mmm':  return Rico.monthAbbr(d.getMonth());
+      case 'mm':   return Rico.zFill(d.getMonth() + 1, 2);
+      case 'm':    return (d.getMonth() + 1);
+      case 'dddd': return Rico.dayNames[d.getDay()];
+      case 'ddd':  return Rico.dayAbbr(d.getDay());
+      case 'dd':   return Rico.zFill(d.getDate(), 2);
+      case 'd':    return d.getDate();
+      case 'hh':   return Rico.zFill((h = d.getHours() % 12) ? h : 12, 2);
+      case 'h':    return ((h = d.getHours() % 12) ? h : 12);
+      case 'HH':   return Rico.zFill(d.getHours(), 2);
+      case 'H':    return d.getHours();
+      case 'nn':   return Rico.zFill(d.getMinutes(), 2);
+      case 'ss':   return Rico.zFill(d.getSeconds(), 2);
+      case 'a/p':  return d.getHours() < 12 ? 'a' : 'p';
+      }
+    }
+  );
+},
+
+/**
+ * Converts a string in ISO 8601 format to a date object.
+ * @returns date object, or false if string is not a valid date or date-time.
+ * @param string value to be converted
+ * @param offset can be used to bias the conversion and must be in minutes if provided
+ * @see Based on <a href='http://delete.me.uk/2005/03/iso8601.html'>delete.me.uk article</a>
+ */
+setISO8601 : function (string,offset) {
+  if (!string) return false;
+  var d = string.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|(?:([-+])(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
+  if (!d) return false;
+  if (!offset) offset=0;
+  var date = new Date(d[1], 0, 1);
+
+  if (d[2]) { date.setMonth(d[2] - 1); }
+  if (d[3]) { date.setDate(d[3]); }
+  if (d[4]) { date.setHours(d[4]); }
+  if (d[5]) { date.setMinutes(d[5]); }
+  if (d[6]) { date.setSeconds(d[6]); }
+  if (d[7]) { date.setMilliseconds(Number("0." + d[7]) * 1000); }
+  if (d[8]) {
+      if (d[10] && d[11]) {
+        offset = (Number(d[10]) * 60) + Number(d[11]);
+      }
+      offset *= ((d[9] == '-') ? 1 : -1);
+      offset -= date.getTimezoneOffset();
+  }
+  var time = (Number(date) + (offset * 60 * 1000));
+  date.setTime(Number(time));
+  return date;
+},
+
+/**
+ * Convert date to an ISO 8601 formatted string.
+ * @param date date object to be converted
+ * @param format an integer in the range 1-6 (default is 6):<dl>
+ * <dt>1 (year)</dt>
+ *   <dd>YYYY (eg 1997)</dd>
+ * <dt>2 (year and month)</dt>
+ *   <dd>YYYY-MM (eg 1997-07)</dd>
+ * <dt>3 (complete date)</dt>
+ *   <dd>YYYY-MM-DD (eg 1997-07-16)</dd>
+ * <dt>4 (complete date plus hours and minutes)</dt>
+ *   <dd>YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)</dd>
+ * <dt>5 (complete date plus hours, minutes and seconds)</dt>
+ *   <dd>YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)</dd>
+ * <dt>6 (complete date plus hours, minutes, seconds and a decimal
+ *   fraction of a second)</dt>
+ *   <dd>YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)</dd>
+ *</dl>
+ * @see Based on: <a href='http://www.codeproject.com/jscript/dateformat.asp'>codeproject.com article</a>
+ */
+toISO8601String : function (date, format, offset) {
+  if (!format) format=6;
+  if (!offset) {
+      offset = 'Z';
+  } else {
+      var d = offset.match(/([-+])([0-9]{2}):([0-9]{2})/);
+      var offsetnum = (Number(d[2]) * 60) + Number(d[3]);
+      offsetnum *= ((d[1] == '-') ? -1 : 1);
+      date = new Date(Number(Number(date) + (offsetnum * 60000)));
+  }
+
+  var zeropad = function (num) { return ((num < 10) ? '0' : '') + num; };
+
+  var str = date.getUTCFullYear();
+  if (format > 1) { str += "-" + zeropad(date.getUTCMonth() + 1); }
+  if (format > 2) { str += "-" + zeropad(date.getUTCDate()); }
+  if (format > 3) {
+      str += "T" + zeropad(date.getUTCHours()) +
+             ":" + zeropad(date.getUTCMinutes());
+  }
+  if (format > 5) {
+    var secs = Number(date.getUTCSeconds() + "." +
+               ((date.getUTCMilliseconds() < 100) ? '0' : '') +
+               zeropad(date.getUTCMilliseconds()));
+    str += ":" + zeropad(secs);
+  } else if (format > 4) {
+    str += ":" + zeropad(date.getUTCSeconds());
+  }
+
+  if (format > 3) { str += offset; }
+  return str;
+},
+
+/**
+ * Returns a new XML document object
+ */
+createXmlDocument : function() {
+  if (document.implementation && document.implementation.createDocument) {
+    var doc = document.implementation.createDocument("", "", null);
+    // some older versions of Moz did not support the readyState property
+    // and the onreadystate event so we patch it! 
+    if (doc.readyState == null) {
+      doc.readyState = 1;
+      doc.addEventListener("load", function () {
+        doc.readyState = 4;
+        if (typeof doc.onreadystatechange == "function") {
+          doc.onreadystatechange();
+        }
+      }, false);
+    }
+    return doc;
+  }
+
+  if (window.ActiveXObject)
+      return Rico.tryFunctions(
+        function() { return new ActiveXObject('MSXML2.DomDocument');   },
+        function() { return new ActiveXObject('Microsoft.DomDocument');},
+        function() { return new ActiveXObject('MSXML.DomDocument');    },
+        function() { return new ActiveXObject('MSXML3.DomDocument');   }
+      ) || false;
+  return null;
+}
+
+};
+
+/**
+ * Update the contents of an HTML element via an AJAX call
+ */
+Rico.ajaxUpdater = function(elem,url,options) {
+  this.updateSend(elem,url,options);
+};
+
+Rico.ajaxUpdater.prototype = {
+  updateSend : function(elem,url,options) {
+    this.element=elem;
+    this.onComplete=options.onComplete;
+    options.onComplete=Rico.bind(this,'updateComplete');
+    new Rico.ajaxRequest(url,options);
+  },
+
+  updateComplete : function(xhr) {
+    this.element.innerHTML=xhr.responseText;
+    if (this.onComplete) this.onComplete(xhr);
+  }
+};
+
+Rico.writeDebugMsg=Rico.log;  // for backwards compatibility
+
+Rico.init();
diff --git a/ricoClient/js/rico2Dojo.js b/ricoClient/js/rico2Dojo.js
new file mode 100644 (file)
index 0000000..83a92fc
--- /dev/null
@@ -0,0 +1,200 @@
+/**
+  *  Copyright (c) 2009 Matt Brown
+  *
+  *  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.
+  **/
+
+if (typeof dojo=='undefined') throw('This version of Rico requires the Dojo library');
+
+Rico.Lib='dojo';
+Rico.LibVersion=dojo.version.toString();
+Rico.extend=dojo.mixin;
+Rico.trim=dojo.trim;
+
+Rico.tryFunctions = function() {
+  for (var i=0; i<arguments.length; i++) {
+               try {
+                       return arguments[i]();
+               } catch(e){}
+       }
+       return null;
+};
+
+Rico.select=dojo.query;
+  
+Rico.eventBind=function(element, eventName, handler) {
+  handler.connection=dojo.connect(Rico.$(element), eventName, handler.object, handler.method);
+};
+
+Rico.eventUnbind=function(element, eventName, handler) {
+  dojo.disconnect(handler.connection);
+};
+
+Rico.eventElement=function(ev) {
+  return ev.target;
+};
+
+Rico.eventStop=dojo.stopEvent;
+
+Rico.eventClient=function(ev) {
+  return {x:ev.pageX, y:ev.pageY};
+};
+
+Rico.eventHandle=function(object, method) {
+  return { object: object, method: method };
+};
+
+Rico.addClass=dojo.addClass;
+Rico.removeClass=dojo.removeClass;
+Rico.hasClass=dojo.hasClass;
+
+Rico.getStyle=function(element, name) {
+  var camelCase = name.replace(/\-(\w)/g, function(all, letter){
+    return letter.toUpperCase();
+  });
+  return dojo.style(element,camelCase);
+};
+
+Rico.setStyle=dojo.style;
+
+// tried to use dojo._abs - 1.3.0 was broken in webkit, nightlies broken on IE8
+Rico.cumulativeOffset=function(element) {
+//  var offset=dojo._abs(element);
+//  return {top:offset.y, left:offset.x};
+  element=Rico.$(element);
+  var valueT = 0, valueL = 0;
+  do {
+    valueT += element.offsetTop  || 0;
+    valueL += element.offsetLeft || 0;
+    element = element.offsetParent;
+  } while (element);
+  return {left: valueL, top: valueT};
+};
+
+Rico.positionedOffset=function(element) {
+  element=Rico.$(element);
+  var p, valueT = 0, valueL = 0;
+  do {
+    valueT += element.offsetTop  || 0;
+    valueL += element.offsetLeft || 0;
+    element = element.offsetParent;
+    if (element) {
+      p = dojo.style(element,'position');
+      if (p == 'relative' || p == 'absolute') break;
+    }
+  } while (element);
+  return {left: valueL, top: valueT};
+};
+
+Rico.getDirectChildrenByTag=function(element, tagName) {
+  var kids = [];
+  var allKids = element.childNodes;
+  tagName=tagName.toLowerCase();
+  for( var i = 0 ; i < allKids.length ; i++ ) {
+    if ( allKids[i] && allKids[i].tagName && allKids[i].tagName.toLowerCase() == tagName )
+      kids.push(allKids[i]);
+  }
+  return kids;
+};
+
+// logic borrowed from Prototype
+Rico._getWinDimension=function(D) {
+  if (this.isWebKit && !document.evaluate) {
+    // Safari <3.0 needs self.innerWidth/Height
+    return self['inner' + D];
+  } else if (this.isOpera && parseFloat(window.opera.version()) < 9.5) {
+    // Opera <9.5 needs document.body.clientWidth/Height
+    return document.body['client' + D]
+  } else {
+    return document.documentElement['client' + D];
+  }
+};
+
+Rico.windowHeight=function() {
+  return this._getWinDimension('Height');
+};
+
+Rico.windowWidth=function() {
+  return this._getWinDimension('Width');
+};
+
+Rico.docScrollLeft=function() {
+  return dojo._docScroll().x;
+};
+
+Rico.docScrollTop=function() {
+  return dojo._docScroll().y;
+};
+
+Rico.ajaxRequest=function(url,options) {
+  this.dojoSend(url,options);
+}
+
+Rico.ajaxRequest.prototype = {
+  dojoSend : function(url,options) {
+    this.onComplete=options.onComplete;
+    this.onSuccess=options.onSuccess;
+    this.onFailure=options.onFailure;
+    var dOptions = {
+      handle : Rico.bind(this,'dojoComplete'),
+      error : Rico.bind(this,'dojoError'),
+      load : Rico.bind(this,'dojoLoad'),
+      url : url,
+      content : options.parameters,
+      form : options.form
+    }
+    var method=options.method.toUpperCase();
+    dojo.xhr(method, dOptions, method=='POST');
+  },
+  
+  dojoComplete : function(dataORerror, ioArgs) {
+    if (this.onComplete) this.onComplete(ioArgs.xhr);
+  },
+  
+  dojoError : function(response, ioArgs) {
+    if (this.onFailure) this.onFailure(ioArgs.xhr);
+  },
+  
+  dojoLoad : function(response, ioArgs) {
+    if (this.onSuccess) this.onSuccess(ioArgs.xhr);
+  }
+}
+
+Rico.getJSON=function(xhr) { return dojo.fromJson(xhr.responseText); };
+
+Rico.ajaxSubmit=function(form,url,options) {
+  options.form=form;
+  if (!options.method) options.method='post';
+  new Rico.ajaxRequest(url,options);
+}
+
+Rico.toQueryString=dojo.objectToQuery;
+
+// Animation
+
+Rico.fadeIn=function(element,duration,onEnd) {
+  var a=dojo.fadeIn({node:element, duration:duration});
+  if (onEnd) dojo.connect(a,"onEnd",onEnd);
+  a.play();
+};
+
+Rico.fadeOut=function(element,duration,onEnd) {
+  var a=dojo.fadeOut({node:element, duration:duration});
+  if (onEnd) dojo.connect(a,"onEnd",onEnd);
+  a.play();
+};
+
+Rico.animate=function(element,options,properties) {
+  options.node=element;
+  options.properties=properties;
+  a=dojo.animateProperty(options);
+  a.play();
+};
diff --git a/ricoClient/js/rico2Ext.js b/ricoClient/js/rico2Ext.js
new file mode 100644 (file)
index 0000000..dc05a38
--- /dev/null
@@ -0,0 +1,197 @@
+/**
+  *  Copyright (c) 2009 Matt Brown
+  *
+  *  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.
+  **/
+
+if (typeof Ext=='undefined') throw('This version of Rico requires the Ext-core library');
+
+
+Rico.Lib='Ext-core';
+Rico.LibVersion=Ext.version;
+Rico.extend=Ext.apply;
+Rico.trim=function(s) { return s.replace(Ext.DomQuery.trimRe,''); };
+Rico.tryFunctions = function() {
+  for (var i=0; i<arguments.length; i++) {
+               try {
+                       return arguments[i]();
+               } catch(e){}
+       }
+       return null;
+};
+
+
+Rico.select=Ext.query;
+  
+Rico.eventBind=function(element, eventName, handler) {
+  Ext.EventManager.addListener(element, eventName, handler.object[handler.method], handler.object);
+};
+
+Rico.eventUnbind=function(element, eventName, handler) {
+  Ext.EventManager.removeListener(element, eventName, handler.object[handler.method], handler.object);
+};
+
+Rico.eventHandle=function(object, method) {
+  return { object: object, method: method };
+};
+
+Rico.eventElement=function(ev) {
+  return ev.target;
+};
+
+Rico.eventClient=function(ev) {
+  return {x:ev.browserEvent.clientX, y:ev.browserEvent.clientY};
+};
+
+Rico.eventStop=function(ev) {
+  ev.stopEvent();
+};
+
+Rico.eventRelatedTarget=function(ev) {
+  return ev.getRelatedTarget();
+};
+  
+Rico.eventKey=function(ev) {
+  return ev.getKey();
+};
+  
+Rico.eventLeftClick=function(ev) {
+  return ev.button===0;
+};
+  
+Rico.addClass=function(element, className) {
+  return Ext.get(element).addClass(className);
+};
+
+Rico.removeClass=function(element, className) {
+  return Ext.get(element).removeClass(className);
+};
+
+Rico.hasClass=function(element, className) {
+  return Ext.get(element).hasClass(className);
+};
+  
+Rico.getStyle=function(element, property) {
+  return Ext.get(element).getStyle(property);
+};
+Rico.setStyle=function(element, properties) {
+  return Ext.get(element).setStyle(properties);
+};
+
+// logic borrowed from Prototype
+// Ext.lib.Dom.getViewportWidth/Height includes scrollbar in Gecko browsers
+Rico._getWinDimension=function(D) {
+  if (this.isWebKit && !document.evaluate) {
+    // Safari <3.0 needs self.innerWidth/Height
+    return self['inner' + D];
+  } else if (this.isOpera && parseFloat(window.opera.version()) < 9.5) {
+    // Opera <9.5 needs document.body.clientWidth/Height
+    return document.body['client' + D]
+  } else {
+    return document.documentElement['client' + D];
+  }
+};
+
+Rico.windowHeight=function() {
+  return this._getWinDimension('Height');
+};
+
+Rico.windowWidth=function() {
+  return this._getWinDimension('Width');
+};
+
+Rico.cumulativeOffset=function(element) {
+  element=Rico.$(element);
+  var valueT = 0, valueL = 0;
+  do {
+    valueT += element.offsetTop  || 0;
+    valueL += element.offsetLeft || 0;
+    element = element.offsetParent;
+  } while (element);
+  return {left: valueL, top: valueT};
+};
+
+Rico.positionedOffset=function(element) {
+  element=Rico.$(element);
+  var p, valueT = 0, valueL = 0;
+  do {
+    valueT += element.offsetTop  || 0;
+    valueL += element.offsetLeft || 0;
+    element = element.offsetParent;
+    if (element) {
+      p = Ext.get(element).getStyle('position');
+      if (p == 'relative' || p == 'absolute') break;
+    }
+  } while (element);
+  return {left: valueL, top: valueT};
+};
+
+Rico.docScrollLeft=function() {
+  return Ext.get(document).getScroll().left;
+};
+
+Rico.docScrollTop=function() {
+  return Ext.get(document).getScroll().top;
+};
+
+Rico.getDirectChildrenByTag=function(element, tagName) {
+  var kids = [];
+  var allKids = element.childNodes;
+  tagName=tagName.toLowerCase();
+  for( var i = 0 ; i < allKids.length ; i++ ) {
+    if ( allKids[i] && allKids[i].tagName && allKids[i].tagName.toLowerCase() == tagName )
+      kids.push(allKids[i]);
+  }
+  return kids;
+};
+
+Rico.ajaxRequest=function(url,options) {
+  var extOptions = {
+    success : options.onSuccess || options.onComplete,
+    failure : options.onFailure || options.onComplete,
+    method : options.method.toUpperCase(),
+    url : url,
+    form : options.form,
+    params : options.parameters
+  }
+  Ext.Ajax.request(extOptions);
+}
+
+Rico.getJSON=function(xhr) { return window["eval"]("(" + xhr.responseText + ")"); };
+
+Rico.ajaxSubmit=function(form,url,options) {
+  options.form=form;
+  if (!options.method) options.method='post';
+  Rico.ajaxRequest(url,options);
+}
+Rico.toQueryString=Ext.urlEncode;
+
+// Animation
+
+Rico.fadeIn=function(element,duration,onEnd) {
+  Ext.get(element).fadeIn({duration:duration/1000.0, callback: onEnd});
+};
+
+Rico.fadeOut=function(element,duration,onEnd) {
+  Ext.get(element).fadeOut({duration:duration/1000.0, callback: onEnd});
+};
+
+Rico.animate=function(element,options,properties) {
+  var opts={};
+  opts.callback=options.onEnd;
+  opts.duration=options.duration/1000.0;
+  opts.width=properties.width;
+  opts.height=properties.height;
+  opts.x=properties.left;
+  opts.y=properties.top;
+  opts.opacity=properties.opacity;
+  Ext.get(element).shift(opts);
+};
diff --git a/ricoClient/js/rico2Glow.js b/ricoClient/js/rico2Glow.js
new file mode 100644 (file)
index 0000000..e2578d4
--- /dev/null
@@ -0,0 +1,225 @@
+/**
+  *  Copyright (c) 2009 Matt Brown
+  *
+  *  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.
+  **/
+
+if (typeof glow=='undefined') throw('This version of Rico requires the glow library');
+
+
+Rico.Lib='Glow';
+Rico.LibVersion=glow.VERSION;
+Rico.extend=glow.lang.apply;
+Rico.trim=glow.lang.trim;
+Rico.tryFunctions = function() {
+  for (var i=0; i<arguments.length; i++) {
+    try {
+      return arguments[i]();
+    } catch(e){}
+  }
+  return null;
+};
+Rico._g=function(element) {
+  if (typeof element=='string')
+    element = document.getElementById(element);
+  return glow.dom.get(element);
+};
+
+Rico.select=function(selector, element) {
+  return element ? this._g(element).get(selector) : glow.dom.get(selector);
+};
+  
+Rico.eventBind=function(element, eventName, handler) {
+  handler.id=glow.events.addListener(Rico.$(element), eventName, handler.object[handler.method], handler.object);
+};
+
+Rico.eventUnbind=function(element, eventName, handler) {
+  glow.events.removeListener(handler.id);
+};
+
+Rico.eventHandle=function(object, method) {
+  return { object: object, method: method };
+};
+
+Rico.eventElement=function(ev) {
+  return ev.source;
+};
+
+Rico.eventClient=function(ev) {
+  return {x:ev.pageX - document.body.scrollLeft - document.documentElement.scrollLeft, 
+          y:ev.pageY - document.body.scrollTop - document.documentElement.scrollTop};
+};
+
+Rico.eventStop=function(ev) {
+  ev.preventDefault();
+  ev.stopPropagation();
+};
+
+Rico.eventKey=function(ev) {
+  return ev.keyCode;
+};
+
+Rico.eventLeftClick=function(ev) {
+  return ev.button==0;
+};
+  
+Rico.addClass=function(element, className) {
+  return this._g(element).addClass(className);
+};
+
+Rico.removeClass=function(element, className) {
+  return this._g(element).removeClass(className);
+};
+
+Rico.hasClass=function(element, className) {
+  return this._g(element).hasClass(className);
+};
+
+/*
+ran into bugs on FF and Safari with native Glow function
+Rico.getStyle=function(element, property) {
+  return this._g(element).css(property);
+};
+
+Use a modified version of Prototype's method
+*/
+Rico.getStyle=function(element, style) {
+  element = Rico.$(element);
+  var camelCase = style.replace(/\-(\w)/g, function(all, letter){
+    return letter.toUpperCase();
+  });
+  style = style == 'float' ? 'cssFloat' : camelCase;
+  var value = element.style[style];
+  if (!value || value == 'auto') {
+    if (element.currentStyle) {
+      value=element.currentStyle[style];
+    } else if (document.defaultView) {
+      var css = document.defaultView.getComputedStyle(element, null);
+      value = css ? css[style] : null;
+    }
+  }
+  if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+  return value == 'auto' ? null : value;
+};
+
+
+Rico.setStyle=function(element, properties) {
+  var elem=this._g(element);
+  for (var prop in properties) {
+    elem.css(prop,properties[prop])
+  }
+};
+
+/**
+ * @returns available height, excluding scrollbar & margin
+ */
+Rico.windowHeight=function() {
+  return glow.dom.get(window).height();
+};
+
+/**
+ * @returns available width, excluding scrollbar & margin
+ */
+Rico.windowWidth=function() {
+  return glow.dom.get(window).width();
+};
+
+Rico.positionedOffset=function(element) {
+  var p, valueT = 0, valueL = 0;
+  do {
+    valueT += element.offsetTop  || 0;
+    valueL += element.offsetLeft || 0;
+    element = element.offsetParent;
+    if (element) {
+      p = glow.dom.get(element).css('position');
+      if (p == 'relative' || p == 'absolute') break;
+    }
+  } while (element);
+  return {left: valueL, top: valueT};
+};
+
+Rico.cumulativeOffset=function(element) {
+  return this._g(element).offset();
+};
+
+Rico._docElement=function() {
+  return (document.compatMode && document.compatMode.indexOf("CSS")!=-1) ? document.documentElement : document.getElementsByTagName("body")[0];
+},
+
+Rico.docScrollLeft=function() {
+  return Rico._docElement.scrollLeft || window.pageXOffset || 0;
+};
+
+Rico.docScrollTop=function() {
+  return Rico._docElement.scrollTop || window.pageYOffset || 0;
+};
+
+Rico.getDirectChildrenByTag=function(element, tagName) {
+  tagName=tagName.toLowerCase();
+  return this._g(element).children().filter(function(i) { return this.tagName && this.tagName.toLowerCase()==tagName; });
+};
+
+Rico.getJSON=function(xhr) { return glow.data.decodeJson(xhr.responseText); };
+
+Rico.ajaxRequest=function(url,options) {
+  this.glowSend(url,options);
+}
+
+Rico.ajaxRequest.prototype = {
+  glowSend : function(url,options) {
+    this.onComplete=options.onComplete;
+    this.onSuccess=options.onSuccess;
+    this.onFailure=options.onFailure;
+    options.onLoad=Rico.bind(this,'glowLoad');
+    options.onError=Rico.bind(this,'glowError');
+    options.useCache=true;
+    if (options.method.toLowerCase()=='post') {
+      glow.net.post(url,options.parameters,options);
+    } else {
+      glow.net.get(url+'?'+glow.data.encodeUrl(options.parameters),options);
+    }
+  },
+  
+  glowError : function(response) {
+    if (this.onFailure) this.onFailure(response);
+    if (this.onComplete) this.onComplete(response.nativeResponse);
+  },
+  
+  glowLoad : function(response) {
+    if (this.onSuccess) this.onSuccess(response.nativeResponse);
+    if (this.onComplete) this.onComplete(response.nativeResponse);
+  }
+}
+
+Rico.ajaxSubmit=function(form,url,options) {
+  options.parameters=glow.data.encodeUrl(this._g(form).val());
+  if (!options.method) options.method='post';
+  url=url || form.action;
+  new Rico.ajaxRequest(url,options);
+}
+Rico.toQueryString=glow.data.encodeUrl;
+
+// Animation
+
+Rico.fadeIn=function(element,duration,onEnd) {
+  glow.anim.fadeIn(this._g(element), duration/1000.0, {onComplete:onEnd});
+};
+
+Rico.fadeOut=function(element,duration,onEnd) {
+  glow.anim.fadeOut(this._g(element), duration/1000.0, {onComplete:onEnd});
+};
+
+Rico.animate=function(element,options,properties) {
+  var effect=glow.anim.css(this._g(element), options.duration/1000.0, properties);
+  glow.events.addListener(effect, "complete", options.onEnd);
+  effect.start();
+  return effect;
+};
diff --git a/ricoClient/js/rico2Moo.js b/ricoClient/js/rico2Moo.js
new file mode 100644 (file)
index 0000000..81f5947
--- /dev/null
@@ -0,0 +1,184 @@
+/**
+  *  Copyright (c) 2009 Matt Brown
+  *
+  *  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.
+  **/
+
+if (typeof MooTools=='undefined') throw('This version of Rico requires the MooTools library');
+
+
+Rico.Lib='MooTools';
+Rico.LibVersion=MooTools.version;
+Rico.extend=$extend;
+Rico.tryFunctions = $try;
+Rico.trim=function(s) { return s.trim(); };
+
+Rico.select=function(selector, element) {
+  return $(element || document).getElements(selector);
+};
+  
+Rico.eventBind=function(element, eventName, handler) {
+  $(element).addEvent(eventName, handler);
+};
+
+Rico.eventUnbind=function(element, eventName, handler) {
+  $(element).removeEvent(eventName, handler);
+};
+
+Rico.eventHandle=function(object, method) {
+  return object[method].bindWithEvent(object);
+};
+
+Rico.eventElement=function(ev) {
+  return ev.target;
+};
+
+Rico.eventClient=function(ev) {
+  return ev.client;
+};
+
+Rico.eventKey=function(ev) {
+  return ev.code;
+};
+
+Rico.eventStop=function(ev) {
+  ev.stop();
+};
+
+Rico.eventLeftClick=function(ev) {
+  return !ev.rightClick;
+};
+  
+Rico.addClass=function(element, className) {
+  return $(element).addClass(className);
+};
+
+Rico.removeClass=function(element, className) {
+  return $(element).removeClass(className);
+};
+
+Rico.hasClass=function(element, className) {
+  return $(element).hasClass(className);
+};
+  
+Rico.getStyle=function(element, property) {
+  return $(element).getStyle(property);
+};
+
+Rico.setStyle=function(element, properties) {
+  return $(element).setStyles(properties);
+};
+
+/**
+ * @returns available height, excluding scrollbar & margin
+ */
+Rico.windowHeight=function() {
+  return Window.getSize().y;
+};
+
+/**
+ * @returns available width, excluding scrollbar & margin
+ */
+Rico.windowWidth=function() {
+  return Window.getSize().x;
+};
+
+Rico._fixOffsets=function(o) {
+  return {top: o.y, left: o.x};
+}
+
+Rico.positionedOffset=function(element) {
+  var p, valueT = 0, valueL = 0;
+  do {
+    valueT += element.offsetTop  || 0;
+    valueL += element.offsetLeft || 0;
+    element = element.offsetParent;
+    if (element) {
+      p = $(element).getStyle('position');
+      if (p == 'relative' || p == 'absolute') break;
+    }
+  } while (element);
+  return {left: valueL, top: valueT};
+};
+
+Rico.cumulativeOffset=function(element) {
+  return this._fixOffsets($(element).getPosition());
+};
+
+Rico.docScrollLeft=function() {
+  return Window.getScroll().x;
+};
+
+Rico.docScrollTop=function() {
+  return Window.getScroll().y;
+};
+
+Rico.getDirectChildrenByTag=function(element, tagName) {
+  return $(element).getChildren(tagName);
+};
+
+Rico.ajaxRequest=function(url,options) {
+  this.mooSend(url,options);
+}
+
+Rico.ajaxRequest.prototype = {
+  mooSend : function(url,options) {
+    this.onSuccess=options.onSuccess;
+    this.onComplete=options.onComplete;
+    var mooOptions = {
+      onComplete : Rico.bind(this,'mooComplete'),
+      onSuccess : Rico.bind(this,'mooSuccess'),
+      onFailure : options.onFailure,
+      method : options.method,
+      data : options.parameters,
+      url : url
+    }
+    this.mooRequest = new Request(mooOptions);
+    this.mooRequest.send();
+  },
+  
+  mooSuccess : function() {
+    if (this.onSuccess) this.onSuccess(this.mooRequest.xhr);
+  },
+  
+  mooComplete : function() {
+    if (this.onComplete) this.onComplete(this.mooRequest.xhr);
+  }
+}
+
+Rico.getJSON=function(xhr) { return JSON.decode(xhr.responseText,true); };
+
+Rico.ajaxSubmit=function(form,url,options) {
+  options.parameters=$(form).toQueryString();
+  if (!options.method) options.method='post';
+  url=url || form.action;
+  new Rico.ajaxRequest(url,options);
+}
+Rico.toQueryString=Hash.toQueryString;
+
+// Animation
+
+Rico.fadeIn=function(element,duration,onEnd) {
+  var a = new Fx.Tween(element, {duration:duration, onComplete:onEnd});
+  a.start('opacity', 1);
+};
+
+Rico.fadeOut=function(element,duration,onEnd) {
+  var a = new Fx.Tween(element, {duration:duration, onComplete:onEnd});
+  a.start('opacity', 0);
+};
+
+Rico.animate=function(element,options,properties) {
+  options.onComplete=options.onEnd;
+  var effect=new Fx.Morph(element,options);
+  effect.start(properties);
+  return effect;
+};
diff --git a/ricoClient/js/rico2Proto.js b/ricoClient/js/rico2Proto.js
new file mode 100644 (file)
index 0000000..bf90dba
--- /dev/null
@@ -0,0 +1,146 @@
+/**
+  *  Copyright (c) 2009 Matt Brown
+  *
+  *  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.
+  **/
+
+if (typeof Prototype=='undefined') throw('This version of Rico requires the Prototype library');
+
+Rico.Lib='Prototype';
+Rico.LibVersion=Prototype.Version;
+Rico.extend=Object.extend;
+Rico.tryFunctions=Try.these;
+Rico.trim=function(s) { return s.strip(); };
+
+Rico.toQueryString=Object.toQueryString;
+Rico.ajaxRequest=Ajax.Request;
+
+Rico.ajaxSubmit=function(form,url,options) {
+  options.parameters=Form.serialize(form);
+  if (!options.method) options.method='post';
+  url=url || form.action;
+  new Ajax.Request(url,options);
+}
+
+Rico.getJSON=function(xhr) { return xhr.responseJSON; };
+
+Rico.select=function(selector, element) {
+  return element ? $(element).select(selector) : $$(selector);
+};
+  
+Rico.eventBind=Event.observe;
+Rico.eventUnbind=Event.stopObserving;
+Rico.eventElement=Event.element;
+Rico.eventStop=Event.stop;
+Rico.eventClient=function(ev) {
+  return {x:ev.clientX, y:ev.clientY};
+};
+
+Rico.eventHandle=function(object, method) {
+  return object[method].bindAsEventListener(object);
+};
+
+Rico.addClass=Element.addClassName;
+Rico.removeClass=Element.removeClassName;
+Rico.hasClass=Element.hasClassName;
+
+Rico.getStyle=Element.getStyle;
+Rico.setStyle=Element.setStyle;
+Rico.windowHeight=function() {
+  return document.viewport.getHeight();
+};
+Rico.windowWidth=function() {
+  return document.viewport.getWidth();
+};
+Rico.positionedOffset=function(element) {
+  return $(element).positionedOffset();
+};
+Rico.cumulativeOffset=function(element) {
+  return $(element).cumulativeOffset();
+};
+
+Rico.docScrollLeft=function() {
+  return document.viewport.getScrollOffsets().left;
+};
+
+Rico.docScrollTop=function() {
+  return document.viewport.getScrollOffsets().top;
+};
+
+Rico.getDirectChildrenByTag=function(element, tagName) {
+  tagName=tagName.toLowerCase();
+  return $(element).childElements().inject([],function(result,child) {
+    if (child.tagName && child.tagName.toLowerCase()==tagName) result.push(child);
+    return result;});
+};
+
+
+// Animation
+
+Rico._animate=Class.create({
+  initialize: function(element,options,properties) {
+    this.element=$(element);
+    this.properties=[];
+    this.totSteps=(typeof options.duration =='number' ? options.duration : 500)/25;
+    this.options=options;
+    this.curStep=0;
+    var m,curval;
+    for (var p in properties) {
+      curval=this.element.getStyle(p);
+      switch (typeof curval) {
+        case 'string':
+          if (m=curval.match(/(-?\d+\.?\d*)([a-zA-Z]*)$/)) {
+            this.properties.push({property:p, vStart:parseFloat(m[1]), vEnd:parseFloat(properties[p]), units:m.length > 2 ? m[2] : ''});
+          }
+          break;
+        case 'number':
+          this.properties.push({property:p, vStart:curval, vEnd:parseFloat(properties[p]), units:''});
+          break;
+      }
+    }
+    this.px=new PeriodicalExecuter(this.processStep.bind(this),0.025);
+  },
+  
+  processStep: function() {
+    this.curStep++;
+    if (this.curStep >= this.totSteps) {
+      this.px.stop();
+      for (var i=0; i<this.properties.length; i++) {
+        this.setStyle(i,this.properties[i].vEnd);
+      }
+      if (this.options.onEnd) this.options.onEnd();
+    } else {
+      for (var i=0; i<this.properties.length; i++) {
+        var n=this.properties[i].vStart + (this.curStep / this.totSteps) * (this.properties[i].vEnd - this.properties[i].vStart);
+        this.setStyle(i,n);
+      }
+    }
+  },
+  
+  setStyle: function(idx, newVal) {
+    if (this.properties[idx].units) newVal+=this.properties[idx].units;
+    var styleParm={};
+    styleParm[this.properties[idx].property]=newVal;
+    this.element.setStyle(styleParm);
+  }
+});
+
+Rico.animate=function(element,options,properties) {
+  var a=new Rico._animate(element,options,properties);
+};
+
+Rico.fadeIn=function(element,duration,onEnd) {
+  new Rico._animate(element, {duration:duration, onEnd:onEnd}, {opacity:1.0})
+};
+
+Rico.fadeOut=function(element,duration,onEnd) {
+  new Rico._animate(element, {duration:duration, onEnd:onEnd}, {opacity:0.0})
+};
diff --git a/ricoClient/js/rico2jQuery.js b/ricoClient/js/rico2jQuery.js
new file mode 100644 (file)
index 0000000..bc35314
--- /dev/null
@@ -0,0 +1,168 @@
+/**
+  *  Copyright (c) 2009 Matt Brown
+  *
+  *  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.
+  **/
+
+if (typeof jQuery=='undefined') throw('This version of Rico requires the jQuery library');
+
+
+Rico.Lib='jQuery';
+Rico.LibVersion=jQuery().jquery;
+Rico.extend=jQuery.extend;
+Rico.trim=jQuery.trim;
+Rico.tryFunctions = function() {
+  for (var i=0; i<arguments.length; i++) {
+               try {
+                       return arguments[i]();
+               } catch(e){}
+       }
+       return null;
+};
+
+
+Rico._j=function(element) {
+  if (typeof element=='string')
+    element = document.getElementById(element);
+  return jQuery(element);
+};
+  
+Rico.select=function(selector, element) {
+  return element ? this._j(element).find(selector) : jQuery(selector);
+};
+  
+Rico.eventBind=function(element, eventName, handler) {
+  this._j(element).bind(eventName, handler);
+};
+
+Rico.eventUnbind=function(element, eventName, handler) {
+  this._j(element).unbind(eventName, handler);
+};
+
+Rico.eventHandle=function(object, method) {
+  return function(e) {
+    return object[method].call(object,e);
+  }
+};
+
+Rico.eventElement=function(ev) {
+  return ev.target;
+};
+
+Rico.eventClient=function(ev) {
+  return {x:ev.clientX, y:ev.clientY};
+};
+
+Rico.eventStop=function(ev) {
+  ev.preventDefault();
+  ev.stopPropagation();
+};
+  
+Rico.addClass=function(element, className) {
+  return this._j(element).addClass(className);
+};
+
+Rico.removeClass=function(element, className) {
+  return this._j(element).removeClass(className);
+};
+
+Rico.hasClass=function(element, className) {
+  return this._j(element).hasClass(className);
+};
+  
+Rico.getStyle=function(element, property) {
+  return this._j(element).css(property);
+};
+Rico.setStyle=function(element, properties) {
+  return this._j(element).css(properties);
+};
+
+/**
+ * @returns available height, excluding scrollbar & margin
+ */
+Rico.windowHeight=function() {
+  return jQuery(window).height();
+};
+
+/**
+ * @returns available width, excluding scrollbar & margin
+ */
+Rico.windowWidth=function() {
+  return jQuery(window).width();
+};
+
+Rico.positionedOffset=function(element) {
+  return this._j(element).position();
+};
+
+Rico.cumulativeOffset=function(element) {
+  return this._j(element).offset();
+};
+
+Rico.docScrollLeft=function() {
+  return jQuery('html').scrollLeft();
+};
+
+Rico.docScrollTop=function() {
+  return jQuery('html').scrollTop();
+};
+
+Rico.getDirectChildrenByTag=function(element, tagName) {
+  return this._j(element).children(tagName);
+};
+
+Rico.ajaxRequest=function(url,options) {
+  this.jSend(url,options);
+}
+
+Rico.ajaxRequest.prototype = {
+  jSend: function(url,options) {
+    this.onSuccess=options.onSuccess;
+    var jOptions = {
+      complete : options.onComplete,
+      error: options.onFailure,
+      success: Rico.bind(this,'jSuccess'),
+      type : options.method.toUpperCase(),
+      url : url,
+      data : options.parameters
+    }
+    this.xhr=jQuery.ajax(jOptions);
+  },
+  
+  jSuccess: function() {
+    if (this.onSuccess) this.onSuccess(this.xhr);
+  }
+}
+
+Rico.getJSON=function(xhr) { return jQuery.httpData(xhr,'json'); };
+
+Rico.ajaxSubmit=function(form,url,options) {
+  options.parameters=this._j(form).serialize();
+  if (!options.method) options.method='post';
+  url=url || form.action;
+  new Rico.ajaxRequest(url,options);
+}
+Rico.toQueryString=jQuery.param;
+
+// Animation
+
+Rico.fadeIn=function(element,duration,onEnd) {
+  this._j(element).fadeIn(duration,onEnd);
+};
+
+Rico.fadeOut=function(element,duration,onEnd) {
+  this._j(element).fadeOut(duration,onEnd);
+};
+
+Rico.animate=function(element,options,properties) {
+  options.complete=options.onEnd;
+  this._j(element).animate(properties,options);
+};
diff --git a/ricoClient/js/ricoCalendar.js b/ricoClient/js/ricoCalendar.js
new file mode 100644 (file)
index 0000000..c0d5721
--- /dev/null
@@ -0,0 +1,569 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+//  Inspired by code originally written by Tan Ling Wee on 2 Dec 2001
+//  Requires prototype.js and ricoCommon.js
+
+Rico.CalendarControl = function(id,options) {
+  this.initialize(id,options);
+};
+
+Rico.CalendarControl.prototype = {
+/**
+ * @class Implements a pop-up Gregorian calendar.
+ * Dates of adoption of the Gregorian calendar vary by country - accurate as a US & British calendar from 14 Sept 1752 to present.
+ * Mark special dates with calls to addHoliday()
+ * @extends Rico.Popup
+ * @constructs
+ * @param id unique identifier
+ * @param options object may contain any of the following:<dl>
+ *   <dt>startAt       </dt><dd> week starts with 0=sunday, 1=monday? default=0</dd>
+ *   <dt>showWeekNumber</dt><dd> show week number in first column? default=0</dd>
+ *   <dt>showToday     </dt><dd> show "Today is..." in footer? default=1</dd>
+ *   <dt>repeatInterval</dt><dd> when left/right arrow is pressed, repeat action every x milliseconds, default=100</dd>
+ *   <dt>dateFmt       </dt><dd> date format for return value (one of values accepted by {@link Date#formatDate}), default=ISO8601</dd>
+ *   <dt>minDate       </dt><dd> earliest selectable date? default=today-50 years</dd>
+ *   <dt>maxDate       </dt><dd> last selectable date? default=today+50 years</dd>
+ *</dl>
+ */
+  initialize: function(id,options) {
+    this.id=id;
+    var today=new Date();
+    Rico.extend(this, new Rico.Popup());
+    Rico.extend(this.options, {
+      ignoreClicks:true,
+      startAt : 0,
+      showWeekNumber : 0,
+      showToday : 1,
+      repeatInterval : 100,
+      dateFmt : 'ISO8601',
+      minDate : new Date(today.getFullYear()-50,0,1),
+      maxDate : new Date(today.getFullYear()+50,11,31)
+    });
+    Rico.extend(this.options, options || {});
+    /**
+     * alias for closePopup
+     * @function
+     */
+    this.close=this.closePopup;
+    this.bPageLoaded=false;
+    this.img=[];
+    this.Holidays={};
+    this.weekString=Rico.getPhraseById("calWeekHdg");
+    this.re=/^\s*(\w+)(\W)(\w+)(\W)(\w+)/i;
+    this.setDateFmt(this.options.dateFmt);
+  },
+
+
+  setDateFmt: function(fmt) {
+    this.dateFmt=(fmt=='rico') ? Rico.dateFmt : fmt;
+    Rico.log(this.id+' date format set to '+this.dateFmt);
+    this.dateParts={};
+    if (this.re.exec(this.dateFmt)) {
+      this.dateParts[RegExp.$1]=0;
+      this.dateParts[RegExp.$3]=1;
+      this.dateParts[RegExp.$5]=2;
+    }
+  },
+  
+/**
+ * Call before displaying calendar to highlight special days
+ * @param d day (1-31)
+ * @param m month (1-12)
+ * @param y year (0 implies a repeating holiday)
+ * @param desc description
+ * @param bgColor background color for cell displaying this day (CSS value, defaults to '#DDF')
+ * @param txtColor text color for cell displaying this day (CSS value), if not specified it is displayed with the same color as other days
+ */
+  addHoliday : function(d, m, y, desc, bgColor, txtColor) {
+    this.Holidays[this.holidayKey(y,m-1,d)]={desc:desc, txtColor:txtColor, bgColor:bgColor || '#DDF'};
+  },
+  
+/** @private */
+  holidayKey : function(y,m,d) {
+    return 'h'+Rico.zFill(y,4)+Rico.zFill(m,2)+Rico.zFill(d,2);
+  },
+
+  atLoad : function() {
+    Rico.log('Calendar#atLoad: '+this.id);
+    this.createContainer();
+    this.container.id=this.id;
+    //this.container.style.width="auto";
+    this.content.className=Rico.theme.calendar || 'ricoCalContainer';
+
+    this.maintab=document.createElement("table");
+    this.maintab.cellSpacing=2;
+    this.maintab.cellPadding=0;
+    this.maintab.border=0;
+    this.maintab.style.borderCollapse='separate';
+    this.maintab.className='ricoCalTab';
+    if (Rico.theme.calendarTable) Rico.addClass(this.maintab,Rico.theme.calendarTable)
+    this.tbody=Rico.getTBody(this.maintab);
+
+    var r,c,d,i,j,img,dow,a,s,tab;
+    this.colStart=this.options.showWeekNumber ? 1 : 0;
+    for (i=0; i<7; i++) {
+      r=this.tbody.insertRow(-1);
+      r.className='row'+i;
+      for (c=0; c<7+this.colStart; c++) {
+        r.insertCell(-1);
+      }
+    }
+    r=this.tbody.rows[0];
+    r.className='ricoCalDayNames';
+    if (this.options.showWeekNumber) {
+      r.cells[0].innerHTML=this.weekString;
+      for (i=0; i<7; i++) {
+        this.tbody.rows[i].cells[0].className='ricoCalWeekNum';
+      }
+    }
+    this.styles=[];
+    for (i=0; i<7; i++) {
+      dow=(i+this.options.startAt) % 7;
+      r.cells[i+this.colStart].innerHTML=Rico.dayAbbr(dow);
+      this.styles[i]='ricoCal'+dow;
+    }
+    
+    // table header (navigation controls)
+    this.thead=this.maintab.createTHead();
+    r=this.thead.insertRow(-1);
+    c=r.appendChild(document.createElement("th"));
+    c.colSpan=7+this.colStart;
+    d=c.appendChild(document.createElement("div"));
+    //d.style.padding='3px';
+    d.className=Rico.theme.calendarHeading || 'RicoCalHeading';
+    
+    d.appendChild(this._createTitleSection('Month'));
+    d.appendChild(this._createTitleSection('Year'));
+    new Rico.HoverSet(d.getElementsByTagName('a'));
+    new Rico.HoverSet(this.tbody.getElementsByTagName('td'),{ hoverNodes: function(e) { return e.innerHTML.match(/^\d+$/) ? [e] : []; } });
+    d.appendChild(Rico.closeButton(Rico.eventHandle(this,'close')));
+
+    // table footer (today)
+    if (this.options.showToday) {
+      this.tfoot=this.maintab.createTFoot();
+      r=this.tfoot.insertRow(-1);
+      this.todayCell=r.insertCell(-1);
+      this.todayCell.colSpan=7+this.colStart;
+      if (Rico.theme.calendarFooter) Rico.addClass(this.todayCell,Rico.theme.calendarFooter);
+      Rico.eventBind(this.todayCell,"click", Rico.eventHandle(this,'selectNow'), false);
+    }
+    this.content.appendChild(this.maintab);
+    var ie6=Rico.isIE && Rico.ieVersion < 7;
+    var selectOptions={shadow: !ie6};
+    
+    // month selector
+    this.monthPopup=new Rico.Popup(document.createElement("div"),selectOptions);
+    this.monthPopup.closePopup();
+    tab=document.createElement("table");
+    tab.className='ricoCalMenu';
+    if (Rico.theme.calendarPopdown) Rico.addClass(tab,Rico.theme.calendarPopdown);
+    tab.cellPadding=2;
+    tab.cellSpacing=0;
+    tab.border=0;
+    tab.style.borderCollapse='separate';
+    tab.style.margin='0px';
+    for (i=0; i<4; i++) {
+      r=tab.insertRow(-1);
+      for (j=0; j<3; j++) {
+        c=r.insertCell(-1);
+        a=document.createElement("a");
+        a.innerHTML=Rico.monthAbbr(i*3+j);
+        a.name=i*3+j;
+        if (Rico.theme.calendarDay) Rico.addClass(a,Rico.theme.calendarDay);
+        c.appendChild(a);
+        Rico.eventBind(a,"click", Rico.eventHandle(this,'selectMonth'), false);
+      }
+    }
+    new Rico.HoverSet(tab.getElementsByTagName('a'));
+    this.monthPopup.content.appendChild(tab);
+    this.content.appendChild(this.monthPopup.container);
+    
+    // year selector
+    this.yearPopup=new Rico.Popup(document.createElement("div"),selectOptions);
+    this.yearPopup.closePopup();
+    this.yearPopup.content.className='ricoCalYearPrompt';
+    if (Rico.theme.calendarPopdown) Rico.addClass(this.yearPopup.content,Rico.theme.calendarPopdown);
+    var tab=document.createElement("table");
+    tab.cellPadding=2;
+    tab.cellSpacing=0;
+    tab.border=0;
+    tab.style.borderCollapse='separate';
+    tab.style.margin='0px';
+    r=tab.insertRow(-1);
+    this.yearLabel=r.insertCell(-1);
+    this.yearLabel.colSpan=3;
+    r=tab.insertRow(-1);
+    c=r.insertCell(-1);
+    this.yearInput=c.appendChild(document.createElement("input"));
+    this.yearInput.maxlength=4;
+    this.yearInput.size=4;
+    Rico.eventBind(this.yearInput,"keypress", Rico.eventHandle(this,'yearKey'), false);
+    c=r.insertCell(-1);
+    c.appendChild(Rico.floatButton('Checkmark', Rico.eventHandle(this,'processPopUpYear')));
+    c=r.insertCell(-1);
+    c.appendChild(Rico.floatButton('Cancel', Rico.eventHandle(this,'popDownYear')));
+    this.yearPopup.content.appendChild(tab);
+    this.content.appendChild(this.yearPopup.container);
+
+    //this.yearLabel.className='ricoCalYearPromptText';
+
+    // fix anchors so they work in IE6
+    a=this.content.getElementsByTagName('a');
+    for (i=0; i<a.length; i++) {
+      a[i].href='javascript:void(0)';
+    }
+    
+    Rico.eventBind(this.tbody,"click", Rico.eventHandle(this,'saveAndClose'));
+    this.close();
+    this.bPageLoaded=true;
+  },
+
+  _createTitleSection : function(section) {
+    var s=document.createElement("span");
+    s.className='RicoCal'+section+'Heading';
+
+    var a=s.appendChild(document.createElement("a"));
+    a.className='Rico_leftArrow';
+    if (Rico.theme.leftArrowAnchor) Rico.addClass(a,Rico.theme.leftArrowAnchor);
+    a.appendChild(this.createNavArrow('dec'+section,'left'));
+
+    a=s.appendChild(document.createElement("a"));
+    a.style.display='inline';
+    Rico.eventBind(a,"click", Rico.eventHandle(this,'popUp'+section), false);
+    this['title'+section]=a;
+
+    a=s.appendChild(document.createElement("a"));
+    a.className='Rico_rightArrow';
+    if (Rico.theme.rightArrowAnchor) Rico.addClass(a,Rico.theme.rightArrowAnchor);
+    a.appendChild(this.createNavArrow('inc'+section,'right'));
+    return s
+  },
+  
+  selectNow : function() {
+    var today = new Date();
+    this.dateNow  = today.getDate();
+    this.monthNow = today.getMonth();
+    this.yearNow  = today.getFullYear();
+    this.monthSelected=this.monthNow;
+    this.yearSelected=this.yearNow;
+    this.constructCalendar();
+  },
+  
+/** @private */
+  createNavArrow: function(funcname,gifname) {
+    var img;
+    img=document.createElement("span");
+    img.className=Rico.theme[gifname+'Arrow'] || 'Rico_'+gifname+'Arrow';
+    Rico.eventBind(img,"click", Rico.eventHandle(this,funcname), false);
+    Rico.eventBind(img,"mousedown", Rico.eventHandle(this,'mouseDown'), false);
+    Rico.eventBind(img,"mouseup", Rico.eventHandle(this,'mouseUp'), false);
+    Rico.eventBind(img,"mouseout", Rico.eventHandle(this,'mouseUp'), false);
+    return img;
+  },
+
+/** @private */
+  mouseDown: function(e) {
+    var el=Rico.eventElement(e);
+    this.repeatFunc=Rico.bind(this,el.name);
+    this.timeoutID=Rico.runLater(500,this,'repeatStart');
+  },
+  
+/** @private */
+  mouseUp: function(e) {
+    clearTimeout(this.timeoutID);
+    clearInterval(this.intervalID);
+  },
+  
+/** @private */
+  repeatStart : function() {
+    clearInterval(this.intervalID);
+    this.intervalID=setInterval(this.repeatFunc,this.options.repeatInterval);
+  },
+  
+/**
+ * @returns true if yr/mo is within minDate/MaxDate
+ */
+  isValidMonth : function(yr,mo) {
+    if (yr < this.options.minDate.getFullYear()) return false;
+    if (yr == this.options.minDate.getFullYear() && mo < this.options.minDate.getMonth()) return false;
+    if (yr > this.options.maxDate.getFullYear()) return false;
+    if (yr == this.options.maxDate.getFullYear() && mo > this.options.maxDate.getMonth()) return false;
+    return true;
+  },
+
+  incMonth : function() {
+    var newMonth=this.monthSelected+1;
+    var newYear=this.yearSelected;
+    if (newMonth>11) {
+      newMonth=0;
+      newYear++;
+    }
+    if (!this.isValidMonth(newYear,newMonth)) return;
+    this.monthSelected=newMonth;
+    this.yearSelected=newYear;
+    this.constructCalendar();
+  },
+
+  decMonth : function() {
+    var newMonth=this.monthSelected-1;
+    var newYear=this.yearSelected;
+    if (newMonth<0) {
+      newMonth=11;
+      newYear--;
+    }
+    if (!this.isValidMonth(newYear,newMonth)) return;
+    this.monthSelected=newMonth;
+    this.yearSelected=newYear;
+    this.constructCalendar();
+  },
+  
+/** @private */
+  selectMonth : function(e) {
+    var el=Rico.eventElement(e);
+    this.monthSelected=parseInt(el.name,10);
+    this.constructCalendar();
+    Rico.eventStop(e);
+  },
+
+  popUpMonth : function() {
+    if (this.monthPopup.visible()) {
+      this.popDownMonth();
+      return;
+    }
+    this.popDownYear();
+    this.monthPopup.openPopup(this.titleMonth.parentNode.offsetLeft, this.thead.offsetHeight+2);
+  },
+
+  popDownMonth : function() {
+    this.monthPopup.closePopup();
+  },
+
+  popDownYear : function() {
+    this.yearPopup.closePopup();
+    this.yearInput.disabled=true;  // make sure this does not get submitted
+  },
+
+/**
+ * Prompt for year
+ */
+  popUpYear : function() {
+    if (this.yearPopup.visible()) {
+      this.popDownYear();
+      return;
+    }
+    this.popDownMonth();
+    this.yearPopup.openPopup(90, this.thead.offsetHeight+2);
+    this.yearLabel.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
+    this.yearInput.disabled=false;
+    this.yearInput.value='';   // this.yearSelected
+    this.yearInput.focus();
+  },
+  
+  yearKey : function(e) {
+    switch (Rico.eventKey(e)) {
+      case 27: this.popDownYear(); Rico.eventStop(e); return false;
+      case 13: this.processPopUpYear(); Rico.eventStop(e); return false;
+    }
+    return true;
+  },
+  
+  processPopUpYear : function() {
+    var newYear=this.yearInput.value;
+    newYear=parseInt(newYear,10);
+    if (isNaN(newYear) || newYear<this.options.minDate.getFullYear() || newYear>this.options.maxDate.getFullYear()) {
+      alert(Rico.getPhraseById("calInvalidYear"));
+    } else {
+      this.yearSelected=newYear;
+      this.popDownYear();
+      this.constructCalendar();
+    }
+  },
+  
+  incYear : function() {
+    if (this.yearSelected>=this.options.maxDate.getFullYear()) return;
+    this.yearSelected++;
+    this.constructCalendar();
+  },
+
+  decYear : function() {
+    if (this.yearSelected<=this.options.minDate.getFullYear()) return;
+    this.yearSelected--;
+    this.constructCalendar();
+  },
+
+  // tried a number of different week number functions posted on the net
+  // this is the only one that produced consistent results when comparing week numbers for December and the following January
+  WeekNbr : function(year,month,day) {
+    var when = new Date(year,month,day);
+    var newYear = new Date(year,0,1);
+    var offset = 7 + 1 - newYear.getDay();
+    if (offset == 8) offset = 1;
+    var daynum = ((Date.UTC(year,when.getMonth(),when.getDate(),0,0,0) - Date.UTC(year,0,1,0,0,0)) /1000/60/60/24) + 1;
+    var weeknum = Math.floor((daynum-offset+7)/7);
+    if (weeknum == 0) {
+      year--;
+      var prevNewYear = new Date(year,0,1);
+      var prevOffset = 7 + 1 - prevNewYear.getDay();
+      weeknum = (prevOffset == 2 || prevOffset == 8) ? 53 : 52;
+    }
+    return weeknum;
+  },
+
+  constructCalendar : function() {
+    var aNumDays = [31,0,31,30,31,30,31,31,30,31,30,31];
+    var startDate = new Date (this.yearSelected,this.monthSelected,1);
+    var endDate,numDaysInMonth,i,colnum;
+
+    if (typeof this.monthSelected!='number' || this.monthSelected>=12 || this.monthSelected<0) {
+      alert('ERROR in calendar: monthSelected='+this.monthSelected);
+      return;
+    }
+
+    if (this.monthSelected==1) {
+      endDate = new Date (this.yearSelected,this.monthSelected+1,1);
+      endDate = new Date (endDate - (24*60*60*1000));
+      numDaysInMonth = endDate.getDate();
+    } else {
+      numDaysInMonth = aNumDays[this.monthSelected];
+    }
+    var dayPointer = startDate.getDay() - this.options.startAt;
+    if (dayPointer<0) dayPointer+=7;
+    this.popDownMonth();
+    this.popDownYear();
+
+    //this.bgcolor=Rico.getStyle(this.tbody,'background-color');
+    //this.bgcolor=this.bgcolor.replace(/\"/g,'');
+    if (this.options.showWeekNumber) {
+      for (i=1; i<7; i++) {
+        this.tbody.rows[i].cells[0].innerHTML='&nbsp;';
+      }
+    }
+    for ( i=0; i<dayPointer; i++ ) {
+      this.resetCell(this.tbody.rows[1].cells[i+this.colStart]);
+    }
+
+    for ( var datePointer=1,r=1; datePointer<=numDaysInMonth; datePointer++,dayPointer++ ) {
+      colnum=dayPointer % 7;
+      if (this.options.showWeekNumber && colnum==0) {
+        this.tbody.rows[r].cells[0].innerHTML=this.WeekNbr(this.yearSelected,this.monthSelected,datePointer);
+      }
+      var c=this.tbody.rows[r].cells[colnum+this.colStart];
+      c.innerHTML=datePointer;
+      c.className=this.styles[colnum];
+      if ((datePointer==this.dateNow)&&(this.monthSelected==this.monthNow)&&(this.yearSelected==this.yearNow)) {
+        Rico.addClass(c,Rico.theme.calendarToday || 'ricoCalToday');
+      }
+      if (Rico.theme.calendarDay) Rico.addClass(c,Rico.theme.calendarDay);
+      if ((datePointer==this.odateSelected) && (this.monthSelected==this.omonthSelected) && (this.yearSelected==this.oyearSelected)) {
+        Rico.addClass(c,Rico.theme.calendarSelectedDay || 'ricoSelectedDay');
+      }
+      var h=this.Holidays[this.holidayKey(this.yearSelected,this.monthSelected,datePointer)];
+      if (!h)  {
+        h=this.Holidays[this.holidayKey(0,this.monthSelected,datePointer)];
+      }
+      c.style.color=h ? h.txtColor : '';
+      c.style.backgroundColor=h ? h.bgColor : '';
+      c.title=h ? h.desc : '';
+      if (colnum==6) r++;
+    }
+    while (dayPointer<42) {
+      colnum=dayPointer % 7;
+      this.resetCell(this.tbody.rows[r].cells[colnum+this.colStart]);
+      dayPointer++;
+      if (colnum==6) r++;
+    }
+
+    this.titleMonth.innerHTML = Rico.monthAbbr(this.monthSelected);
+    this.titleYear.innerHTML = this.yearSelected;
+    if (this.todayCell) {
+      this.todayCell.innerHTML = Rico.getPhraseById("calToday",this.dateNow,Rico.monthAbbr(this.monthNow),this.yearNow,this.monthNow+1);
+    }
+  },
+  
+/** @private */
+  resetCell: function(c) {
+    c.innerHTML="&nbsp;";
+    c.className='ricoCalEmpty';
+    c.style.color='';
+    c.style.backgroundColor='';
+    c.title='';
+  },
+  
+/** @private */
+  saveAndClose : function(e) {
+    Rico.eventStop(e);
+    var el=Rico.eventElement(e);
+    var s=el.innerHTML.replace(/&nbsp;/g,'');
+    if (s=='' || el.className=='ricoCalWeekNum') return;
+    var day=parseInt(s,10);
+    if (isNaN(day)) return;
+    var d=new Date(this.yearSelected,this.monthSelected,day);
+    var dateStr=Rico.formatDate(d,this.dateFmt=='ISO8601' ? 'yyyy-mm-dd' : this.dateFmt);
+    if (this.returnValue) {
+      this.returnValue(dateStr);
+      this.close();
+    }
+  },
+
+  open : function(curval) {
+    if (!this.bPageLoaded) return;
+    var today = new Date();
+    this.dateNow  = today.getDate();
+    this.monthNow = today.getMonth();
+    this.yearNow  = today.getFullYear();
+    this.oyearSelected = -1;
+    if (typeof curval=='object') {
+      this.odateSelected  = curval.getDate();
+      this.omonthSelected = curval.getMonth();
+      this.oyearSelected  = curval.getFullYear();
+    } else if (this.dateFmt=='ISO8601') {
+      var d=Rico.setISO8601(curval);
+      if (d) {
+        this.odateSelected  = d.getDate();
+        this.omonthSelected = d.getMonth();
+        this.oyearSelected  = d.getFullYear();
+      }
+    } else if (this.re.exec(curval)) {
+      var aDate = [ RegExp.$1, RegExp.$3, RegExp.$5 ];
+      this.odateSelected  = parseInt(aDate[this.dateParts.dd], 10);
+      this.omonthSelected = parseInt(aDate[this.dateParts.mm], 10) - 1;
+      this.oyearSelected  = parseInt(aDate[this.dateParts.yyyy], 10);
+      if (this.oyearSelected < 100) {
+        // apply a century to 2-digit years
+        this.oyearSelected+=this.yearNow - (this.yearNow % 100);
+        var maxyr=this.options.maxDate.getFullYear();
+        while (this.oyearSelected > maxyr) this.oyearSelected-=100;
+      }
+    } else {
+      if (curval) {
+        alert('ERROR: invalid date passed to calendar ('+curval+')');
+      }
+    }
+    if (this.oyearSelected > 0) {
+      this.dateSelected=this.odateSelected;
+      this.monthSelected=this.omonthSelected;
+      this.yearSelected=this.oyearSelected;
+    } else {
+      this.dateSelected=this.dateNow;
+      this.monthSelected=this.monthNow;
+      this.yearSelected=this.yearNow;
+    }
+    this.constructCalendar();
+    this.openPopup();
+  }
+};
+
+Rico.includeLoaded('ricoCalendar.js');
diff --git a/ricoClient/js/ricoColorPicker.js b/ricoClient/js/ricoColorPicker.js
new file mode 100644 (file)
index 0000000..a1e64c3
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+// ===================================================================
+// Adapted to Rico by Matt Brown from code 
+//   published by Matt Kruse http://www.mattkruse.com/
+// ===================================================================
+
+Rico.ColorPicker = function(id,options) {
+  this.initialize(id,options);
+};
+
+Rico.ColorPicker.prototype = {
+/**
+ * @class Implements a pop-up color picker control.
+ * @extends Rico.Popup
+ * @constructs
+ * @param id unique identifier
+ * @param options object may contain any of the following:<dl>
+ *   <dt>showColorCode</dt><dd> show hex color code as user hovers over color grid? default=false</dd>
+ *   <dt>cellsPerRow  </dt><dd> number of colors per row in the grid? default=18</dd>
+ *   <dt>palette      </dt><dd> array of 6 digit hex values, default=216 "web safe" colors</dd>
+ *</dl>
+ */
+  initialize: function(id,options) {
+    this.id=id;
+    this.currentValue = "#FFFFFF";
+    Rico.extend(this, new Rico.Popup());
+    Rico.extend(this.options, {
+      showColorCode : false,
+      cellsPerRow   : 18,
+      palette       : []
+    });
+    var hexvals=['00','33','66','99','CC','FF'];
+    for (var g=0; g<hexvals.length; g++) {
+      for (var r=0; r<hexvals.length; r++) {
+        for (var b=0; b<hexvals.length; b++) {
+          this.options.palette.push(hexvals[r]+hexvals[g]+hexvals[b]);
+        }
+      }
+    }
+    Rico.extend(this.options, options || {});
+  },
+
+  atLoad : function() {
+    this.createContainer();
+    this.content.className='ricoColorPicker';
+    var width = this.options.cellsPerRow;
+    var cp_contents = "<TABLE BORDER='1' CELLSPACING='1' CELLPADDING='0'>";
+    for (var i=0; i<this.options.palette.length; i++) {
+      if ((i % width) == 0) { cp_contents += "<TR>"; }
+      cp_contents += '<TD BGCOLOR="#'+this.options.palette[i]+'">&nbsp;</TD>';
+      if ( ((i+1)>=this.options.palette.length) || (((i+1) % width) == 0)) {
+        cp_contents += "</TR>";
+      }
+    }
+    var halfwidth = Math.floor(width/2);
+    if (this.options.showColorCode) {
+      cp_contents += "<TR><TD COLSPAN='"+halfwidth+"' ID='colorPickerSelectedColor'>&nbsp;</TD><TD COLSPAN='"+(width-halfwidth)+"' ALIGN='CENTER' ID='colorPickerSelectedColorValue'>#FFFFFF</TD></TR>";
+    } else {
+      cp_contents += "<TR><TD COLSPAN='"+width+"' ID='colorPickerSelectedColor'>&nbsp;</TD></TR>";
+    }
+    cp_contents += "</TABLE>";
+    this.content.innerHTML=cp_contents;
+    /**
+     * alias for openPopup
+     * @function
+     */
+    this.open=this.openPopup;
+    /**
+     * alias for closePopup
+     * @function
+     */
+    this.close=this.closePopup;
+    Rico.eventBind(this.container,"mouseover", Rico.eventHandle(this,'highlightColor'), false);
+    Rico.eventBind(this.container,"click", Rico.eventHandle(this,'selectColor'), false);
+    this.close();
+  },
+
+/** @private */
+  selectColor: function(e) {
+    Rico.eventStop(e);
+    if (this.returnValue) this.returnValue(this.currentValue);
+    this.close();
+  },
+
+/* This function runs when you move your mouse over a color block */
+/** @private */
+  highlightColor: function(e) {
+    var elem = Rico.eventElement(e);
+    if (!elem.tagName || elem.tagName.toLowerCase() != 'td') return;
+    var c=Rico.Color.createColorFromBackground(elem).toString();
+    this.currentValue = c;
+    Rico.setStyle('colorPickerSelectedColor', {backgroundColor:c});
+    var d = Rico.$("colorPickerSelectedColorValue");
+    if (d) d.innerHTML = c;
+  }
+};
+
+Rico.includeLoaded('ricoColorPicker.js');
diff --git a/ricoClient/js/ricoDragDrop.js b/ricoClient/js/ricoDragDrop.js
new file mode 100644 (file)
index 0000000..e0f8bc6
--- /dev/null
@@ -0,0 +1,578 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+Rico.dndMgrList = [];
+
+Rico.registerDraggable = function(aDraggable, mgrIdx) {
+  if (typeof mgrIdx != 'number') mgrIdx=0;
+  if (typeof Rico.dndMgrList[mgrIdx] != 'object')
+    Rico.dndMgrList[mgrIdx] = new Rico.dndMgr();
+  Rico.dndMgrList[mgrIdx].registerDraggable(aDraggable);
+};
+
+Rico.registerDropZone = function(aDropZone, mgrIdx) {
+  if (typeof mgrIdx != 'number') mgrIdx=0;
+  if (typeof Rico.dndMgrList[mgrIdx] != 'object')
+    Rico.dndMgrList[mgrIdx] = new Rico.dndMgr();
+  Rico.dndMgrList[mgrIdx].registerDropZone(aDropZone);
+};
+
+Rico.dndMgr = function() {
+  this.initialize();
+};
+
+Rico.dndMgr.prototype = {
+/**
+ * @class Implements drag-n-drop manager -- a group of linked draggables and drop zones
+ * @constructs
+ */
+   initialize: function() {
+      this.dropZones                = [];
+      this.draggables               = [];
+      this.currentDragObjects       = [];
+      this.dragElement              = null;
+      this.lastSelectedDraggable    = null;
+      this.currentDragObjectVisible = false;
+      this.interestedInMotionEvents = false;
+      this._mouseDown = Rico.eventHandle(this,'_mouseDownHandler');
+      this._mouseMove = Rico.eventHandle(this,'_mouseMoveHandler');
+      this._mouseUp = Rico.eventHandle(this,'_mouseUpHandler');
+   },
+
+   registerDropZone: function(aDropZone) {
+      this.dropZones[ this.dropZones.length ] = aDropZone;
+   },
+
+   deregisterDropZone: function(aDropZone) {
+      var newDropZones = new Array();
+      var j = 0;
+      for ( var i = 0 ; i < this.dropZones.length ; i++ ) {
+         if ( this.dropZones[i] != aDropZone )
+            newDropZones[j++] = this.dropZones[i];
+      }
+
+      this.dropZones = newDropZones;
+   },
+
+   clearDropZones: function() {
+      this.dropZones = new Array();
+   },
+
+   registerDraggable: function( aDraggable ) {
+      this.draggables[ this.draggables.length ] = aDraggable;
+      var htmlElement = aDraggable.getMouseDownHTMLElement();
+      if ( htmlElement != null ) { 
+         htmlElement.ricoDraggable = aDraggable;
+         Rico.eventBind(htmlElement, "mousedown", Rico.eventHandle(this,'_attachEvents'));
+         Rico.eventBind(htmlElement, "mousedown", this._mouseDown);
+      }
+   },
+
+   clearSelection: function() {
+      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+         this.currentDragObjects[i].deselect();
+      this.currentDragObjects = new Array();
+      this.lastSelectedDraggable = null;
+   },
+
+   hasSelection: function() {
+      return this.currentDragObjects.length > 0;
+   },
+
+   setStartDragFromElement: function( e, mouseDownElement ) {
+      this.origPos = Rico.cumulativeOffset(mouseDownElement);
+      var coord=Rico.eventClient(e);
+      this.startx = coord.x - this.origPos.left;
+      this.starty = coord.y - this.origPos.top;
+
+      this.interestedInMotionEvents = this.hasSelection();
+      Rico.eventStop(e);
+   },
+
+   updateSelection: function( draggable, extendSelection ) {
+      if ( ! extendSelection )
+         this.clearSelection();
+
+      if ( draggable.isSelected() ) {
+         this.currentDragObjects=this.currentDragObjects.without(draggable);
+         draggable.deselect();
+         if ( draggable == this.lastSelectedDraggable )
+            this.lastSelectedDraggable = null;
+      }
+      else {
+         draggable.select();
+         if ( draggable.isSelected() ) {
+           this.currentDragObjects.push(draggable);
+           this.lastSelectedDraggable = draggable;
+         }
+      }
+   },
+
+   _mouseDownHandler: function(e) {
+      // if not button 1 ignore it...
+      if (!Rico.eventLeftClick(e)) return;
+
+      var eventTarget      = Rico.eventElement(e);
+      var draggableObject  = eventTarget.ricoDraggable;
+
+      var candidate = eventTarget;
+      while (draggableObject == null && candidate.parentNode) {
+         candidate = candidate.parentNode;
+         draggableObject = candidate.ricoDraggable;
+      }
+   
+      if ( draggableObject == null ) return;
+
+      this.updateSelection( draggableObject, e.ctrlKey );
+
+      // clear the drop zones postion cache...
+      if ( this.hasSelection() ) {
+         for ( var i = 0 ; i < this.dropZones.length ; i++ )
+            this.dropZones[i].clearPositionCache();
+      }
+      this.setStartDragFromElement( e, draggableObject.getMouseDownHTMLElement() );
+   },
+
+
+   _mouseMoveHandler: function(e) {
+      if ( !this.interestedInMotionEvents ) {
+         return;
+      }
+
+      if ( ! this.hasSelection() )
+         return;
+
+      if ( ! this.currentDragObjectVisible )
+         this._startDrag(e);
+
+      if ( !this.activatedDropZones )
+         this._activateRegisteredDropZones();
+
+      this._updateDraggableLocation(e);
+      this._updateDropZonesHover(e);
+
+      Rico.eventStop(e);
+   },
+
+   _makeDraggableObjectVisible: function(e) {
+      if ( !this.hasSelection() )
+         return;
+
+      var dragElement;
+      if ( this.currentDragObjects.length > 1 )
+         dragElement = this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);
+      else
+         dragElement = this.currentDragObjects[0].getSingleObjectDragGUI();
+
+      // go ahead and absolute position it...
+      this.dragElemPosition=Rico.getStyle(dragElement, "position");
+      if (this.dragElemPosition != "absolute")
+         dragElement.style.position = "absolute";
+
+      // need to parent him into the document...
+      if ( dragElement.parentNode == null || dragElement.parentNode.nodeType == 11 )
+         document.body.appendChild(dragElement);
+
+      this.dragElement = dragElement;
+      this._updateDraggableLocation(e);
+
+      this.currentDragObjectVisible = true;
+   },
+
+   _leftOffset: function(e) {
+          return e.offsetX ? document.body.scrollLeft : 0;
+       },
+
+   _topOffset: function(e) {
+          return e.offsetY ? document.body.scrollTop : 0;
+       },
+
+               
+   _updateDraggableLocation: function(e) {
+      var dragObjectStyle = this.dragElement.style;
+      var coord=Rico.eventClient(e);
+      dragObjectStyle.left = (coord.x + this._leftOffset(e) - this.startx) + "px";
+      dragObjectStyle.top  = (coord.y + this._topOffset(e) - this.starty) + "px";
+   },
+
+   _updateDropZonesHover: function(e) {
+      var i,n = this.dropZones.length;
+      for ( i = 0 ; i < n ; i++ ) {
+         if ( ! this._mousePointInDropZone( e, this.dropZones[i] ) )
+            this.dropZones[i].hideHover();
+      }
+
+      for ( i = 0 ; i < n ; i++ ) {
+         if ( this._mousePointInDropZone( e, this.dropZones[i] ) ) {
+            if ( this.dropZones[i].canAccept(this.currentDragObjects) )
+               this.dropZones[i].showHover();
+         }
+      }
+   },
+
+   _startDrag: function(e) {
+      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+         this.currentDragObjects[i].startDrag();
+      this._makeDraggableObjectVisible(e);
+   },
+
+   _mouseUpHandler: function(e) {
+      if ( ! this.hasSelection() ) return;
+      if (!Rico.eventLeftClick(e)) return;
+
+      this.interestedInMotionEvents = false;
+
+      if ( this._placeDraggableInDropZone(e) )
+         this._completeDropOperation(e);
+      else if (this.dragElement != null) {
+         Rico.eventStop(e);
+         Rico.animate(this.dragElement, 
+                      {duration: 300, onEnd:Rico.bind(this,'_doCancelDragProcessing')}, 
+                      {left:this.origPos.left, top:this.origPos.top});
+      }
+
+     Rico.eventUnbind(document.body, "mousemove", this._mouseMove);
+     Rico.eventUnbind(document.body, "mouseup",  this._mouseUp);
+   },
+
+   _retTrue: function () {
+      return true;
+   },
+
+   _completeDropOperation: function(e) {
+      if ( this.dragElement != this.currentDragObjects[0].getMouseDownHTMLElement() ) {
+         if ( this.dragElement.parentNode != null )
+            this.dragElement.parentNode.removeChild(this.dragElement);
+      }
+
+      this._deactivateRegisteredDropZones();
+      this._endDrag();
+      this.clearSelection();
+      this.dragElement = null;
+      this.currentDragObjectVisible = false;
+      Rico.eventStop(e);
+   },
+
+   _doCancelDragProcessing: function() {
+      this._cancelDrag();
+      if ( this.dragElement == this.currentDragObjects[0].getMouseDownHTMLElement() ) {
+         this.dragElement.style.position=this.dragElemPosition;
+      } else {
+         if ( this.dragElement && this.dragElement.parentNode != null )
+            this.dragElement.parentNode.removeChild(this.dragElement);
+      }
+      this._deactivateRegisteredDropZones();
+      this.dragElement = null;
+      this.currentDragObjectVisible = false;
+   },
+
+   _placeDraggableInDropZone: function(e) {
+      var foundDropZone = false;
+      var n = this.dropZones.length;
+      for ( var i = 0 ; i < n ; i++ ) {
+         if ( this._mousePointInDropZone( e, this.dropZones[i] ) ) {
+            if ( this.dropZones[i].canAccept(this.currentDragObjects) ) {
+               this.dropZones[i].hideHover();
+               this.dropZones[i].accept(this.currentDragObjects);
+               foundDropZone = true;
+               break;
+            }
+         }
+      }
+
+      return foundDropZone;
+   },
+
+   _cancelDrag: function() {
+      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+         this.currentDragObjects[i].cancelDrag();
+   },
+
+   _endDrag: function() {
+      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+         this.currentDragObjects[i].endDrag();
+   },
+
+   _mousePointInDropZone: function( e, dropZone ) {
+
+      var absoluteRect = dropZone.getAbsoluteRect();
+      var coord=Rico.eventClient(e);
+
+      return coord.x  > absoluteRect.left + this._leftOffset(e) &&
+             coord.x  < absoluteRect.right + this._leftOffset(e) &&
+             coord.y  > absoluteRect.top + this._topOffset(e)   &&
+             coord.y  < absoluteRect.bottom + this._topOffset(e);
+   },
+
+   _activateRegisteredDropZones: function() {
+      var n = this.dropZones.length;
+      for ( var i = 0 ; i < n ; i++ ) {
+         var dropZone = this.dropZones[i];
+         if ( dropZone.canAccept(this.currentDragObjects) )
+            dropZone.activate();
+      }
+
+      this.activatedDropZones = true;
+   },
+
+   _deactivateRegisteredDropZones: function() {
+      var n = this.dropZones.length;
+      for ( var i = 0 ; i < n ; i++ )
+         this.dropZones[i].deactivate();
+      this.activatedDropZones = false;
+   },
+
+   _attachEvents: function () {
+     Rico.eventBind(document.body, "mousemove", this._mouseMove);
+     Rico.eventBind(document.body, "mouseup",  this._mouseUp);
+   }
+
+};
+
+
+Rico.Draggable = function(type, htmlElement) {
+  this.initialize(type, htmlElement);
+};
+
+Rico.Draggable.prototype = {
+/**
+ * @class Implements behavior for a draggable element
+ * @constructs
+ */
+   initialize: function( type, htmlElement ) {
+      this.type          = type;
+      this.htmlElement   = Rico.$(htmlElement);
+      this.selected      = false;
+   },
+
+   /**
+    *   Returns the HTML element that should have a mouse down event
+    *   added to it in order to initiate a drag operation
+    **/
+   getMouseDownHTMLElement: function() {
+      return this.htmlElement;
+   },
+
+   select: function() {
+      this._select();
+   },
+
+   _select: function() {
+      this.selected = true;
+      if (this.showingSelected) return;
+      this.showingSelected = true;
+
+      var htmlElement = this.getMouseDownHTMLElement();
+      var color = Rico.Color.createColorFromBackground(htmlElement);
+      color.isBright() ? color.darken(0.033) : color.brighten(0.033);
+      this.saveBackground = Rico.getStyle(htmlElement, "backgroundColor", "background-color");
+      htmlElement.style.backgroundColor = color.asHex();
+   },
+
+   deselect: function() {
+      this.selected = false;
+      if (!this.showingSelected) return;
+      var htmlElement = this.getMouseDownHTMLElement();
+      htmlElement.style.backgroundColor = this.saveBackground;
+      this.showingSelected = false;
+   },
+
+   isSelected: function() {
+      return this.selected;
+   },
+
+   startDrag: function() {
+   },
+
+   cancelDrag: function() {
+   },
+
+   endDrag: function() {
+   },
+
+   getSingleObjectDragGUI: function() {
+      return this.htmlElement;
+   },
+
+   getMultiObjectDragGUI: function( draggables ) {
+      return this.htmlElement;
+   },
+
+   getDroppedGUI: function() {
+      return this.htmlElement;
+   },
+
+   toString: function() {
+      return this.type + ":" + this.htmlElement + ":";
+   }
+
+};
+
+
+Rico.LiveGridDraggable = function(grid, rownum, colnum) {
+  this.initialize(grid, rownum, colnum);
+};
+
+Rico.LiveGridDraggable.prototype = Rico.extend(new Rico.Draggable(), {
+/**
+ * @class Enables draggable behavior for LiveGrid cells.
+ * Called by LiveGrid#appendBlankRow for columns where canDrag is true.
+ * @extends Rico.Draggable
+ * @constructs
+ */
+  initialize: function( grid, rownum, colnum) {\r
+    this.type        = 'RicoCell';\r
+    this.htmlElement = grid.cell(rownum,colnum);\r
+    this.liveGrid    = grid;\r
+    this.dragRow     = rownum;\r
+    this.dragCol     = colnum;\r
+  },\r
+  \r
+  select: function() {
+    if (this.dragRow >= this.liveGrid.buffer.totalRows) return;
+    this.selected = true;
+    this.showingSelected = true;
+  },
+
+  deselect: function() {
+    this.selected = false;
+    this.showingSelected = false;
+  },
+
+  getSingleObjectDragGUI: function() {\r
+    var div = document.createElement("div");\r
+    div.className = 'LiveGridDraggable';\r
+    div.style.width = (this.htmlElement.offsetWidth - 10) + "px";\r
+    div.innerHTML=this.htmlElement.innerHTML;
+    return div;\r
+  }\r
+});\r
+
+
+Rico.Dropzone = function(htmlElement) {
+  this.initialize(htmlElement);
+};
+
+Rico.Dropzone.prototype = {
+/**
+ * @class Implements behavior for a drop zone
+ * @constructs
+ */
+   initialize: function( htmlElement ) {
+      this.htmlElement  = Rico.$(htmlElement);
+      this.absoluteRect = null;
+   },
+
+   getHTMLElement: function() {
+      return this.htmlElement;
+   },
+
+   clearPositionCache: function() {
+      this.absoluteRect = null;
+   },
+
+   getAbsoluteRect: function() {
+      if ( this.absoluteRect == null ) {
+         var htmlElement = this.getHTMLElement();
+         var pos = Rico.viewportOffset(htmlElement);
+
+         this.absoluteRect = {
+            top:    pos.top,
+            left:   pos.left,
+            bottom: pos.top + htmlElement.offsetHeight,
+            right:  pos.left + htmlElement.offsetWidth
+         };
+      }
+      return this.absoluteRect;
+   },
+
+   activate: function() {
+      var htmlElement = this.getHTMLElement();
+      if (htmlElement == null  || this.showingActive)
+         return;
+
+      this.showingActive = true;
+      this.saveBackgroundColor = htmlElement.style.backgroundColor;
+
+      var fallbackColor = "#ffea84";
+      var currentColor = Rico.Color.createColorFromBackground(htmlElement);
+      if ( currentColor == null )
+         htmlElement.style.backgroundColor = fallbackColor;
+      else {
+         currentColor.isBright() ? currentColor.darken(0.2) : currentColor.brighten(0.2);
+         htmlElement.style.backgroundColor = currentColor.asHex();
+      }
+   },
+
+   deactivate: function() {
+      var htmlElement = this.getHTMLElement();
+      if (htmlElement == null || !this.showingActive)
+         return;
+
+      htmlElement.style.backgroundColor = this.saveBackgroundColor;
+      this.showingActive = false;
+      this.saveBackgroundColor = null;
+   },
+
+   showHover: function() {
+      var htmlElement = this.getHTMLElement();
+      if ( htmlElement == null || this.showingHover )
+         return;
+
+      this.saveBorderWidth = htmlElement.style.borderWidth;
+      this.saveBorderStyle = htmlElement.style.borderStyle;
+      this.saveBorderColor = htmlElement.style.borderColor;
+
+      this.showingHover = true;
+      htmlElement.style.borderWidth = "1px";
+      htmlElement.style.borderStyle = "solid";
+      //htmlElement.style.borderColor = "#ff9900";
+      htmlElement.style.borderColor = "#ffff00";
+   },
+
+   hideHover: function() {
+      var htmlElement = this.getHTMLElement();
+      if ( htmlElement == null || !this.showingHover )
+         return;
+
+      htmlElement.style.borderWidth = this.saveBorderWidth;
+      htmlElement.style.borderStyle = this.saveBorderStyle;
+      htmlElement.style.borderColor = this.saveBorderColor;
+      this.showingHover = false;
+   },
+
+   canAccept: function(draggableObjects) {
+      return true;
+   },
+
+   accept: function(draggableObjects) {
+      var htmlElement = this.getHTMLElement();
+      if ( htmlElement == null )
+         return;
+
+      var n = draggableObjects.length;
+      for ( var i = 0 ; i < n ; i++ ) {
+         var theGUI = draggableObjects[i].getDroppedGUI();
+         if ( Rico.getStyle( theGUI, "position" ) == "absolute" ) {
+            theGUI.style.position = "static";
+            theGUI.style.top = "";
+            theGUI.style.top = "";
+         }
+         htmlElement.appendChild(theGUI);
+      }
+   }
+};
+
+Rico.includeLoaded('ricoDragDrop.js');
diff --git a/ricoClient/js/ricoGridCommon.js b/ricoClient/js/ricoGridCommon.js
new file mode 100644 (file)
index 0000000..5169c64
--- /dev/null
@@ -0,0 +1,953 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+if(typeof Rico=='undefined') throw("GridCommon requires the Rico JavaScript framework");
+
+/**
+ * Define methods that are common to both SimpleGrid and LiveGrid
+ */
+Rico.GridCommon = {
+
+  baseInit: function() {
+    this.options = {
+      resizeBackground : 'resize.gif',
+      saveColumnInfo   : {width:true, filter:false, sort:false},  // save info in cookies?
+      cookiePrefix     : 'RicoGrid.',
+      allowColResize   : true,      // allow user to resize columns
+      windowResize     : true,      // Resize grid on window.resize event? Set to false when embedded in an accordian.
+      click            : null,
+      dblclick         : null,
+      contextmenu      : null,
+      menuEvent        : 'dblclick',  // event that triggers menus - click, dblclick, contextmenu, or none (no menus)
+      defaultWidth     : -1,          // if -1, then use unformatted column width
+      scrollBarWidth   : 19,          // this is the value used in positioning calculations, it does not actually change the width of the scrollbar
+      minScrollWidth   : 100,         // min scroll area width when width of frozen columns exceeds window width
+      exportWindow     : "height=400,width=500,scrollbars=1,menubar=1,resizable=1",
+      exportStyleList  : ['background-color','color','text-align','font-weight','font-size','font-family'],
+      exportImgTags    : false,       // applies to grid header and to SimpleGrid cells (not LiveGrid cells)
+      exportFormFields : true,
+      FilterLocation   : null,        // heading row number to place filters. -1=add a new heading row.
+      FilterAllToken   : '___ALL___', // select box value to use to indicate ALL
+      columnSpecs      : []
+    };
+    this.colWidths = [];
+    this.hdrCells=[];
+    this.headerColCnt=0;
+    this.headerRowIdx=0;       // row in header which gets resizers (no colspan's in this row)
+    this.tabs=new Array(2);
+    this.thead=new Array(2);
+    this.tbody=new Array(2);
+  },
+
+  attachMenuEvents: function() {
+    var i;
+    if (!this.options.menuEvent || this.options.menuEvent=='none') return;
+    this.hideScroll=navigator.userAgent.match(/Macintosh\b.*\b(Firefox|Camino)\b/i) || (Rico.isOpera && parseFloat(window.opera.version())<9.5);
+    this.options[this.options.menuEvent]=Rico.eventHandle(this,'handleMenuClick');
+    if (this.highlightDiv) {
+      switch (this.options.highlightElem) {
+        case 'cursorRow':
+          this.attachMenu(this.highlightDiv[0]);
+          break;
+        case 'cursorCell':
+          for (i=0; i<2; i++) {
+            this.attachMenu(this.highlightDiv[i]);
+          }
+          break;
+      }
+    }
+    for (i=0; i<2; i++) {
+      this.attachMenu(this.tbody[i]);
+    }
+  },
+
+  attachMenu: function(elem) {
+    if (this.options.click)
+      Rico.eventBind(elem, 'click', this.options.click, false);
+    if (this.options.dblclick) {
+      if (Rico.isWebKit || Rico.isOpera)
+        Rico.eventBind(elem, 'click', Rico.eventHandle(this,'handleDblClick'), false);
+      else
+        Rico.eventBind(elem, 'dblclick', this.options.dblclick, false);
+    }
+    if (this.options.contextmenu) {
+      if (Rico.isOpera || Rico.isKonqueror)
+        Rico.eventBind(elem, 'click', Rico.eventHandle(this,'handleContextMenu'), false);
+      else
+        Rico.eventBind(elem, 'contextmenu', this.options.contextmenu, false);
+    }
+  },
+
+/**
+ * implement double-click for browsers that don't support a double-click event (e.g. Safari)
+ */
+  handleDblClick: function(e) {
+    var elem=Rico.eventElement(e);
+    if (this.dblClickElem == elem) {
+      this.options.dblclick(e);
+    } else {
+      this.dblClickElem = elem;
+      this.safariTimer=Rico.runLater(300,this,'clearDblClick');
+    }
+  },
+
+  clearDblClick: function() {
+    this.dblClickElem=null;
+  },
+
+/**
+ * implement right-click for browsers that don't support contextmenu event (e.g. Opera, Konqueror)
+ * use control-click instead
+ */
+  handleContextMenu: function(e) {
+    var b;
+    if( typeof( e.which ) == 'number' )
+      b = e.which; //Netscape compatible
+    else if( typeof( e.button ) == 'number' )
+      b = e.button; //DOM
+    else
+      return;
+    if (b==1 && e.ctrlKey) {
+      this.options.contextmenu(e);
+    }
+  },
+
+  cancelMenu: function() {
+    if (this.menu) this.menu.cancelmenu();
+  },
+
+/**
+ * gather info from original headings
+ */
+  getColumnInfo: function(hdrSrc) {
+    Rico.log('getColumnInfo: len='+hdrSrc.length);
+    if (hdrSrc.length == 0) return 0;
+    this.headerRowCnt=hdrSrc.length;
+    var r,c,colcnt;
+    for (r=0; r<this.headerRowCnt; r++) {
+      var headerRow = hdrSrc[r];
+      var headerCells=headerRow.cells;
+      if (r >= this.hdrCells.length) this.hdrCells[r]=[];
+      for (c=0; c<headerCells.length; c++) {
+        var obj={};
+        obj.cell=headerCells[c];
+        obj.colSpan=headerCells[c].colSpan || 1;  // Safari & Konqueror return default colspan of 0
+        if (this.options.defaultWidth < 0) obj.initWidth=headerCells[c].offsetWidth;
+        this.hdrCells[r].push(obj);
+      }
+      if (headerRow.id.slice(-5)=='_main') {
+        colcnt=this.hdrCells[r].length;
+        this.headerRowIdx=r;
+      }
+    }
+    if (!colcnt) {
+      this.headerRowIdx=this.headerRowCnt-1;
+      colcnt=this.hdrCells[this.headerRowIdx].length;
+    }
+    Rico.log("getColumnInfo: colcnt="+colcnt);
+    return colcnt;
+  },
+
+  addHeadingRow: function(className) {
+    var r=this.headerRowCnt++;
+    this.hdrCells[r]=[];
+    for( var h=0; h < 2; h++ ) {
+      var row = this.thead[h].insertRow(-1);
+      var newClass='ricoLG_hdg '+this.tableId+'_hdg'+r;
+      if (className) newClass+=' '+className;
+      row.className=newClass;
+      var limit= h==0 ? this.options.frozenColumns : this.headerColCnt-this.options.frozenColumns;
+      for( var c=0; c < limit; c++ ) {
+        var hdrCell=row.insertCell(-1);
+        var colDiv=Rico.wrapChildren(hdrCell,'ricoLG_col');
+        Rico.wrapChildren(colDiv,'ricoLG_cell');
+        this.hdrCells[r].push({cell:hdrCell,colSpan:1});
+      }
+    }
+    return r;
+  },
+  
+/**
+ * create column array
+ */
+  createColumnArray: function(columnType) {
+    this.direction=Rico.getStyle(this.outerDiv,'direction').toLowerCase();  // ltr or rtl
+    this.align=this.direction=='rtl' ? ['right','left'] : ['left','right'];
+    Rico.log('createColumnArray: dir='+this.direction);
+    this.columns = [];
+    for (var c=0 ; c < this.headerColCnt; c++) {
+      Rico.log("createColumnArray: c="+c);
+      var tabidx=c<this.options.frozenColumns ? 0 : 1;
+      var col=new Rico[columnType](this, c, this.hdrCells[this.headerRowIdx][c], tabidx);
+      this.columns.push(col);
+      if (c > 0) this.columns[c-1].next=col;
+    }
+    this.getCookie();
+  },
+
+/**
+ * Create div structure
+ */
+  createDivs: function() {
+    Rico.log("createDivs start");
+    this.outerDiv   = this.createDiv("outer");
+    if (Rico.theme.widget) Rico.addClass(this.outerDiv,Rico.theme.widget);
+    //if (Rico.isOpera) this.outerDiv.style.overflow="hidden";
+    this.scrollDiv  = this.createDiv("scroll",this.outerDiv);
+    this.frozenTabs = this.createDiv("frozenTabs",this.outerDiv);
+    this.innerDiv   = this.createDiv("inner",this.outerDiv);
+    this.resizeDiv  = this.createDiv("resize",this.outerDiv,true);
+    this.exportDiv  = this.createDiv("export",this.outerDiv,true);
+
+    this.messagePopup=new Rico.Popup();
+    this.messagePopup.createContainer({hideOnEscape:false, hideOnClick:false, parent:this.outerDiv});
+    this.messagePopup.content.className='ricoLG_messageDiv';
+    if (Rico.theme.gridMessage) Rico.addClass(this.messagePopup.content,Rico.theme.gridMessage);
+
+    this.keywordPopup=new Rico.Window('', {zIndex:-1, parent:this.outerDiv});
+    this.keywordPopup.container.className='ricoLG_keywordDiv';
+    var instructions=this.keywordPopup.contentDiv.appendChild(document.createElement("p"));
+    instructions.innerHTML=Rico.getPhraseById("keywordPrompt");
+    this.keywordBox=this.keywordPopup.contentDiv.appendChild(document.createElement("input"));
+    this.keywordBox.size=20;
+    Rico.eventBind(this.keywordBox,"keypress", Rico.eventHandle(this,'keywordKey'), false);
+    this.keywordPopup.contentDiv.appendChild(Rico.floatButton('Checkmark', Rico.eventHandle(this,'processKeyword')));
+    var s=this.keywordPopup.contentDiv.appendChild(document.createElement("p"));
+    Rico.setStyle(s,{clear:'both'});
+
+    //this.frozenTabs.style[this.align[0]]='0px';
+    //this.innerDiv.style[this.align[0]]='0px';
+    Rico.log("createDivs end");
+  },
+  
+  keywordKey: function(e) {
+    switch (Rico.eventKey(e)) {
+      case 27: this.closeKeyword(); Rico.eventStop(e); return false;
+      case 13: this.processKeyword(); Rico.eventStop(e); return false;
+    }
+    return true;
+  },
+  
+  openKeyword: function(colnum) {
+    this.keywordCol=colnum;
+    this.keywordBox.value='';
+    this.keywordPopup.setTitle(this.columns[colnum].displayName);
+    this.keywordPopup.centerPopup();
+    this.keywordBox.focus();
+  },
+  
+  closeKeyword: function() {
+    this.keywordPopup.closePopup();
+    this.cancelMenu();
+  },
+  
+  processKeyword: function() {
+    var keyword=this.keywordBox.value;
+    this.closeKeyword();
+    this.columns[this.keywordCol].setFilterKW(keyword);
+  },
+
+/**
+ * Create a div and give it a standardized id and class name.
+ * If the div already exists, then just assign the class name.
+ */
+  createDiv: function(elemName,elemParent,hidden) {
+    var id=this.tableId+"_"+elemName+"Div";
+    var newdiv=document.getElementById(id);
+    if (!newdiv) {
+      newdiv = document.createElement("div");
+      newdiv.id = id;
+      if (elemParent) elemParent.appendChild(newdiv);
+    }
+    newdiv.className = "ricoLG_"+elemName+"Div";
+    if (hidden) Rico.hide(newdiv);
+    return newdiv;
+  },
+
+/**
+ * Common code used to size & position divs in both SimpleGrid & LiveGrid
+ */
+  baseSizeDivs: function() {
+    this.setOtherHdrCellWidths();
+
+    if (this.options.frozenColumns) {
+      Rico.show(this.tabs[0]);
+      Rico.show(this.frozenTabs);
+      // order of next 3 lines is critical in IE6
+      this.hdrHt=Math.max(Rico.nan2zero(this.thead[0].offsetHeight),this.thead[1].offsetHeight);
+      this.dataHt=Math.max(Rico.nan2zero(this.tbody[0].offsetHeight),this.tbody[1].offsetHeight);
+      this.frzWi=this.borderWidth(this.tabs[0]);
+    } else {
+      Rico.hide(this.tabs[0]);
+      Rico.hide(this.frozenTabs);
+      this.frzWi=0;
+      this.hdrHt=this.thead[1].offsetHeight;
+      this.dataHt=this.tbody[1].offsetHeight;
+    }
+
+    var wiLimit,i;
+    var borderWi=this.borderWidth(this.columns[0].dataCell);
+    Rico.log('baseSizeDivs '+this.tableId+': hdrHt='+this.hdrHt+' dataHt='+this.dataHt);
+    Rico.log(this.tableId+' frzWi='+this.frzWi+' borderWi='+borderWi);
+    for (i=0; i<this.options.frozenColumns; i++) {
+      if (this.columns[i].visible) this.frzWi+=parseInt(this.columns[i].colWidth,10)+borderWi;
+    }
+    this.scrTabWi=this.borderWidth(this.tabs[1]);
+    Rico.log('scrTabWi: '+this.scrTabWi);
+    for (i=this.options.frozenColumns; i<this.columns.length; i++) {
+      if (this.columns[i].visible) this.scrTabWi+=parseInt(this.columns[i].colWidth,10)+borderWi;
+    }
+    this.scrWi=this.scrTabWi+this.options.scrollBarWidth;
+    if (this.sizeTo=='parent') {
+      if (Rico.isIE) Rico.hide(this.outerDiv);
+      wiLimit=this.outerDiv.parentNode.offsetWidth;
+      if (Rico.isIE) Rico.show(this.outerDiv);
+    }  else {
+      wiLimit=Rico.windowWidth()-this.options.scrollBarWidth-8;
+    }
+    if (this.outerDiv.parentNode.clientWidth > 0)
+      wiLimit=Math.min(this.outerDiv.parentNode.clientWidth, wiLimit);
+    var overage=this.frzWi+this.scrWi-wiLimit;
+    Rico.log('baseSizeDivs '+this.tableId+': scrWi='+this.scrWi+' wiLimit='+wiLimit+' overage='+overage+' clientWidth='+this.outerDiv.parentNode.clientWidth);
+    if (overage > 0 && this.options.frozenColumns < this.columns.length)
+      this.scrWi=Math.max(this.scrWi-overage, this.options.minScrollWidth);
+    this.scrollDiv.style.width=this.scrWi+'px';
+    this.scrollDiv.style.top=this.hdrHt+'px';
+    this.frozenTabs.style.width=this.scrollDiv.style[this.align[0]]=this.innerDiv.style[this.align[0]]=this.frzWi+'px';
+    this.outerDiv.style.width=(this.frzWi+this.scrWi)+'px';
+  },
+
+/**
+ * Returns the sum of the left & right border widths of an element
+ */
+  borderWidth: function(elem) {
+    var l=Rico.nan2zero(Rico.getStyle(elem,'borderLeftWidth'));
+    var r=Rico.nan2zero(Rico.getStyle(elem,'borderRightWidth'));
+    Rico.log((elem.id || elem.tagName)+' borderWidth: L='+l+', R='+r);
+    return l + r;
+//    return Rico.nan2zero(Rico.getStyle(elem,'borderLeftWidth')) + Rico.nan2zero(Rico.getStyle(elem,'borderRightWidth'));
+  },
+
+  setOtherHdrCellWidths: function() {
+    var c,i,j,r,w,hdrcell,cell,origSpan,newSpan,divs;
+    for (r=0; r<this.hdrCells.length; r++) {
+      if (r==this.headerRowIdx) continue;
+      Rico.log('setOtherHdrCellWidths: r='+r);
+      c=i=0;
+      while (i<this.headerColCnt && c<this.hdrCells[r].length) {
+        hdrcell=this.hdrCells[r][c];
+        cell=hdrcell.cell;
+        origSpan=newSpan=hdrcell.colSpan;
+        for (w=j=0; j<origSpan; j++, i++) {
+          if (this.columns[i].hdrCell.style.display=='none')
+            newSpan--;
+          else if (this.columns[i].hdrColDiv.style.display!='none')
+            w+=parseInt(this.columns[i].colWidth,10);
+        }
+        if (!hdrcell.hdrColDiv || !hdrcell.hdrCellDiv) {
+          divs=cell.getElementsByTagName('div');
+          hdrcell.hdrColDiv=(divs.length<1) ? Rico.wrapChildren(cell,'ricoLG_col') : divs[0];
+          hdrcell.hdrCellDiv=(divs.length<2) ? Rico.wrapChildren(hdrcell.hdrColDiv,'ricoLG_cell') : divs[1];
+        }
+        if (newSpan==0) {
+          cell.style.display='none';
+        } else if (w==0) {
+          hdrcell.hdrColDiv.style.display='none';
+          cell.colSpan=newSpan;
+        } else {
+          cell.style.display='';
+          hdrcell.hdrColDiv.style.display='';
+          cell.colSpan=newSpan;
+          hdrcell.hdrColDiv.style.width=w+'px';
+        }
+        c++;
+      }
+    }
+  },
+
+  initFilterImage: function(filterRowNum){
+    this.filterAnchor=document.getElementById(this.tableId+'_filterLink');
+    if (!this.filterAnchor) return;
+    this.filterRows=Rico.select('tr.'+this.tableId+'_hdg'+filterRowNum);
+    if (this.filterRows.length!=2) return;
+    for (var i=0, r=[]; i<2; i++) r[i]=Rico.select('.ricoLG_cell',this.filterRows[i]);
+    this.filterElements=r[0].concat(r[1]);
+    this.saveHeight = this.filterElements[0].offsetHeight;
+    var pt=Rico.getStyle(this.filterElements[0],'paddingTop');
+    var pb=Rico.getStyle(this.filterElements[0],'paddingBottom');
+    if (pt) this.saveHeight-=parseInt(pt,10);
+    if (pb) this.saveHeight-=parseInt(pb,10);
+    this.rowNum = filterRowNum;
+    this.setFilterImage(false);
+    //Rico.eventBind(this.filterAnchor, 'click', Rico.eventHandle(this,'toggleFilterRow'), false);
+  },
+
+  toggleFilterRow: function() {
+    if ( Rico.visible(this.filterRows[0]) )
+      this.slideFilterUp();
+    else
+      this.slideFilterDown();
+  },
+
+  setFilterImage: function(expandFlag) {
+    var altText=Rico.getPhraseById((expandFlag ? 'show' : 'hide')+'FilterRow');
+    this.filterAnchor.innerHTML = '<img src="'+Rico.imgDir+'tableFilter'+(expandFlag ? 'Expand' : 'Collapse')+'.gif" alt="'+altText+'" border="0">';
+  },
+
+/**
+ * Returns a div for the cell at the specified row and column index.
+ * In SimpleGrid, r can refer to any row in the grid.
+ * In LiveGrid, r refers to a visible row (row 0 is the first visible row).
+ */
+  cell: function(r,c) {
+    return (0<=c && c<this.columns.length && r>=0) ? this.columns[c].cell(r) : null;
+  },
+
+/**
+ * Returns the screen height available for a grid
+ */
+  availHt: function() {
+    var divPos=Rico.cumulativeOffset(this.outerDiv);
+    return Rico.windowHeight()-divPos.top-2*this.options.scrollBarWidth-15;  // allow for scrollbar and some margin
+  },
+
+  setHorizontalScroll: function() {
+    var newLeft=(-this.scrollDiv.scrollLeft)+'px';
+    this.hdrTabs[1].style.left=newLeft;
+  },
+
+  pluginScroll: function() {
+     if (this.scrollPluggedIn) return;
+     Rico.eventBind(this.scrollDiv,"scroll",this.scrollEventFunc, false);
+     this.scrollPluggedIn=true;
+  },
+
+  unplugScroll: function() {
+     Rico.eventUnbind(this.scrollDiv,"scroll", this.scrollEventFunc , false);
+     this.scrollPluggedIn=false;
+  },
+
+  hideMsg: function() {
+    this.messagePopup.closePopup();
+  },
+
+  showMsg: function(msg) {
+    this.messagePopup.setContent(msg);
+    this.messagePopup.centerPopup();
+    Rico.log("showMsg: "+msg);
+  },
+
+/**
+ * @return array of column objects which have invisible status
+ */
+  listInvisible: function(attr) {
+    var hiddenColumns=[];
+    for (var x=0;x<this.columns.length;x++) {
+      if (!this.columns[x].visible)
+        hiddenColumns.push(attr ? this.columns[x][attr] : this.columns[x]);
+    }
+    return hiddenColumns;
+  },
+
+/**
+ * @return index of left-most visibile column, or -1 if there are no visible columns
+ */
+  firstVisible: function() {
+    for (var x=0;x<this.columns.length;x++) {
+      if (this.columns[x].visible) return x;
+    }
+    return -1;
+  },
+
+/**
+ * Show all columns
+ */
+  showAll: function() {
+    var invisible=this.listInvisible();
+    for (var x=0;x<invisible.length;x++)
+      invisible[x].showColumn();
+  },
+  
+  chooseColumns: function() {
+    this.menu.cancelmenu();
+    var x,z,col,itemDiv,span,contentDiv;\r
+    if (!this.columnChooser) {
+      Rico.log('creating columnChooser');
+      z=Rico.getStyle(this.outerDiv.offsetParent,'zIndex');
+      if (typeof z!='number') z=0;
+      this.columnChooser=new Rico.Window(Rico.getPhraseById('gridChooseCols'), {zIndex:z+2, parent:this.outerDiv});
+      this.columnChooser.container.className='ricoLG_chooserDiv';
+      contentDiv=this.columnChooser.contentDiv;
+      for (x=0;x<this.columns.length;x++) {
+        col=this.columns[x];
+        itemDiv=contentDiv.appendChild(document.createElement('div'));
+        col.ChooserBox=Rico.createFormField(itemDiv,'input','checkbox');
+        span=itemDiv.appendChild(document.createElement('span'));
+        span.innerHTML=col.displayName;
+        Rico.eventBind(col.ChooserBox, 'click', Rico.eventHandle(col,'chooseColumn'), false);
+      }
+    }
+    Rico.log('opening columnChooser');
+    this.columnChooser.openPopup(1,this.hdrHt);
+    for (x=0;x<this.columns.length;x++) {
+      this.columns[x].ChooserBox.checked=this.columns[x].visible;
+      this.columns[x].ChooserBox.disabled = !this.columns[x].canHideShow();
+    }
+  },
+
+  blankRow: function(r) {
+    for (var c=0; c < this.columns.length; c++) {
+      this.columns[c].clearCell(r);
+    }
+  },
+  
+  getExportStyles: function(chkelem) {
+    var exportStyles=this.options.exportStyleList;
+    var bgImg=Rico.getStyle(chkelem,'backgroundImage');
+    if (!bgImg || bgImg=='none') return exportStyles;
+    for (var styles=[],i=0; i<exportStyles.length; i++)
+      if (exportStyles[i]!='background-color' && exportStyles[i]!='color') styles.push(exportStyles[i]);
+    return styles;
+  },
+
+/**
+ * Support function for printVisible()
+ */
+  exportStart: function() {
+    var r,c,i,j,hdrcell,newSpan,divs,cell;
+    var exportStyles=this.getExportStyles(this.thead[0]);
+    //alert(exportStyles.join('\n'));
+    this.exportRows=[];
+    this.exportText="<table border='1' cellspacing='0'>";\r
+    for (c=0; c<this.columns.length; c++) {\r
+      if (this.columns[c].visible) this.exportText+="<col width='"+parseInt(this.columns[c].colWidth,10)+"'>";
+    }\r
+    this.exportText+="<thead style='display: table-header-group;'>";
+    if (this.exportHeader) this.exportText+=this.exportHeader;
+    for (r=0; r<this.hdrCells.length; r++) {
+      if (this.hdrCells[r].length==0 || !Rico.visible(this.hdrCells[r][0].cell.parentNode)) continue;
+      this.exportText+="<tr>";
+      for (c=0,i=0; c<this.hdrCells[r].length; c++) {
+        hdrcell=this.hdrCells[r][c];
+        newSpan=hdrcell.colSpan;
+        for (j=0; j<hdrcell.colSpan; j++, i++) {
+          if (!this.columns[i].visible) newSpan--;
+        }
+        if (newSpan > 0) {
+          divs=Rico.select('.ricoLG_cell',hdrcell.cell);
+          cell=divs && divs.length>0 ? divs[0] : hdrcell.cell;
+          this.exportText+="<td style='"+this.exportStyle(cell,exportStyles)+"'";
+          if (hdrcell.colSpan > 1) this.exportText+=" colspan='"+newSpan+"'";
+          this.exportText+=">"+Rico.getInnerText(cell,!this.options.exportImgTags, !this.options.exportFormFields, 'NoExport')+"</td>";
+        }
+      }
+      this.exportText+="</tr>";
+    }
+    this.exportText+="</thead><tbody>";
+  },
+
+/**
+ * Support function for printVisible().
+ * exportType is optional and defaults 'plain'; 'owc' can be used for IE users with Office Web Components.
+ */
+  exportFinish: function(exportType) {
+    if (this.hideMsg) this.hideMsg();
+    window.status=Rico.getPhraseById('exportComplete');
+    if (this.exportRows.length > 0) this.exportText+='<tr>'+this.exportRows.join('</tr><tr>')+'</tr>';
+    if (this.exportFooter) this.exportText+=this.exportFooter;
+    this.exportText+="</tbody></table>";
+    this.exportDiv.innerHTML=this.exportText;
+    this.exportText=undefined;
+    this.exportRows=undefined;
+    if (this.cancelMenu) this.cancelMenu();
+    var w=window.open(Rico.htmDir+'export-'+(exportType || 'plain')+'.html?'+this.exportDiv.id,'',this.options.exportWindow);
+    if (w == null) alert(Rico.getPhraseById('disableBlocker'));
+  },
+
+/**
+ * Support function for printVisible()
+ */
+  exportStyle: function(elem,styleList) {
+    for (var i=0,s=''; i < styleList.length; i++) {
+      try {
+        var curstyle=Rico.getStyle(elem,styleList[i]);
+        if (curstyle) s+=styleList[i]+':'+curstyle+';';
+      } catch(e) {};
+    }
+    return s;
+  },
+
+/**
+ * Gets the value of the grid cookie and interprets the contents.
+ * All information for a particular grid is stored in a single cookie.
+ * This may include column widths, column hide/show status, current sort, and any column filters.
+ */
+  getCookie: function() {
+    var c=Rico.getCookie(this.options.cookiePrefix+this.tableId);
+    if (!c) return;
+    var cookieVals=c.split(',');
+    for (var i=0; i<cookieVals.length; i++) {
+      var v=cookieVals[i].split(':');
+      if (v.length!=2) continue;
+      var colnum=parseInt(v[0].slice(1),10);
+      if (colnum < 0 || colnum >= this.columns.length) continue;
+      var col=this.columns[colnum];
+      switch (v[0].charAt(0)) {
+        case 'w':
+          col.setColWidth(v[1]);
+          col.customWidth=true;
+          break;
+        case 'h':
+          if (v[1].toLowerCase()=='true')
+            col.hideshow(true,true);
+          else
+            col.hideshow(false,true);
+          break;
+        case 's':
+          if (!this.options.saveColumnInfo.sort || !col.sortable) break;
+          col.setSorted(v[1]);
+          break;
+        case 'f':
+          if (!this.options.saveColumnInfo.filter || !col.filterable) break;
+          var filterTemp=v[1].split('~');
+          col.filterOp=filterTemp.shift();
+          col.filterValues = [];
+          col.filterType = Rico.ColumnConst.USERFILTER;
+          for (var j=0; j<filterTemp.length; j++)
+            col.filterValues.push(unescape(filterTemp[j]));
+          break;
+      }
+    }
+  },
+
+/**
+ * Sets the grid cookie.
+ * All information for a particular grid is stored in a single cookie.
+ * This may include column widths, column hide/show status, current sort, and any column filters.
+ */
+  setCookie: function() {
+    var cookieVals=[];
+    for (var i=0; i<this.columns.length; i++) {
+      var col=this.columns[i];
+      if (this.options.saveColumnInfo.width) {
+        if (col.customWidth) cookieVals.push('w'+i+':'+col.colWidth);
+        if (col.customVisible) cookieVals.push('h'+i+':'+col.visible);
+      }
+      if (this.options.saveColumnInfo.sort) {
+        if (col.currentSort != Rico.ColumnConst.UNSORTED)
+          cookieVals.push('s'+i+':'+col.currentSort);
+      }
+      if (this.options.saveColumnInfo.filter && col.filterType == Rico.ColumnConst.USERFILTER) {
+        var filterTemp=[col.filterOp];
+        for (var j=0; j<col.filterValues.length; j++)
+          filterTemp.push(escape(col.filterValues[j]));
+        cookieVals.push('f'+i+':'+filterTemp.join('~'));
+      }
+    }
+    Rico.setCookie(this.options.cookiePrefix+this.tableId, cookieVals.join(','), this.options.cookieDays, this.options.cookiePath, this.options.cookieDomain);
+  }
+
+};
+
+
+Rico.ColumnConst = {
+  UNFILTERED:   0,
+  SYSTEMFILTER: 1,
+  USERFILTER:   2,
+
+  UNSORTED:  0,
+  SORT_ASC:  "ASC",
+  SORT_DESC: "DESC",
+
+  MINWIDTH: 10,
+  DOLLAR:  {type:'number', prefix:'$', decPlaces:2, ClassName:'alignright'},
+  EURO:    {type:'number', prefix:'&euro;', decPlaces:2, ClassName:'alignright'},
+  PERCENT: {type:'number', suffix:'%', decPlaces:2, multiplier:100, ClassName:'alignright'},
+  QTY:     {type:'number', decPlaces:0, ClassName:'alignright'},
+  DEFAULT: {type:"showTags"}
+}
+
+
+/**
+ * @class Define methods that are common to columns in both SimpleGrid and LiveGrid
+ */
+Rico.TableColumnBase = function() {};
+
+Rico.TableColumnBase.prototype = {
+
+/**
+ * Common code used to initialize the column in both SimpleGrid & LiveGrid
+ */
+  baseInit: function(liveGrid,colIdx,hdrInfo,tabIdx) {
+    Rico.log("TableColumnBase.init index="+colIdx+" tabIdx="+tabIdx);
+    this.liveGrid  = liveGrid;
+    this.index     = colIdx;
+    this.hideWidth = Rico.isKonqueror || Rico.isWebKit || liveGrid.headerRowCnt>1 ? 5 : 2;  // column width used for "hidden" columns. Anything less than 5 causes problems with Konqueror. Best to keep this greater than padding used inside cell.
+    this.options   = liveGrid.options;
+    this.tabIdx    = tabIdx;
+    this.hdrCell   = hdrInfo.cell;
+    this.body = document.getElementsByTagName("body")[0];  // work around FireFox bug (document.body doesn't exist after XSLT)
+    this.displayName  = this.getDisplayName(this.hdrCell);
+    var divs=this.hdrCell.getElementsByTagName('div');
+    this.hdrColDiv=(divs.length<1) ? Rico.wrapChildren(this.hdrCell,'ricoLG_col') : divs[0];
+    this.hdrCellDiv=(divs.length<2) ? Rico.wrapChildren(this.hdrColDiv,'ricoLG_cell') : divs[1];
+    var sectionIndex= tabIdx==0 ? colIdx : colIdx-liveGrid.options.frozenColumns;
+    this.dataCell = liveGrid.tbody[tabIdx].rows[0].cells[sectionIndex];
+    divs=this.dataCell.getElementsByTagName('div');
+    this.dataColDiv=(divs.length<1) ? Rico.wrapChildren(this.dataCell,'ricoLG_col') : divs[0];
+
+    this.mouseDownHandler= Rico.eventHandle(this,'handleMouseDown');
+    this.mouseMoveHandler= Rico.eventHandle(this,'handleMouseMove');
+    this.mouseUpHandler  = Rico.eventHandle(this,'handleMouseUp');
+    this.mouseOutHandler = Rico.eventHandle(this,'handleMouseOut');
+
+    this.fieldName = 'col'+this.index;
+    var spec = liveGrid.options.columnSpecs[colIdx];
+    this.format=Rico.extend( {}, Rico.ColumnConst.DEFAULT);
+    switch (typeof spec) {
+      case 'object':
+        if (typeof spec.format=='string') Rico.extend(this.format, Rico.ColumnConst[spec.format.toUpperCase()]);
+        Rico.extend(this.format, spec);
+        break;
+      case 'string':
+        if (spec.slice(0,4)=='spec') spec=spec.slice(4).toUpperCase();  // for backwards compatibility
+        if (typeof Rico.ColumnConst[spec]=='object') Rico.extend(this.format, Rico.ColumnConst[spec]);
+        break;
+    }
+    Rico.addClass(this.dataColDiv, this.colClassName());
+    this.visible=true;
+    if (typeof this.format.visible=='boolean') this.visible=this.format.visible;
+    Rico.log("TableColumn.init index="+colIdx+" fieldName="+this.fieldName);
+    this.sortable     = typeof this.format.canSort=='boolean' ? this.format.canSort : liveGrid.options.canSortDefault;
+    this.currentSort  = Rico.ColumnConst.UNSORTED;
+    this.filterable   = typeof this.format.canFilter=='boolean' ? this.format.canFilter : liveGrid.options.canFilterDefault;
+    this.filterType   = Rico.ColumnConst.UNFILTERED;
+    this.hideable     = typeof this.format.canHide=='boolean' ? this.format.canHide : liveGrid.options.canHideDefault;
+
+    var wi=(typeof(this.format.width)=='number') ? this.format.width : hdrInfo.initWidth;
+    wi=(typeof(wi)=='number') ? Math.max(wi,Rico.ColumnConst.MINWIDTH) : liveGrid.options.defaultWidth;
+    this.setColWidth(wi);
+    if (!this.visible) this.setDisplay('none');
+    if (this.options.allowColResize && !this.format.noResize) this.insertResizer();
+  },
+  
+  colClassName: function() {
+    return this.format.ClassName ? this.format.ClassName : this.liveGrid.tableId+'_col'+this.index;
+  },
+
+  insertResizer: function() {
+    this.hdrCell.style.width='';
+    var resizer=this.hdrCellDiv.appendChild(document.createElement('div'));
+    resizer.className='ricoLG_Resize';
+    resizer.style[this.liveGrid.align[1]]='0px';
+    if (this.options.resizeBackground) {
+      var resizePath=Rico.imgDir+this.options.resizeBackground;
+      if (Rico.isIE && Rico.ieVersion < 8)
+        resizePath=location.protocol+resizePath; // IE6+7 only
+      resizer.style.backgroundImage='url('+resizePath+')';
+    }
+    Rico.eventBind(resizer,"mousedown", this.mouseDownHandler, false);
+  },
+
+/**
+ * get the display name of a column
+ */
+  getDisplayName: function(el) {
+    var anchors=el.getElementsByTagName("A");
+    //Check the existance of A tags
+    if (anchors.length > 0)
+      return anchors[0].innerHTML;
+    else
+      return Rico.stripTags(el.innerHTML);
+  },
+
+  _clear: function(gridCell) {
+    gridCell.innerHTML='&nbsp;';
+  },
+
+  clearCell: function(rowIndex) {
+    var gridCell=this.cell(rowIndex);
+    this._clear(gridCell,rowIndex);
+    if (!this.liveGrid.buffer) return;
+    var acceptAttr=this.liveGrid.buffer.options.acceptAttr;
+    for (var k=0; k<acceptAttr.length; k++) {
+      switch (acceptAttr[k]) {
+        case 'style': gridCell.style.cssText=''; break;
+        case 'class': gridCell.className=''; break;
+        default:      gridCell['_'+acceptAttr[k]]=''; break;
+      }
+    }
+  },
+
+  dataTable: function() {
+    return this.liveGrid.tabs[this.tabIdx];
+  },
+
+  numRows: function() {
+    return this.dataColDiv.childNodes.length;
+  },
+
+  clearColumn: function() {
+    var childCnt=this.numRows();
+    for (var r=0; r<childCnt; r++)
+      this.clearCell(r);
+  },
+
+  cell: function(r) {
+    return this.dataColDiv.childNodes[r];
+  },
+
+  getFormattedValue: function(r,xImg,xForm,xClass) {
+    return Rico.getInnerText(this.cell(r),xImg,xForm,xClass);
+  },
+
+  setColWidth: function(wi) {
+    if (typeof wi=='number') {
+      wi=parseInt(wi,10);
+      if (wi < Rico.ColumnConst.MINWIDTH) return;
+      wi=wi+'px';
+    }
+    Rico.log('setColWidth '+this.index+': '+wi);
+    this.colWidth=wi;
+    this.hdrColDiv.style.width=wi;
+    this.dataColDiv.style.width=wi;
+  },
+
+  pluginMouseEvents: function() {
+    if (this.mousePluggedIn==true) return;
+    Rico.eventBind(this.body,"mousemove", this.mouseMoveHandler, false);
+    Rico.eventBind(this.body,"mouseup",   this.mouseUpHandler  , false);
+    Rico.eventBind(this.body,"mouseout",  this.mouseOutHandler , false);
+    this.mousePluggedIn=true;
+  },
+
+  unplugMouseEvents: function() {
+    Rico.eventUnbind(this.body,"mousemove", this.mouseMoveHandler, false);
+    Rico.eventUnbind(this.body,"mouseup",   this.mouseUpHandler  , false);
+    Rico.eventUnbind(this.body,"mouseout",  this.mouseOutHandler , false);
+    this.mousePluggedIn=false;
+  },
+
+  handleMouseDown: function(e) {
+    this.resizeStart=Rico.eventClient(e).x;
+    this.origWidth=parseInt(this.colWidth,10);
+    var p=Rico.positionedOffset(this.hdrCell);
+    if (this.liveGrid.direction=='rtl') {
+      this.edge=p.left+this.liveGrid.options.scrollBarWidth;
+      switch (this.tabIdx) {
+        case 0: this.edge+=this.liveGrid.innerDiv.offsetWidth; break;
+        case 1: this.edge-=this.liveGrid.scrollDiv.scrollLeft; break;
+      }
+    } else {
+      this.edge=p.left+this.hdrCell.offsetWidth;
+      if (this.tabIdx>0) this.edge+=Rico.nan2zero(this.liveGrid.tabs[0].offsetWidth)-this.liveGrid.scrollDiv.scrollLeft;
+    }
+    this.liveGrid.resizeDiv.style.left=this.edge+"px";
+    this.liveGrid.resizeDiv.style.display="";
+    this.liveGrid.outerDiv.style.cursor='e-resize';
+    this.tmpHighlight=this.liveGrid.highlightEnabled;
+    this.liveGrid.highlightEnabled=false;
+    this.pluginMouseEvents();
+    Rico.eventStop(e);
+  },
+
+  handleMouseMove: function(e) {
+    var delta=Rico.eventClient(e).x-this.resizeStart;
+    var newWidth=(this.liveGrid.direction=='rtl') ? this.origWidth-delta : this.origWidth+delta;
+    if (newWidth < Rico.ColumnConst.MINWIDTH) return;
+    this.liveGrid.resizeDiv.style.left=(this.edge+delta)+"px";
+    this.colWidth=newWidth;
+    Rico.eventStop(e);
+  },
+
+  handleMouseUp: function(e) {
+    this.unplugMouseEvents();
+    Rico.log('handleMouseUp '+this.liveGrid.tableId);
+    this.liveGrid.outerDiv.style.cursor='';
+    this.liveGrid.resizeDiv.style.display="none";
+    this.setColWidth(this.colWidth);
+    this.customWidth=true;
+    this.liveGrid.setCookie();
+    this.liveGrid.highlightEnabled=this.tmpHighlight;
+    this.liveGrid.sizeDivs();
+    Rico.eventStop(e);
+  },
+
+  handleMouseOut: function(e) {
+    var reltg = Rico.eventRelatedTarget(e) || e.toElement;
+    while (reltg != null && reltg.nodeName.toLowerCase() != 'body')
+      reltg=reltg.parentNode;
+    if (reltg!=null && reltg.nodeName.toLowerCase() == 'body') return true;
+    this.handleMouseUp(e);
+    return true;
+  },
+
+  setDisplay: function(d) {
+    this.hdrCell.style.display=d;
+    this.hdrColDiv.style.display=d;
+    this.dataCell.style.display=d;
+    this.dataColDiv.style.display=d;
+  },
+  
+  hideshow: function(visible,noresize) {
+    this.setDisplay(visible ? '' : 'none');
+    this.liveGrid.cancelMenu();
+    this.visible=visible;
+    this.customVisible=true;
+    if (noresize) return;
+    this.liveGrid.setCookie();
+    this.liveGrid.sizeDivs();
+  },
+
+  hideColumn: function() {
+    Rico.log('hideColumn '+this.liveGrid.tableId);
+    this.hideshow(false,false);
+  },
+
+  showColumn: function() {
+    Rico.log('showColumn '+this.liveGrid.tableId);
+    this.hideshow(true,false);
+  },
+
+  chooseColumn: function(e) {
+    var elem=Rico.eventElement(e);
+    this.hideshow(elem.checked,false);
+  },
+
+  setImage: function() {
+    if ( this.currentSort == Rico.ColumnConst.SORT_ASC ) {
+       this.imgSort.style.display='inline-block';
+       this.imgSort.className=Rico.theme.sortAsc || 'ricoLG_sortAsc';
+    } else if ( this.currentSort == Rico.ColumnConst.SORT_DESC ) {
+       this.imgSort.style.display='inline-block';
+       this.imgSort.className=Rico.theme.sortDesc || 'ricoLG_sortDesc';
+    } else {
+       this.imgSort.style.display='none';
+    }
+    if (this.filterType == Rico.ColumnConst.USERFILTER) {
+       this.imgFilter.style.display='';
+       this.imgFilter.title=this.getFilterText();
+    } else {
+       this.imgFilter.style.display='none';
+    }
+  },
+
+  canHideShow: function() {
+    return this.hideable;
+  }
+
+};
+
+Rico.includeLoaded('ricoGridCommon.js');
diff --git a/ricoClient/js/ricoLiveGrid.js b/ricoClient/js/ricoLiveGrid.js
new file mode 100644 (file)
index 0000000..0c69e68
--- /dev/null
@@ -0,0 +1,2413 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+if(typeof Rico=='undefined') throw("LiveGrid requires the Rico JavaScript framework");
+
+
+/** @namespace */
+if (!Rico.Buffer) Rico.Buffer = {};
+
+Rico.Buffer.Base = function(dataTable, options) {
+  this.initialize(dataTable, options);
+}
+/** @lends Rico.Buffer.Base# */
+Rico.Buffer.Base.prototype = {
+/**
+ * @class Defines the static buffer class (no AJAX).
+ * Loads buffer with data that already exists in the document as an HTML table or passed via javascript.
+ * Also serves as a base class for AJAX-enabled buffers.
+ * @constructs
+ */
+  initialize: function(dataTable, options) {
+    this.clear();
+    this.updateInProgress = false;
+    this.lastOffset = 0;
+    this.rcvdRowCount = false;  // true if an eof element was included in the last xml response
+    this.foundRowCount = false; // true if an xml response is ever received with eof true
+    this.totalRows = 0;
+    this.rowcntContent = "";
+    this.rcvdOffset = -1;
+    this.options = {
+      fixedHdrRows     : 0,
+      canFilter        : true,  // does buffer object support filtering?
+      isEncoded        : true,  // is the data received via ajax html encoded?
+      acceptAttr       : []     // attributes that can be copied from original/ajax data (e.g. className, style, id)
+    };
+    Rico.extend(this.options, options || {});
+    if (dataTable) {
+      this.loadRowsFromTable(dataTable,this.options.fixedHdrRows);
+    } else {
+      this.clear();
+    }
+  },
+
+  registerGrid: function(liveGrid) {
+    this.liveGrid = liveGrid;
+  },
+
+  setTotalRows: function( newTotalRows ) {
+    if (typeof(newTotalRows)!='number') newTotalRows=this.size;
+    if (this.totalRows == newTotalRows) return;
+    this.totalRows = newTotalRows;
+    if (!this.liveGrid) return;
+    Rico.log("setTotalRows, newTotalRows="+newTotalRows);
+    switch (this.liveGrid.sizeTo) {
+      case 'data':
+        this.liveGrid.resizeWindow();
+        break;
+      case 'datamax':
+        this.liveGrid.setPageSize(newTotalRows);
+        break;
+      default:
+        this.liveGrid.updateHeightDiv();
+        break;
+    }
+  },
+
+  loadRowsFromTable: function(tableElement,firstRow) {
+    var newRows = new Array();
+    var trs = tableElement.getElementsByTagName("tr");
+    for ( var i=firstRow || 0; i < trs.length; i++ ) {
+      var row = new Array();
+      var cells = trs[i].getElementsByTagName("td");
+      for ( var j=0; j < cells.length ; j++ )
+        row[j]=cells[j].innerHTML;
+      newRows.push( row );
+    }
+    this.loadRows(newRows);
+  },
+
+  loadRowsFromArray: function(array2D) {
+    for ( var i=0; i < array2D.length; i++ ) {
+      for ( var j=0; j < array2D[i].length ; j++ ) {
+        array2D[i][j]=array2D[i][j].toString();
+      }
+    }
+    this.loadRows(array2D);
+  },
+
+  loadRows: function(jstable) {
+    this.baseRows = jstable;
+    this.startPos = 0;
+    this.size = this.baseRows.length;
+  },
+
+  dom2jstable: function(rowsElement) {
+    Rico.log('dom2jstable: encoded='+this.options.isEncoded);
+    var newRows = new Array();
+    var trs = rowsElement.getElementsByTagName("tr");
+    for ( var i=0; i < trs.length; i++ ) {
+      var row = new Array();
+      var cells = trs[i].getElementsByTagName("td");
+      for ( var j=0; j < cells.length ; j++ )
+        row[j]=Rico.getContentAsString(cells[j],this.options.isEncoded);
+      newRows.push( row );
+    }
+    return newRows;
+  },
+
+  dom2jstableAttr: function(rowsElement,firstRow) {
+    var acceptAttr=this.options.acceptAttr;
+    Rico.log("dom2jstableAttr start, # attr="+acceptAttr.length);
+    var newRows = new Array();
+    var trs = rowsElement.getElementsByTagName("tr");
+    for ( var i=firstRow || 0; i < trs.length; i++ ) {
+      var row = new Array();
+      var cells = trs[i].getElementsByTagName("td");
+      for ( var j=0; j < cells.length ; j++ ) {
+        row[j]={};
+        for (var k=0; k<acceptAttr.length; k++)
+          row[j]['_'+acceptAttr[k]]=cells[j].getAttribute(acceptAttr[k]);
+        if (Rico.isIE) row[j]._class=cells[j].getAttribute('className');
+      }
+      newRows.push( row );
+    }
+    Rico.log("dom2jstableAttr end");
+    return newRows;
+  },
+
+  _blankRow: function() {
+    var newRow=[];
+    for (var i=0; i<this.liveGrid.columns.length; i++) {
+      newRow[i]='';
+    }
+    return newRow;
+  },
+
+  deleteRows: function(rowIndex,cnt) {
+    this.baseRows.splice(rowIndex,typeof(cnt)=='number' ? cnt : 1);
+    this.liveGrid.isPartialBlank=true;
+    this.size=this.baseRows.length;
+  },
+
+  insertRow: function(beforeRowIndex) {
+    var r=this._blankRow();
+    this.baseRows.splice(beforeRowIndex,0,r);
+    this.size=this.baseRows.length;
+    this.liveGrid.isPartialBlank=true;
+    if (this.startPos < 0) this.startPos=0;
+    return r;
+  },
+
+  appendRows: function(cnt) {
+    var newRows=[];
+    for (var i=0; i<cnt; i++) {
+      var r=this._blankRow();
+      this.baseRows.push(r);
+      newRows.push(r);
+    }
+    this.size=this.baseRows.length;
+    this.liveGrid.isPartialBlank=true;
+    if (this.startPos < 0) this.startPos=0;
+    return newRows;
+  },
+  
+  sortFunc: function(coltype) {
+    switch (coltype) {
+      case 'number': return Rico.bind(this,'_sortNumeric');
+      case 'control':return Rico.bind(this,'_sortControl');
+      default:       return Rico.bind(this,'_sortAlpha');
+    }
+  },
+
+  sortBuffer: function(colnum) {
+    if (!this.baseRows) {
+      this.delayedSortCol=colnum;
+      return;
+    }
+    this.liveGrid.showMsg(Rico.getPhraseById("sorting"));
+    this.sortColumn=colnum;
+    var col=this.liveGrid.columns[colnum];
+    this.getValFunc=col._sortfunc;
+    this.baseRows.sort(this.sortFunc(col.format.type));
+    if (col.getSortDirection()=='DESC') this.baseRows.reverse();
+  },
+  
+  _sortAlpha: function(a,b) {
+    var aa = this.sortColumn<a.length ? Rico.getInnerText(a[this.sortColumn]) : '';
+    var bb = this.sortColumn<b.length ? Rico.getInnerText(b[this.sortColumn]) : '';
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+  },
+
+  _sortNumeric: function(a,b) {
+    var aa = this.sortColumn<a.length ? this.nan2zero(Rico.getInnerText(a[this.sortColumn])) : 0;
+    var bb = this.sortColumn<b.length ? this.nan2zero(Rico.getInnerText(b[this.sortColumn])) : 0;
+    return aa-bb;
+  },
+
+  nan2zero: function(n) {
+    if (typeof(n)=='string') n=parseFloat(n);
+    return isNaN(n) || typeof(n)=='undefined' ? 0 : n;
+  },
+  
+  _sortControl: function(a,b) {
+    var aa = this.sortColumn<a.length ? Rico.getInnerText(a[this.sortColumn]) : '';
+    var bb = this.sortColumn<b.length ? Rico.getInnerText(b[this.sortColumn]) : '';
+    if (this.getValFunc) {
+      aa=this.getValFunc(aa);
+      bb=this.getValFunc(bb);
+    }
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+  },
+
+  clear: function() {
+    this.baseRows = [];
+    this.rows = [];
+    this.startPos = -1;
+    this.size = 0;
+    this.windowPos = 0;
+  },
+
+  isInRange: function(position) {
+    var lastRow=Math.min(this.totalRows, position + this.liveGrid.pageSize);
+    return (position >= this.startPos) && (lastRow <= this.endPos()); // && (this.size != 0);
+  },
+
+  endPos: function() {
+    return this.startPos + this.rows.length;
+  },
+
+  fetch: function(offset) {
+    Rico.log('fetch '+this.liveGrid.tableId+': offset='+offset);
+    this.applyFilters();
+    this.setTotalRows();
+    this.rcvdRowCount = true;
+    this.foundRowCount = true;
+    if (offset < 0) offset=0;
+    this.liveGrid.refreshContents(offset);
+    return;
+  },
+
+/**
+ * @return a 2D array of buffer data representing the rows that are currently visible on the grid
+ */
+  visibleRows: function() {
+    return this.rows.slice(this.windowStart,this.windowEnd);
+  },
+
+  setWindow: function(startrow, endrow) {
+    this.windowStart = startrow - this.startPos;  // position in the buffer of first visible row
+    Rico.log('setWindow '+this.liveGrid.tableId+': '+startrow+', '+endrow+', newstart='+this.windowStart);
+    this.windowEnd = Math.min(endrow,this.size);  // position in the buffer of last visible row containing data+1
+    this.windowPos = startrow;                    // position in the dataset of first visible row
+  },
+
+/**
+ * @return true if bufRow is currently visible in the grid
+ */
+  isVisible: function(bufRow) {
+    return bufRow < this.rows.length && bufRow >= this.windowStart && bufRow < this.windowEnd;
+  },
+  
+/**
+ * takes a window row index and returns the corresponding buffer row index
+ */
+  bufferRow: function(windowRow) {
+    return this.windowStart+windowRow;
+  },
+
+/**
+ * @return buffer cell at the specified visible row/col index
+ */
+  getWindowCell: function(windowRow,col) {
+    var bufrow=this.bufferRow(windowRow);
+    return this.isVisible(bufrow) && col < this.rows[bufrow].length ? this.rows[bufrow][col] : null;
+  },
+
+  getWindowAttr: function(windowRow,col) {
+    var bufrow=this.bufferRow(windowRow);
+    return this.attr && this.isVisible(bufrow) && col < this.attr[bufrow].length ? this.attr[bufrow][col] : null;
+  },
+
+  getWindowValue: function(windowRow,col) {
+    return this.getWindowCell(windowRow,col);
+  },
+
+  setWindowValue: function(windowRow,col,newval) {
+    var bufrow=this.bufferRow(windowRow);
+    if (bufrow >= this.windowEnd) return false;
+    return this.setValue(bufrow,col,newval);
+  },
+
+  getCell: function(bufRow,col) {
+    return bufRow < this.size ? this.rows[bufRow][col] : null;
+  },
+
+  getValue: function(bufRow,col) {
+    return this.getCell(bufRow,col);
+  },
+
+  setValue: function(bufRow,col,newval,newstyle) {
+    if (bufRow>=this.size) return false;
+    if (!this.rows[bufRow][col]) this.rows[bufRow][col]={};
+    this.rows[bufRow][col]=newval;
+    if (typeof newstyle=='string') this.rows[bufRow][col]._style=newstyle;
+    this.rows[bufRow][col].modified=true;
+    return true;
+  },
+
+  getRows: function(start, count) {
+    var begPos = start - this.startPos;
+    var endPos = Math.min(begPos + count,this.size);
+    var results = new Array();
+    for ( var i=begPos; i < endPos; i++ ) {
+      results.push(this.rows[i]);
+    }
+    return results;
+  },
+
+  applyFilters: function() {
+    var newRows=[],re=[];
+    var r,c,n,i,showRow,filtercnt;
+    var cols=this.liveGrid.columns;
+    for (n=0,filtercnt=0; n<cols.length; n++) {
+      c=cols[n];
+      if (c.filterType == Rico.ColumnConst.UNFILTERED) continue;
+      filtercnt++;
+      if (c.filterOp=='LIKE') re[n]=new RegExp(c.filterValues[0],'i');
+    }
+    Rico.log('applyFilters: # of filters='+filtercnt);
+    if (filtercnt==0) {
+      this.rows = this.baseRows;
+    } else {
+      for (r=0; r<this.baseRows.length; r++) {
+        showRow=true;
+        for (n=0; n<cols.length && showRow; n++) {
+          c=cols[n];
+          if (c.filterType == Rico.ColumnConst.UNFILTERED) continue;
+          switch (c.filterOp) {
+            case 'LIKE':
+              showRow=re[n].test(this.baseRows[r][n]);
+              break;
+            case 'EQ':
+              showRow=this.baseRows[r][n]==c.filterValues[0];
+              break;
+            case 'NE':
+              for (i=0; i<c.filterValues.length && showRow; i++)
+                showRow=this.baseRows[r][n]!=c.filterValues[i];
+              break;
+            case 'LE':
+              if (c.format.type=='number')
+                showRow=this.nan2zero(this.baseRows[r][n])<=this.nan2zero(c.filterValues[0]);
+              else
+                showRow=this.baseRows[r][n]<=c.filterValues[0];
+              break;
+            case 'GE':
+              if (c.format.type=='number')
+                showRow=this.nan2zero(this.baseRows[r][n])>=this.nan2zero(c.filterValues[0]);
+              else
+                showRow=this.baseRows[r][n]>=c.filterValues[0];
+              break;
+            case 'NULL':
+              showRow=this.baseRows[r][n]=='';
+              break;
+            case 'NOTNULL':
+              showRow=this.baseRows[r][n]!='';
+              break;
+          }
+        }
+        if (showRow) newRows.push(this.baseRows[r]);
+      }
+      this.rows = newRows;
+    }
+    this.rowcntContent = this.size = this.rows.length;
+  },
+
+  printAll: function(exportType) {
+    this.liveGrid.showMsg(Rico.getPhraseById('exportInProgress'));
+    Rico.runLater(10,this,'_printAll',exportType);  // allow message to paint
+  },
+
+/**
+ * Support function for printAll()
+ */
+  _printAll: function(exportType) {
+    this.liveGrid.exportStart();
+    this.exportBuffer(this.getRows(0,this.totalRows));
+    this.liveGrid.exportFinish(exportType);
+  },
+
+/**
+ * Copies visible rows to a new window as a simple html table.
+ */
+  printVisible: function(exportType) {
+    this.liveGrid.showMsg(Rico.getPhraseById('exportInProgress'));
+    Rico.runLater(10,this,'_printVisible',exportType);  // allow message to paint
+  },
+
+  _printVisible: function(exportType) {
+    this.liveGrid.exportStart();
+    this.exportBuffer(this.visibleRows());
+    this.liveGrid.exportFinish(exportType);
+  },
+
+/**
+ * Send all rows to print/export window
+ */
+  exportBuffer: function(rows,startPos) {
+    var r,c,v,col,exportText;
+    Rico.log("exportBuffer: "+rows.length+" rows");
+    var exportStyles=this.liveGrid.getExportStyles(this.liveGrid.tbody[0]);
+    var tdstyle=[];
+    var totalcnt=startPos || 0;
+    var cols=this.liveGrid.columns;
+    for (c=0; c<cols.length; c++) {
+      if (cols[c].visible) tdstyle[c]=this.liveGrid.exportStyle(cols[c].cell(0),exportStyles);  // assumes row 0 style applies to all rows
+    }
+    for(r=0; r < rows.length; r++) {
+      exportText='';
+      for (c=0; c<cols.length; c++) {
+        if (!cols[c].visible) continue;
+        col=cols[c];
+        col.expStyle=tdstyle[c];
+        v=col._export(rows[r][c],rows[r]);
+        if (v=='') v='&nbsp;';
+        exportText+="<td style='"+col.expStyle+"'>"+v+"</td>";
+      }
+      this.liveGrid.exportRows.push(exportText);
+      totalcnt++;
+      if (totalcnt % 10 == 0) window.status=Rico.getPhraseById('exportStatus',totalcnt);
+    }
+  }
+
+};
+
+
+// Rico.LiveGrid -----------------------------------------------------
+
+Rico.LiveGrid = function(tableId, buffer, options) {
+  this.initialize(tableId, buffer, options);
+}
+
+/** 
+ * @lends Rico.LiveGrid#
+ * @property tableId id string for this grid
+ * @property options the options object passed to the constructor extended with defaults
+ * @property buffer the buffer object containing the data for this grid
+ * @property columns array of {@link Rico.LiveGridColumn} objects
+ */
+Rico.LiveGrid.prototype = {
+/**
+ * @class Buffered LiveGrid component
+ * @extends Rico.GridCommon
+ * @constructs
+ */
+  initialize: function( tableId, buffer, options ) {
+    Rico.extend(this, Rico.GridCommon);
+    Rico.extend(this, Rico.LiveGridMethods);
+    this.baseInit();
+    this.tableId = tableId;
+    this.buffer = buffer;
+    this.actionId='_action_'+tableId;
+    Rico.setDebugArea(tableId+"_debugmsgs");    // if used, this should be a textarea
+
+    Rico.extend(this.options, {
+      visibleRows      : -1,    // -1 or 'window'=size grid to client window; -2 or 'data'=size grid to min(window,data); -3 or 'body'=size so body does not have a scrollbar; -4 or 'parent'=size to parent element (e.g. if grid is inside a div)
+      frozenColumns    : 0,
+      offset           : 0,     // first row to be displayed
+      prefetchBuffer   : true,  // load table on page load?
+      minPageRows      : 2,
+      maxPageRows      : 50,
+      canSortDefault   : true,  // can be overridden in the column specs
+      canFilterDefault : buffer.options.canFilter, // can be overridden in the column specs
+      canHideDefault   : true,  // can be overridden in the column specs
+
+      // highlight & selection parameters
+      highlightElem    : 'none',// what gets highlighted/selected (cursorRow, cursorCell, menuRow, menuCell, selection, or none)
+      highlightSection : 3,     // which section gets highlighted (frozen=1, scrolling=2, all=3, none=0)
+      highlightMethod  : 'class', // outline, class, both (outline is less CPU intensive on the client)
+      highlightClass   : Rico.theme.gridHighlightClass || 'ricoLG_selection',
+
+      // export/print parameters
+      maxPrint         : 1000,  // max # of rows that can be printed/exported, 0=disable print/export feature
+
+      // heading parameters
+      headingSort      : 'link', // link: make headings a link that will sort column, hover: make headings a hoverset, none: events on headings are disabled
+      hdrIconsFirst    : true,   // true: put sort & filter icons before header text, false: after
+      filterImg        : 'filtercol.gif'
+    });
+    // other options:
+    //   sortCol: initial sort column
+
+    this.options.sortHandler = Rico.bind(this,'sortHandler');
+    this.options.filterHandler = Rico.bind(this,'filterHandler');
+    this.options.onRefreshComplete = Rico.bind(this,'bookmarkHandler');
+    this.options.rowOverHandler = Rico.eventHandle(this,'rowMouseOver');
+    this.options.mouseDownHandler = Rico.eventHandle(this,'selectMouseDown');
+    this.options.mouseOverHandler = Rico.eventHandle(this,'selectMouseOver');
+    this.options.mouseUpHandler  = Rico.eventHandle(this,'selectMouseUp');
+    Rico.extend(this.options, options || {});
+
+    switch (typeof this.options.visibleRows) {
+      case 'string':
+        this.sizeTo=this.options.visibleRows;
+        switch (this.options.visibleRows) {
+          case 'data':   this.options.visibleRows=-2; break;
+          case 'body':   this.options.visibleRows=-3; break;
+          case 'parent': this.options.visibleRows=-4; break;
+          case 'datamax':this.options.visibleRows=-5; break;
+          default:       this.options.visibleRows=-1; break;
+        }
+        break;
+      case 'number':
+        switch (this.options.visibleRows) {
+          case -1: this.sizeTo='window'; break;
+          case -2: this.sizeTo='data'; break;
+          case -3: this.sizeTo='body'; break;
+          case -4: this.sizeTo='parent'; break;
+          case -5: this.sizeTo='datamax'; break;
+          default: this.sizeTo='fixed'; break;
+        }
+        break;
+      default:
+        this.sizeTo='window';
+        this.options.visibleRows=-1;
+        break;
+    }
+    this.highlightEnabled=this.options.highlightSection>0;
+    this.pageSize=0;
+    this.createTables();
+    if (this.headerColCnt==0) {
+      alert('ERROR: no columns found in "'+this.tableId+'"');
+      return;
+    }
+    this.createColumnArray('LiveGridColumn');
+    if (this.options.headingSort=='hover')
+      this.createHoverSet();
+
+    this.bookmark=document.getElementById(this.tableId+"_bookmark");
+    this.sizeDivs();
+    var filterUIrow=this.buffer.options.canFilter ? this.options.FilterLocation : false;
+    if (typeof(filterUIrow)=='number' && filterUIrow<0)
+      filterUIrow=this.addHeadingRow('ricoLG_FilterRow');
+    this.createDataCells(this.options.visibleRows);
+    if (this.pageSize == 0) return;
+    this.buffer.registerGrid(this);
+    if (this.buffer.setBufferSize) this.buffer.setBufferSize(this.pageSize);
+    this.scrollTimeout = null;
+    this.lastScrollPos = 0;
+    this.attachMenuEvents();
+
+    // preload the images...
+    new Image().src = Rico.imgDir+this.options.filterImg;
+    Rico.log("images preloaded");
+
+    this.setSortUI( this.options.sortCol, this.options.sortDir );
+    this.setImages();
+    if (this.listInvisible().length==this.columns.length)
+      this.columns[0].showColumn();
+    this.sizeDivs();
+    this.scrollDiv.style.display="";
+    if (this.buffer.totalRows>0)
+      this.updateHeightDiv();
+    if (this.options.prefetchBuffer) {
+      if (this.bookmark) this.bookmark.innerHTML = Rico.getPhraseById('bookmarkLoading');
+      if (this.options.canFilterDefault && this.options.getQueryParms)
+        this.checkForFilterParms();
+      this.scrollToRow(this.options.offset);
+      this.buffer.fetch(this.options.offset);
+    }
+    if (typeof(filterUIrow)=='number')
+      this.createFilters(filterUIrow);
+    this.scrollEventFunc=Rico.eventHandle(this,'handleScroll');
+    this.wheelEventFunc=Rico.eventHandle(this,'handleWheel');
+    this.wheelEvent=(Rico.isIE || Rico.isOpera || Rico.isWebKit) ? 'mousewheel' : 'DOMMouseScroll';
+    if (this.options.offset && this.options.offset < this.buffer.totalRows)
+      Rico.runLater(50,this,'scrollToRow',this.options.offset);  // Safari requires a delay
+    this.pluginScroll();
+    this.setHorizontalScroll();
+    Rico.log("setHorizontalScroll done");
+    if (this.options.windowResize)
+      Rico.runLater(100,this,'pluginWindowResize');
+    Rico.log("initialize complete for "+this.tableId);
+  }
+};
+
+
+Rico.LiveGridMethods = {
+/** @lends Rico.LiveGrid# */
+
+  createHoverSet: function() {
+    var hdrs=[];
+    for( var c=0; c < this.headerColCnt; c++ ) {
+      if (this.columns[c].sortable) {\r
+        hdrs.push(this.columns[c].hdrCellDiv);
+      }
+    }
+    this.hoverSet = new Rico.HoverSet(hdrs);
+  },
+
+  checkForFilterParms: function() {
+    var s=window.location.search;
+    if (s.charAt(0)=='?') s=s.substring(1);
+    var pairs = s.split('&');
+    for (var i=0; i<pairs.length; i++) {
+      if (pairs[i].match(/^f\[\d+\]/)) {
+        this.buffer.options.requestParameters.push(pairs[i]);
+      }
+    }
+  },
+
+/**
+ * Refreshes a detail grid from a master grid
+ * @returns row index on master table on success, -1 otherwise
+ */
+  drillDown: function(e,masterColNum,detailColNum) {
+    var cell=Rico.eventElement(e || window.event);
+    cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
+    if (!cell) return -1;
+    var idx=this.winCellIndex(cell);
+    if (idx.row >= this.buffer.totalRows) return -1
+    this.unhighlight();
+    this.menuIdx=idx;  // ensures selection gets cleared when menu is displayed
+    this.highlight(idx);
+    var drillValue=this.buffer.getWindowCell(idx.row,masterColNum);
+    for (var i=3; i<arguments.length; i++)
+      arguments[i].setDetailFilter(detailColNum,drillValue);
+    return idx.row;
+  },
+
+/**
+ * set filter on a detail grid that is in a master-detail relationship
+ */
+  setDetailFilter: function(colNumber,filterValue) {
+    var c=this.columns[colNumber];
+    c.format.ColData=filterValue;
+    c.setSystemFilter('EQ',filterValue);
+  },
+
+/**
+ * Create one table for frozen columns and one for scrolling columns.
+ * Also create div's to contain them.
+ * @returns true on success
+ */
+  createTables: function() {
+    var insertloc,hdrSrc,i;
+    var table = document.getElementById(this.tableId) || document.getElementById(this.tableId+'_outerDiv');
+    if (!table) return false;
+    if (table.tagName.toLowerCase()=='table') {
+      var theads=table.getElementsByTagName("thead");
+      if (theads.length == 1) {
+        Rico.log("createTables: using thead section, id="+this.tableId);
+        if (this.options.PanelNamesOnTabHdr && this.options.panels) {
+          var r=theads[0].insertRow(0);
+          this.insertPanelNames(r, 0, this.options.frozenColumns, 'ricoFrozen');
+          this.insertPanelNames(r, this.options.frozenColumns, this.options.columnSpecs.length);
+        }
+        hdrSrc=theads[0].rows;
+      } else {
+        Rico.log("createTables: using tbody section, id="+this.tableId);
+        hdrSrc=new Array(table.rows[0]);
+      }
+      insertloc=table;
+    } else if (this.options.columnSpecs.length > 0) {
+      if (!table.id.match(/_outerDiv$/)) insertloc=table;
+      Rico.log("createTables: inserting at "+table.tagName+", id="+this.tableId);
+    } else {
+      alert("ERROR!\n\nUnable to initialize '"+this.tableId+"'\n\nLiveGrid terminated");
+      return false;
+    }
+
+    this.createDivs();
+    this.scrollTabs = this.createDiv("scrollTabs",this.innerDiv);
+    this.shadowDiv  = this.createDiv("shadow",this.scrollDiv);
+    this.shadowDiv.style.direction='ltr';  // avoid FF bug
+    this.scrollDiv.style.display="none";
+    this.scrollDiv.scrollTop=0;
+    if (this.options.highlightMethod!='class') {
+      this.highlightDiv=[];
+      switch (this.options.highlightElem) {
+        case 'menuRow':
+        case 'cursorRow':
+          this.highlightDiv[0] = this.createDiv("highlight",this.outerDiv);
+          this.highlightDiv[0].style.display="none";
+          break;
+        case 'menuCell':
+        case 'cursorCell':
+          for (i=0; i<2; i++) {
+            this.highlightDiv[i] = this.createDiv("highlight",i==0 ? this.frozenTabs : this.scrollTabs);
+            this.highlightDiv[i].style.display="none";
+            this.highlightDiv[i].id+=i;
+          }
+          break;
+        case 'selection':
+          // create one div for each side of the rectangle
+          var parentDiv=this.options.highlightSection==1 ? this.frozenTabs : this.scrollTabs;
+          for (i=0; i<4; i++) {
+            this.highlightDiv[i] = this.createDiv("highlight",parentDiv);
+            this.highlightDiv[i].style.display="none";
+            this.highlightDiv[i].style.overflow="hidden";
+            this.highlightDiv[i].id+=i;
+            this.highlightDiv[i].style[i % 2==0 ? 'height' : 'width']="0px";
+          }
+          break;
+      }
+    }
+
+    // create new tables
+    for (i=0; i<2; i++) {
+      this.tabs[i] = document.createElement("table");
+      this.tabs[i].className = 'ricoLG_table';
+      this.tabs[i].border=0;
+      this.tabs[i].cellPadding=0;
+      this.tabs[i].cellSpacing=0;
+      this.tabs[i].id = this.tableId+"_tab"+i;
+      this.thead[i]=this.tabs[i].createTHead();
+      this.thead[i].className='ricoLG_top';
+      if (Rico.theme.gridheader) Rico.addClass(this.thead[i],Rico.theme.gridheader);
+      this.tbody[i]=Rico.getTBody(this.tabs[i]);
+      this.tbody[i].className='ricoLG_bottom';
+      if (Rico.theme.gridcontent) Rico.addClass(this.tbody[i],Rico.theme.gridcontent);
+      this.tbody[i].insertRow(-1);
+    }
+    this.frozenTabs.appendChild(this.tabs[0]);
+    this.scrollTabs.appendChild(this.tabs[1]);
+    if (insertloc) insertloc.parentNode.insertBefore(this.outerDiv,insertloc);
+    if (hdrSrc) {
+      this.headerColCnt = this.getColumnInfo(hdrSrc);
+      this.loadHdrSrc(hdrSrc);
+    } else {
+      this.createHdr(0,0,this.options.frozenColumns);
+      this.createHdr(1,this.options.frozenColumns,this.options.columnSpecs.length);
+      if (this.options.PanelNamesOnTabHdr && this.options.panels) {
+        this.insertPanelNames(this.thead[0].insertRow(0), 0, this.options.frozenColumns);
+        this.insertPanelNames(this.thead[1].insertRow(0), this.options.frozenColumns, this.options.columnSpecs.length);
+      }
+      for (i=0; i<2; i++)
+        this.headerColCnt = this.getColumnInfo(this.thead[i].rows);
+    }
+    for( var c=0; c < this.headerColCnt; c++ )
+      this.tbody[c<this.options.frozenColumns ? 0 : 1].rows[0].insertCell(-1);
+    if (insertloc) table.parentNode.removeChild(table);
+    Rico.log('createTables end');
+    return true;
+  },
+
+  createDataCells: function(visibleRows) {
+    if (visibleRows < 0) {
+      for (var i=0; i<this.options.minPageRows; i++)
+        this.appendBlankRow();
+      this.sizeDivs();
+      this.autoAppendRows(this.remainingHt());
+    } else {
+      for( var r=0; r < visibleRows; r++ )
+        this.appendBlankRow();
+    }
+    var s=this.options.highlightSection;
+    if (s & 1) this.attachHighlightEvents(this.tbody[0]);
+    if (s & 2) this.attachHighlightEvents(this.tbody[1]);
+  },
+
+/**
+ * @param colnum column number
+ * @return id string for a filter element
+ */
+  filterId: function(colnum) {
+    return 'RicoFilter_'+this.tableId+'_'+colnum;
+  },
+
+/**
+ * Create filter elements in heading
+ * Reads this.columns[].filterUI to determine type of filter element for each column (t=text box, s=select list, c=custom)
+ * @param r heading row where filter elements will be placed
+ */
+  createFilters: function(r) {
+    for( var c=0; c < this.headerColCnt; c++ ) {
+      var col=this.columns[c];
+      var fmt=col.format;
+      if (typeof fmt.filterUI!='string') continue;
+      var cell=this.hdrCells[r][c].cell;
+      var field,name=this.filterId(c);\r
+      var divs=cell.getElementsByTagName('div');
+      // copy text alignment from data cell
+      var align=Rico.getStyle(this.cell(0,c),'textAlign');
+      divs[1].style.textAlign=align;
+      switch (fmt.filterUI.charAt(0)) {
+        case 't':
+          // text field
+          field=Rico.createFormField(divs[1],'input','text',name,name);
+          var size=fmt.filterUI.match(/\d+/);
+          field.maxLength=fmt.Length || 50;\r
+          field.size=size ? parseInt(size,10) : 10;
+          divs[1].appendChild(Rico.clearButton(Rico.eventHandle(col,'filterClear')));
+          if (col.filterType==Rico.ColumnConst.USERFILTER && col.filterOp=='LIKE') {
+            var v=col.filterValues[0];
+            if (v.charAt(0)=='*') v=v.substr(1);
+            if (v.slice(-1)=='*') v=v.slice(0,-1);
+            field.value=v;
+            col.lastKeyFilter=v;
+          }
+          Rico.eventBind(field,'keyup',Rico.eventHandle(col,'filterKeypress'),false);
+          col.filterField=field;\r
+          break;\r
+        case 'm':
+          // multi-select
+        case 's':
+          // drop-down select
+          field=Rico.createFormField(divs[1],'select',null,name);\r
+          Rico.addSelectOption(field,this.options.FilterAllToken,Rico.getPhraseById("filterAll"));\r
+          col.filterField=field;
+          var options={};\r
+          Rico.extend(options, this.buffer.ajaxOptions);
+          var colnum=typeof(fmt.filterCol)=='number' ? fmt.filterCol : c;
+          options.parameters = {id: this.tableId, distinct:colnum};
+          options.parameters[this.actionId]="query";
+          options.onComplete = Rico.bind(this,'filterValuesUpdate',c);
+          new Rico.ajaxRequest(this.buffer.dataSource, options);
+          break;\r
+        case 'c':
+          // custom
+          if (typeof col._createFilters == 'function')
+            col._createFilters(divs[1], name);
+          break;
+      }
+    }
+    this.initFilterImage(r);
+  },
+
+/**
+ * update select list filter with values in AJAX response
+ * @returns true on success
+ */
+  filterValuesUpdate: function(colnum,request) {
+    var response = request.responseXML.getElementsByTagName("ajax-response");
+    Rico.log("filterValuesUpdate: "+request.status);
+    if (response == null || response.length != 1) return false;
+    response=response[0];
+    var error = response.getElementsByTagName('error');
+    if (error.length > 0) {
+      Rico.log("Data provider returned an error:\n"+Rico.getContentAsString(error[0],this.buffer.isEncoded));
+      alert(Rico.getPhraseById("requestError",Rico.getContentAsString(error[0],this.buffer.isEncoded)));
+      return false;
+    }\r
+    response=response.getElementsByTagName('response')[0];\r
+    var rowsElement = response.getElementsByTagName('rows')[0];\r
+    var col=this.columns[parseInt(colnum,10)];
+    var rows = this.buffer.dom2jstable(rowsElement);\r
+    var c,opt,v;
+    if (col.filterType==Rico.ColumnConst.USERFILTER && col.filterOp=='EQ') v=col.filterValues[0];
+    Rico.log('filterValuesUpdate: col='+colnum+' rows='+rows.length);
+    switch (col.format.filterUI.charAt(0)) {
+      case 'm':
+        // multi-select
+        col.mFilter = document.body.appendChild(document.createElement("div"));
+        col.mFilter.className = 'ricoLG_mFilter'
+        Rico.hide(col.mFilter);
+        var contentDiv = col.mFilter.appendChild(document.createElement("div"));
+        contentDiv.className = 'ricoLG_mFilter_content'
+        var buttonDiv = col.mFilter.appendChild(document.createElement("div"));
+        buttonDiv.className = 'ricoLG_mFilter_button'
+        col.mFilterButton=buttonDiv.appendChild(document.createElement("button"));
+        col.mFilterButton.innerHTML=Rico.getPhraseById("ok");
+        var eventName=Rico.isWebKit ? 'mousedown' : 'click';
+        Rico.eventBind(col.filterField,eventName,Rico.eventHandle(col,'mFilterSelectClick'));
+        Rico.eventBind(col.mFilterButton,'click',Rico.eventHandle(col,'mFilterFinish'));
+        //col.filterField.options[0].text=$('AllLabel').innerHTML;
+        tab = contentDiv.appendChild(document.createElement("table"));
+        tab.border=0;
+        tab.cellPadding=2;
+        tab.cellSpacing=0;
+        //tbody=(tab.tBodies.length==0) ? tab.appendChild(document.createElement("tbody")) : tab.tBodies[0];
+        var baseId=this.filterId(colnum)+'_';
+        this.createMFilterItem(tab,this.options.FilterAllToken,Rico.getPhraseById("filterAll"),baseId+'all',Rico.eventHandle(col,'mFilterAllClick'));
+        var handle=Rico.eventHandle(col,'mFilterOtherClick')
+        for (var i=0; i<rows.length; i++) {
+          if (rows[i].length>0) {
+            c=rows[i][0];
+            this.createMFilterItem(tab,c,c || Rico.getPhraseById("filterBlank"),baseId+i,handle);
+          }
+        }
+        col.mFilterInputs=contentDiv.getElementsByTagName('input');
+        col.mFilterLabels=contentDiv.getElementsByTagName('label');
+        col.mFilterFocus=col.mFilterInputs.length ? col.mFilterInputs[0] : col.mFilterButton;
+        break;
+
+      case 's':
+        // drop-down select
+        for (var i=0; i<rows.length; i++) {
+          if (rows[i].length>0) {
+            c=rows[i][0];
+            opt=Rico.addSelectOption(col.filterField,c,c || Rico.getPhraseById("filterBlank"));
+            if (col.filterType==Rico.ColumnConst.USERFILTER && c==v) opt.selected=true;
+          }
+        }
+        Rico.eventBind(col.filterField,'change',Rico.eventHandle(col,'filterChange'));
+        break;
+    }
+    return true;\r
+  },
+  
+  createMFilterItem: function(table,code,description,id,eventHandle) {
+    var tr=table.insertRow(-1);
+    tr.vAlign='top';
+    if (tr.rowIndex % 2 == 1) tr.className='ricoLG_mFilter_oddrow';
+    var td1=tr.insertCell(-1)
+    var td2=tr.insertCell(-1)
+    var field=Rico.createFormField(td1,'input','checkbox',id);
+    field.value=code;
+    field.checked=true;
+    var label = td2.appendChild(document.createElement("label"));
+    label.htmlFor = id;
+    label.innerHTML=description;
+    Rico.eventBind(field,'click',eventHandle);
+  },
+
+  unplugHighlightEvents: function() {
+    var s=this.options.highlightSection;
+    if (s & 1) this.detachHighlightEvents(this.tbody[0]);
+    if (s & 2) this.detachHighlightEvents(this.tbody[1]);
+  },
+
+/**
+ * place panel names on first row of grid header (used by LiveGridForms)
+ */
+  insertPanelNames: function(r,start,limit,cellClass) {
+    Rico.log('insertPanelNames: start='+start+' limit='+limit);
+    r.className='ricoLG_hdg';
+    var lastIdx=-1, span, newCell=null, spanIdx=0;
+    for( var c=start; c < limit; c++ ) {
+      if (lastIdx == this.options.columnSpecs[c].panelIdx) {
+        span++;
+      } else {
+        if (newCell) newCell.colSpan=span;
+        newCell = r.insertCell(-1);
+        if (cellClass) newCell.className=cellClass;
+        span=1;
+        lastIdx=this.options.columnSpecs[c].panelIdx;
+        newCell.innerHTML=this.options.panels[lastIdx];
+      }
+    }
+    if (newCell) newCell.colSpan=span;
+  },
+
+/**
+ * create grid header for table i (if none was provided)
+ */
+  createHdr: function(i,start,limit) {
+    Rico.log('createHdr: i='+i+' start='+start+' limit='+limit);
+    var mainRow = this.thead[i].insertRow(-1);
+    mainRow.id=this.tableId+'_tab'+i+'h_main';
+    mainRow.className='ricoLG_hdg';
+    for( var c=start; c < limit; c++ ) {
+      var newCell = mainRow.insertCell(-1);
+      newCell.innerHTML=this.options.columnSpecs[c].Hdg;
+    }
+  },
+
+/**
+ * move header cells in original table to grid
+ */
+  loadHdrSrc: function(hdrSrc) {
+    var i,h,c,r,newrow,cells;
+    Rico.log('loadHdrSrc start');
+    for (i=0; i<2; i++) {
+      for (r=0; r<hdrSrc.length; r++) {
+        newrow = this.thead[i].insertRow(-1);
+        newrow.className='ricoLG_hdg '+this.tableId+'_hdg'+r;
+      }
+    }
+    if (hdrSrc.length==1) {
+      cells=hdrSrc[0].cells;
+      for (c=0; cells.length > 0; c++)
+        this.thead[c<this.options.frozenColumns ? 0 : 1].rows[0].appendChild(cells[0]);
+    } else {
+      for (r=0; r<hdrSrc.length; r++) {
+        cells=hdrSrc[r].cells;
+        for (c=0,h=0; cells.length > 0; c++) {
+          if (cells[0].className=='ricoFrozen') {
+            if (r==this.headerRowIdx) this.options.frozenColumns=c+1;
+          } else {
+            h=1;
+          }
+          this.thead[h].rows[r].appendChild(cells[0]);
+        }
+      }
+    }
+    Rico.log('loadHdrSrc end');
+  },
+
+/**
+ * Size div elements
+ */
+  sizeDivs: function() {
+    Rico.log('sizeDivs: '+this.tableId);
+    //this.cancelMenu();
+    this.unhighlight();
+    this.baseSizeDivs();
+    var firstVisible=this.firstVisible();
+    if (this.pageSize == 0 || firstVisible < 0) return;
+    var totRowHt=this.columns[firstVisible].dataColDiv.offsetHeight;
+    this.rowHeight = Math.round(totRowHt/this.pageSize);
+    var scrHt=this.dataHt;
+    if (this.scrWi>0 || Rico.isIE || Rico.isWebKit)
+      scrHt+=this.options.scrollBarWidth;
+    this.scrollDiv.style.height=scrHt+'px';
+    this.innerDiv.style.width=(this.scrWi-this.options.scrollBarWidth+1)+'px';
+    this.resizeDiv.style.height=this.frozenTabs.style.height=this.innerDiv.style.height=(this.hdrHt+this.dataHt+1)+'px';
+    Rico.log('sizeDivs scrHt='+scrHt+' innerHt='+this.innerDiv.style.height+' rowHt='+this.rowHeight+' pageSize='+this.pageSize);
+    var pad=(this.scrWi-this.scrTabWi < this.options.scrollBarWidth) ? 2 : 0;
+    this.shadowDiv.style.width=(this.scrTabWi+pad)+'px';
+    this.outerDiv.style.height=(this.hdrHt+scrHt)+'px';
+    this.setHorizontalScroll();
+  },
+
+  setHorizontalScroll: function() {
+    var scrleft=this.scrollDiv.scrollLeft;
+    this.scrollTabs.style.left=(-scrleft)+'px';
+  },
+
+  remainingHt: function() {
+    var tabHt;
+    var winHt=Rico.windowHeight();
+    var margin=Rico.isIE ? 15 : 10;
+    // if there is a horizontal scrollbar take it into account
+    if (!Rico.isIE && window.frameElement && window.frameElement.scrolling=='yes' && this.sizeTo!='parent') margin+=this.options.scrollBarWidth;
+    switch (this.sizeTo) {
+      case 'window':
+      case 'data':
+        var divTop=Rico.cumulativeOffset(this.outerDiv).top;
+        tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
+        Rico.log("remainingHt, winHt="+winHt+' tabHt='+tabHt+' gridY='+divTop);
+        return winHt-divTop-tabHt-this.options.scrollBarWidth-margin;  // allow for scrollbar and some margin
+      case 'parent':
+        var offset=this.offsetFromParent(this.outerDiv);
+        tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
+        if (Rico.isIE) Rico.hide(this.outerDiv);
+        var parentHt=this.outerDiv.parentNode.offsetHeight;
+        if (Rico.isIE) Rico.show(this.outerDiv);
+        Rico.log("remainingHt, parentHt="+parentHt+' gridY='+offset+' winHt='+winHt+' tabHt='+tabHt);
+        return parentHt - tabHt - offset - this.options.scrollBarWidth;
+      case 'body':
+        //Rico.log("remainingHt, document.height="+document.height);
+        //Rico.log("remainingHt, body.offsetHeight="+document.body.offsetHeight);
+        //Rico.log("remainingHt, body.scrollHeight="+document.body.scrollHeight);
+        //Rico.log("remainingHt, documentElement.scrollHeight="+document.documentElement.scrollHeight);
+        var bodyHt=Rico.isIE ? document.body.scrollHeight : document.body.offsetHeight;
+        var remHt=winHt-bodyHt-margin;
+        if (!Rico.isWebKit) remHt-=this.options.scrollBarWidth;
+        Rico.log("remainingHt, winHt="+winHt+' pageHt='+bodyHt+' remHt='+remHt);
+        return remHt;
+      default:
+        tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
+        Rico.log("remainingHt, winHt="+winHt+' tabHt='+tabHt);
+        if (this.sizeTo.slice(-1)=='%') winHt*=parseFloat(this.sizeTo)/100.0;
+        else if (this.sizeTo.slice(-2)=='px') winHt=parseInt(this.sizeTo,10);
+        return winHt-tabHt-this.options.scrollBarWidth-margin;  // allow for scrollbar and some margin
+    }
+  },
+
+  offsetFromParent: function(element) {
+    var valueT = 0;
+    var elParent=element.parentNode;
+    do {
+      //Rico.log("offsetFromParent: "+element.tagName+' id='+element.id+' otop='+element.offsetTop);
+      valueT += element.offsetTop  || 0;
+      element = element.offsetParent;
+      if (!element || element==null) break;
+      var p = Rico.getStyle(element, 'position');
+      if (element.tagName=='BODY' || element.tagName=='HTML' || p=='absolute') return valueT-elParent.offsetTop;
+    } while (element != elParent);
+    return valueT;
+  },
+
+  adjustPageSize: function() {
+    var remHt=this.remainingHt();
+    Rico.log('adjustPageSize remHt='+remHt+' lastRow='+this.lastRowPos);
+    if (remHt > this.rowHeight)
+      this.autoAppendRows(remHt);
+    else if (remHt < 0 || this.sizeTo=='data')
+      this.autoRemoveRows(-remHt);
+  },
+  
+  setPageSize: function(newRowCount) {
+    newRowCount=Math.min(newRowCount,this.options.maxPageRows);
+    newRowCount=Math.max(newRowCount,this.options.minPageRows);
+    this.sizeTo='fixed';
+    var oldSize=this.pageSize;
+    while (this.pageSize > newRowCount) {
+      this.removeRow();
+    }
+    while (this.pageSize < newRowCount) {
+      this.appendBlankRow();
+    }
+    this.finishResize(oldSize);
+  },
+
+  pluginWindowResize: function() {
+    Rico.log("pluginWindowResize");
+    this.resizeWindowHandler=Rico.eventHandle(this,'resizeWindow');
+    Rico.eventBind(window, "resize", this.resizeWindowHandler, false);
+  },
+
+  unplugWindowResize: function() {
+    if (!this.resizeWindowHandler) return;
+    Rico.eventUnbind(window,"resize", this.resizeWindowHandler, false);
+    this.resizeWindowHandler=null;
+  },
+
+  resizeWindow: function() {
+    Rico.log('resizeWindow '+this.tableId+' lastRow='+this.lastRowPos);
+    if (this.resizeState=='finish') {
+      Rico.log('resizeWindow postponed');
+      this.resizeState='resize';
+      return;
+    }
+    if (!this.sizeTo || this.sizeTo=='fixed') {
+      this.sizeDivs();
+      return;
+    }
+    if (this.sizeTo=='parent' && Rico.getStyle(this.outerDiv.parentNode,'display') == 'none') return;
+    var oldSize=this.pageSize;
+    this.adjustPageSize();
+    this.finishResize(oldSize);
+  },
+
+  finishResize: function(oldSize) {
+    if (this.pageSize > oldSize && this.buffer.totalRows>0) {
+      this.isPartialBlank=true;
+      var adjStart=this.adjustRow(this.lastRowPos);
+      this.buffer.fetch(adjStart);
+    } else if (this.pageSize < oldSize) {
+      if (this.options.onRefreshComplete) this.options.onRefreshComplete(this.contentStartPos,this.contentStartPos+this.pageSize-1);  // update bookmark
+    }
+    this.resizeState='finish';
+    Rico.runLater(20,this,'finishResize2');
+    Rico.log('Resize '+this.tableId+' complete. old size='+oldSize+' new size='+this.pageSize);
+  },
+
+  finishResize2: function() {
+    this.sizeDivs();
+    this.updateHeightDiv();
+    if (this.resizeState=='resize') {
+      this.resizeWindow();
+    } else {
+      this.resizeState='';
+    }
+  },
+
+  topOfLastPage: function() {
+    return Math.max(this.buffer.totalRows-this.pageSize,0);
+  },
+
+  updateHeightDiv: function() {
+    var notdisp=this.topOfLastPage();
+    var ht = notdisp ? this.scrollDiv.clientHeight + Math.floor(this.rowHeight * (notdisp + 0.4)) : 1;
+    Rico.log("updateHeightDiv, ht="+ht+' scrollDiv.clientHeight='+this.scrollDiv.clientHeight+' rowsNotDisplayed='+notdisp);
+    this.shadowDiv.style.height=ht+'px';
+  },
+
+  autoRemoveRows: function(overage) {
+    if (!this.rowHeight) return;
+    var removeCnt=Math.ceil(overage / this.rowHeight);
+    if (this.sizeTo=='data')
+      removeCnt=Math.max(removeCnt,this.pageSize-this.buffer.totalRows);
+    Rico.log("autoRemoveRows overage="+overage+" removeCnt="+removeCnt);
+    for (var i=0; i<removeCnt; i++)
+      this.removeRow();
+  },
+
+  removeRow: function() {
+    if (this.pageSize <= this.options.minPageRows) return;
+    this.pageSize--;
+    for( var c=0; c < this.headerColCnt; c++ ) {
+      var cell=this.columns[c].cell(this.pageSize);
+      this.columns[c].dataColDiv.removeChild(cell);
+    }
+  },
+
+  autoAppendRows: function(overage) {
+    if (!this.rowHeight) return;
+    var addCnt=Math.floor(overage / this.rowHeight);
+    Rico.log("autoAppendRows overage="+overage+" cnt="+addCnt+" rowHt="+this.rowHeight);
+    for (var i=0; i<addCnt; i++) {
+      if (this.sizeTo=='data' && this.pageSize>=this.buffer.totalRows) break;
+      this.appendBlankRow();
+    }
+  },
+
+/**
+ * on older systems, this can be fairly slow
+ */
+  appendBlankRow: function() {
+    if (this.pageSize >= this.options.maxPageRows) return;
+    Rico.log("appendBlankRow #"+this.pageSize);
+    var cls=this.defaultRowClass(this.pageSize);
+    for( var c=0; c < this.headerColCnt; c++ ) {
+      var newdiv = document.createElement("div");
+      newdiv.className = 'ricoLG_cell '+cls;
+      newdiv.id=this.tableId+'_'+this.pageSize+'_'+c;
+      this.columns[c].dataColDiv.appendChild(newdiv);
+      if (this.columns[c].format.canDrag && Rico.registerDraggable)
+        Rico.registerDraggable( new Rico.LiveGridDraggable(this, this.pageSize, c), this.options.dndMgrIdx );
+      newdiv.innerHTML='&nbsp;';   // this seems to be required by IE
+      if (this.columns[c]._create) {
+        this.columns[c]._create(newdiv,this.pageSize);
+      }
+    }
+    this.pageSize++;
+  },
+
+  defaultRowClass: function(rownum) {
+    var cls
+    if (rownum % 2==0) {
+      cls='ricoLG_evenRow';
+      //if (Rico.theme.primary) cls+=' '+Rico.theme.primary;
+    } else {
+      cls='ricoLG_oddRow';
+      //if (Rico.theme.secondary) cls+=' '+Rico.theme.secondary;
+    }
+    return cls;
+  },
+
+  handleMenuClick: function(e) {
+    if (!this.menu) return;
+    this.cancelMenu();
+    this.unhighlight(); // in case highlighting was invoked externally
+    var idx;
+    var cell=Rico.eventElement(e);
+    if (cell.className=='ricoLG_highlightDiv') {
+      idx=this.highlightIdx;
+    } else {
+      cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
+      if (!cell) return;
+      idx=this.winCellIndex(cell);
+      if ((this.options.highlightSection & (idx.tabIdx+1))==0) return;
+    }
+    this.highlight(idx);
+    this.highlightEnabled=false;
+    if (this.hideScroll) this.scrollDiv.style.overflow="hidden";
+    this.menuIdx=idx;
+    if (!this.menu.div) this.menu.createDiv();
+    this.menu.liveGrid=this;
+    if (this.menu.buildGridMenu) {
+      var showMenu=this.menu.buildGridMenu(idx.row, idx.column, idx.tabIdx);
+      if (!showMenu) return;
+    }
+    if (this.options.highlightElem=='selection' && !this.isSelected(idx.cell)) {
+      this.selectCell(idx.cell);
+    }
+    this.menu.showmenu(e,Rico.bind(this,'closeMenu'));
+  },
+
+  closeMenu: function() {
+    if (!this.menuIdx) return;
+    if (this.hideScroll) this.scrollDiv.style.overflow="";
+    //this.unhighlight();
+    this.highlightEnabled=true;
+    this.menuIdx=null;
+  },
+
+/**
+ * @return index of cell within the window
+ */
+  winCellIndex: function(cell) {
+    var l=cell.id.lastIndexOf('_',cell.id.length);
+    var l2=cell.id.lastIndexOf('_',l-1)+1;
+    var c=parseInt(cell.id.substr(l+1));
+    var r=parseInt(cell.id.substr(l2,l));
+    return {row:r, column:c, tabIdx:this.columns[c].tabIdx, cell:cell};
+  },
+
+/**
+ * @return index of cell within the dataset
+ */
+  datasetIndex: function(cell) {
+    var idx=this.winCellIndex(cell);
+    idx.row+=this.buffer.windowPos;
+    idx.onBlankRow=(idx.row >= this.buffer.endPos());
+    return idx;
+  },
+
+  attachHighlightEvents: function(tBody) {
+    switch (this.options.highlightElem) {
+      case 'selection':
+        Rico.eventBind(tBody,"mousedown", this.options.mouseDownHandler, false);
+        /** @ignore */
+        tBody.ondrag = function () { return false; };
+        /** @ignore */
+        tBody.onselectstart = function () { return false; };
+        break;
+      case 'cursorRow':
+      case 'cursorCell':
+        Rico.eventBind(tBody,"mouseover", this.options.rowOverHandler, false);
+        break;
+    }
+  },
+
+  detachHighlightEvents: function(tBody) {
+    switch (this.options.highlightElem) {
+      case 'selection':
+        Rico.eventUnbind(tBody,"mousedown", this.options.mouseDownHandler, false);
+        tBody.ondrag = null;
+        tBody.onselectstart = null;
+        break;
+      case 'cursorRow':
+      case 'cursorCell':
+        Rico.eventUnbind(tBody,"mouseover", this.options.rowOverHandler, false);
+        break;
+    }
+  },
+
+/**
+ * @return array of objects containing row/col indexes (index values are relative to the start of the window)
+ */
+  getVisibleSelection: function() {
+    var cellList=[];
+    if (this.SelectIdxStart && this.SelectIdxEnd) {
+      var r1=Math.max(Math.min(this.SelectIdxEnd.row,this.SelectIdxStart.row)-this.buffer.startPos,this.buffer.windowStart);
+      var r2=Math.min(Math.max(this.SelectIdxEnd.row,this.SelectIdxStart.row)-this.buffer.startPos,this.buffer.windowEnd-1);
+      var c1=Math.min(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+      var c2=Math.max(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+      //Rico.log("getVisibleSelection "+r1+','+c1+' to '+r2+','+c2+' ('+this.SelectIdxStart.row+',startPos='+this.buffer.startPos+',windowPos='+this.buffer.windowPos+',windowEnd='+this.buffer.windowEnd+')');
+      for (var r=r1; r<=r2; r++) {
+        for (var c=c1; c<=c2; c++)
+          cellList.push({row:r-this.buffer.windowStart,column:c});
+      }
+    }
+    if (this.SelectCtrl) {
+      for (var i=0; i<this.SelectCtrl.length; i++) {
+        if (this.SelectCtrl[i].row>=this.buffer.windowStart && this.SelectCtrl[i].row<this.buffer.windowEnd)
+          cellList.push({row:this.SelectCtrl[i].row-this.buffer.windowStart,column:this.SelectCtrl[i].column});
+      }
+    }
+    return cellList;
+  },
+
+  updateSelectOutline: function() {
+    if (!this.SelectIdxStart || !this.SelectIdxEnd) return;
+    var r1=Math.max(Math.min(this.SelectIdxEnd.row,this.SelectIdxStart.row), this.buffer.windowStart);
+    var r2=Math.min(Math.max(this.SelectIdxEnd.row,this.SelectIdxStart.row), this.buffer.windowEnd-1);
+    if (r1 > r2) {
+      this.HideSelection();
+      return;
+    }
+    var c1=Math.min(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+    var c2=Math.max(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+    var top1=this.columns[c1].cell(r1-this.buffer.windowStart).offsetTop;
+    var cell2=this.columns[c1].cell(r2-this.buffer.windowStart);
+    var bottom2=cell2.offsetTop+cell2.offsetHeight;
+    var left1=this.columns[c1].dataCell.offsetLeft;
+    var left2=this.columns[c2].dataCell.offsetLeft;
+    var right2=left2+this.columns[c2].dataCell.offsetWidth;
+    //window.status='updateSelectOutline: '+r1+' '+r2+' top='+top1+' bot='+bottom2;
+    this.highlightDiv[0].style.top=this.highlightDiv[3].style.top=this.highlightDiv[1].style.top=(this.hdrHt+top1-1) + 'px';
+    this.highlightDiv[2].style.top=(this.hdrHt+bottom2-1)+'px';
+    this.highlightDiv[3].style.left=(left1-2)+'px';
+    this.highlightDiv[0].style.left=this.highlightDiv[2].style.left=(left1-1)+'px';
+    this.highlightDiv[1].style.left=(right2-1)+'px';
+    this.highlightDiv[0].style.width=this.highlightDiv[2].style.width=(right2-left1-1) + 'px';
+    this.highlightDiv[1].style.height=this.highlightDiv[3].style.height=(bottom2-top1) + 'px';
+    //this.highlightDiv[0].style.right=this.highlightDiv[2].style.right=this.highlightDiv[1].style.right=()+'px';
+    //this.highlightDiv[2].style.bottom=this.highlightDiv[3].style.bottom=this.highlightDiv[1].style.bottom=(this.hdrHt+bottom2) + 'px';
+    for (var i=0; i<4; i++)
+      this.highlightDiv[i].style.display='';
+  },
+
+  HideSelection: function() {
+    var i;
+    if (this.options.highlightMethod!='class') {
+      for (i=0; i<this.highlightDiv.length; i++)
+        this.highlightDiv[i].style.display='none';
+    }
+    if (this.options.highlightMethod!='outline') {
+      var cellList=this.getVisibleSelection();
+      Rico.log("HideSelection "+cellList.length);
+      for (i=0; i<cellList.length; i++)
+        this.unhighlightCell(this.columns[cellList[i].column].cell(cellList[i].row));
+    }
+  },
+
+  ShowSelection: function() {
+    if (this.options.highlightMethod!='class')
+      this.updateSelectOutline();
+    if (this.options.highlightMethod!='outline') {
+      var cellList=this.getVisibleSelection();
+      for (var i=0; i<cellList.length; i++)
+        this.highlightCell(this.columns[cellList[i].column].cell(cellList[i].row));
+    }
+  },
+
+  ClearSelection: function() {
+    Rico.log("ClearSelection");
+    this.HideSelection();
+    this.SelectIdxStart=null;
+    this.SelectIdxEnd=null;
+    this.SelectCtrl=[];
+  },
+
+  selectCell: function(cell) {
+    this.ClearSelection();
+    this.SelectIdxStart=this.SelectIdxEnd=this.datasetIndex(cell);
+    this.ShowSelection();
+  },
+
+  AdjustSelection: function(cell) {
+    var newIdx=this.datasetIndex(cell);
+    if (this.SelectIdxStart.tabIdx != newIdx.tabIdx) return;
+    this.HideSelection();
+    this.SelectIdxEnd=newIdx;
+    this.ShowSelection();
+  },
+
+  RefreshSelection: function() {
+    var cellList=this.getVisibleSelection();
+    for (var i=0; i<cellList.length; i++) {
+      this.columns[cellList[i].column].displayValue(cellList[i].row);
+    }
+  },
+
+  FillSelection: function(newVal,newStyle) {
+    if (this.SelectIdxStart && this.SelectIdxEnd) {
+      var r1=Math.min(this.SelectIdxEnd.row,this.SelectIdxStart.row);
+      var r2=Math.max(this.SelectIdxEnd.row,this.SelectIdxStart.row);
+      var c1=Math.min(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+      var c2=Math.max(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+      for (var r=r1; r<=r2; r++) {
+        for (var c=c1; c<=c2; c++) {
+          this.buffer.setValue(r,c,newVal,newStyle);
+        }
+      }
+    }
+    if (this.SelectCtrl) {
+      for (var i=0; i<this.SelectCtrl.length; i++) {
+        this.buffer.setValue(this.SelectCtrl[i].row,this.SelectCtrl[i].column,newVal,newStyle);
+      }
+    }
+    this.RefreshSelection();
+  },
+
+/**
+ * Process mouse down event
+ * @param e event object
+ */
+  selectMouseDown: function(e) {
+    if (this.highlightEnabled==false) return true;
+    this.cancelMenu();
+    var cell=Rico.eventElement(e);
+    if (!Rico.eventLeftClick(e)) return true;
+    cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
+    if (!cell) return true;
+    Rico.eventStop(e);
+    var newIdx=this.datasetIndex(cell);
+    if (newIdx.onBlankRow) return true;
+    Rico.log("selectMouseDown @"+newIdx.row+','+newIdx.column);
+    if (e.ctrlKey) {
+      if (!this.SelectIdxStart || this.options.highlightMethod!='class') return true;
+      if (!this.isSelected(cell)) {
+        this.highlightCell(cell);
+        this.SelectCtrl.push(this.datasetIndex(cell));
+      } else {
+        for (var i=0; i<this.SelectCtrl.length; i++) {
+          if (this.SelectCtrl[i].row==newIdx.row && this.SelectCtrl[i].column==newIdx.column) {
+            this.unhighlightCell(cell);
+            this.SelectCtrl.splice(i,1);
+            break;
+          }
+        }
+      }
+    } else if (e.shiftKey) {
+      if (!this.SelectIdxStart) return true;
+      this.AdjustSelection(cell);
+    } else {
+      this.selectCell(cell);
+      this.pluginSelect();
+    }
+    return false;
+  },
+
+  pluginSelect: function() {
+    if (this.selectPluggedIn) return;
+    var tBody=this.tbody[this.SelectIdxStart.tabIdx];
+    Rico.eventBind(tBody,"mouseover", this.options.mouseOverHandler, false);
+    Rico.eventBind(this.outerDiv,"mouseup",  this.options.mouseUpHandler,  false);
+    this.selectPluggedIn=true;
+  },
+
+  unplugSelect: function() {
+    if (!this.selectPluggedIn) return;
+    var tBody=this.tbody[this.SelectIdxStart.tabIdx];
+    Rico.eventUnbind(tBody,"mouseover", this.options.mouseOverHandler , false);
+    Rico.eventUnbind(this.outerDiv,"mouseup", this.options.mouseUpHandler , false);
+    this.selectPluggedIn=false;
+  },
+
+  selectMouseUp: function(e) {
+    this.unplugSelect();
+    var cell=Rico.eventElement(e);
+    cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
+    if (!cell) return;
+    if (this.SelectIdxStart && this.SelectIdxEnd)
+      this.AdjustSelection(cell);
+    else
+      this.ClearSelection();
+  },
+
+  selectMouseOver: function(e) {
+    var cell=Rico.eventElement(e);
+    cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
+    if (!cell) return;
+    this.AdjustSelection(cell);
+    Rico.eventStop(e);
+  },
+
+  isSelected: function(cell) {
+    if (this.options.highlightMethod!='outline') return Rico.hasClass(cell,this.options.highlightClass);
+    if (!this.SelectIdxStart || !this.SelectIdxEnd) return false;
+    var r1=Math.max(Math.min(this.SelectIdxEnd.row,this.SelectIdxStart.row), this.buffer.windowStart);
+    var r2=Math.min(Math.max(this.SelectIdxEnd.row,this.SelectIdxStart.row), this.buffer.windowEnd-1);
+    if (r1 > r2) return false;
+    var c1=Math.min(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+    var c2=Math.max(this.SelectIdxEnd.column,this.SelectIdxStart.column);
+    var curIdx=this.datasetIndex(cell);
+    return (r1<=curIdx.row && curIdx.row<=r2 && c1<=curIdx.column && curIdx.column<=c2);
+  },
+
+  highlightCell: function(cell) {
+    Rico.addClass(cell,this.options.highlightClass);
+  },
+
+  unhighlightCell: function(cell) {
+    if (cell==null) return;
+    Rico.removeClass(cell,this.options.highlightClass);
+  },
+
+  selectRow: function(r) {
+    for (var c=0; c<this.columns.length; c++)
+      this.highlightCell(this.columns[c].cell(r));
+  },
+
+  unselectRow: function(r) {
+    for (var c=0; c<this.columns.length; c++)
+      this.unhighlightCell(this.columns[c].cell(r));
+  },
+
+  rowMouseOver: function(e) {
+    if (!this.highlightEnabled) return;
+    var cell=Rico.eventElement(e);
+    cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
+    if (!cell) return;
+    var newIdx=this.winCellIndex(cell);
+    if ((this.options.highlightSection & (newIdx.tabIdx+1))==0) return;
+    this.highlight(newIdx);
+  },
+
+  highlight: function(newIdx) {
+    if (this.options.highlightMethod!='outline') this.cursorSetClass(newIdx);
+    if (this.options.highlightMethod!='class') this.cursorOutline(newIdx);
+    this.highlightIdx=newIdx;
+  },
+
+  cursorSetClass: function(newIdx) {
+    switch (this.options.highlightElem) {
+      case 'menuCell':
+      case 'cursorCell':
+        if (this.highlightIdx) this.unhighlightCell(this.highlightIdx.cell);
+        this.highlightCell(newIdx.cell);
+        break;
+      case 'menuRow':
+      case 'cursorRow':
+        if (this.highlightIdx) this.unselectRow(this.highlightIdx.row);
+        var s1=this.options.highlightSection & 1;
+        var s2=this.options.highlightSection & 2;
+        var c0=s1 ? 0 : this.options.frozenColumns;
+        var c1=s2 ? this.columns.length : this.options.frozenColumns;
+        for (var c=c0; c<c1; c++)
+          this.highlightCell(this.columns[c].cell(newIdx.row));
+        break;
+      default: return;
+    }
+  },
+
+  cursorOutline: function(newIdx) {
+    var div;
+    switch (this.options.highlightElem) {
+      case 'menuCell':
+      case 'cursorCell':
+        div=this.highlightDiv[newIdx.tabIdx];
+        div.style.left=(this.columns[newIdx.column].dataCell.offsetLeft-1)+'px';
+        div.style.width=this.columns[newIdx.column].colWidth;
+        this.highlightDiv[1-newIdx.tabIdx].style.display='none';
+        break;
+      case 'menuRow':
+      case 'cursorRow':
+        div=this.highlightDiv[0];
+        var s1=this.options.highlightSection & 1;
+        var s2=this.options.highlightSection & 2;
+        div.style.left=s1 ? '0px' : this.frozenTabs.style.width;
+        div.style.width=((s1 ? this.frozenTabs.offsetWidth : 0) + (s2 ? this.innerDiv.offsetWidth : 0) - 4)+'px';
+        break;
+      default: return;
+    }
+    div.style.top=(this.hdrHt+newIdx.row*this.rowHeight-1)+'px';
+    div.style.height=(this.rowHeight-1)+'px';
+    div.style.display='';
+  },
+
+  unhighlight: function() {
+    switch (this.options.highlightElem) {
+      case 'menuCell':
+        //this.highlightIdx=this.menuIdx;
+        /*jsl:fallthru*/
+      case 'cursorCell':
+        if (this.highlightIdx) this.unhighlightCell(this.highlightIdx.cell);
+        if (!this.highlightDiv) return;
+        for (var i=0; i<2; i++)
+          this.highlightDiv[i].style.display='none';
+        break;
+      case 'menuRow':
+        //this.highlightIdx=this.menuIdx;
+        /*jsl:fallthru*/
+      case 'cursorRow':
+        if (this.highlightIdx) this.unselectRow(this.highlightIdx.row);
+        if (this.highlightDiv) this.highlightDiv[0].style.display='none';
+        break;
+    }
+  },
+
+  resetContents: function() {
+    Rico.log("resetContents");
+    this.ClearSelection();
+    this.buffer.clear();
+    this.clearRows();
+    this.clearBookmark();
+  },
+
+  setImages: function() {
+    for (var n=0; n<this.columns.length; n++)
+      this.columns[n].setImage();
+  },
+
+/**
+ * @return column index, or -1 if there are no sorted columns
+ */
+  findSortedColumn: function() {
+    for (var n=0; n<this.columns.length; n++) {
+      if (this.columns[n].isSorted()) return n;
+    }
+    return -1;
+  },
+
+  findColumnName: function(name) {
+    for (var n=0; n<this.columns.length; n++) {
+      if (this.columns[n].fieldName == name) return n;
+    }
+    return -1;
+  },
+  
+/**
+ * Searches options.columnSpecs colAttr for matching colValue
+ * @return array of matching column indexes
+ */
+  findColumnsBySpec: function(colAttr, colValue) {
+    var result=[]
+    for (var n=0; n<this.options.columnSpecs.length; n++) {
+      if (this.options.columnSpecs[n][colAttr] == colValue) result.push(n);
+    }
+    return result;
+  },
+
+/**
+ * Set initial sort
+ */
+  setSortUI: function( columnNameOrNum, sortDirection ) {
+    Rico.log("setSortUI: "+columnNameOrNum+' '+sortDirection);
+    var colnum=this.findSortedColumn();
+    if (colnum >= 0) {
+      sortDirection=this.columns[colnum].getSortDirection();
+    } else {
+      if (typeof sortDirection!='string') {
+        sortDirection=Rico.ColumnConst.SORT_ASC;
+      } else {
+        sortDirection=sortDirection.toUpperCase();
+        if (sortDirection != Rico.ColumnConst.SORT_DESC) sortDirection=Rico.ColumnConst.SORT_ASC;
+      }
+      switch (typeof columnNameOrNum) {
+        case 'string':
+          colnum=this.findColumnName(columnNameOrNum);
+          break;
+        case 'number':
+          colnum=columnNameOrNum;
+          break;
+      }
+    }
+    if (typeof(colnum)!='number' || colnum < 0) return;
+    this.clearSort();
+    this.columns[colnum].setSorted(sortDirection);
+    this.buffer.sortBuffer(colnum);
+  },
+
+/**
+ * clear sort flag on all columns
+ */
+  clearSort: function() {
+    for (var x=0;x<this.columns.length;x++)
+      this.columns[x].setUnsorted();
+  },
+
+/**
+ * clear filters on all columns
+ */
+  clearFilters: function() {
+    for (var x=0;x<this.columns.length;x++) {
+      this.columns[x].setUnfiltered(true);
+    }
+    if (this.options.filterHandler) {
+      this.options.filterHandler();
+    }
+  },
+
+/**
+ * returns number of columns with a user filter set
+ */
+  filterCount: function() {
+    for (var x=0,cnt=0;x<this.columns.length;x++) {
+      if (this.columns[x].isFiltered()) cnt++;
+    }
+    return cnt;
+  },
+
+  sortHandler: function() {
+    this.cancelMenu();
+    this.ClearSelection();
+    this.setImages();
+    var n=this.findSortedColumn();
+    if (n < 0) return;
+    Rico.log("sortHandler: sorting column "+n);
+    this.buffer.sortBuffer(n);
+    this.clearRows();
+    this.scrollDiv.scrollTop = 0;
+    this.buffer.fetch(0);
+  },
+
+  filterHandler: function() {
+    Rico.log("filterHandler");
+    this.cancelMenu();
+    if (this.buffer.processingRequest) {
+      this.queueFilter=true;
+      return;
+    }
+    this.unplugScroll();
+    this.ClearSelection();
+    this.setImages();
+    this.clearBookmark();
+    this.clearRows();
+    this.buffer.fetch(-1);
+    Rico.runLater(10,this,'pluginScroll'); // resetting ht div can cause a scroll event, triggering an extra fetch
+  },
+
+  clearBookmark: function() {
+    if (this.bookmark) this.bookmark.innerHTML="&nbsp;";
+  },
+
+  bookmarkHandler: function(firstrow,lastrow) {
+    var newhtml;
+    if (isNaN(firstrow) || !this.bookmark) return;
+    var totrows=this.buffer.totalRows;
+    if (totrows < lastrow) lastrow=totrows;
+    if (totrows<=0) {
+      newhtml = Rico.getPhraseById('bookmarkNoMatch');
+    } else if (lastrow<0) {
+      newhtml = Rico.getPhraseById('bookmarkNoRec');
+    } else if (this.buffer.foundRowCount) {
+      newhtml = Rico.getPhraseById('bookmarkExact',firstrow,lastrow,totrows);
+    } else {
+      newhtml = Rico.getPhraseById('bookmarkAbout',firstrow,lastrow,totrows);
+    }
+    this.bookmark.innerHTML = newhtml;
+  },
+
+  clearRows: function() {
+    if (this.isBlank==true) return;
+    for (var c=0; c < this.columns.length; c++)
+      this.columns[c].clearColumn();
+    this.isBlank = true;
+  },
+
+  refreshContents: function(startPos) {
+    Rico.log("refreshContents1 "+this.tableId+": startPos="+startPos+" lastRow="+this.lastRowPos+" PartBlank="+this.isPartialBlank+" pageSize="+this.pageSize);
+    this.hideMsg();
+    this.cancelMenu();
+    this.unhighlight(); // in case highlighting was manually invoked
+    if (this.queueFilter) {
+      Rico.log("refreshContents: cancelling refresh because filter has changed");
+      this.queueFilter=false;
+      this.filterHandler();
+      return;
+    }
+    this.highlightEnabled=this.options.highlightSection!='none';
+    var viewPrecedesBuffer = this.buffer.startPos > startPos;
+    var contentStartPos = viewPrecedesBuffer ? this.buffer.startPos: startPos;
+    this.contentStartPos = contentStartPos+1;
+    var contentEndPos = Math.min(this.buffer.startPos + this.buffer.size, startPos + this.pageSize);
+    this.buffer.setWindow(contentStartPos, contentEndPos);
+    Rico.log('refreshContents2 '+this.tableId+': cStartPos='+contentStartPos+' cEndPos='+contentEndPos+' vPrecedesBuf='+viewPrecedesBuffer+' b.startPos='+this.buffer.startPos);
+    if (startPos == this.lastRowPos && !this.isPartialBlank && !this.isBlank) return;
+    this.isBlank = false;
+    var onRefreshComplete = this.options.onRefreshComplete;
+
+    if ((startPos + this.pageSize < this.buffer.startPos) ||
+        (this.buffer.startPos + this.buffer.size < startPos) ||
+        (this.buffer.size == 0)) {
+      this.clearRows();
+      if (onRefreshComplete) onRefreshComplete(this.contentStartPos,contentEndPos);  // update bookmark
+      return;
+    }
+
+    Rico.log('refreshContents: contentStartPos='+contentStartPos+' contentEndPos='+contentEndPos+' viewPrecedesBuffer='+viewPrecedesBuffer);
+    var rowSize = contentEndPos - contentStartPos;
+    var blankSize = this.pageSize - rowSize;
+    var blankOffset = viewPrecedesBuffer ? 0: rowSize;
+    var contentOffset = viewPrecedesBuffer ? blankSize: 0;
+
+    for (var r=0; r < rowSize; r++) { //initialize what we have
+      for (var c=0; c < this.columns.length; c++)
+        this.columns[c].displayValue(r + contentOffset);
+    }
+    for (var i=0; i < blankSize; i++)     // blank out the rest
+      this.blankRow(i + blankOffset);
+    if (this.options.highlightElem=='selection') this.ShowSelection();
+    this.isPartialBlank = blankSize > 0;
+    this.lastRowPos = startPos;
+    Rico.log("refreshContents complete, startPos="+startPos);
+    if (onRefreshComplete) onRefreshComplete(this.contentStartPos,contentEndPos);  // update bookmark
+  },
+
+  scrollToRow: function(rowOffset) {
+     var p=this.rowToPixel(rowOffset);
+     Rico.log("scrollToRow, rowOffset="+rowOffset+" pixel="+p);
+     this.scrollDiv.scrollTop = p; // this causes a scroll event
+     if ( this.options.onscroll )
+        this.options.onscroll( this, rowOffset );
+  },
+
+  scrollUp: function() {
+     this.moveRelative(-1);
+  },
+
+  scrollDown: function() {
+     this.moveRelative(1);
+  },
+
+  pageUp: function() {
+     this.moveRelative(-this.pageSize);
+  },
+
+  pageDown: function() {
+     this.moveRelative(this.pageSize);
+  },
+
+  adjustRow: function(rowOffset) {
+     var notdisp=this.topOfLastPage();
+     if (notdisp == 0 || !rowOffset) return 0;
+     return Math.min(notdisp,rowOffset);
+  },
+
+  rowToPixel: function(rowOffset) {
+     return this.adjustRow(rowOffset) * this.rowHeight;
+  },
+
+/**
+ * @returns row to display at top of scroll div
+ */
+  pixeltorow: function(p) {
+     var notdisp=this.topOfLastPage();
+     if (notdisp == 0) return 0;
+     var prow=parseInt(p/this.rowHeight,10);
+     return Math.min(notdisp,prow);
+  },
+
+  moveRelative: function(relOffset) {
+     var newoffset=Math.max(this.scrollDiv.scrollTop+relOffset*this.rowHeight,0);
+     newoffset=Math.min(newoffset,this.scrollDiv.scrollHeight);
+     //Rico.log("moveRelative, newoffset="+newoffset);
+     this.scrollDiv.scrollTop=newoffset;
+  },
+
+  pluginScroll: function() {
+     if (this.scrollPluggedIn) return;
+     Rico.log("pluginScroll: wheelEvent="+this.wheelEvent);
+     Rico.eventBind(this.scrollDiv,"scroll",this.scrollEventFunc, false);
+     for (var t=0; t<2; t++)
+       Rico.eventBind(this.tabs[t],this.wheelEvent,this.wheelEventFunc, false);
+     this.scrollPluggedIn=true;
+  },
+
+  unplugScroll: function() {
+     if (!this.scrollPluggedIn) return;
+     Rico.log("unplugScroll");
+     Rico.eventUnbind(this.scrollDiv,"scroll", this.scrollEventFunc , false);
+     for (var t=0; t<2; t++)
+       Rico.eventUnbind(this.tabs[t],this.wheelEvent,this.wheelEventFunc, false);
+     this.scrollPluggedIn=false;
+  },
+
+  handleWheel: function(e) {
+    var delta = 0;
+    if (e.wheelDelta) {
+      if (Rico.isOpera)
+        delta = e.wheelDelta/120;
+      else if (Rico.isWebKit)
+        delta = -e.wheelDelta/12;
+      else
+        delta = -e.wheelDelta/120;
+    } else if (e.detail) {
+      delta = e.detail/3; /* Mozilla/Gecko */
+    }
+    if (delta) this.moveRelative(delta);
+    Rico.eventStop(e);
+    return false;
+  },
+
+  handleScroll: function(e) {
+     if ( this.scrollTimeout )
+       clearTimeout( this.scrollTimeout );
+     this.setHorizontalScroll();
+     var scrtop=this.scrollDiv.scrollTop;
+     var vscrollDiff = this.lastScrollPos-scrtop;
+     if (vscrollDiff == 0.00) return;
+     var newrow=this.pixeltorow(scrtop);
+     if (newrow == this.lastRowPos && !this.isPartialBlank && !this.isBlank) return;
+     var stamp1 = new Date();
+     Rico.log("handleScroll, newrow="+newrow+" scrtop="+scrtop);
+     if (this.options.highlightElem=='selection') this.HideSelection();
+     this.buffer.fetch(newrow);
+     if (this.options.onscroll) this.options.onscroll(this, newrow);
+     this.scrollTimeout = Rico.runLater(1200,this,'scrollIdle');
+     this.lastScrollPos = this.scrollDiv.scrollTop;
+     var stamp2 = new Date();
+     //Rico.log("handleScroll, time="+(stamp2.getTime()-stamp1.getTime()));
+  },
+
+  scrollIdle: function() {
+     if ( this.options.onscrollidle )
+        this.options.onscrollidle();
+  }
+
+};
+
+
+Rico.LiveGridColumn = function(grid,colIdx,hdrInfo,tabIdx) {
+  this.initialize(grid,colIdx,hdrInfo,tabIdx);
+};
+
+Rico.LiveGridColumn.prototype = 
+/** @lends Rico.LiveGridColumn# */
+{
+/**
+ * Implements a LiveGrid column. Also contains static properties used by SimpleGrid columns.
+ * @extends Rico.TableColumnBase
+ * @constructs
+ */
+initialize: function(liveGrid,colIdx,hdrInfo,tabIdx) {
+  Rico.extend(this, new Rico.TableColumnBase());
+  this.baseInit(liveGrid,colIdx,hdrInfo,tabIdx);
+  this.buffer=liveGrid.buffer;
+  if (typeof(this.format.type)!='string' || this.format.EntryType=='tinyMCE') this.format.type='raw';
+  if (typeof this.isNullable!='boolean') this.isNullable = /number|date/.test(this.format.type);
+  this.isText = /raw|text|showTags/.test(this.format.type);
+  Rico.log(" sortable="+this.sortable+" filterable="+this.filterable+" hideable="+this.hideable+" isNullable="+this.isNullable+' isText='+this.isText);
+  this.fixHeaders(this.liveGrid.tableId, this.options.hdrIconsFirst);
+  if (this['format_'+this.format.type]) {
+    this._format=this['format_'+this.format.type];
+    //this._format=Rico.bind(this,'format_'+this.format.type);
+  }
+  if (this.format.control) {
+    // copy all properties/methods that start with '_'
+    if (typeof this.format.control=='string') {
+      this.format.control=eval(this.format.control);
+    }
+    for (var property in this.format.control) {
+      if (property.charAt(0)=='_') {
+        Rico.log("Copying control property "+property+ ' to ' + this);
+        this[property] = this.format.control[property];
+      }
+    }
+  }
+},
+
+/**
+ * Sorts the column in ascending order
+ */
+sortAsc: function() {
+  this.setColumnSort(Rico.ColumnConst.SORT_ASC);
+},
+
+/**
+ * Sorts the column in descending order
+ */
+sortDesc: function() {
+  this.setColumnSort(Rico.ColumnConst.SORT_DESC);
+},
+
+/**
+ * Sorts the column in the specified direction
+ * @param direction must be one of Rico.ColumnConst.UNSORTED, .SORT_ASC, or .SORT_DESC
+ */
+setColumnSort: function(direction) {
+  this.liveGrid.clearSort();
+  this.setSorted(direction);
+  if (this.liveGrid.options.saveColumnInfo.sort)
+    this.liveGrid.setCookie();
+  if (this.options.sortHandler)
+    this.options.sortHandler();
+},
+
+/**
+ * @returns true if this column is allowed to be sorted
+ */
+isSortable: function() {
+  return this.sortable;
+},
+
+/**
+ * @returns true if this column is currently sorted
+ */
+isSorted: function() {
+  return this.currentSort != Rico.ColumnConst.UNSORTED;
+},
+
+/**
+ * @returns Rico.ColumnConst.UNSORTED, .SORT_ASC, or .SORT_DESC
+ */
+getSortDirection: function() {
+  return this.currentSort;
+},
+
+/**
+ * toggle the sort sequence for this column
+ */
+toggleSort: function() {
+  if (this.buffer && this.buffer.totalRows==0) return;
+  if (this.currentSort == Rico.ColumnConst.SORT_ASC)
+    this.sortDesc();
+  else
+    this.sortAsc();
+},
+
+/**
+ * Flags that this column is not sorted
+ */
+setUnsorted: function() {
+  this.setSorted(Rico.ColumnConst.UNSORTED);
+},
+
+/**
+ * Flags that this column is sorted, but doesn't actually carry out the sort
+ * @param direction must be one of Rico.ColumnConst.UNSORTED, .SORT_ASC, or .SORT_DESC
+ */
+setSorted: function(direction) {
+  this.currentSort = direction;
+},
+
+/**
+ * @returns true if this column is allowed to be filtered
+ */
+canFilter: function() {
+  return this.filterable;
+},
+
+/**
+ * @returns a textual representation of how this column is filtered
+ */
+getFilterText: function() {
+  var vals=[];
+  for (var i=0; i<this.filterValues.length; i++) {
+    var v=this.filterValues[i];
+    vals.push(v=='' ? Rico.getPhraseById('filterBlank') : v);
+  }
+  switch (this.filterOp) {
+    case 'EQ':   return '= '+vals.join(', ');
+    case 'NE':   return Rico.getPhraseById('filterNot',vals.join(', '));
+    case 'LE':   return '<= '+vals[0];
+    case 'GE':   return '>= '+vals[0];
+    case 'LIKE': return Rico.getPhraseById('filterLike',vals[0]);
+    case 'NULL': return Rico.getPhraseById('filterEmpty');
+    case 'NOTNULL': return Rico.getPhraseById('filterNotEmpty');
+  }
+  return '?';
+},
+
+/**
+ * @returns returns the query string representation of the filter
+ */
+getFilterQueryParm: function() {
+  if (this.filterType == Rico.ColumnConst.UNFILTERED) return '';
+  var retval='&f['+this.index+'][op]='+this.filterOp;
+  retval+='&f['+this.index+'][len]='+this.filterValues.length;
+  for (var i=0; i<this.filterValues.length; i++) {
+    retval+='&f['+this.index+']['+i+']='+escape(this.filterValues[i]);
+  }
+  return retval;
+},
+
+/**
+ * removes the filter from this column
+ */
+setUnfiltered: function(skipHandler) {
+  this.filterType = Rico.ColumnConst.UNFILTERED;
+  if (this.liveGrid.options.saveColumnInfo.filter)
+    this.liveGrid.setCookie();
+  if (this.removeFilterFunc)
+    this.removeFilterFunc();
+  if (this.options.filterHandler && !skipHandler)
+    this.options.filterHandler();
+},
+
+setFilterEQ: function() {
+  this.setUserFilter('EQ');
+},
+setFilterNE: function() {
+  this.setUserFilter('NE');
+},
+addFilterNE: function() {
+  this.filterValues.push(this.userFilter);
+  if (this.liveGrid.options.saveColumnInfo.filter)
+    this.liveGrid.setCookie();
+  if (this.options.filterHandler)
+    this.options.filterHandler();
+},
+setFilterGE: function() { this.setUserFilter('GE'); },
+setFilterLE: function() { this.setUserFilter('LE'); },
+setFilterKW: function(keyword) {
+  if (keyword!='' && keyword!=null) {
+    this.setFilter('LIKE',keyword,Rico.ColumnConst.USERFILTER);
+  } else {
+    this.setUnfiltered(false);
+  }
+},
+
+setUserFilter: function(relop) {
+  this.setFilter(relop,this.userFilter,Rico.ColumnConst.USERFILTER);
+},
+
+setSystemFilter: function(relop,filter) {
+  this.setFilter(relop,filter,Rico.ColumnConst.SYSTEMFILTER);
+},
+
+setFilter: function(relop,filter,type,removeFilterFunc) {
+  this.filterValues = typeof(filter)=='object' ? filter : [filter];
+  this.filterType = type;
+  this.filterOp = relop;
+  if (type == Rico.ColumnConst.USERFILTER && this.liveGrid.options.saveColumnInfo.filter)
+    this.liveGrid.setCookie();
+  this.removeFilterFunc=removeFilterFunc;
+  if (this.options.filterHandler)
+    this.options.filterHandler();
+},
+
+isFiltered: function() {
+  return this.filterType == Rico.ColumnConst.USERFILTER;
+},
+
+filterChange: function(e) {\r
+  var selbox=Rico.eventElement(e);
+  if (selbox.value==this.liveGrid.options.FilterAllToken)\r
+    this.setUnfiltered();\r
+  else
+    this.setFilter('EQ',selbox.value,Rico.ColumnConst.USERFILTER,function() {selbox.selectedIndex=0;});\r
+},
+
+filterClear: function(e) {\r
+  this.filterField.value='';
+  this.setUnfiltered();\r
+},
+
+filterKeypress: function(e) {\r
+  var txtbox=Rico.eventElement(e);
+  if (typeof this.lastKeyFilter != 'string') this.lastKeyFilter='';\r
+  if (this.lastKeyFilter==txtbox.value) return;\r
+  var v=txtbox.value;\r
+  Rico.log("filterKeypress: "+this.index+' '+v);\r
+  this.lastKeyFilter=v;
+  if (v=='' || v=='*')\r
+    this.setUnfiltered();\r
+  else {
+    this.setFilter('LIKE', v, Rico.ColumnConst.USERFILTER, function() {txtbox.value='';});
+  }\r
+},\r
+
+mFilterSelectClick: function(e) {
+  Rico.eventStop(e);
+  if (this.mFilter.style.display!='none') {
+    this.mFilterFinish(e);
+    if (Rico.isIE && Rico.ieVersion <= 6) {
+      this.filterField.focus();
+    } else {
+      this.filterField.blur();
+    }
+  } else {
+    var offset=Rico.cumulativeOffset(this.filterField);
+    this.mFilter.style.top=(offset.top+this.filterField.offsetHeight)+'px';
+    this.mFilter.style.left=offset.left+'px';
+    this.mFilter.style.width=Math.min(this.filterField.offsetWidth,parseInt(this.colWidth,10))+'px';
+    Rico.show(this.mFilter);
+    this.mFilterFocus.focus();
+  }
+},
+
+mFilterFinish: function(e) {
+  if (!this.mFilterChange) {
+    Rico.hide(this.mFilter);
+    return;
+  }
+  if (this.mFilterInputs[0].checked) {
+    this.mFilterReset();
+    Rico.hide(this.mFilter);
+    this.setUnfiltered();
+    return;
+  }
+  var newValues=[];
+  var newLabels=[];
+  for (var i=1; i<this.mFilterInputs.length; i++) {
+    if (this.mFilterInputs[i].checked) {
+      newValues.push(this.mFilterInputs[i].value)
+      newLabels.push(this.mFilterLabels[i].innerHTML)
+    }
+  }
+  if (newValues.length > 0) {
+    var newText=newLabels.join(', ');
+    this.filterField.options[0].text=newText;
+    this.filterField.title=newText;
+    Rico.hide(this.mFilter);
+    this.mFilterChange=false;
+    this.setFilter('EQ',newValues,Rico.ColumnConst.USERFILTER,Rico.bind(this,'mFilterReset'));
+  } else {
+    alert('Please select at least one value');
+  }
+},
+
+mFilterReset: function() {
+  var newText=this.mFilterLabels[0].innerHTML;  // all
+  this.filterField.options[0].text=newText;
+  this.filterField.title=newText;
+},
+
+mFilterAllClick: function(e) {
+  var allChecked=this.mFilterInputs[0].checked;
+  for (var i=1; i<this.mFilterInputs.length; i++) {
+    this.mFilterInputs[i].checked=allChecked;
+  }
+  this.mFilterChange=true;
+},
+
+mFilterOtherClick: function(e) {
+  this.mFilterInputs[0].checked=false;
+  this.mFilterChange=true;
+},
+
+format_text: function(v) {
+  if (typeof v!='string')
+    return '&nbsp;';
+  else
+    return Rico.stripTags(v);
+},
+
+format_showTags: function(v) {
+  if (typeof v!='string')
+    return '&nbsp;';
+  else
+    return v.replace(/&/g, '&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+},
+
+format_number: function(v) {
+  if (typeof v=='undefined' || v=='' || v==null)
+    return '&nbsp;';
+  else
+    return Rico.formatNumber(v,this.format);
+},
+
+format_datetime: function(v) {
+  if (typeof v=='undefined' || v=='' || v==null)
+    return '&nbsp;';
+  else {
+    var d=Rico.setISO8601(v);
+    if (!d) return v;
+    return (this.format.prefix || '')+Rico.formatDate(d,this.format.dateFmt || 'translateDateTime')+(this.format.suffix || '');
+  }
+},
+
+// converts GMT/UTC to local time
+format_UTCasLocalTime: function(v) {
+  if (typeof v=='undefined' || v=='' || v==null)
+    return '&nbsp;';
+  else {
+    var tz=new Date();
+    var d=Rico.setISO8601(v,-tz.getTimezoneOffset());
+    if (!d) return v;
+    return (this.format.prefix || '')+Rico.formatDate(d,this.format.dateFmt || 'translateDateTime')+(this.format.suffix || '');
+  }
+},
+
+format_date: function(v) {
+  if (typeof v=='undefined' || v==null || v=='')
+    return '&nbsp;';
+  else {
+    var d=Rico.setISO8601(v);
+    if (!d) return v;
+    return (this.format.prefix || '')+Rico.formatDate(d,this.format.dateFmt || 'translateDate')+(this.format.suffix || '');
+  }
+},
+
+fixHeaders: function(prefix, iconsfirst) {
+  if (this.sortable) {
+    var handler=Rico.eventHandle(this,'toggleSort');
+    switch (this.options.headingSort) {
+      case 'link':
+        var a=Rico.wrapChildren(this.hdrCellDiv,'ricoSort',undefined,'a');
+        a.href = "javascript:void(0)";
+        Rico.eventBind(a,"click", handler);
+        break;
+      case 'hover':
+        Rico.eventBind(this.hdrCellDiv,"click", handler);
+        break;
+    }
+  }
+  this.imgFilter = document.createElement('img');
+  this.imgFilter.style.display='none';
+  this.imgFilter.src=Rico.imgDir+this.options.filterImg;
+  this.imgFilter.className='ricoLG_HdrIcon';
+  this.imgSort = document.createElement('span');
+  this.imgSort.style.display='none';
+  if (iconsfirst) {
+    this.hdrCellDiv.insertBefore(this.imgSort,this.hdrCellDiv.firstChild);
+    this.hdrCellDiv.insertBefore(this.imgFilter,this.hdrCellDiv.firstChild);
+  } else {
+    this.hdrCellDiv.appendChild(this.imgFilter);
+    this.hdrCellDiv.appendChild(this.imgSort);
+  }
+  if (!this.format.filterUI) {
+    Rico.eventBind(this.imgFilter, 'click', Rico.eventHandle(this,'filterClick'), false);
+  }
+},
+
+filterClick: function(e) {
+  if (this.filterType==Rico.ColumnConst.USERFILTER && this.filterOp=='LIKE') {
+    this.liveGrid.openKeyword(this.index);
+  }
+},
+
+getValue: function(windowRow) {
+  return this.buffer.getWindowCell(windowRow,this.index);
+},
+
+getBufferAttr: function(windowRow) {
+  return this.buffer.getWindowAttr(windowRow,this.index);
+},
+
+setValue: function(windowRow,newval) {
+  this.buffer.setWindowValue(windowRow,this.index,newval);
+},
+
+_format: function(v) {
+  return v;
+},
+
+_display: function(v,gridCell) {
+  gridCell.innerHTML=this._format(v);
+},
+
+_export: function(v) {
+  return this._format(v);
+},
+
+displayValue: function(windowRow) {
+  var bufval=this.getValue(windowRow);
+  if (bufval==null) {
+    this.clearCell(windowRow);
+    return;
+  }
+  var gridCell=this.cell(windowRow);
+  this._display(bufval,gridCell,windowRow);
+  var acceptAttr=this.buffer.options.acceptAttr;
+  if (acceptAttr.length==0) return;
+  var bufAttr=this.getBufferAttr(windowRow);
+  if (bufAttr==null) return;
+  for (var k=0; k<acceptAttr.length; k++) {
+    bufAttr=bufAttr['_'+acceptAttr[k]] || '';
+    switch (acceptAttr[k]) {
+      case 'style': gridCell.style.cssText=bufAttr; break;
+      case 'class': gridCell.className=bufAttr; break;
+      default:      gridCell['_'+acceptAttr[k]]=bufAttr; break;
+    }
+  }
+}
+
+};
+
+Rico.includeLoaded('ricoLiveGrid.js');
diff --git a/ricoClient/js/ricoLiveGridAjax.js b/ricoClient/js/ricoLiveGridAjax.js
new file mode 100644 (file)
index 0000000..79af917
--- /dev/null
@@ -0,0 +1,576 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+if(typeof Rico=='undefined') throw("LiveGridAjax requires the Rico JavaScript framework");
+
+if (!Rico.Buffer) Rico.Buffer = {};
+
+Rico.Buffer.AjaxXML = function(url,options,ajaxOptions) {
+  this.initialize(url,options,ajaxOptions);
+}
+
+Rico.Buffer.AjaxXML.prototype = {
+/**
+ * @class Implements buffer for LiveGrid. Loads data from server via a single AJAX call.
+ * @extends Rico.Buffer.Base
+ * @constructs
+ */
+  initialize: function(url,options,ajaxOptions) {
+    Rico.extend(this, new Rico.Buffer.Base());
+    Rico.extend(this, Rico.Buffer.AjaxXMLMethods);
+    this.dataSource=url;
+    this.options.bufferTimeout=20000;            // time to wait for ajax response (milliseconds)
+    this.options.requestParameters=[];
+    this.options.waitMsg=Rico.getPhraseById("waitForData");  // replace this with an image tag if you prefer
+    this.options.canFilter=true;
+    this.options.fmt='xml';
+    Rico.extend(this.options, options || {});
+    this.ajaxOptions = { parameters: null, method : 'get' };
+    Rico.extend(this.ajaxOptions, ajaxOptions || {});
+    this.requestCount=0;
+    this.processingRequest=false;
+    this.pendingRequest=-2;
+    this.fetchData=true;
+    this.sortParm={};
+  }
+}
+
+Rico.Buffer.AjaxXMLMethods = {
+
+/** @lends Rico.Buffer.AjaxXML# */
+  fetch: function(offset) {
+    if (this.fetchData) {
+      this.foundRowCount=true;
+      this.fetchData=false;
+      this.processingRequest=true;
+      this.liveGrid.showMsg(this.options.waitMsg);
+      this.timeoutHandler = Rico.runLater(this.options.bufferTimeout,this,'handleTimedOut');
+      this.ajaxOptions.parameters = this.formQueryHashXML(0,-1);
+      Rico.log('sending request');
+      if (typeof this.dataSource=='string') {
+        this.ajaxOptions.onComplete = Rico.bind(this,'ajaxUpdate',offset);
+        new Rico.ajaxRequest(this.dataSource, this.ajaxOptions);
+      } else {
+        this.ajaxOptions.onComplete = Rico.bind(this,'jsUpdate',offset);
+        this.dataSource(this.ajaxOptions);
+      }
+    } else {
+      if (offset < 0) {
+        this.applyFilters();
+        this.setTotalRows(this.size);
+        offset=0;
+      }
+      this.liveGrid.refreshContents(offset);
+    }
+  },
+
+/**
+ * Server did not respond in time... assume that there could have been
+ * an error, and allow requests to be processed again.
+ */
+  handleTimedOut: function() {
+    Rico.log("Request Timed Out");
+    this.liveGrid.showMsg(Rico.getPhraseById("requestTimedOut"));
+  },
+
+  formQueryHashXML: function(startPos,fetchSize) {
+    var queryHash= {
+      id: this.liveGrid.tableId,
+      page_size: (typeof fetchSize=='number') ? fetchSize : this.totalRows,
+      offset: startPos.toString()
+    };
+    if (!this.foundRowCount) queryHash['get_total']='true';
+    if (this.options.requestParameters) {
+      for ( var i=0; i < this.options.requestParameters.length; i++ ) {
+        var anArg = this.options.requestParameters[i];
+        if ( anArg.name != undefined && anArg.value != undefined ) {
+          queryHash[anArg.name]=anArg.value;
+        } else {
+          var ePos  = anArg.indexOf('=');
+          var argName  = anArg.substring( 0, ePos );
+          var argValue = anArg.substring( ePos + 1 );
+          queryHash[argName]=argValue;
+        }
+      }
+    }
+    return queryHash;
+  },
+
+  clearTimer: function() {
+    if(typeof this.timeoutHandler != "number") return;
+    window.clearTimeout(this.timeoutHandler);
+    delete this.timeoutHandler;
+  },
+
+  // used by both XML and SQL buffers
+  jsUpdate: function(startPos, newRows, newAttr, totalRows, errMsg) {
+    this.clearTimer();
+    this.processingRequest=false;
+    Rico.log("jsUpdate: "+arguments.length);
+    if (errMsg) {
+      Rico.log("jsUpdate: received error="+errMsg);
+      this.liveGrid.showMsg(Rico.getPhraseById("requestError",errMsg));
+      return;
+    }
+    this.rcvdRows = newRows.length;
+    if (typeof totalRows=='number') {
+      this.rowcntContent = totalRows.toString();
+      this.rcvdRowCount = true;
+      this.foundRowCount = true;
+      Rico.log("jsUpdate: found RowCount="+this.rowcntContent);
+    }
+    this.updateBuffer(startPos, newRows, newAttr);
+    if (this.options.onAjaxUpdate)
+      this.options.onAjaxUpdate();
+    this.updateGrid(startPos);
+    if (this.options.TimeOut && this.timerMsg)
+      this.restartSessionTimer();
+    if (this.pendingRequest>=-1) {
+      var offset=this.pendingRequest;
+      Rico.log("jsUpdate: found pending request for offset="+offset);
+      this.pendingRequest=-2;
+      this.fetch(offset);
+    }
+  },
+
+  // used by both XML and SQL buffers
+  ajaxUpdate: function(startPos,xhr) {
+    this.clearTimer();
+    this.processingRequest=false;
+    if (xhr.status != 200) {
+      Rico.log("ajaxUpdate: received http error="+xhr.status);
+      this.liveGrid.showMsg(Rico.getPhraseById("httpError",xhr.status));
+      return;
+    }
+    this._responseHandler=this['processResponse'+this.options.fmt.toUpperCase()];
+    if (!this._responseHandler(startPos,xhr)) return;
+    if (this.options.onAjaxUpdate)
+      this.options.onAjaxUpdate();
+    this.updateGrid(startPos);
+    if (this.options.TimeOut && this.timerMsg)
+      this.restartSessionTimer();
+    if (this.pendingRequest>=-1) {
+      var offset=this.pendingRequest;
+      Rico.log("ajaxUpdate: found pending request for offset="+offset);
+      this.pendingRequest=-2;
+      this.fetch(offset);
+    }
+  },
+  
+  // used by both XML and SQL buffers
+  processResponseXML: function(startPos,request) {
+    // The response text may contain META DATA for debugging if client side debugging is enabled in VS\r
+    var xmlDoc = request.responseXML;\r
+    if (request.responseText.substring(0, 4) == "<!--") {\r
+      var nEnd = request.responseText.indexOf("-->");\r
+      if (nEnd == -1) {\r
+        this.liveGrid.showMsg('Web server error - client side debugging may be enabled');\r
+        return false;\r
+      }\r
+      xmlDoc = Rico.createXmlDocument();\r
+      xmlDoc.loadXML(request.responseText.substring(nEnd+3));\r
+    }
+    
+    if (!xmlDoc) {
+      alert("Data provider returned an invalid XML response");
+      Rico.log("Data provider returned an invalid XML response");
+      return false;
+    }
+
+    // process children of <ajax-response>
+    var response = xmlDoc.getElementsByTagName("ajax-response");
+    if (response == null || response.length != 1) return false;
+    this.rcvdRows = 0;
+    this.rcvdRowCount = false;
+    var ajaxResponse=response[0];
+    var debugtags = ajaxResponse.getElementsByTagName('debug');
+    for (var i=0; i<debugtags.length; i++)
+      Rico.log("ajaxUpdate: debug msg "+i+": "+Rico.getContentAsString(debugtags[i],this.options.isEncoded));
+    var error = ajaxResponse.getElementsByTagName('error');
+    if (error.length > 0) {
+      var msg=Rico.getContentAsString(error[0],this.options.isEncoded);
+      alert("Data provider returned an error:\n"+msg);
+      Rico.log("Data provider returned an error:\n"+msg);
+      return false;
+    }
+    var rowsElement = ajaxResponse.getElementsByTagName('rows')[0];
+    if (!rowsElement) {
+      Rico.log("ajaxUpdate: invalid response");
+      this.liveGrid.showMsg(Rico.getPhraseById("invalidResponse"));
+      return false;
+    }
+    var rowcnttags = ajaxResponse.getElementsByTagName('rowcount');
+    if (rowcnttags && rowcnttags.length==1) {
+      this.rowcntContent = Rico.getContentAsString(rowcnttags[0],this.options.isEncoded);
+      this.rcvdRowCount = true;
+      this.foundRowCount = true;
+      Rico.log("ajaxUpdate: found RowCount="+this.rowcntContent);
+    }
+
+    // process <rows>
+    this.updateUI = rowsElement.getAttribute("update_ui") == "true";
+    this.rcvdOffset = rowsElement.getAttribute("offset");
+    Rico.log("ajaxUpdate: rcvdOffset="+this.rcvdOffset);
+    var newRows = this.dom2jstable(rowsElement);
+    var newAttr = (this.options.acceptAttr.length > 0) ? this.dom2jstableAttr(rowsElement) : false;
+    this.rcvdRows = newRows.length;
+    this.updateBuffer(startPos, newRows, newAttr);
+    return true;
+  },
+
+  processResponseJSON: function(startPos,request) {
+    var json = Rico.getJSON(request);
+    if (!json || json == null) {
+      alert("Data provider returned an invalid JSON response");
+      Rico.log("Data provider returned an invalid JSON response");
+      return false;
+    }
+
+    if (json.debug) {
+      for (var i=0; i<json.debug.length; i++)
+        Rico.writeDebugMsg("debug msg "+i+": "+json.debug[i]);
+    }
+    if (json.error) {
+      alert("Data provider returned an error:\n"+json.error);
+      Rico.writeDebugMsg("Data provider returned an error:\n"+json.error);
+      return false;
+    }
+
+    if (json.rowcount) {
+      this.rowcntContent = json.rowcount;
+      this.rcvdRowCount = true;
+      this.foundRowCount = true;
+      Rico.writeDebugMsg("loadRows, found RowCount="+json.rowcount);
+    }
+
+    this.rcvdRows = json.rows.length;
+    this.updateBuffer(startPos, json.rows);
+    return true;
+  },
+
+  // specific to XML buffer
+  updateBuffer: function(start, newRows, newAttr) {
+    this.baseRows = newRows;
+    this.attr = newAttr;
+    Rico.log("updateBuffer: # of rows="+this.rcvdRows);
+    this.rcvdRowCount=true;
+    this.rowcntContent=this.rcvdRows;
+    if (typeof this.delayedSortCol=='number')
+      this.sortBuffer(this.delayedSortCol);
+    this.applyFilters();
+    this.startPos = 0;
+  },
+
+  // used by both XML and SQL buffers
+  updateGrid: function(offset) {
+    Rico.log("updateGrid, size="+this.size+' rcv cnt type='+typeof(this.rowcntContent));
+    var newpos;
+    if (this.rcvdRowCount==true) {
+      Rico.log("found row cnt: "+this.rowcntContent);
+      var eofrow=parseInt(this.rowcntContent,10);
+      var lastTotalRows=this.totalRows;
+      if (!isNaN(eofrow) && eofrow!=lastTotalRows) {
+        this.setTotalRows(eofrow);
+        newpos=Math.min(this.liveGrid.topOfLastPage(),offset);
+        Rico.log("updateGrid: new rowcnt="+eofrow+" newpos="+newpos);
+        if (lastTotalRows==0 && this.liveGrid.sizeTo=='data')
+          this.liveGrid.adjustPageSize();
+        this.liveGrid.scrollToRow(newpos);
+        if ( this.isInRange(newpos) ) {
+          this.liveGrid.refreshContents(newpos);
+        } else {
+          this.fetch(newpos);
+        }
+        return;
+      }
+    } else {
+      var lastbufrow=offset+this.rcvdRows;
+      if (lastbufrow>this.totalRows) {
+        var newcnt=lastbufrow;
+        Rico.log("extending totrows to "+newcnt);
+        this.setTotalRows(newcnt);
+      }
+    }
+    newpos=this.liveGrid.pixeltorow(this.liveGrid.scrollDiv.scrollTop);
+    Rico.log("updateGrid: newpos="+newpos);
+    this.liveGrid.refreshContents(newpos);
+  }
+
+};
+
+
+
+Rico.Buffer.AjaxSQL = function(url,options,ajaxOptions) {
+  this.initialize(url,options,ajaxOptions);
+}
+
+Rico.Buffer.AjaxSQL.prototype = {
+/**
+ * @class Implements buffer for LiveGrid. Loads data from server in chunks as user scrolls through the grid.
+ * @extends Rico.Buffer.AjaxXML
+ * @constructs
+ */
+  initialize: function(url,options,ajaxOptions) {
+    Rico.extend(this, new Rico.Buffer.AjaxXML());
+    Rico.extend(this, Rico.Buffer.AjaxSQLMethods);
+    this.dataSource=url;
+    this.options.canFilter=true;
+    this.options.largeBufferSize  = 7.0;   // 7 pages
+    this.options.nearLimitFactor  = 1.0;   // 1 page
+    Rico.extend(this.options, options || {});
+    Rico.extend(this.ajaxOptions, ajaxOptions || {});
+  }
+}
+
+Rico.Buffer.AjaxSQLMethods = {
+/** @lends Rico.Buffer.AjaxSQL# */
+
+  registerGrid: function(liveGrid) {
+    this.liveGrid = liveGrid;
+    this.sessionExpired=false;
+    this.timerMsg=document.getElementById(liveGrid.tableId+'_timer');
+    if (this.options.TimeOut && this.timerMsg) {
+      if (!this.timerMsg.title) this.timerMsg.title=Rico.getPhraseById("sessionExpireMinutes");
+      this.restartSessionTimer();
+    }
+  },
+
+  setBufferSize: function(pageSize) {
+    this.maxFetchSize = Math.max(50,parseInt(this.options.largeBufferSize * pageSize,10));
+    this.nearLimit = parseInt(this.options.nearLimitFactor * pageSize,10);
+    this.maxBufferSize = this.maxFetchSize * 3;
+  },
+
+  restartSessionTimer: function() {
+    if (this.sessionExpired==true) return;
+    this.sessionEndTime = (new Date()).getTime() + this.options.TimeOut*60000;
+    if (this.sessionTimer) clearTimeout(this.sessionTimer);
+    this.updateSessionTimer();
+  },
+
+  updateSessionTimer: function() {
+    var now=(new Date()).getTime();
+    if (now > this.sessionEndTime) {
+      this.displaySessionTimer(Rico.getPhraseById("sessionExpired"));
+      this.timerMsg.style.backgroundColor="red";
+      this.sessionExpired=true;
+    } else {
+      var timeRemaining=Math.ceil((this.sessionEndTime - now) / 60000);
+      this.displaySessionTimer(timeRemaining);
+      this.sessionTimer=Rico.runLater(10000,this,'updateSessionTimer');
+    }
+  },
+
+  displaySessionTimer: function(msg) {
+    this.timerMsg.innerHTML='&nbsp;'+msg+'&nbsp;';
+  },
+
+  /**
+   * Update the grid with fresh data from the database, maintaining scroll position.
+   * @param resetRowCount indicates whether the total row count should be refreshed as well
+   */
+  refresh: function(resetRowCount) {
+    var lastGridPos=this.liveGrid.lastRowPos;\r
+    this.clear();
+    if (resetRowCount) {
+      this.setTotalRows(0);
+      this.foundRowCount = false;
+    }
+    this.liveGrid.clearBookmark();
+    this.liveGrid.clearRows();
+    this.fetch(lastGridPos);
+  },
+
+  /**
+   * Fetch data from database.
+   * @param offset position (row) within the dataset (-1=clear existing buffer before issuing request)
+   */
+  fetch: function(offset) {
+    Rico.log("AjaxSQL fetch: offset="+offset+', lastOffset='+this.lastOffset);
+    if (this.processingRequest) {
+      Rico.log("AjaxSQL fetch: queue request");
+      this.pendingRequest=offset;
+      return;
+    }
+    if (offset < 0) {
+      this.clear();
+      this.setTotalRows(0);
+      this.foundRowCount = false;
+      offset=0;
+    }
+    var lastOffset = this.lastOffset;
+    this.lastOffset = offset;
+    if (this.isInRange(offset)) {
+      Rico.log("AjaxSQL fetch: in buffer");
+      this.liveGrid.refreshContents(offset);
+      if (offset > lastOffset) {
+        if (offset+this.liveGrid.pageSize < this.endPos()-this.nearLimit) return;
+        if (this.endPos()==this.totalRows && this.foundRowCount) return;
+      } else if (offset < lastOffset) {
+        if (offset > this.startPos+this.nearLimit) return;
+        if (this.startPos==0) return;
+      } else return;
+    }
+    if (offset >= this.totalRows && this.foundRowCount) return;
+
+    this.processingRequest=true;
+    Rico.log("AjaxSQL fetch: processing offset="+offset);
+    var bufferStartPos = this.getFetchOffset(offset);
+    var fetchSize = this.getFetchSize(bufferStartPos);
+    var partialLoaded = false;
+
+    this.liveGrid.showMsg(this.options.waitMsg);
+    this.timeoutHandler = Rico.runLater(this.options.bufferTimeout, this, 'handleTimedOut');
+    this.ajaxOptions.parameters = this.formQueryHashSQL(bufferStartPos,fetchSize,this.options.fmt);
+    this.requestCount++;
+    Rico.log('sending req #'+this.requestCount);
+    if (typeof this.dataSource=='string') {
+      this.ajaxOptions.onComplete = Rico.bind(this,'ajaxUpdate',bufferStartPos);
+      new Rico.ajaxRequest(this.dataSource, this.ajaxOptions);
+    } else {
+      this.ajaxOptions.onComplete = Rico.bind(this,'jsUpdate',bufferStartPos);
+      this.dataSource(this.ajaxOptions);
+    }
+  },
+
+  formQueryHashSQL: function(startPos,fetchSize,fmt) {
+    var queryHash=this.formQueryHashXML(startPos,fetchSize);
+    queryHash[this.liveGrid.actionId]="query";
+    if (fmt) queryHash._fmt=fmt;
+
+    // sort
+    Rico.extend(queryHash,this.sortParm);
+
+    // filters
+    for (var n=0; n<this.liveGrid.columns.length; n++) {
+      var c=this.liveGrid.columns[n];
+      if (c.filterType == Rico.ColumnConst.UNFILTERED) continue;
+      var colnum=typeof(c.format.filterCol)=='number' ? c.format.filterCol : c.index;
+      queryHash['f['+colnum+'][op]']=c.filterOp;
+      queryHash['f['+colnum+'][len]']=c.filterValues.length;
+      for (var i=0; i<c.filterValues.length; i++) {
+        var fval=c.filterValues[i];
+        if (c.filterOp=='LIKE' && fval.indexOf('*')==-1) fval='*'+fval+'*';
+        queryHash['f['+colnum+']['+i+']']=fval;
+      }
+    }
+    return queryHash;
+  },
+
+  getFetchSize: function(adjustedOffset) {
+    var adjustedSize = 0;
+    if (adjustedOffset >= this.startPos) { //appending
+      var endFetchOffset = this.maxFetchSize + adjustedOffset;
+      adjustedSize = endFetchOffset - adjustedOffset;
+      if(adjustedOffset == 0 && adjustedSize < this.maxFetchSize)
+        adjustedSize = this.maxFetchSize;
+      Rico.log("getFetchSize/append, adjustedSize="+adjustedSize+" adjustedOffset="+adjustedOffset+' endFetchOffset='+endFetchOffset);
+    } else { //prepending
+      adjustedSize = Math.min(this.startPos - adjustedOffset,this.maxFetchSize);
+    }
+    return adjustedSize;
+  },
+
+  getFetchOffset: function(offset) {
+    var adjustedOffset = offset;
+    if (offset > this.startPos)
+      adjustedOffset = Math.max(offset, this.endPos());  //appending
+    else if (offset + this.maxFetchSize >= this.startPos)
+      adjustedOffset = Math.max(this.startPos - this.maxFetchSize, 0);  //prepending
+    return adjustedOffset;
+  },
+
+  updateBuffer: function(start, newRows, newAttr) {
+    Rico.log("updateBuffer: start="+start+", # of rows="+this.rcvdRows);
+    if (this.rows.length == 0) { // initial load
+      this.rows = newRows;
+      this.attr = newAttr;
+      this.startPos = start;
+    } else if (start > this.startPos) { //appending
+      if (this.startPos + this.rows.length < start) {
+        this.rows =  newRows;
+        this.attr = newAttr;
+        this.startPos = start;
+      } else {
+        this.rows = this.rows.concat( newRows.slice(0, newRows.length));
+        if (this.attr) this.attr = this.attr.concat( newAttr.slice(0, newAttr.length));
+        if (this.rows.length > this.maxBufferSize) {
+          var fullSize = this.rows.length;
+          this.rows = this.rows.slice(this.rows.length - this.maxBufferSize, this.rows.length);
+          if (this.attr) this.attr = this.attr.slice(this.attr.length - this.maxBufferSize, this.attr.length);
+          this.startPos = this.startPos +  (fullSize - this.rows.length);
+        }
+      }
+    } else { //prepending
+      if (start + newRows.length < this.startPos) {
+        this.rows =  newRows;
+      } else {
+        this.rows = newRows.slice(0, this.startPos).concat(this.rows);
+        if (this.maxBufferSize && this.rows.length > this.maxBufferSize)
+          this.rows = this.rows.slice(0, this.maxBufferSize);
+      }
+      this.startPos =  start;
+    }
+    this.size = this.rows.length;
+  },
+
+  sortBuffer: function(colnum) {
+    this.sortParm={};
+    var col=this.liveGrid.columns[colnum];
+    if (this.options.sortParmFmt) {
+      this.sortParm['sort_col']=col[this.options.sortParmFmt];
+      this.sortParm['sort_dir']=col.getSortDirection();
+    } else {
+      this.sortParm['s'+colnum]=col.getSortDirection();
+    }
+    this.clear();
+  },
+
+  printAllSQL: function(exportType) {
+    var parms=this.formQueryHashSQL(0,-1,exportType);
+    parms.hidden=this.liveGrid.listInvisible('index').join(',');
+    var url=this.dataSource+'?'+Rico.toQueryString(parms);
+    window.open(url,'',this.liveGrid.options.exportWindow);
+  },
+
+  printVisibleSQL: function(exportType) {
+    var parms=this.formQueryHashSQL(this.liveGrid.contentStartPos-1, this.liveGrid.pageSize, exportType);
+    parms.hidden=this.liveGrid.listInvisible('index').join(',');
+    var url=this.dataSource+'?'+Rico.toQueryString(parms);
+    window.open(url,'',this.liveGrid.options.exportWindow);
+  },
+
+  // for datasource that is a javascript function
+  _printAll: function(exportType) {
+    this.liveGrid.exportStart();
+    this.ajaxOptions.parameters = this.formQueryHashSQL(0,-1);
+    this.ajaxOptions.onComplete = Rico.bind(this,'_jsExport',exportType);
+    this.dataSource(this.ajaxOptions);
+  },
+
+  _jsExport: function(exportType, newRows, newAttr, totalRows, errMsg) {
+    Rico.log("_jsExport: "+arguments.length);
+    if (errMsg) {
+      Rico.log("_jsExport: received error="+errMsg);
+      this.liveGrid.showMsg(Rico.getPhraseById("requestError",errMsg));
+      return;
+    }
+    this.exportBuffer(newRows,0);
+    this.liveGrid.exportFinish(exportType);
+  }
+
+};
+
+Rico.includeLoaded('ricoLiveGridAjax.js');
diff --git a/ricoClient/js/ricoLiveGridControls.js b/ricoClient/js/ricoLiveGridControls.js
new file mode 100644 (file)
index 0000000..2f90dea
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+\r
+// -----------------------------------------------------\r
+//\r
+// Custom formatting for LiveGrid columns\r
+//\r
+// columnSpecs Usage: { type:'control', control:new Rico.TableColumn.CONTROLNAME() }\r
+//\r
+// -----------------------------------------------------\r
+
+Rico.TableColumn = {};
+\r
+Rico.TableColumn.checkboxKey = function(showKey) {
+  this.initialize(showKey);
+}
+
+Rico.TableColumn.checkboxKey.prototype = {
+/**
+ * @class Custom formatting for a LiveGrid column.
+ * Display unique key column as: &lt;checkbox&gt; &lt;key value&gt;
+ * and keep track of which keys the user selects
+ * Key values should not contain &lt;, &gt;, or &amp;
+ * @constructs
+ */
+  initialize: function(showKey) {
+    this._checkboxes=[];
+    this._spans=[];
+    this._KeyHash={};
+    this._showKey=showKey;\r
+  },
+
+  _create: function(gridCell,windowRow) {
+    this._checkboxes[windowRow]=Rico.createFormField(gridCell,'input','checkbox',this.liveGrid.tableId+'_chkbox_'+this.index+'_'+windowRow);
+    this._spans[windowRow]=Rico.createFormField(gridCell,'span',null,this.liveGrid.tableId+'_desc_'+this.index+'_'+windowRow);
+    this._clear(gridCell,windowRow);
+    Rico.eventBind(this._checkboxes[windowRow], 'click', Rico.eventHandle(this,'_onclick'));
+  },
+
+  _onclick: function(e) {
+    var elem=Event.element(e);
+    var windowRow=parseInt(elem.id.substr((elem.id.lastIndexOf('_',elem.id.length)+1)));  //faster than split
+    var v=this.getValue(windowRow);
+    if (elem.checked)
+      this._addChecked(v);
+    else
+      this._remChecked(v);
+  },
+
+  _clear: function(gridCell,windowRow) {
+    var box=this._checkboxes[windowRow];
+    box.checked=false;
+    box.style.display='none';
+    this._spans[windowRow].innerHTML='';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    var box=this._checkboxes[windowRow];
+    box.style.display='';
+    box.checked=this._KeyHash[v];
+    if (this._showKey) this._spans[windowRow].innerHTML=v;
+  },
+
+  _SelectedKeys: function() {
+    return Rico.keys(this._KeyHash);
+  },
+
+  _addChecked: function(k){\r
+    this._KeyHash[k]=1;\r
+  },\r
+\r
+  _remChecked: function(k){\r
+    delete this._KeyHash[k];\r
+  }\r
+}
+
+
+Rico.TableColumn.checkbox = function(checkedValue, uncheckedValue, defaultValue, readOnly)
+{
+  this.initialize(checkedValue, uncheckedValue, defaultValue, readOnly);
+}
+
+Rico.TableColumn.checkbox.prototype = {
+/**
+ * @class display checkboxes for two-valued column (e.g. yes/no)
+ * @constructs
+ */
+  initialize: function(checkedValue, uncheckedValue, defaultValue, readOnly) {
+    this._checkedValue=checkedValue;
+    this._uncheckedValue=uncheckedValue;
+    this._defaultValue=defaultValue || false;
+    this._readOnly=readOnly || false;
+    this._checkboxes=[];
+  },
+
+  _create: function(gridCell,windowRow) {
+    this._checkboxes[windowRow]=Rico.createFormField(gridCell,'input','checkbox',this.liveGrid.tableId+'_chkbox_'+this.index+'_'+windowRow);
+    this._clear(gridCell,windowRow);
+    if (this._readOnly)
+      this._checkboxes[windowRow].disabled=true;
+    else
+      Rico.eventBind(this._checkboxes[windowRow], 'click', Rico.eventHandle(this,'_onclick'));
+  },
+
+  _onclick: function(e) {
+    var elem=Event.element(e);
+    var windowRow=parseInt(elem.id.substr((elem.id.lastIndexOf('_',elem.id.length)+1)));  //faster than split
+    var newval=elem.checked ? this._checkedValue : this._uncheckedValue;
+    this.setValue(windowRow,newval);
+  },
+
+  _clear: function(gridCell,windowRow) {
+    var box=this._checkboxes[windowRow];
+    box.checked=this._defaultValue;
+    box.style.display='none';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    var box=this._checkboxes[windowRow];
+    box.style.display='';
+    box.checked=(v==this._checkedValue);
+  }
+
+}
+
+
+Rico.TableColumn.textbox = function(boxSize, boxMaxLen, readOnly) {
+  this.initialize(boxSize, boxMaxLen, readOnly);
+}
+
+Rico.TableColumn.textbox.prototype = {
+/**
+ * @class display value in a text box
+ * @constructs
+ */
+  initialize: function(boxSize, boxMaxLen, readOnly) {
+    this._boxSize=boxSize;
+    this._boxMaxLen=boxMaxLen;
+    this._readOnly=readOnly || false;
+    this._textboxes=[];
+  },
+
+  _create: function(gridCell,windowRow) {
+    var box=Rico.createFormField(gridCell,'input','text',this.liveGrid.tableId+'_txtbox_'+this.index+'_'+windowRow);
+    box.size=this._boxSize;
+    box.maxLength=this._boxMaxLen;
+    this._textboxes[windowRow]=box;
+    this._clear(gridCell,windowRow);
+    if (this._readOnly)
+      box.disabled=true;
+    else
+      Rico.eventBind(box, 'change', Rico.eventHandle(this,'_onchange'));
+  },
+
+  _onchange: function(e) {
+    var elem=Event.element(e);
+    var windowRow=parseInt(elem.id.substr((elem.id.lastIndexOf('_',elem.id.length)+1)));  //faster than split
+    this.setValue(windowRow,elem.value);
+  },
+
+  _clear: function(gridCell,windowRow) {
+    var box=this._textboxes[windowRow];
+    box.value='';
+    box.style.display='none';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    var box=this._textboxes[windowRow];
+    box.style.display='';
+    box.value=v;
+  }
+
+}
+
+
+Rico.TableColumn.HighlightCell = function(chkcol,chkval,highlightColor,highlightBackground,chkop) {
+  this.initialize(chkcol,chkval,highlightColor,highlightBackground,chkop);
+}
+
+Rico.TableColumn.HighlightCell.prototype = {
+/**
+ * @class highlight a grid cell when a particular value is present in the specified column
+ * @constructs
+ */
+  initialize: function(chkcol,chkval,highlightColor,highlightBackground,chkop) {\r
+    this._chkcol=chkcol;\r
+    this._chkval=chkval;
+    this._chkop=chkop;\r
+    this._highlightColor=highlightColor;\r
+    this._highlightBackground=highlightBackground;\r
+  },\r
+\r
+  _clear: function(gridCell,windowRow) {\r
+    gridCell.style.color='';\r
+    gridCell.style.backgroundColor='';\r
+    gridCell.innerHTML='&nbsp;';\r
+  },\r
+\r
+  _display: function(v,gridCell,windowRow) {\r
+    var gridval=this.liveGrid.buffer.getWindowValue(windowRow,this._chkcol);\r
+    var match;\r
+    switch(this._chkop){
+        case '!=':
+          match=(gridval!=this._chkval);
+          break;
+        case '>':
+          match=(gridval>this._chkval);
+          break;
+        case '<':
+          match=(gridval<this._chkval);
+          break;
+        case '>=':
+          match=(gridval>=this._chkval);
+          break;
+        case '<=':
+          match=(gridval<=this._chkval);
+          break;
+        default:
+          match=(gridval==this._chkval);
+          break;
+    }
+    gridCell.style.color=match ? this._highlightColor : '';\r
+    gridCell.style.backgroundColor=match ? this._highlightBackground : '';\r
+    gridCell.innerHTML=this._format(v);\r
+  }\r
+}
+
+
+Rico.TableColumn.bgColor = function() {
+}
+
+Rico.TableColumn.bgColor.prototype = {
+/**
+ * @class database value contains a css color name/value
+ */
+ _clear: function(gridCell,windowRow) {
+    gridCell.style.backgroundColor='';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    gridCell.style.backgroundColor=v;
+  }
+
+}
+
+
+Rico.TableColumn.link = function(href,target,linktext) {
+  this.initialize(href,target,linktext);
+}
+
+Rico.TableColumn.link.prototype = {
+/**
+ * @class database value contains a url to another page
+ * @constructs
+ */
+  initialize: function(href,target,linktext) {
+    this._href=href;
+    this._target=target;
+    this._linktext=linktext;
+    this._anchors=[];
+  },
+
+  _create: function(gridCell,windowRow) {
+    this._anchors[windowRow]=Rico.createFormField(gridCell,'a',null,this.liveGrid.tableId+'_a_'+this.index+'_'+windowRow);
+    if (this._target) this._anchors[windowRow].target=this._target;
+    this._clear(gridCell,windowRow);
+  },
+
+  _clear: function(gridCell,windowRow) {
+    this._anchors[windowRow].href='';
+    this._anchors[windowRow].innerHTML='';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    var getWindowValue=Rico.bind(this.liveGrid.buffer,'getWindowValue');
+    var href=this._href=='self' ? v : this._href.replace(/\{\d+\}/g,
+      function ($1) {
+        var colIdx=parseInt($1.substr(1),10);
+        return getWindowValue(windowRow,colIdx);
+      }
+    );
+    var desc=this._linktext || v;
+    if (href && desc) {
+      this._anchors[windowRow].href=href;
+      this._anchors[windowRow].innerHTML=desc;
+    } else {
+      this._clear(gridCell,windowRow);
+    }
+  }
+
+};
+
+
+Rico.TableColumn.image = function(prefix,suffix) {
+  this.initialize(prefix,suffix);
+};
+
+Rico.TableColumn.image.prototype = {
+/**
+ * @class database value contains a url to an image
+ * @constructs
+ */
+  initialize: function(prefix,suffix) {
+    this._img=[];
+    this._prefix=prefix || '';
+    this._suffix=suffix || '';
+  },
+
+  _create: function(gridCell,windowRow) {
+    this._img[windowRow]=Rico.createFormField(gridCell,'img',null,this.liveGrid.tableId+'_img_'+this.index+'_'+windowRow);
+    this._clear(gridCell,windowRow);
+  },
+
+  _clear: function(gridCell,windowRow) {
+    var img=this._img[windowRow];
+    img.style.display='none';
+    img.src='';
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    var img=this._img[windowRow];
+    this._img[windowRow].src=this._prefix+v+this._suffix;
+    img.style.display='';
+  }
+
+};
+
+
+Rico.TableColumn.lookup = function(map, defaultCode, defaultDesc) {
+  this.initialize(map, defaultCode, defaultDesc);
+};
+
+Rico.TableColumn.lookup.prototype = {
+/**
+ * @class map a database value to a display value
+ * @constructs
+ */
+  initialize: function(map, defaultCode, defaultDesc) {
+    this._map=map;
+    this._defaultCode=defaultCode || '';
+    this._defaultDesc=defaultDesc || '&nbsp;';
+    this._sortfunc=Rico.bind(this,'_sortvalue');
+    this._codes=[];
+    this._descriptions=[];
+  },
+
+  _create: function(gridCell,windowRow) {
+    this._descriptions[windowRow]=Rico.createFormField(gridCell,'span',null,this.liveGrid.tableId+'_desc_'+this.index+'_'+windowRow);
+    this._codes[windowRow]=Rico.createFormField(gridCell,'input','hidden',this.liveGrid.tableId+'_code_'+this.index+'_'+windowRow);
+    this._clear(gridCell,windowRow);
+  },
+
+  _clear: function(gridCell,windowRow) {
+    this._codes[windowRow].value=this._defaultCode;
+    this._descriptions[windowRow].innerHTML=this._defaultDesc;
+  },
+
+  _sortvalue: function(v) {
+    return this._getdesc(v).replace(/&amp;/g, '&').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&nbsp;/g,' ');
+  },
+
+  _getdesc: function(v) {
+    var desc=this._map[v];
+    return (typeof desc=='string') ? desc : this._defaultDesc;
+  },
+
+  _export: function(v) {
+    return this._getdesc(v);
+  },
+
+  _display: function(v,gridCell,windowRow) {
+    this._codes[windowRow].value=v;
+    this._descriptions[windowRow].innerHTML=this._getdesc(v);
+  }
+
+};
+
+
+
+Rico.TableColumn.MultiLine = function() {
+};
+
+Rico.TableColumn.MultiLine.prototype = {
+/**
+ * @class Fix issues with multiline content in IE
+ */
+  _display: function(v,gridCell,windowRow) {\r
+    var newdiv = document.createElement("div");\r
+    newdiv.innerHTML = this._format(v);\r
+    newdiv.style.height='100%';\r
+    if (gridCell.firstChild)\r
+      gridCell.replaceChild(newdiv, gridCell.firstChild);\r
+    else\r
+      gridCell.appendChild(newdiv);\r
+  }\r
+
+};
+
+Rico.includeLoaded('ricoLiveGridControls.js');
diff --git a/ricoClient/js/ricoLiveGridForms.js b/ricoClient/js/ricoLiveGridForms.js
new file mode 100644 (file)
index 0000000..fce844d
--- /dev/null
@@ -0,0 +1,1121 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+if(typeof Rico=='undefined') throw("LiveGridForms requires the Rico JavaScript framework");
+
+
+Rico.TableEdit = function(liveGrid) {
+  this.initialize(liveGrid);
+}
+
+Rico.TableEdit.prototype = {
+/**
+ * @class Supports editing LiveGrid data.
+ * @constructs
+ */
+  initialize: function(liveGrid) {
+    Rico.log('Rico.TableEdit initialize: '+liveGrid.tableId);
+    this.grid=liveGrid;
+    this.options = {
+      maxDisplayLen    : 20,    // max displayed text field length
+      panelHeight      : 200,   // size of tabbed panels
+      panelWidth       : 500,
+      compact          : false,    // compact corners
+      RecordName       : Rico.getPhraseById("record"),
+      updateURL        : window.location.href, // default is that updates post back to the generating page
+      readOnlyColor    : '#AAA',   // read-only fields displayed using this color
+      showSaveMsg      : 'errors'  // disposition of database update responses (full - show full response, errors - show full response for errors and short response otherwise)
+    };
+    Rico.extend(this.options, liveGrid.options);
+    this.hasWF2=(document.implementation && document.implementation.hasFeature && document.implementation.hasFeature('WebForms', '2.0'));
+    this.menu=liveGrid.menu;
+    this.menu.options.dataMenuHandler=Rico.bind(this,'editMenu');
+    this.menu.ignoreClicks();
+    this.editText=Rico.getPhraseById("editRecord",this.options.RecordName);
+    this.cloneText=Rico.getPhraseById("cloneRecord",this.options.RecordName);
+    this.delText=Rico.getPhraseById("deleteRecord",this.options.RecordName);
+    this.addText=Rico.getPhraseById("addRecord",this.options.RecordName);
+    this.buttonHover=new Rico.HoverSet();
+    this.dateRegExp=/^\s*(\w+)(\W)(\w+)(\W)(\w+)/i;
+    Rico.EditControls.atLoad();
+    this.createKeyArray();
+    this.createEditDiv();
+    this.saveMsg=Rico.$(liveGrid.tableId+'_savemsg');
+    Rico.eventBind(document,"click", Rico.eventHandle(this,'clearSaveMsg'));
+    this.extraMenuItems=[];
+    this.responseHandler=Rico.bind(this,'processResponse');
+    Rico.log("Rico.TableEdit.initialize complete, hasWF2="+this.hasWF2);
+  },
+
+  createKeyArray: function() {
+    this.keys=[];
+    for (var i=0; i<this.grid.columns.length; i++) {
+      if (this.grid.columns[i].format && this.grid.columns[i].format.isKey)
+        this.keys.push({colidx:i});
+    }
+  },
+
+  createEditDiv: function() {
+
+    // create popup form
+
+    this.requestCount=1;
+    this.formPopup=new Rico.Window('', {overflow: this.options.panels ? 'hidden' : 'auto'});
+    this.formPopup.contentCell.className='ricoLG_editDiv';
+    if (this.options.canEdit || this.options.canAdd) {
+      this.startForm();
+      this.createForm(this.form);
+    } else {
+      var buttonClose=this.createButton(Rico.getPhraseById("close"));
+      Rico.eventBind(buttonClose,"click", Rico.eventHandle(this,'cancelEdit'), false);
+      this.createForm(this.formPopup.contentDiv);
+    }
+    this.editDivCreated=true;
+
+    // create responseDialog
+
+    this.responseDialog = this.grid.createDiv('editResponse',document.body);
+    this.responseDialog.style.display='none';
+
+    var buttonOK = document.createElement('button');
+    buttonOK.appendChild(document.createTextNode('OK'));
+    Rico.eventBind(buttonOK,"click", Rico.eventHandle(this,'ackResponse'));
+    this.responseDialog.appendChild(buttonOK);
+
+    this.responseDiv = this.grid.createDiv('editResponseText',this.responseDialog);
+
+    if (this.panelGroup) {
+      Rico.log("createEditDiv complete, requestCount="+this.requestCount);
+      Rico.runLater(50,this,'initPanelGroup');
+    }
+  },
+
+  initPanelGroup: function() {
+    this.requestCount--;
+    Rico.log("initPanelGroup: "+this.requestCount);
+    if (this.requestCount>0) return;
+    var wi=parseInt(this.options.panelWidth,10);
+    if (this.form) {
+      //this.form.style.width=(wi+10)+'px';
+      if (Rico.isWebKit) this.formPopup.container.style.display='block';  // this causes display to flash briefly
+      this.options.bgColor = Rico.Color.createColorFromBackground(this.form).toString();
+    }
+    this.formPopup.container.style.display='none';
+    //this.options.panelHdrWidth=(Math.floor(wi / this.options.panels.length)-20)+'px';
+    this.formPanels=new Rico.TabbedPanel(this.panelGroup, this.options);
+  },
+
+  notEmpty: function(v) {
+    return typeof(v)!='undefined';
+  },
+
+  startForm: function() {
+    this.form = document.createElement('form');
+    /** @ignore */
+    this.form.onsubmit=function() {return false;};
+    this.form.autocomplete="off"; // seems to fix "Permission denied..." errors in FF
+    this.formPopup.contentDiv.appendChild(this.form);
+
+    var tab = document.createElement('div');
+    tab.className='ButtonBar';
+    var button=tab.appendChild(this.createButton(Rico.getPhraseById("saveRecord",this.options.RecordName)));
+    Rico.eventBind(button,"click", Rico.eventHandle(this,'TESubmit'), false);
+    button=tab.appendChild(this.createButton(Rico.getPhraseById("cancel")));
+    Rico.eventBind(button,"click", Rico.eventHandle(this,'cancelEdit'), false);
+    this.form.appendChild(tab);
+
+    // hidden fields
+    this.hiddenFields = document.createElement('div');
+    this.hiddenFields.style.display='none';
+    this.action = this.appendHiddenField(this.grid.actionId,'');
+    var i,fldSpec;
+    for (i=0; i<this.grid.columns.length; i++) {
+      fldSpec=this.grid.columns[i].format;
+      if (fldSpec && fldSpec.FormView && fldSpec.FormView=="hidden")
+        this.appendHiddenField(fldSpec.FieldName,fldSpec.ColData);
+    }
+    for (var k=0; k<this.keys.length; k++) {
+      this.keys[k].keyField = this.appendHiddenField('_k'+this.keys[k].colidx,'');
+    }
+    this.form.appendChild(this.hiddenFields);
+  },
+
+  createButton: function(buttonLabel) {
+    var button = document.createElement('a');
+    button.href='javascript:void(0)';
+    button.innerHTML=buttonLabel;
+    button.className='RicoButton';
+    if (Rico.theme.button) Rico.addClass(button,Rico.theme.button);
+    this.buttonHover.add(button);
+    return button;
+  },
+
+  createPanel: function(i) {
+    var hasFields=false;
+    for (var j=0; j<this.grid.columns.length; j++) {
+      var fldSpec=this.grid.columns[j].format;
+      if (!fldSpec) continue;
+      if (!fldSpec.EntryType) continue;
+      if (fldSpec.EntryType=='H') continue;
+      if (fldSpec.FormView && fldSpec.FormView=="hidden") continue;
+      var panelIdx=fldSpec.panelIdx || 0;
+      if (panelIdx==i) {
+        hasFields=true;
+        break;
+      }
+    }
+    if (!hasFields) return null;
+    this.panelHdr[i] = document.createElement('li');
+    this.panelHdr[i].innerHTML=this.options.panels[i];
+    this.panelHdrs.appendChild(this.panelHdr[i]);
+    this.panelContent[i] = document.createElement('div');
+    this.panelContents.appendChild(this.panelContent[i]);
+    this.panelActualIdx[i]=this.panelCnt++;
+    return this.createFormTable(this.panelContent[i],'tabContent');
+  },
+
+  createForm: function(parentDiv) {
+    var i,div,fldSpec,panelIdx,tables=[];
+    this.panelCnt=0;
+    this.panelHdr=[];
+    this.panelContent=[];
+    if (this.options.panels) {
+      this.panelGroup = document.createElement('div');
+      this.panelGroup.className='tabPanelGroup';
+      this.panelHdrs = document.createElement('ul');
+      this.panelGroup.appendChild(this.panelHdrs);
+      this.panelContents = document.createElement('div');
+      this.panelContents.className='tabContentContainer';
+      this.panelGroup.appendChild(this.panelContents);
+      this.panelActualIdx=[];
+      parentDiv.appendChild(this.panelGroup);
+      if (this.grid.direction=='rtl') {
+        for (i=this.options.panels.length-1; i>=0; i--) {
+          tables[i]=this.createPanel(i);
+        }
+      } else {
+        for (i=0; i<this.options.panels.length; i++) {
+          tables[i]=this.createPanel(i);
+        }
+      }
+      parentDiv.appendChild(this.panelGroup);
+    } else {
+      div=document.createElement('div');
+      div.className='noTabContent';
+      tables[0]=this.createFormTable(div);
+      parentDiv.appendChild(div);
+    }
+    for (i=0; i<this.grid.columns.length; i++) {
+      fldSpec=this.grid.columns[i].format;
+      if (!fldSpec) continue;
+      panelIdx=fldSpec.panelIdx || 0;
+      if (tables[panelIdx]) this.appendFormField(this.grid.columns[i],tables[panelIdx]);
+      if (typeof fldSpec.pattern=='string') {
+        switch (fldSpec.pattern) {
+          case 'email':
+            fldSpec.regexp=/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/;
+            break;
+          case 'float-unsigned':
+            fldSpec.regexp=/^\d+(\.\d+)?$/;
+            break;
+          case 'float-signed':
+            fldSpec.regexp=/^[-+]?\d+(\.\d+)?$/;
+            break;
+          case 'int-unsigned':
+            fldSpec.regexp=/^\d+$/;
+            break;
+          case 'int-signed':
+            fldSpec.regexp=/^[-+]?\d+$/;
+            break;
+          default:
+            fldSpec.regexp=new RegExp(fldSpec.pattern);
+            break;
+        }
+      }
+    }
+  },
+
+  createFormTable: function(div) {
+    var tab=document.createElement('table');
+    tab.border=0;
+    div.appendChild(tab);
+    return tab;
+  },
+
+  appendHiddenField: function(name,value) {
+    var field=Rico.createFormField(this.hiddenFields,'input','hidden',name,name);
+    field.value=value;
+    return field;
+  },
+
+  appendFormField: function(column, table) {
+    var fmt=column.format;
+    if (!fmt.EntryType) return;
+    if (fmt.EntryType=="H") return;
+    if (fmt.FormView) return;
+    Rico.log('appendFormField: '+column.displayName+' - '+fmt.EntryType);
+    var row = fmt.noFormBreak && table.rows.length > 0 ? table.rows[table.rows.length-1] : table.insertRow(-1);
+    var hdr = row.insertCell(-1);
+    column.formLabel=hdr;
+    if (hdr.noWrap) hdr.noWrap=true;
+    var entry = row.insertCell(-1);
+    if (entry.noWrap) entry.noWrap=true;
+    hdr.id='lbl_'+fmt.FieldName;
+    var field, name=fmt.FieldName;
+    switch (fmt.EntryType) {
+      case 'TA':
+      case 'tinyMCE':
+        field=Rico.createFormField(entry,'textarea',null,name);
+        field.cols=fmt.TxtAreaCols;
+        field.rows=fmt.TxtAreaRows;
+        field.innerHTML=fmt.ColData;
+        hdr.style.verticalAlign='top';
+        break;
+      case 'R':
+      case 'RL':
+        field=Rico.createFormField(entry,'div',null,name);
+        if (fmt.DescriptionField) field.RicoUpdate=fmt.DescriptionField;
+        if (fmt.MultiSelect) Rico.addClass(field, 'MultiSelect');
+        if (fmt.isNullable && !fmt.MultiSelect) this.addSelectNone(field);
+        this.selectValuesRequest(field,column);
+        break;
+      case 'N':
+        field=Rico.createFormField(entry,'select',null,name);
+        if (fmt.isNullable) this.addSelectNone(field);
+        Rico.eventBind(field,"change", Rico.eventHandle(this,'checkSelectNew'));
+        this.selectValuesRequest(field,column);
+        field=document.createElement('span');
+        field.className='ricoEditLabel';
+        field.id='labelnew__'+fmt.FieldName;
+        field.innerHTML='&nbsp;&nbsp;&nbsp;'+Rico.getPhraseById('formNewValue').replace(' ','&nbsp;');
+        entry.appendChild(field);
+        name='textnew__'+fmt.FieldName;
+        field=Rico.createFormField(entry,'input','text',name,name);
+        break;
+      case 'S':
+      case 'SL':
+        if (fmt.ReadOnly) {
+          field=Rico.createFormField(entry,'input','text',name,name);
+          this.initField(field,fmt);
+        } else {
+          field=Rico.createFormField(entry,'select',null,name);
+          if (fmt.MultiSelect) field.multiple=true;
+          if (fmt.SelectRows) field.size=parseInt(fmt.SelectRows,10);
+          if (fmt.isNullable && !fmt.MultiSelect) this.addSelectNone(field);
+          if (fmt.DescriptionField) {
+            field.RicoUpdate=fmt.DescriptionField;
+            Rico.eventBind(field,"change", Rico.eventHandle(this,'selectClick'), false);
+          }
+          this.selectValuesRequest(field,column);
+        }
+        break;
+      case 'D':
+        if (!fmt.isNullable) fmt.required=true;
+        if (!fmt.dateFmt) fmt.dateFmt=Rico.dateFmt;
+        if (!fmt.Help) fmt.Help=fmt.dateFmt;
+        if (typeof fmt.min=='string') fmt.min=Rico.setISO8601(fmt.min) || new Date(fmt.min);
+        if (typeof fmt.max=='string') fmt.max=Rico.setISO8601(fmt.max) || new Date(fmt.max);
+        if (this.hasWF2) {
+          field=Rico.createFormField(entry,'input','date',name,name);
+          field.required=fmt.required;
+          if (fmt.min) field.min=Rico.toISO8601String(fmt.min,3);
+          if (fmt.max) field.max=Rico.toISO8601String(fmt.max,3);
+          field.required=fmt.required;
+          fmt.SelectCtl=null;  // use the WebForms calendar instead of the Rico calendar
+        } else {
+          field=Rico.createFormField(entry,'input','text',name,name);
+        }
+        this.initField(field,fmt);
+        break;
+      case 'I':
+        if (!fmt.isNullable) fmt.required=true;
+        if (!fmt.pattern) fmt.pattern='int-signed';
+        if (this.hasWF2) {
+          field=Rico.createFormField(entry,'input','number',name,name);
+          field.required=fmt.required;
+          field.min=fmt.min;
+          field.max=fmt.max;
+          field.step=1;
+        } else {
+          field=Rico.createFormField(entry,'input','text',name,name);
+        }
+        if (typeof fmt.min=='string') fmt.min=parseInt(fmt.min,10);
+        if (typeof fmt.max=='string') fmt.max=parseInt(fmt.max,10);
+        this.initField(field,fmt);
+        break;
+      case 'F':
+        if (!fmt.isNullable) fmt.required=true;
+        if (!fmt.pattern) fmt.pattern='float-signed';
+        field=Rico.createFormField(entry,'input','text',name,name);
+        this.initField(field,fmt);
+        if (typeof fmt.min=='string') fmt.min=parseFloat(fmt.min);
+        if (typeof fmt.max=='string') fmt.max=parseFloat(fmt.max);
+        break;
+      default:
+        field=Rico.createFormField(entry,'input','text',name,name);
+        if (!fmt.isNullable && fmt.EntryType!='T') fmt.required=true;
+        this.initField(field,fmt);
+        break;
+    }
+    if (field) {
+      if (fmt.SelectCtl)
+        Rico.EditControls.applyTo(column,field);
+    }
+    var hdrSuffix='';
+    hdr.className='ricoEditLabel';
+    if (fmt.Help) {
+      hdr.title=fmt.Help;
+      hdrSuffix="&nbsp;<img src='"+Rico.imgDir+"info_icon.gif'>";
+      Rico.addClass(hdr,'ricoHelp');
+    }
+    var hdrText=fmt.EntryType.length>1 && fmt.EntryType.charAt(1)=='L' ? column.next.displayName : column.displayName;
+    hdr.innerHTML=hdrText+hdrSuffix;
+  },
+
+  addSelectNone: function(field) {
+    this.addSelectOption(field,this.options.TableSelectNone,Rico.getPhraseById("selectNone"));
+  },
+
+  initField: function(field,fmt) {
+    if (fmt.Length) {
+      field.maxLength=fmt.Length;
+      field.size=Math.min(fmt.Length, this.options.maxDisplayLen);
+    }
+    field.value=fmt.ColData;
+  },
+  
+  selectClick: function(e) {
+    var SelObj=Rico.eventElement(e);
+    if (SelObj.readOnly) {
+      Rico.eventStop(e);
+      return false;
+    }
+    if (SelObj.RicoUpdate) {
+      var opt=SelObj.options[SelObj.selectedIndex];
+      Rico.$(SelObj.RicoUpdate).value=opt.innerHTML;
+    }
+  },
+  
+  radioClick: function(e) {
+    var ChkBoxObj=Rico.eventElement(e);
+    if (ChkBoxObj.readOnly) {
+      Rico.eventStop(e);
+      return false;
+    }
+    var container=Rico.getParentByTagName(ChkBoxObj,'div');
+    if (container.RicoUpdate) {
+      Rico.$(container.RicoUpdate).value=ChkBoxObj.nextSibling.innerHTML;
+    }
+  },
+
+  checkSelectNew: function(e) {
+    this.updateSelectNew(Rico.eventElement(e));
+  },
+
+  updateSelectNew: function(SelObj) {
+    var vis=(SelObj.value==this.options.TableSelectNew) ? "" : "hidden";
+    Rico.$("labelnew__" + SelObj.id).style.visibility=vis;
+    Rico.$("textnew__" + SelObj.id).style.visibility=vis;
+  },
+
+  selectValuesRequest: function(elem,column) {
+    var fldSpec=column.format;
+    if (fldSpec.SelectValues) {
+      var valueList=fldSpec.SelectValues.split(',');
+      for (var i=0; i<valueList.length; i++)
+        this.addSelectOption(elem,valueList[i],valueList[i],i);
+    } else {
+      this.requestCount++;
+      var options={};
+      Rico.extend(options, this.grid.buffer.ajaxOptions);
+      options.parameters = {id: this.grid.tableId, offset: '0', page_size: '-1', edit: column.index};
+      options.parameters[this.grid.actionId]="query";
+      options.onComplete = Rico.bind(this,'selectValuesUpdate',elem);
+      new Rico.ajaxRequest(this.grid.buffer.dataSource, options);
+      Rico.log("selectValuesRequest: "+fldSpec.FieldName);
+    }
+  },
+
+  selectValuesUpdate: function(elem,request) {
+    var response = request.responseXML.getElementsByTagName("ajax-response");
+    Rico.log("selectValuesUpdate: "+request.status);
+    if (response == null || response.length != 1) return;
+    response=response[0];
+    var error = response.getElementsByTagName('error');
+    if (error.length > 0) {
+      var errmsg=Rico.getContentAsString(error[0],this.grid.buffer.isEncoded);
+      Rico.log("Data provider returned an error:\n"+errmsg);
+      alert(Rico.getPhraseById("requestError",errmsg));
+      return null;
+    }
+    response=response.getElementsByTagName('response')[0];
+    var rowsElement = response.getElementsByTagName('rows')[0];
+    var rows = this.grid.buffer.dom2jstable(rowsElement);
+    Rico.log("selectValuesUpdate: id="+elem.id+' rows='+rows.length);
+    for (var i=0; i<rows.length; i++) {
+      if (rows[i].length>0) {
+        var c0=rows[i][0];
+        var c1=(rows[i].length>1) ? rows[i][1] : c0;
+        this.addSelectOption(elem,c0,c1,i);
+      }
+    }
+    if (Rico.$('textnew__'+elem.id))
+      this.addSelectOption(elem,this.options.TableSelectNew,Rico.getPhraseById("selectNewVal"));
+    if (this.panelGroup)
+      Rico.runLater(50,this,'initPanelGroup');
+  },
+
+  addSelectOption: function(elem,value,text,idx) {
+    switch (elem.tagName.toLowerCase()) {
+      case 'div':
+        var opt=Rico.createFormField(elem,'input', Rico.hasClass(elem, 'MultiSelect') ? 'checkbox' : 'radio', elem.id+'_'+idx, elem.id);
+        opt.value=value;
+        var lbl=document.createElement('label');
+        lbl.innerHTML=text;
+        lbl.htmlFor=opt.id;
+        elem.appendChild(lbl);
+        Rico.eventBind(opt,"click", Rico.eventHandle(this,'radioClick'), false);
+        break;
+      case 'select':
+        Rico.addSelectOption(elem,value,text);
+        break;
+    }
+  },
+
+  clearSaveMsg: function() {
+    if (this.saveMsg) this.saveMsg.innerHTML="";
+  },
+
+  addMenuItem: function(menuText,menuAction,enabled) {
+    this.extraMenuItems.push({menuText:menuText,menuAction:menuAction,enabled:enabled});
+  },
+
+  editMenu: function(grid,r,c,onBlankRow) {
+    this.clearSaveMsg();
+    if (this.grid.buffer.sessionExpired==true || this.grid.buffer.startPos<0) return false;
+    this.rowIdx=r;
+    var elemTitle=Rico.$('pageTitle');
+    var pageTitle=elemTitle ? elemTitle.innerHTML : document.title;
+    this.menu.addMenuHeading(pageTitle);
+    if (onBlankRow==false) {
+      for (var i=0; i<this.extraMenuItems.length; i++) {
+        this.menu.addMenuItem(this.extraMenuItems[i].menuText,this.extraMenuItems[i].menuAction,this.extraMenuItems[i].enabled);
+      }
+      this.menu.addMenuItem(this.editText,Rico.bind(this,'editRecord'),this.canEdit(r));
+      this.menu.addMenuItem(this.delText,Rico.bind(this,'deleteRecord'),this.canDelete(r));
+      if (this.options.canClone) {
+        this.menu.addMenuItem(this.cloneText,Rico.bind(this,'cloneRecord'),this.canAdd(r) && this.canEdit(r));
+      }
+    }
+    this.menu.addMenuItem(this.addText,Rico.bind(this,'addRecord'),this.canAdd(r));
+    return true;
+  },
+  
+  canAdd: function(r) {
+    return (typeof this.options.canAdd=='function') ? this.options.canAdd(r) : this.options.canAdd;
+  },
+
+  canEdit: function(r) {
+    return (typeof this.options.canEdit=='function') ? this.options.canEdit(r) : this.options.canEdit;
+  },
+
+  canDelete: function(r) {
+    return (typeof this.options.canDelete=='function') ? this.options.canDelete(r) : this.options.canDelete;
+  },
+
+  cancelEdit: function(e) {
+    Rico.eventStop(e);
+    for (var i=0; i<this.grid.columns.length; i++) {
+      if (this.grid.columns[i].format && this.grid.columns[i].format.SelectCtl)
+        Rico.EditControls.close(this.grid.columns[i].format.SelectCtl);
+    }
+    this.makeFormInvisible();
+    this.grid.highlightEnabled=true;
+    this.menu.cancelmenu();
+    return false;
+  },
+
+  setField: function(fldnum,fldvalue) {
+    var fldSpec=this.grid.columns[fldnum].format;
+    var e=Rico.$(fldSpec.FieldName);
+    var a,i,o,elems,opts,txt;
+    if (!e) return;
+    Rico.log('setField: '+fldSpec.FieldName+'='+fldvalue);
+    switch (e.tagName.toUpperCase()) {
+      case 'DIV':
+        elems=e.getElementsByTagName('INPUT');
+        o={}
+        if (fldSpec.MultiSelect && fldvalue) {
+          a=fldvalue.split(',');
+          for (var i=0; i<a.length; i++) o[a[i]]=1;
+        } else {
+          o[fldvalue]=1;
+        }
+        for (i=0; i<elems.length; i++)
+          elems[i].checked=o[elems[i].value]==1;
+        break;
+      case 'INPUT':
+        if (fldSpec.EntryType=='D' && fldvalue!=fldSpec.ColData) {
+          // remove time data if it exists
+          a=fldvalue.split(/\s|T/);
+          fldvalue=a[0];
+          if (this.isTextInput(e)) {
+            var d=Rico.setISO8601(fldvalue);
+            if (d) fldvalue=Rico.formatDate(d,fldSpec.dateFmt);
+          }
+        }
+        e.value=fldvalue;
+        break;
+      case 'SELECT':
+        opts=e.options;
+        //alert('setField SELECT: id='+e.id+'\nvalue='+fldvalue+'\nopt cnt='+opts.length)
+        o={}
+        if (fldSpec.MultiSelect && fldvalue) {
+          a=fldvalue.split(',');
+          for (var i=0; i<a.length; i++) o[a[i]]=1;
+          for (i=0; i<opts.length; i++)
+            opts[i].selected=o[opts[i].value]==1;
+        } else {
+          for (i=0; i<opts.length; i++) {
+            if (opts[i].value==fldvalue) {
+              e.selectedIndex=i;
+              break;
+            }
+          }
+        }
+        if (fldSpec.EntryType=='N') {
+          txt=Rico.$('textnew__'+e.id);
+          if (!txt) alert('Warning: unable to find id "textnew__'+e.id+'"');
+          txt.value=fldvalue;
+          if (e.selectedIndex!=i) e.selectedIndex=opts.length-1;
+          this.updateSelectNew(e);
+        }
+        return;
+      case 'TEXTAREA':
+        e.value=fldvalue;
+        if (fldSpec.EntryType=='tinyMCE' && typeof(tinyMCE)!='undefined' && this.initialized) {
+          if (tinyMCE.updateContent) {
+            tinyMCE.updateContent(e.id);  // version 2.x
+          } else {
+            tinyMCE.execInstanceCommand(e.id, 'mceSetContent', false, fldvalue);  // version 3.x
+          }
+        }
+        return;
+    }
+  },
+
+  setReadOnly: function(addFlag) {
+    for (var i=0; i<this.grid.columns.length; i++) {
+      var fldSpec=this.grid.columns[i].format;
+      if (!fldSpec) continue;
+      var e=Rico.$(fldSpec.FieldName);
+      if (!e) continue;
+      var ro=!fldSpec.Writeable || fldSpec.ReadOnly || (fldSpec.InsertOnly && !addFlag) || (fldSpec.UpdateOnly && addFlag);
+      var color=ro ? this.options.readOnlyColor : '';
+      switch (e.tagName.toUpperCase()) {
+        case 'DIV':
+          e.style.color=color;
+          var elems=e.getElementsByTagName('INPUT');
+          for (var j=0; j<elems.length; j++) {
+            elems[j].readOnly=ro;
+          }
+          break;
+        case 'SELECT':
+          if (fldSpec.EntryType=='N') {
+            var txt=Rico.$('textnew__'+e.id);
+            txt.readOnly=ro;
+          }
+          e.readOnly=ro;
+          break;
+        case 'TEXTAREA':
+        case 'INPUT':
+          e.readOnly=ro;
+          e.style.color=color;
+          if (fldSpec.selectIcon) fldSpec.selectIcon.style.display=ro ? 'none' : '';
+          break;
+      }
+    }
+  },
+
+  hideResponse: function(msg) {
+    this.responseDiv.innerHTML=msg;
+    this.responseDialog.style.display='none';
+  },
+
+  showResponse: function() {
+    var offset=Rico.cumulativeOffset(this.grid.outerDiv);
+    offset.top+=Rico.docScrollTop();
+    this.responseDialog.style.top=offset.top+"px";
+    this.responseDialog.style.left=offset.left+"px";
+    this.responseDialog.style.display='';
+  },
+
+  processResponse: function(xhr) {
+    var responseText,success=true;
+    Rico.log('Processing response from form submittal');
+    this.responseDiv.innerHTML=xhr.responseText;
+    var respNodes=Rico.select('.ricoFormResponse',this.responseDiv);
+    if (respNodes) {
+      // generate a translated response
+      var phraseId=Rico.trim(respNodes[0].className).split(/\s+/)[1];
+      responseText=Rico.getPhraseById(phraseId,this.options.RecordName);
+    } else {
+      // present the response as sent from the server (untranslated)
+      var ch=this.responseDiv.childNodes;
+      for (var i=ch.length-1; i>=0; i--) {
+        if (ch[i].nodeType==1 && ch[i].nodeName!='P' && ch[i].nodeName!='DIV' && ch[i].nodeName!='BR')
+          this.responseDiv.removeChild(ch[i]);
+      }
+      responseText=Rico.stripTags(this.responseDiv.innerHTML);
+      success=(responseText.toLowerCase().indexOf('error')==-1);
+    }
+    if (success && this.options.showSaveMsg!='full') {
+      this.hideResponse('');
+      this.grid.resetContents();
+      this.grid.buffer.foundRowCount = false;
+      this.grid.buffer.fetch(this.grid.lastRowPos || 0);
+      if (this.saveMsg) this.saveMsg.innerHTML='&nbsp;'+responseText+'&nbsp;';
+    }
+    this.processCallback(this.options.onSubmitResponse);
+    Rico.log('Processing response completed');
+  },
+
+  processCallback: function(callback) {
+    switch (typeof callback) {
+      case 'string': return eval(callback);
+      case 'function': return callback();
+    }
+  },
+
+  // called when ok pressed on error response message
+  ackResponse: function(e) {
+    this.hideResponse('');
+    this.grid.highlightEnabled=true;
+  },
+
+  cloneRecord: function() {
+    this.formPopup.setTitle(this.cloneText);
+    this.displayEditForm("ins");
+  },
+
+  editRecord: function() {
+    this.formPopup.setTitle(this.editText);
+    this.displayEditForm("upd");
+  },
+
+  displayEditForm: function(action) {
+    this.grid.highlightEnabled=false;
+    this.menu.cancelmenu();
+    this.hideResponse(Rico.getPhraseById('saving'));
+    this.grid.outerDiv.style.cursor = 'auto';
+    this.action.value=action;
+    for (var i=0; i<this.grid.columns.length; i++) {
+      var c=this.grid.columns[i];
+      if (c.format) {
+        var v=c.getValue(this.rowIdx);
+        this.setField(i,v);
+        if (c.format.selectDesc) {
+          if (c.format.EntryType.length>1 && c.format.EntryType.charAt(1)=='L')
+            v=this.grid.columns[i+1].getValue(this.rowIdx);
+          v=c._format(v);
+          if (v==='') v='&nbsp;';
+          c.format.selectDesc.innerHTML=v;
+        }
+        if (c.format.SelectCtl)
+          Rico.EditControls.displayClrImg(c, !c.format.InsertOnly);
+      }
+    }
+    this.setReadOnly(action=='ins');
+    for (var k=0; k<this.keys.length; k++) {
+      this.keys[k].keyField.value = this.grid.buffer.getWindowValue(this.rowIdx,this.keys[k].colidx);
+    }
+    this.makeFormVisible(this.rowIdx);
+  },
+  
+  addPrepare: function() {
+    this.hideResponse(Rico.getPhraseById('saving'));
+    this.setReadOnly(true);
+    this.form.reset();
+    this.action.value="ins";
+    for (var i=0; i<this.grid.columns.length; i++) {
+      var c=this.grid.columns[i];
+      if (c.format) {
+        this.setField(i,c.format.ColData);
+        if (c.format.SelectCtl) {
+          Rico.EditControls.resetValue(c);
+          Rico.EditControls.displayClrImg(c, !c.format.UpdateOnly);
+        }
+      }
+    }
+  },
+
+  addRecord: function() {
+    this.menu.cancelmenu();
+    this.formPopup.setTitle(this.addText);
+    this.addPrepare();
+    this.makeFormVisible(-1);
+    if (this.formPanels) this.formPanels.select(0);
+  },
+
+  drillDown: function(e,masterColNum,detailColNum) {
+    return this.grid.drillDown.apply(this.grid, arguments);
+  },
+
+  // set filter on a detail grid that is in a master-detail relationship
+  setDetailFilter: function(colNumber,filterValue) {
+    this.grid.setDetailFilter(colNumber,filterValue);
+  },
+
+  makeFormVisible: function(row) {
+    this.formPopup.container.style.display='block';
+
+    // set left position
+    var editWi=this.formPopup.container.offsetWidth;
+    var odOffset=Rico.cumulativeOffset(this.grid.outerDiv);
+    var winWi=Rico.windowWidth();
+    this.formPopup.container.style.left=editWi+odOffset.left > winWi ? (winWi-editWi)+'px' : (odOffset.left+1)+'px';
+
+    // set top position
+    var scrTop=Rico.docScrollTop();
+    var editHt=this.formPopup.container.offsetHeight;
+    var newTop=odOffset.top+this.grid.hdrHt+scrTop;
+    var bottom=Rico.windowHeight()+scrTop;
+    if (row >= 0) {
+      newTop+=(row+1)*this.grid.rowHeight;
+      if (newTop+editHt>bottom) newTop-=(this.formPopup.contentCell.offsetHeight+this.grid.rowHeight);
+    } else {
+      if (newTop+editHt>bottom) newTop=bottom-editHt-2;
+    }
+
+    if (this.processCallback(this.options.formOpen) === false) return;
+    this.formPopup.openPopup(null,Math.max(newTop,scrTop));
+    this.formPopup.container.style.visibility='visible';
+    Rico.EditControls.setZ(Rico.getStyle(this.formPopup.container,'zIndex'));
+    if (this.initialized) return;
+
+    var i, spec;
+    for (i = 0; i < this.grid.columns.length; i++) {
+      spec=this.grid.columns[i].format;
+      if (!spec || !spec.EntryType || !spec.FieldName) continue;
+      switch (spec.EntryType) {
+        case 'tinyMCE':
+          if (typeof tinyMCE!='undefined') tinyMCE.execCommand('mceAddControl', true, spec.FieldName);
+          break;
+      }
+    }
+    this.initialized=true;
+  },
+
+  makeFormInvisible: function() {
+    this.formPopup.container.style.visibility='hidden';
+    this.formPopup.closePopup();
+    this.processCallback(this.options.formClose);
+  },
+
+  getConfirmDesc: function(rowIdx) {
+    return Rico.stripTags(this.grid.cell(rowIdx,this.options.ConfirmDeleteCol).innerHTML).replace('&nbsp;',' '); //.unescapeHTML();
+  },
+
+  deleteRecord: function() {
+    this.menu.cancelmenu();
+    var desc;
+    switch(this.options.ConfirmDeleteCol){
+      case -1 :
+        desc=Rico.getPhraseById("thisRecord",this.options.RecordName);
+        break;
+      case -2 : // Use key/column header to identify the row
+        for (var k=0; k<this.keys.length; k++) {
+          var i=this.keys[k].colidx;
+          var fmt=this.grid.columns[i].format;
+          if (fmt.EntryType.length>1 && fmt.EntryType.charAt(1)=='L') i++;
+          var value=Rico.stripTags(this.grid.cell(rowIdx,i).innerHTML);
+          if (desc) desc+=', ';
+          desc+=this.grid.columns[i].displayName+" "+value;
+        }
+        break;
+      default   :
+        desc='\"' + Rico.truncate(this.getConfirmDesc(this.rowIdx),50) + '\"';
+        break;
+    }
+    if (!this.options.ConfirmDelete.valueOf || confirm(Rico.getPhraseById("confirmDelete",desc))) {
+      this.hideResponse(Rico.getPhraseById('deleting'));
+      this.showResponse();
+      var parms={};
+      parms[this.grid.actionId]="del";
+      for (var k=0; k<this.keys.length; k++) {
+        var i=this.keys[k].colidx;
+        var value=this.grid.columns[i].getValue(this.rowIdx);
+        parms['_k'+i]=value;  // prototype does the encoding automatically
+        //parms['_k'+i]=encodeURIComponent(value);
+      }
+      new Rico.ajaxRequest(this.options.updateURL, {parameters:parms,method:'post',onComplete:this.responseHandler});
+    }
+    this.menu.cancelmenu();
+  },
+
+  validationMsg: function(elem,colnum,phraseId) {
+    var col=this.grid.columns[colnum];
+    if (this.formPanels) this.formPanels.select(this.panelActualIdx[col.format.panelIdx]);
+    var msg=Rico.getPhraseById(phraseId," \"" + col.formLabel.innerHTML + "\"");
+    Rico.log(' Validation error: '+msg);
+    if (col.format.Help) msg+="\n\n"+col.format.Help;
+    alert(msg);
+    setTimeout(function() { try { elem.focus(); elem.select(); } catch(e) {}; }, 10);
+    return false;
+  },
+  
+  isTextInput: function(elem) {
+    if (!elem) return false;
+    if (elem.tagName.toLowerCase()!='input') return false;
+    if (elem.type.toLowerCase()!='text') return false;
+    if (elem.readOnly) return false;
+    if (!Rico.visible(elem)) return false;
+    return true;
+  },
+  
+  parseDate: function(v, dateFmt) {
+    dateParts={};
+    if (!this.dateRegExp.exec(dateFmt)) return NaN;
+    dateParts[RegExp.$1]=0;
+    dateParts[RegExp.$3]=1;
+    dateParts[RegExp.$5]=2;
+    var aDate = v.split(/\D/);
+    var d=new Date();
+    var curyr=d.getFullYear();
+    if (aDate.length==2 && dateParts.yyyy==2) aDate.push(curyr);
+    if (aDate.length!=3) return NaN;
+    var dd=parseInt(aDate[dateParts.dd], 10);
+    if (dd==0 || dd>31) return NaN;
+    var mm=parseInt(aDate[dateParts.mm], 10) - 1;
+    if (mm > 11) return NaN;
+    var yy=parseInt(aDate[dateParts.yyyy], 10);
+    if (yy < 100) {
+      // apply a century to 2-digit years
+      yy+=curyr - (curyr % 100);
+    }
+    d.setFullYear(yy,mm,dd);
+    return d;
+  },
+
+  TESubmit: function(e) {
+    var i,lbl,spec,elem,n,dateValues=[];
+
+    Rico.eventStop(e);
+    Rico.log('Event: TESubmit called to validate input');
+
+    // check fields that are supposed to be non-blank
+
+    for (i = 0; i < this.grid.columns.length; i++) {
+      spec=this.grid.columns[i].format;
+      if (!spec || !spec.EntryType || !spec.FieldName) continue;
+      elem=Rico.$(spec.FieldName);
+      if (!this.isTextInput(elem)) continue;
+      Rico.log(' Validating field #'+i+' EntryType='+spec.EntryType+' ('+spec.FieldName+')');
+
+      // check for blanks
+      if (elem.value.length == 0) {
+        if (spec.required)
+          return this.validationMsg(elem,i,"formPleaseEnter");
+        else
+          continue;
+      }
+
+      // check pattern
+      if (elem.value.length > 0 && spec.regexp && !spec.regexp.test(elem.value))
+        return this.validationMsg(elem,i,"formInvalidFmt");
+
+      // check min/max and date values
+      switch (spec.EntryType.charAt(0)) {
+        case 'I': n=parseInt(elem.value,10); break;
+        case 'F': n=parseFloat(elem.value); break;
+        case 'D': 
+          n=this.parseDate(elem.value,spec.dateFmt);
+          if (isNaN(n)) return this.validationMsg(elem,i,"formInvalidFmt");
+          dateValues.push({e:elem,v:n});
+          break;
+        default:  n=NaN; break;
+      }
+      if (typeof spec.min!='undefined' && !isNaN(n) && n < spec.min)
+        return this.validationMsg(elem,i,"formOutOfRange");
+      if (typeof spec.max!='undefined' && !isNaN(n) && n > spec.max)
+        return this.validationMsg(elem,i,"formOutOfRange");
+    }
+    if (this.processCallback(this.options.formSubmit) === false) return false;
+
+    // update drop-down for any columns with entry type of N
+
+    for (i = 0; i < this.grid.columns.length; i++) {
+      spec=this.grid.columns[i].format;
+      if (!spec || !spec.EntryType || !spec.FieldName) continue;
+      if (spec.EntryType.charAt(0) != 'N') continue;
+      var SelObj=Rico.$(spec.FieldName);
+      if (!SelObj || SelObj.value!=this.options.TableSelectNew) continue;
+      var newtext=Rico.$("textnew__" + SelObj.id).value;
+      this.addSelectOption(SelObj,newtext,newtext);
+    }
+    
+    // set date values to ISO format
+    for (i = 0; i < dateValues.length; i++) {
+      dateValues[i].e.value = Rico.formatDate(dateValues[i].v,'yyyy-mm-dd');
+    }
+
+    if (typeof tinyMCE!='undefined') tinyMCE.triggerSave();
+    this.makeFormInvisible();
+    this.sendForm();
+    this.menu.cancelmenu();
+    return false;
+  },
+  
+  sendForm: function() {
+    this.showResponse();
+    Rico.log("sendForm: "+this.grid.tableId);
+    Rico.ajaxSubmit(this.form, this.options.updateURL, {method:'post',onComplete:this.responseHandler});
+  }
+};
+
+
+/**
+ * @namespace Registers custom popup widgets to fill in a text box (e.g. ricoCalendar and ricoTree)
+ * <pre>
+ * Custom widget must implement:
+ *   open() method (make control visible)
+ *   close() method (hide control)
+ *   container property (div element that contains the control)
+ *   id property (uniquely identifies the widget class)
+ *
+ * widget calls returnValue method to return a value to the caller
+ *
+ * this object handles clicks on the control's icon and positions the control appropriately.
+ * </pre>
+ */
+Rico.EditControls = {
+  widgetList : {},
+  elemList   : {},
+  zIndex     : 0,
+
+  register: function(widget, imgsrc) {
+    this.widgetList[widget.id] = {imgsrc:imgsrc, widget:widget, currentEl:''};
+    widget.returnValue=Rico.bind(this,'setValue',widget);
+    Rico.log("Rico.EditControls.register:"+widget.id);
+  },
+  
+  setZ: function(z) {
+    this.zIndex=Math.max(this.zIndex,z+10);
+  },
+
+  atLoad: function() {
+    for (var id in this.widgetList) {
+      var widget=this.widgetList[id].widget;
+      if (widget.atLoad && !widget.atLoadComplete) {
+        Rico.log("Rico.EditControls.atLoad: "+id);
+        widget.atLoad();
+        widget.atLoadComplete=true;
+      }
+    }
+  },
+
+  applyTo: function(column,inputCtl) {
+    var wInfo=this.widgetList[column.format.SelectCtl];
+    if (!wInfo) return;
+    Rico.log('Rico.EditControls.applyTo: '+column.displayName+' : '+column.format.SelectCtl);
+    var descSpan = document.createElement('span');
+    var newimg = document.createElement('img');
+    newimg.style.paddingLeft='4px';
+    newimg.style.cursor='pointer';
+    newimg.align='top';
+    newimg.src=wInfo.imgsrc;
+    newimg.id=this.imgId(column.format.FieldName);
+    Rico.eventBind(newimg,"click", Rico.eventHandle(this,'processClick'));
+    inputCtl.parentNode.appendChild(descSpan);
+    inputCtl.parentNode.appendChild(newimg);
+    inputCtl.style.display='none';    // comment out this line for debugging
+    var clr;
+    if (column.format.isNullable) {
+      clr=Rico.clearButton(Rico.eventHandle(this,'processClear'));
+      clr.id=newimg.id+'_clear';
+      inputCtl.parentNode.appendChild(clr);
+    }
+    this.elemList[newimg.id] = {descSpan:descSpan, inputCtl:inputCtl, widget:wInfo.widget, listObj:wInfo, column:column, clrimg:clr};
+    column.format.selectIcon=newimg;
+    column.format.selectDesc=descSpan;
+  },
+
+  displayClrImg: function(column,bShow) {
+    var el=this.elemList[this.imgId(column.format.FieldName)];
+    //alert(column.format.FieldName+': '+bShow+' '+typeof(el.clrimg));
+    if (el && el.clrimg) el.clrimg.style.display=bShow ? 'inline-block' : 'none';
+  },
+
+  processClear: function(e) {
+    var elem=Rico.eventElement(e);
+    var el=this.elemList[elem.id.slice(0,-6)];
+    if (!el) return;
+    el.inputCtl.value='';
+    el.descSpan.innerHTML=el.column._format('');
+  },
+
+  processClick: function(e) {
+    var elem=Rico.eventElement(e);
+    var el=this.elemList[elem.id];
+    if (!el) return;
+    if (el.listObj.currentEl==elem.id && el.widget.container.style.display!='none') {
+      el.widget.close();
+      el.listObj.currentEl='';
+    } else {
+      el.listObj.currentEl=elem.id;
+      Rico.log('Rico.EditControls.processClick: '+el.widget.id+' : '+el.inputCtl.value);
+      el.widget.container.style.zIndex=this.zIndex;
+      el.widget.open(el.inputCtl.value,el.column);     // this may change the size of the widget
+      Rico.positionCtlOverIcon(el.widget.container,elem);
+    }
+  },
+
+  imgId: function(fieldname) {
+    return 'icon_'+fieldname;
+  },
+
+  resetValue: function(column) {
+    var el=this.elemList[this.imgId(column.format.FieldName)];
+    if (!el) return;
+    el.inputCtl.value=column.format.ColData;
+    var v=column._format(column.format.ColData);
+    if (v==='') v='&nbsp;';
+    el.descSpan.innerHTML=v;
+  },
+
+  setValue: function(widget,newVal,newDesc) {
+    var wInfo=this.widgetList[widget.id];
+    if (!wInfo) return null;
+    var id=wInfo.currentEl;
+    if (!id) return null;
+    var el=this.elemList[id];
+    if (!el) return null;
+    el.inputCtl.value=newVal;
+    if (!newDesc) newDesc=el.column._format(newVal);
+    el.descSpan.innerHTML=newDesc;
+    if (el.column.format.DescriptionField)
+      Rico.$(el.column.format.DescriptionField).value = newDesc;
+    //alert(widget.id+':'+id+':'+el.inputCtl.id+':'+el.inputCtl.value+':'+newDesc);
+  },
+
+  close: function(id) {
+    var wInfo=this.widgetList[id];
+    if (!wInfo) return;
+    if (wInfo.widget.container.style.display!='none')
+      wInfo.widget.close();
+  }
+};
+
+Rico.includeLoaded('ricoLiveGridForms.js');
diff --git a/ricoClient/js/ricoLiveGridMenu.js b/ricoClient/js/ricoLiveGridMenu.js
new file mode 100644 (file)
index 0000000..7ca9385
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+ if(typeof Rico=='undefined')
+  throw("GridMenu requires the Rico JavaScript framework");
+
+/**
+ * Standard menu for LiveGrid
+ */
+Rico.GridMenu = function(options) {
+  this.initialize(options);
+};
+
+Rico.GridMenu.prototype = {
+
+initialize: function(options) {
+  this.options = {
+    width           : '18em',
+    dataMenuHandler : null          // put custom items on the menu
+  };
+  Rico.extend(this.options, options || {});
+  Rico.extend(this, new Rico.Menu(this.options));
+  this.sortmenu = new Rico.Menu({ width: '15em' });
+  this.filtermenu = new Rico.Menu({ width: '22em' });
+  this.exportmenu = new Rico.Menu({ width: '24em' });
+  this.hideshowmenu = new Rico.Menu({ width: '22em' });
+  this.createDiv();
+  this.sortmenu.createDiv();
+  this.filtermenu.createDiv();
+  this.exportmenu.createDiv();
+  this.hideshowmenu.createDiv();
+},
+
+// Build context menu for grid
+buildGridMenu: function(r,c) {
+  this.clearMenu();
+  var totrows=this.liveGrid.buffer.totalRows;
+  var onBlankRow=r >= totrows;
+  var column=this.liveGrid.columns[c];
+  if (this.options.dataMenuHandler) {
+     var showDefaultMenu=this.options.dataMenuHandler(this.liveGrid,r,c,onBlankRow);
+     if (!showDefaultMenu) return (this.itemCount > 0);
+  }
+
+  // menu items for sorting
+  if (column.sortable && totrows>0) {
+    this.sortmenu.clearMenu();
+    this.addSubMenuItem(Rico.getPhraseById("gridmenuSortBy",column.displayName), this.sortmenu, false);
+    this.sortmenu.addMenuItemId("gridmenuSortAsc", Rico.bind(column,'sortAsc'), true);
+    this.sortmenu.addMenuItemId("gridmenuSortDesc", Rico.bind(column,'sortDesc'), true);
+  }
+
+  // menu items for filtering
+  this.filtermenu.clearMenu();
+  if (column.canFilter() && !column.format.filterUI && (!onBlankRow || column.filterType == Rico.ColumnConst.USERFILTER)) {
+    this.addSubMenuItem(Rico.getPhraseById("gridmenuFilterBy",column.displayName), this.filtermenu, false);
+    column.userFilter=column.getValue(r);
+    if (column.filterType == Rico.ColumnConst.USERFILTER) {
+      this.filtermenu.addMenuItemId("gridmenuRemoveFilter", Rico.bind(column,'setUnfiltered',false), true);
+      if (column.filterOp=='LIKE')
+        this.filtermenu.addMenuItemId("gridmenuChgKeyword", Rico.bind(this.liveGrid,'openKeyword',c), true);
+      if (column.filterOp=='NE' && !onBlankRow)
+        this.filtermenu.addMenuItemId("gridmenuExcludeAlso", Rico.bind(column,'addFilterNE'), true);
+    } else if (!onBlankRow) {
+      this.filtermenu.addMenuItemId("gridmenuInclude", Rico.bind(column,'setFilterEQ'), true);
+      this.filtermenu.addMenuItemId("gridmenuGreaterThan", Rico.bind(column,'setFilterGE'), column.userFilter!='');
+      this.filtermenu.addMenuItemId("gridmenuLessThan", Rico.bind(column,'setFilterLE'), column.userFilter!='');
+      if (column.isText)
+        this.filtermenu.addMenuItemId("gridmenuContains", Rico.bind(this.liveGrid,'openKeyword',c), true);
+      this.filtermenu.addMenuItemId("gridmenuExclude", Rico.bind(column,'setFilterNE'), true);
+    }
+    if (this.liveGrid.filterCount() > 0) {
+      this.filtermenu.addMenuItemId("gridmenuRefresh", Rico.bind(this.liveGrid,'filterHandler'), true);
+      this.filtermenu.addMenuItemId("gridmenuRemoveAll", Rico.bind(this.liveGrid,'clearFilters'), true);
+    }
+  } else if (this.liveGrid.filterCount() > 0) {
+    this.addSubMenuItem(Rico.getPhraseById("gridmenuFilterBy",column.displayName), this.filtermenu, false);
+    this.filtermenu.addMenuItemId("gridmenuRemoveAll", Rico.bind(this.liveGrid,'clearFilters'), true);
+  }
+
+  // menu items for Print/Export
+  this.exportmenu.clearMenu();
+  if (this.liveGrid.buffer.printVisibleSQL && typeof(this.liveGrid.buffer.dataSource)=='string') {
+    // SQL buffer
+    this.addSubMenuItem(Rico.getPhraseById('gridmenuExport'),this.exportmenu,false);
+    this.exportmenu.addMenuItemId("gridmenuExportVis2Web", Rico.bind(this.liveGrid.buffer,'printVisibleSQL','html'));
+    this.exportmenu.addMenuItemId("gridmenuExportAll2Web", Rico.bind(this.liveGrid.buffer,'printAllSQL','html'), this.liveGrid.buffer.totalRows <= this.liveGrid.options.maxPrint);
+    this.exportmenu.addMenuBreak();
+    this.exportmenu.addMenuItemId("gridmenuExportVis2SS", Rico.bind(this.liveGrid.buffer,'printVisibleSQL','xl'));
+    this.exportmenu.addMenuItemId("gridmenuExportAll2SS", Rico.bind(this.liveGrid.buffer,'printAllSQL','xl'), this.liveGrid.buffer.totalRows <= this.liveGrid.options.maxPrint);
+  } else if (this.liveGrid.options.maxPrint > 0 && totrows>0) {
+    // any other buffer
+    this.addSubMenuItem(Rico.getPhraseById('gridmenuExport'),this.exportmenu,false);
+    this.exportmenu.addMenuItemId("gridmenuExportVis2Web", Rico.bind(this.liveGrid.buffer,'printVisible','plain'));
+    this.exportmenu.addMenuItemId("gridmenuExportAll2Web", Rico.bind(this.liveGrid.buffer,'printAll','plain'), this.liveGrid.buffer.totalRows <= this.liveGrid.options.maxPrint);
+    if (Rico.isIE) {
+      this.exportmenu.addMenuBreak();
+      this.exportmenu.addMenuItemId("gridmenuExportVis2SS", Rico.bind(this.liveGrid.buffer,'printVisible','owc'));
+      this.exportmenu.addMenuItemId("gridmenuExportAll2SS", Rico.bind(this.liveGrid.buffer,'printAll','owc'), this.liveGrid.buffer.totalRows <= this.liveGrid.options.maxPrint);
+    }
+  }
+
+  // menu items for hide/unhide
+  var hiddenCols=this.liveGrid.listInvisible();
+  for (var showableCnt=0,x=0; x<hiddenCols.length; x++) {
+    if (hiddenCols[x].canHideShow()) showableCnt++;
+  }
+  if (showableCnt > 0 || column.canHideShow()) {
+    this.hideshowmenu.clearMenu();
+    this.addSubMenuItem(Rico.getPhraseById('gridmenuHideShow'),this.hideshowmenu,false);
+    this.hideshowmenu.addMenuItemId('gridmenuChooseCols', Rico.bind(this.liveGrid,'chooseColumns'),true,false);
+    var visibleCnt=this.liveGrid.columns.length-hiddenCols.length;
+    var enabled=(visibleCnt>1 && column.visible && column.canHideShow());
+    this.hideshowmenu.addMenuItem(Rico.getPhraseById('gridmenuHide',column.displayName), Rico.bind(column,'hideColumn'), enabled);
+    for (var cnt=0,x=0; x<hiddenCols.length; x++) {
+      if (hiddenCols[x].canHideShow()) {
+        if (cnt++==0) this.hideshowmenu.addMenuBreak();
+        this.hideshowmenu.addMenuItem(Rico.getPhraseById('gridmenuShow',hiddenCols[x].displayName), Rico.bind(hiddenCols[x],'showColumn'), true);
+      }
+    }
+    if (hiddenCols.length > 1)
+      this.hideshowmenu.addMenuItemId('gridmenuShowAll', Rico.bind(this.liveGrid,'showAll'));
+  }
+  return true;
+}
+
+}
+
+Rico.includeLoaded('ricoLiveGridMenu.js');
diff --git a/ricoClient/js/ricoSearch.js b/ricoClient/js/ricoSearch.js
new file mode 100644 (file)
index 0000000..3e90dd7
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+Rico.KeywordSearch = function(id,options) {
+  this.initialize(id,options);
+};
+
+Rico.KeywordSearch.prototype = {
+/**
+ * @class Implements a pop-up keyword search control.
+ * @extends Rico.Popup
+ * @constructs
+ * @param id unique identifier
+ * @param options object may contain any of the following:<dl>
+ *   <dt>showColorCode</dt><dd> show hex color code as user hovers over color grid? default=false</dd>
+ *   <dt>cellsPerRow  </dt><dd> number of colors per row in the grid? default=18</dd>
+ *   <dt>palette      </dt><dd> array of 6 digit hex values, default=216 "web safe" colors</dd>
+ *</dl>
+ */
+  initialize: function(id,options) {
+    this.id=id;
+    Rico.extend(this, new Rico.Window(Rico.getPhraseById("keywordTitle"),options));
+    this.contentCell.className='ricoKeywordSearch';
+    Rico.extend(this.options, {
+      listLength : 10,
+      maxSuggest : 20,
+      width: '12em'
+    });
+  },
+
+  atLoad : function() {
+    this.searchField=Rico.createFormField(this.contentDiv,'input','text',this.id+'_search');
+    this.searchField.style.display="block";
+    this.searchField.style.width=this.options.width;
+    Rico.eventBind(this.searchField,'keyup',Rico.eventHandle(this,'filterKeypress'),false);
+    this.selectList=Rico.createFormField(this.contentDiv,'select',null,this.id+'_list');
+    this.selectList.size=this.options.listLength;
+    this.selectList.style.display="block";
+    this.selectList.style.width=this.options.width;
+    Rico.eventBind(this.selectList,'change',Rico.eventHandle(this,'listClick'),false);
+    /**
+     * alias for closePopup
+     * @function
+     */
+    this.close=this.closePopup;
+    this.close();
+  },
+  
+  open: function(currentVal,column) {
+    this.column=column;
+    this.grid=this.column.liveGrid;
+    this.searchField.value='';
+    this.selectList.options.length=0;
+    this.openPopup();
+    this.searchField.focus();
+    this.selectValuesRequest('');
+  },
+
+  selectValuesRequest: function(filter) {
+    var colnum=this.column.index;
+    var options={};
+    Rico.extend(options, this.grid.buffer.ajaxOptions);
+    options.parameters = {id: this.grid.tableId, offset: '0', page_size: this.options.maxSuggest, edit: colnum};
+    options.parameters[this.grid.actionId]="query";
+    if (filter!='' && filter!='*') {
+      if (filter.indexOf('*')==-1) filter='*'+filter+'*';
+      options.parameters['f[1][op]']="LIKE";
+      options.parameters['f[1][len]']=1;
+      options.parameters['f[1][0]']=filter;
+    }
+    options.onComplete = Rico.bind(this,'selectValuesUpdate');
+    new Rico.ajaxRequest(this.grid.buffer.dataSource, options);
+  },
+
+  selectValuesUpdate: function(request) {
+    var response = request.responseXML.getElementsByTagName("ajax-response");
+    Rico.log("selectValuesUpdate: "+request.status);
+    if (response == null || response.length != 1) return;
+    response=response[0];
+    var error = response.getElementsByTagName('error');
+    if (error.length > 0) {
+      var errmsg=Rico.getContentAsString(error[0],this.grid.buffer.isEncoded);
+      Rico.log("Data provider returned an error:\n"+errmsg);
+      alert(Rico.getPhraseById("requestError",errmsg));
+      return null;
+    }
+    this.selectList.options.length=0;
+    response=response.getElementsByTagName('response')[0];
+    var rowsElement = response.getElementsByTagName('rows')[0];
+    var rows = this.grid.buffer.dom2jstable(rowsElement);
+    Rico.log("selectValuesUpdate: id="+this.selectList.id+' rows='+rows.length);
+    for (var i=0; i<rows.length; i++) {
+      if (rows[i].length>0) {
+        var c0=rows[i][0];
+        var c1=(rows[i].length>1) ? rows[i][1] : c0;
+        Rico.addSelectOption(this.selectList,c0,c1);
+      }
+    }
+  },
+
+  filterKeypress: function(e) {
+    var txtbox=Rico.eventElement(e);
+    if (typeof this.lastKeyFilter != 'string') this.lastKeyFilter='';
+    if (this.lastKeyFilter==txtbox.value) return;
+    var v=txtbox.value;
+    Rico.log("filterKeypress: "+this.index+' '+v);
+    this.lastKeyFilter=v;
+    this.selectValuesRequest(v);
+  },
+  
+  listClick: function(e) {
+    var elem=Rico.eventElement(e);
+    if (elem.tagName.toLowerCase() != 'select') return;
+    if (this.returnValue) {
+      var opt=elem.options[elem.selectedIndex];
+      this.returnValue(opt.value,opt.innerHTML);
+    }
+    this.close();
+  }
+
+};
+
+Rico.includeLoaded('ricoSearch.js');
diff --git a/ricoClient/js/ricoSimpleGrid.js b/ricoClient/js/ricoSimpleGrid.js
new file mode 100644 (file)
index 0000000..b7c4851
--- /dev/null
@@ -0,0 +1,401 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+if(typeof Rico=='undefined') throw("SimpleGrid requires the Rico JavaScript framework");
+
+Rico.SimpleGrid = function(tableId, options) {
+  this.initialize(tableId, options);
+}
+
+Rico.SimpleGrid.prototype = {
+/**
+ * @class Create & manage an unbuffered grid.
+ * Supports: frozen columns & headings, resizable columns.
+ * @extends Rico.GridCommon
+ * @constructs
+ */
+  initialize: function( tableId, options ) {
+    Rico.extend(this, Rico.GridCommon);
+    this.baseInit();
+    Rico.setDebugArea(tableId+"_debugmsgs");    // if used, this should be a textarea
+    Rico.extend(this.options, options || {});
+    this.tableId = tableId;
+    Rico.log("SimpleGrid initialize start: "+tableId);\r
+    this.createDivs();
+    this.hdrTabs=new Array(2);
+    this.simpleGridInit();
+    Rico.log("SimpleGrid initialize end: "+tableId);\r
+  },
+
+  simpleGridInit: function() {
+    var i;
+    for (i=0; i<2; i++) {
+      Rico.log("simpleGridInit "+i);\r
+      this.tabs[i]=document.getElementById(this.tableId+'_tab'+i);
+      if (!this.tabs[i]) return;
+      this.hdrTabs[i]=document.getElementById(this.tableId+'_tab'+i+'h');
+      if (!this.hdrTabs[i]) return;
+      if (i==0) this.tabs[i].style.position='absolute';
+      if (i==0) this.tabs[i].style.left='0px';
+      this.hdrTabs[i].style.position='absolute';
+      this.hdrTabs[i].style.top='0px';
+      this.hdrTabs[i].style.zIndex=1;
+      this.thead[i]=this.hdrTabs[i];
+      this.tbody[i]=this.tabs[i];
+      this.headerColCnt = this.getColumnInfo(this.hdrTabs[i].rows);
+      if (i==0) this.options.frozenColumns=this.headerColCnt;
+      if (Rico.theme.gridheader) Rico.addClass(this.thead[i],Rico.theme.gridheader);
+      if (Rico.theme.gridcontent) Rico.addClass(this.tbody[i],Rico.theme.gridcontent);
+    }
+    if (this.headerColCnt==0) {
+      alert('ERROR: no columns found in "'+this.tableId+'"');
+      return;
+    }
+    this.hdrHt=Math.max(Rico.nan2zero(this.hdrTabs[0].offsetHeight),this.hdrTabs[1].offsetHeight);
+    for (i=0; i<2; i++) {
+      if (i==0) this.tabs[i].style.top=this.hdrHt+'px';
+    }
+    this.createColumnArray('SimpleGridColumn');
+    this.pageSize=this.columns[0].dataColDiv.childNodes.length;
+    this.sizeDivs();
+    if (typeof(this.options.FilterLocation)=='number')
+      this.createFilters(this.options.FilterLocation);
+    this.attachMenuEvents();
+    this.scrollEventFunc=Rico.eventHandle(this,'handleScroll');
+    this.pluginScroll();
+    if (this.options.windowResize)
+      Rico.eventBind(window,"resize", Rico.eventHandle(this,'sizeDivs'), false);
+  },
+
+  // return id string for a filter element
+  filterId: function(colnum) {
+    return 'RicoFilter_'+this.tableId+'_'+colnum;
+  },
+  
+  // create filter elements on heading row r
+  createFilters: function(r) {
+    if (r < 0) {
+      r=this.addHeadingRow();
+      this.sizeDivs();
+    }
+    for( var c=0; c < this.headerColCnt; c++ ) {
+      var col=this.columns[c];
+      var fmt=col.format;
+      if (typeof fmt.filterUI!='string') continue;
+      var cell=this.hdrCells[r][c].cell;
+      var field,name=this.filterId(c);\r
+      var divs=cell.getElementsByTagName('div');
+      switch (fmt.filterUI.charAt(0)) {
+        case 't':
+          field=Rico.createFormField(divs[1],'input','text',name,name);
+          var size=fmt.filterUI.match(/\d+/);
+          field.maxLength=fmt.Length || 50;\r
+          field.size=size ? parseInt(size,10) : 10;
+          Rico.eventBind(field,'keyup',Rico.eventHandle(col,'filterKeypress'),false);\r
+          break;\r
+        case 's':
+          field=Rico.createFormField(divs[1],'select',null,name);\r
+          Rico.addSelectOption(field,this.options.FilterAllToken,Rico.getPhraseById("filterAll"));
+          this.getFilterValues(col);
+          var keys=Rico.keys(col.filterHash);
+          keys.sort();
+          for (var i=0; i<keys.length; i++)
+            Rico.addSelectOption(field,keys[i],keys[i] || Rico.getPhraseById("filterBlank"));\r
+          Rico.eventBind(field,'change',Rico.eventHandle(col,'filterChange'),false);\r
+          break;\r
+      }
+    }
+    this.initFilterImage(r);
+  },
+  
+  getFilterValues: function(col) {
+    var h={};
+    var n=col.numRows();
+    for (var i=0; i<n; i++) {
+      var v=Rico.getInnerText(col.cell(i));
+      var hval=h[v];
+      if (hval)
+        hval.push(i);
+      else
+        h[v]=[i];
+    }
+    col.filterHash=h;\r
+  },
+  
+  // hide filtered rows
+  applyFilters: function() {
+    // rows to display will be the intersection of all filterRows arrays
+    var fcols=[];
+    for (var c=0; c<this.columns.length; c++) {
+      if (this.columns[c].filterRows)
+        fcols.push(this.columns[c].filterRows);
+    }
+    if (fcols.length==0) {
+      // no filters are set
+      this.showAllRows();
+      return;
+    }
+    for (var r=0; r<this.pageSize; r++) {
+      var showflag=true;
+      for (var j=0; j<fcols.length; j++) {
+        if (fcols[j].indexOf(r)==-1) {
+          showflag=false;
+          break;
+        }
+      }
+      if (showflag)
+        this.showRow(r);
+      else
+        this.hideRow(r);
+    }
+    this.sizeDivs();\r
+  },
+
+  handleScroll: function(e) {
+    var newTop=(this.hdrHt-this.scrollDiv.scrollTop)+'px';
+    this.tabs[0].style.top=newTop;
+    this.setHorizontalScroll();
+  },
+
+  /**
+   * Register a menu that will only be used in the scrolling part of the grid.
+   * If submenus are used, they must be registered after the main menu.
+   */
+  registerScrollMenu: function(menu) {
+    if (!this.menu) this.menu=menu;
+    menu.grid=this;
+    menu.showmenu=menu.showSimpleMenu;
+    menu.showSubMenu=menu.showSimpleSubMenu;
+    menu.createDiv(this.outerDiv);
+  },
+
+  handleMenuClick: function(e) {
+    if (!this.menu) return;
+    this.cancelMenu();
+    this.menuCell=Rico.getParentByTagName(Rico.eventElement(e),'div');
+    this.highlightEnabled=false;
+    if (this.hideScroll) this.scrollDiv.style.overflow="hidden";
+    if (this.menu.buildGridMenu) this.menu.buildGridMenu(this.menuCell);
+    this.menu.showmenu(e,this.closeMenu.bind(this));
+  },
+
+  closeMenu: function() {
+    if (this.hideScroll) this.scrollDiv.style.overflow="";
+    this.highlightEnabled=true;
+  },
+
+  sizeDivs: function() {
+    if (this.outerDiv.offsetParent.style.display=='none') return;
+    this.baseSizeDivs();
+    var maxHt=Math.max(this.options.maxHt || this.availHt(), 50);
+    var totHt=Math.min(this.hdrHt+this.dataHt, maxHt);
+    Rico.log('sizeDivs '+this.tableId+': hdrHt='+this.hdrHt+' dataHt='+this.dataHt);
+    this.dataHt=totHt-this.hdrHt;
+    if (this.scrWi>0) this.dataHt+=this.options.scrollBarWidth;
+    this.scrollDiv.style.height=this.dataHt+'px';
+    var divAdjust=2;
+    this.innerDiv.style.width=(this.scrWi-this.options.scrollBarWidth+divAdjust)+'px';
+    this.innerDiv.style.height=(this.hdrHt+1)+'px';
+    totHt+=divAdjust;
+    this.resizeDiv.style.height=this.frozenTabs.style.height=totHt+'px';
+    this.outerDiv.style.height=(totHt+this.options.scrollBarWidth)+'px';
+    this.handleScroll();
+  },
+  
+/**
+ * Copies all rows to a new window as a simple html table.
+ */
+  printVisible: function(exportType) {
+    this.showMsg(Rico.getPhraseById('exportInProgress'));
+    Rico.runLater(10,this,'_printVisible',exportType);  // allow message to paint
+  },
+
+  _printVisible: function(exportType) {
+    this.exportStart();
+    var exportStyles=this.getExportStyles(this.tbody[0]);
+    for(var r=0; r < this.pageSize; r++) {
+      if (this.columns[0].cell(r).style.display=='none') continue;
+      var exportText='';
+      for (var c=0; c<this.columns.length; c++) {
+        var col=this.columns[c];
+        if (col.visible) {
+          var v=col.getFormattedValue(r, !this.options.exportImgTags, !this.options.exportFormFields, 'NoExport');
+          if (col.format.exportPrefix) v=col.format.exportPrefix+v;
+          if (v=='') v='&nbsp;';
+          exportText+="<td style='"+this.exportStyle(col.cell(r),exportStyles)+"'>"+v+"</td>";
+        }
+      }
+      this.exportRows.push(exportText);
+    }
+    this.exportFinish(exportType);
+  },
+
+  /**
+   * Hide a row in the grid.
+   * sizeDivs() should be called after this function has completed.
+   */
+  hideRow: function(rownum) {
+    if (this.columns[0].cell(rownum).style.display=='none') return;
+    for (var i=0; i<this.columns.length; i++)
+      this.columns[i].cell(rownum).style.display='none';
+  },
+
+  /**
+   * Unhide a row in the grid.
+   * sizeDivs() should be called after this function has completed.
+   */
+  showRow: function(rownum) {
+    if (this.columns[0].cell(rownum).style.display=='') return;
+    for (var i=0; i<this.columns.length; i++)
+      this.columns[i].cell(rownum).style.display='';
+  },
+
+  /**
+   * Search for rows that contain SearchString in column ColIdx.
+   * If ShowMatch is false, then matching rows are hidden, if true then mismatching rows are hidden.
+   */
+  searchRows: function(ColIdx,SearchString,ShowMatch) {\r
+    if (!SearchString) return;\r
+    var re=new RegExp(SearchString);\r
+    var rowcnt=this.columns[ColIdx].numRows();\r
+    for(var r=0; r<rowcnt; r++) {\r
+      var txt=this.cell(r,ColIdx).innerHTML;\r
+      var matched=(txt.match(re) != null);\r
+      if (matched != ShowMatch) this.hideRow(r);\r
+    }
+    this.sizeDivs();
+    this.handleScroll();\r
+  },\r
+\r
+  /**
+   * Unhide all rows in the grid
+   */
+  showAllRows: function() {
+    for (var i=0; i<this.pageSize; i++)
+      this.showRow(i);
+    this.sizeDivs();\r
+  },
+  
+  openPopup: function(elem,popupobj) {
+    while (elem && !Rico.hasClass(elem,'ricoLG_cell'))
+      elem=elem.parentNode;
+    if (!elem) return false;
+    var td=Rico.getParentByTagName(elem,'td');
+  
+    var newLeft=Math.floor(td.offsetLeft-this.scrollDiv.scrollLeft+td.offsetWidth/2);
+    if (this.direction == 'rtl') {
+      if (newLeft > this.width) newLeft-=this.width;
+    } else {
+      if (newLeft+this.width+this.options.margin > this.scrollDiv.clientWidth) newLeft-=this.width;
+    }
+    popupobj.divPopup.style.visibility="hidden";
+    popupobj.divPopup.style.display="block";
+    var contentHt=popupobj.divPopup.offsetHeight;
+    var newTop=Math.floor(elem.offsetTop-this.scrollDiv.scrollTop+elem.offsetHeight/2);
+    if (newTop+contentHt+popupobj.options.margin > this.scrollDiv.clientHeight)
+      newTop=Math.max(newTop-contentHt,0);
+    popupobj.openPopup(this.frzWi+newLeft,this.hdrHt+newTop);
+    popupobj.divPopup.style.visibility ="visible";
+    return elem;
+  }
+
+}
+
+if (Rico.Menu) {
+Rico.extend(Rico.Menu.prototype, {
+
+showSimpleMenu: function(e,hideFunc) {
+  Rico.eventStop(e);
+  this.hideFunc=hideFunc;
+  if (this.div.childNodes.length==0) {
+    this.cancelmenu();
+    return false;
+  }
+  var elem=Rico.eventElement(e);
+  this.grid.openPopup(elem,this);
+  return elem;
+},
+
+showSimpleSubMenu: function(a,submenu) {
+  if (this.openSubMenu) this.hideSubMenu();
+  this.openSubMenu=submenu;
+  this.openMenuAnchor=a;
+  if (a.className=='ricoSubMenu') a.className='ricoSubMenuOpen';
+  var top=parseInt(this.div.style.top,10);
+  var left=parseInt(this.div.style.left,10);
+  submenu.openPopup(left+a.offsetWidth,top+a.offsetTop);
+  submenu.div.style.visibility ="visible";
+}
+
+});
+}
+
+
+Rico.SimpleGridColumn = function(grid,colIdx,hdrInfo,tabIdx) {
+  this.initialize(grid,colIdx,hdrInfo,tabIdx);
+}
+
+Rico.SimpleGridColumn.prototype = {
+/**
+ * @class Implements a SimpleGrid column
+ * @extends Rico.TableColumnBase
+ * @constructs
+ */
+initialize: function(grid,colIdx,hdrInfo,tabIdx) {
+  Rico.extend(this, new Rico.TableColumnBase());
+  this.baseInit(grid,colIdx,hdrInfo,tabIdx);
+},
+
+setUnfiltered: function() {
+  this.filterRows=null;
+},
+
+filterChange: function(e) {\r
+  var selbox=Rico.eventElement(e);
+  if (selbox.value==this.liveGrid.options.FilterAllToken)\r
+    this.setUnfiltered();\r
+  else
+    this.filterRows=this.filterHash[selbox.value];
+  this.liveGrid.applyFilters();
+},
+
+filterKeypress: function(e) {\r
+  var txtbox=Rico.eventElement(e);
+  if (typeof this.lastKeyFilter != 'string') this.lastKeyFilter='';\r
+  if (this.lastKeyFilter==txtbox.value) return;\r
+  var v=txtbox.value;\r
+  Rico.log("filterKeypress: "+this.index+' '+v);\r
+  this.lastKeyFilter=v;
+  if (v) {
+    v=v.replace('\\','\\\\');
+    v=v.replace('(','\\(').replace(')','\\)');
+    v=v.replace('.','\\.');
+    if (this.format.filterUI.indexOf('^') > 0) v='^'+v;
+    var re=new RegExp(v,'i');\r
+    this.filterRows=[];
+    var n=this.numRows();
+    for (var i=0; i<n; i++) {
+      var celltxt=Rico.getInnerText(this.cell(i));
+      if (celltxt.match(re)) this.filterRows.push(i);
+    }
+  } else {
+    this.setUnfiltered();\r
+  }
+  this.liveGrid.applyFilters();
+}
+
+}
+
+Rico.includeLoaded('ricoSimpleGrid.js');
diff --git a/ricoClient/js/ricoThemeroller.js b/ricoClient/js/ricoThemeroller.js
new file mode 100644 (file)
index 0000000..36773f4
--- /dev/null
@@ -0,0 +1,61 @@
+/*\r
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)\r
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)\r
+ *\r
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this\r
+ *  file except in compliance with the License. You may obtain a copy of the License at\r
+ *\r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ *  Unless required by applicable law or agreed to in writing, software distributed under the\r
+ *  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
+ *  either express or implied. See the License for the specific language governing permissions\r
+ *  and limitations under the License.\r
+ */\r
\r
+// Connects Rico to jQuery Themeroller css classes\r
+\r
+ Rico.theme = {\r
+  widget: 'ui-widget',\r
+  gridheader: 'ui-widget-header',\r
+  gridcontent:'ui-widget-content',\r
+  gridMessage:'ui-state-highlight ui-corner-all',\r
+  sortAsc:'ui-icon ui-icon-triangle-1-n',\r
+  sortDesc:'ui-icon ui-icon-triangle-1-s',\r
+  hover:'ui-state-hover',\r
+  selected:'ui-state-active',\r
+  button:'ui-state-default ui-corner-all',\r
+  gridHighlightClass:'ui-state-hover',\r
+  accordion:'ui-accordion ui-widget ui-helper-reset',\r
+  accTitle:'ui-accordion-header ui-helper-reset ui-state-default',\r
+  accContent:'ui-accordion-content ui-helper-reset ui-widget-content',\r
+  tabPanel:'ui-tabs ui-widget ui-widget-content ui-helper-clearfix',\r
+  tabNavContainer:'ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header',\r
+  tabTitle:'ui-state-default',\r
+  tabContent:'ui-tabs-panel ui-widget-content ui-corner-bottom',\r
+  tabCornerOptions: {corners:'top',nativeCorners:true},\r
+  tabSelected:'ui-tabs-selected ui-state-active',\r
+  calendar:'ui-datepicker ui-widget ui-widget-content ui-helper-clearfix',\r
+  calendarHeading:'ui-datepicker-header ui-widget-header ui-helper-clearfix',\r
+  calendarTable:'ui-datepicker-calendar',\r
+  calendarDay:'ui-state-default',\r
+  calendarFooter:'ui-widget-footer',\r
+  calendarToday:'ui-state-highlight',\r
+  calendarSelectedDay:'ui-state-active',\r
+  calendarPopdown:'ui-widget-content',\r
+  tree:'ui-widget ui-widget-content',\r
+  treeContent:'ui-widget-content',\r
+  leftArrow:'ui-icon ui-icon-circle-triangle-w',\r
+  rightArrow:'ui-icon ui-icon-circle-triangle-e',\r
+  leftArrowAnchor:'ui-datepicker-prev',\r
+  rightArrowAnchor:'ui-datepicker-next',\r
+  dialog:'ui-dialog ui-widget ui-widget-content ui-draggable',\r
+  dialogTitle:'ui-dialog-titlebar ui-widget-header',\r
+  dialogContent:'ui-widget-content',\r
+  buttonAnchor:'ui-state-default',\r
+  checkmark:'ui-icon ui-icon-check',\r
+  closeAnchor:'ui-dialog-titlebar-close',\r
+  cancel:'ui-icon ui-icon-close',\r
+  clear:'ui-icon ui-icon-close',\r
+  close:'ui-icon ui-icon-closethick'\r
+}\r
diff --git a/ricoClient/js/ricoTree.js b/ricoClient/js/ricoTree.js
new file mode 100644 (file)
index 0000000..1ed804b
--- /dev/null
@@ -0,0 +1,326 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+
+//  Rico Tree Control
+//  Requires prototype.js and ricoCommon.js
+//  Data for the tree can be obtained via AJAX requests
+//  Each record in the AJAX response should contain 5 or 6 cells:
+//   cells[0]=parent node id
+//   cells[1]=node id
+//   cells[2]=description
+//   cells[3]=L/zero (leaf), C/non-zero (container)
+//   cells[4]=0->not selectable, 1->selectable (use default action), otherwise the node is selectable and cells[4] contains the action
+//   cells[5]=leafIcon (optional)
+
+
+Rico.TreeControl = function(id,url,options) {
+  this.initialize(id,url,options);
+};
+
+Rico.TreeControl.prototype = {
+/**
+ * @class Implements a pop-up tree control.
+ * @extends Rico.Popup
+ * @constructs
+ * @param id unique identifier
+ * @param url data source
+ * @param options object may contain any of the following:<dl>
+ *   <dt>nodeIdDisplay</dt><dd> first, last, tooltip, or none? default=none</dd>
+ *   <dt>showCheckBox </dt><dd> show checkbox next to each item? default=false</dd>
+ *   <dt>showFolders  </dt><dd> show folder icons? default=false</dd>
+ *   <dt>showPlusMinus</dt><dd> show +/- icons to open/close branches? default=true</dd>
+ *   <dt>showLines    </dt><dd> show vertical lines connecting each level? default=true</dd>
+ *   <dt>defaultAction</dt><dd> Rico event handle to call when user clicks on an item, default is to call returnValue method</dd>
+ *   <dt>height       </dt><dd> control height? default=300px</dd>
+ *   <dt>width        </dt><dd> control width? default=300px</dd>
+ *   <dt>leafIcon     </dt><dd> url to img, default=doc.gif ('none'=no leaf icon)</dd>
+ *</dl>
+ */
+  initialize: function(id,url,options) {
+    Rico.extend(this, new Rico.Popup());
+    Rico.extend(this.options, {
+      ignoreClicks:true,
+      nodeIdDisplay:'none',
+      showCheckBox: false,
+      showFolders: false,
+      showPlusMinus: true,
+      showLines: true,
+      defaultAction: Rico.eventHandle(this,'nodeClick'),
+      height: '300px',
+      width: '300px',
+      leafIcon: Rico.imgDir+'doc.gif'
+    });
+    Rico.extend(this.options, options || {});
+    this.id=id;
+    this.dataSource=url;
+    this.close=this.closePopup;
+    this.hoverSet = new Rico.HoverSet([]);
+  },
+
+  atLoad : function() {
+    var imgsrc = ["node.gif","nodelast.gif","folderopen.gif","folderclosed.gif"];
+    // preload images
+    for (var i=0;i<imgsrc.length;i++) {
+      var img=new Image();
+      img.src = Rico.imgDir+imgsrc[i];
+    }
+    this.treeDiv=document.createElement("div");
+    this.treeDiv.id=this.id;
+    this.treeDiv.className='ricoTree';
+    if (Rico.theme.treeContent) Rico.addClass(this.treeDiv,Rico.theme.treeContent);
+    this.treeDiv.style.height=this.options.height;
+    this.treeDiv.style.width=this.options.width;
+    this.createContainer();
+    this.content.className=Rico.theme.tree || 'ricoTreeContainer';
+    this.content.appendChild(this.treeDiv);
+    if (this.options.showCheckBox) {
+      this.buttonDiv=document.createElement("div");
+      this.buttonDiv.style.width=this.options.width;
+      this.buttonDiv.className='ricoTreeButtons';
+      if (Rico.getStyle(this.container,'position')=='absolute') {
+        var span=document.createElement("span");
+        span.innerHTML=RicoTranslate.getPhraseById('treeSave');
+        Rico.setStyle(span,{'float':'left',cursor:'pointer'});
+        this.buttonDiv.appendChild(span);
+        Rico.eventBind(span, 'click', Rico.eventHandle(this,'saveSelection'));
+      }
+      var span=document.createElement("span");
+      span.innerHTML=RicoTranslate.getPhraseById('treeClear');
+      Rico.setStyle(span,{'float':'right',cursor:'pointer'});
+      this.buttonDiv.appendChild(span);
+      this.content.appendChild(this.buttonDiv);
+      Rico.eventBind(span, 'click', Rico.eventHandle(this,'clrCheckBoxEvent'));
+    }
+    this.close();
+  },
+
+  setTreeDiv: function(divId) {
+    this.treeDiv = Rico.$(divId);
+    this.openPopup = function() {};
+  },
+
+  open: function() {
+    this.openPopup();
+    if (this.treeDiv.childNodes.length == 0 && this.dataSource) {
+      this.loadXMLDoc();
+    }
+  },
+
+  loadXMLDoc: function(branchPin) {
+    var parms = { id: this.id };
+    if (branchPin) parms.Parent=branchPin;
+    Rico.log('Tree loadXMLDoc: '+this.id);
+    new Rico.ajaxRequest(this.dataSource, {parameters:parms,method:'get',onComplete:Rico.bind(this,'processResponse')});
+  },
+
+  domID: function(nodeID,part) {
+    return 'RicoTree_'+part+'_'+this.id+'_'+nodeID;
+  },
+
+  processResponse: function(request) {
+    var response = request.responseXML.getElementsByTagName("ajax-response");
+    if (response == null || response.length != 1) return;
+    var rowsElement = response[0].getElementsByTagName('rows')[0];
+    var trs = rowsElement.getElementsByTagName("tr");
+    var rowdata=[];
+    for (var i=0; i < trs.length; i++) {
+      var cells = trs[i].getElementsByTagName("td");
+      if (cells.length < 5) continue;
+      var content=[];
+      content[5]=this.options.leafIcon;
+      for (var j=0; j<cells.length; j++) {
+        content[j]=Rico.getContentAsString(cells[j],true);
+      }
+      content[3] = content[3].match(/^0|L$/i) ? 0 : 1;
+      content[4] = parseInt(content[4]);
+      rowdata.push(content);
+    }
+    for (var i=0; i < rowdata.length; i++) {
+      var moreChildren=(i < rowdata.length-1) && (rowdata[i][0]==rowdata[i+1][0]);
+      this.addNode(rowdata[i][0],rowdata[i][1],rowdata[i][2],rowdata[i][3],rowdata[i][4],rowdata[i][5],!moreChildren);
+    }
+  },
+
+  DisplayImages: function(row,arNames) {
+    var i,img,td;
+    for(i=0;i<arNames.length;i++) {
+      img = document.createElement("img");
+      img.src=Rico.imgDir+arNames[i] + ".gif";
+      td=row.insertCell(-1);
+      td.appendChild(img);
+    }
+  },
+
+  addNode: function(parentId, nodeId, nodeDesc, isContainer, isSelectable, leafIcon, isLast) {
+    var parentNode=Rico.$(this.domID(parentId,'Parent'));
+    var parentChildren=Rico.$(this.domID(parentId,'Children'));
+    var level=parentNode ? parentNode.TreeLevel+1 : 0;
+    //alert("addNode at level " + level + " (" + nodeId + ")")
+    var tab = document.createElement("table");
+    var div = document.createElement("div");
+    div.id=this.domID(nodeId,'Children');
+    div.className='ricoTreeBranch';
+    div.style.display=parentNode ? 'none' : '';
+    tab.border=0;
+    tab.cellSpacing=0;
+    tab.cellPadding=0;
+    tab.id=this.domID(nodeId,'Parent');
+    tab.TreeLevel=level;
+    tab.TreeContainer=isContainer;
+    tab.TreeFetchedChildren=this.dataSource ? false : true;
+    var row=tab.insertRow(0);
+    var td=[];
+    for (var i=0; i<level-1; i++) {
+      td[i]=row.insertCell(-1);
+    }
+    if (level>1) {
+      var tdParent=parentNode.getElementsByTagName('td');
+      for (var i=0; i<level-2; i++) {
+        td[i].innerHTML=tdParent[i].innerHTML;
+      }
+      var img = document.createElement("img");
+      img.src=Rico.imgDir+(parentChildren.nextSibling && this.options.showLines ? "nodeline" : "nodeblank")+".gif";
+      td[level-2].appendChild(img);
+    }
+    if (level>0) {
+      var suffix=isLast && this.options.showLines ? 'last' : '';
+      var prefix=this.options.showLines ? 'node' : '';
+      if (this.options.showPlusMinus && isContainer) {
+        var img = document.createElement("img");
+        img.name=nodeId;
+        img.style.cursor='pointer';
+        Rico.eventBind(img, 'click', Rico.eventHandle(this,'clickBranch'));
+        img.src=Rico.imgDir+prefix+"p"+suffix+".gif";
+        row.insertCell(-1).appendChild(img);
+      } else if (this.options.showLines) {
+        var img = document.createElement("img");
+        img.src=Rico.imgDir+"node"+suffix+".gif";
+        row.insertCell(-1).appendChild(img);
+      }
+      if (this.options.showFolders && (isContainer || (leafIcon && leafIcon!='none'))) {
+        var img = document.createElement("img");
+        if (!isContainer) {
+          img.src=leafIcon;
+        } else {
+          img.name=nodeId;
+          img.style.cursor='pointer';
+          Rico.eventBind(img, 'click', Rico.eventHandle(this,'clickBranch'));
+          img.src=Rico.imgDir+"folderclosed.gif";
+        }
+        row.insertCell(-1).appendChild(img);
+      }
+    }
+    if (isSelectable && this.options.showCheckBox) {
+      var chkbx=document.createElement("input");
+      chkbx.type="checkbox";
+      chkbx.value=nodeId;
+      row.insertCell(-1).appendChild(chkbx);
+    }
+
+    if (isSelectable && !this.options.showCheckBox) {
+      var span=document.createElement('a');
+      if (typeof isSelectable=='string') {
+        span.href=isSelectable;
+      } else {
+        span.href='javascript:void(0)';
+        Rico.eventBind(span, 'click', this.options.defaultAction);
+      }
+      this.hoverSet.add(span);
+    } else {
+      var span=document.createElement('p');
+    }
+    span.id=this.domID(nodeId,'Desc');
+    span.className='ricoTreeLevel'+level;
+    switch (this.options.nodeIdDisplay) {
+      case 'last': nodeDesc+=' ('+nodeId+')'; break;
+      case 'first': nodeDesc=nodeId+' - '+nodeDesc; break;
+      case 'tooltip': span.title=nodeId; break;
+    }
+       span.appendChild(document.createTextNode(nodeDesc));
+    row.insertCell(-1).appendChild(span);
+
+    var parent=parentChildren || this.treeDiv;
+    parent.appendChild(tab);
+    parent.appendChild(div);
+  },
+
+  nodeClick: function(e) {
+    var node=Rico.eventElement(e);
+    if (this.returnValue) {
+      var t=this.domID('','Desc');
+      this.returnValue(node.id.substr(t.length),node.innerHTML);
+    }
+    this.close();
+  },
+
+  saveSelection: function(e) {
+    if (this.returnValue) {
+      this.returnValue(this.getCheckedItems());
+    }
+    this.close();
+  },
+
+  getCheckedItems: function() {
+    var inp=this.treeDiv.getElementsByTagName('input');
+    var vals=[];
+    for (var i=0; i<inp.length; i++) {
+      if (inp[i].type=='checkbox' && inp[i].checked) {
+        vals.push(inp[i].value);
+      }
+    }
+    return vals;
+  },
+
+  setCheckBoxes: function(val) {
+    var inp=this.treeDiv.getElementsByTagName('input');
+    for (var i=0; i<inp.length; i++) {
+      if (inp[i].type=='checkbox') {
+        inp[i].checked=val;
+      }
+    }
+  },
+
+  clrCheckBoxEvent: function(e) {
+    Rico.eventStop(e);
+    this.setCheckBoxes(false);
+  },
+
+  clickBranch: function(e) {
+    var node=Rico.eventElement(e);
+    var tab=Rico.getParentByTagName(node,'table');
+    if (!tab || !tab.TreeContainer) return;
+    var a=tab.id.split('_');
+    a[1]='Children';
+    var childDiv=Rico.$(a.join('_'));
+    Rico.toggle(childDiv);
+    if (node.tagName=='IMG') {
+      var v=Rico.visible(childDiv);
+      if (node.src.match(/node(p|m)(last)?\.gif$/)) {
+        node.src=node.src.replace(/nodep|nodem/,'node'+(v ? 'm' : 'p'));
+      } else if (node.src.match(/folder(open|closed)\.gif$/)) {
+        node.src=node.src.replace(/folder(open|closed)/,'folder'+(v ? 'open' : 'closed'));
+      } else if (node.src.match(/\b(m|p)\.gif$/)) {
+        node.src=node.src.replace(/(p|m)\.gif/,v ? 'm\.gif' : 'p\.gif');
+      }
+    }
+    if (!tab.TreeFetchedChildren) {
+      tab.TreeFetchedChildren=1;
+      this.loadXMLDoc(node.name);
+    }
+  }
+
+};
+
+Rico.includeLoaded('ricoTree.js');
diff --git a/ricoClient/js/ricoUI.js b/ricoClient/js/ricoUI.js
new file mode 100644 (file)
index 0000000..50416a8
--- /dev/null
@@ -0,0 +1,1388 @@
+/*
+ *  (c) 2005-2009 Richard Cowin (http://openrico.org)
+ *  (c) 2005-2009 Matt Brown (http://dowdybrown.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ *  file except in compliance with the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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.
+ */
+Rico.applyShadow = function(elem,shadowFlag) {
+  if (typeof shadowFlag=='undefined') shadowFlag=true;
+  var tab = document.createElement("table");
+  tab.border=0;
+  tab.cellPadding=0;
+  tab.cellSpacing=0;
+  tab.style.margin='0px';
+  tab.style.width='auto';
+  var tbody=Rico.getTBody(tab);
+  var r=tbody.insertRow(-1);
+  var c0=r.insertCell(-1);
+  c0.style.padding='0px';
+  if (shadowFlag) {
+    if (Rico.isIE && Rico.ieVersion < 7) {
+      tab.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=130)";
+    } else {
+      var c=r.insertCell(-1);
+      c.style.width='8px';
+      c.style.padding='0px';
+      c.style.background="transparent url("+Rico.imgDir+"shadow_r.png) no-repeat 0px 3px";
+      r=tbody.insertRow(-1);
+      c=r.insertCell(-1);
+      c.colSpan=2;
+      c.style.padding='0px';
+      c.innerHTML="<div style='height: 8px; font-size: 1px; position: relative;'><div style='height: 8px; width: 8px; position: absolute; top: 0px; left: 5px; background: transparent url("+Rico.imgDir+"shadow_ll.png) no-repeat top right;'></div><div style='height: 8px; margin: 0px 8px 0px 13px; background: transparent url("+Rico.imgDir+"shadow_l.png) repeat-x;'></div><div style='height: 8px; width: 8px; position: absolute; top: 0px; right: 0px; background: transparent url("+Rico.imgDir+"shadow_lr.png) no-repeat top left;'></div></div>";
+    }
+  }
+  if (elem && elem.parentNode) {
+    elem.parentNode.replaceChild(tab, elem);
+    c0.appendChild(elem);
+  }
+  return tab;
+};
+
+Rico.Popup = function(containerDiv,options) {
+  this.initialize(containerDiv,options);
+};
+
+Rico.Popup.prototype = {
+/**
+ * @class Class to manage pop-up div windows.
+ * @constructs
+ * @param options object may contain any of the following:<dl>
+ *   <dt>hideOnEscape</dt><dd> hide popup when escape key is pressed? default=true</dd>
+ *   <dt>hideOnClick </dt><dd> hide popup when mouse button is clicked? default=true</dd>
+ *   <dt>ignoreClicks</dt><dd> if true, mouse clicks within the popup are not allowed to bubble up to parent elements</dd>
+ *   <dt>position    </dt><dd> defaults to absolute, use "auto" to auto-detect</dd>
+ *   <dt>shadow      </dt><dd> display shadow with popup? default=true</dd>
+ *   <dt>zIndex      </dt><dd> which layer? default=1</dd>
+ *   <dt>canDrag     </dt><dd> boolean value (or function that returns a boolean) indicating if it is ok to drag/reposition popup, default=false</dd>
+ *   <dt>onClose     </dt><dd> function to call when the popup is closed</dd>
+ *</dl>
+ * @param containerDiv if supplied, then setDiv() is called at the end of initialization
+ */
+  initialize: function(containerDiv,options) {
+    this.options = {
+      hideOnEscape  : true,
+      hideOnClick   : true,
+      ignoreClicks  : false,
+      position      : 'absolute',
+      shadow        : true,
+      zIndex        : 2,
+      canDrag       : false,
+      dragElement   : false,
+      closeFunc     : false
+    };
+    if (containerDiv) this.setDiv(containerDiv,options);
+  },
+  
+  createContainer: function(options) {
+    this.setDiv(document.createElement('div'), options);
+    if (options && options.parent) {
+      options.parent.appendChild(this.container);
+    } else {
+      document.getElementsByTagName("body")[0].appendChild(this.container);
+    }
+  },
+
+/**
+ * Apply popup behavior to a div that already exists in the DOM
+ * @param containerDiv div element (or element id) in the DOM. If null, then the div is created automatically.
+ */
+  setDiv: function(containerDiv,options) {
+    Rico.extend(this.options, options || {});
+    this.container=Rico.$(containerDiv);
+    if (this.options.position == 'auto') {
+      this.position=Rico.getStyle(this.container,'position').toLowerCase();
+    } else {
+      this.position=this.container.style.position=this.options.position;
+    }
+    if (this.position != 'absolute') {
+      this.content=this.container;
+      return;
+    }
+    if (this.options.zIndex >= 0) this.container.style.zIndex=this.options.zIndex;
+    this.closeFunc=this.options.closeFunc || Rico.bind(this,'closePopup');
+    //this.container.style.overflow='hidden';
+    this.container.style.top='0px';
+    this.container.style.left='0px';
+    this.container.style.display='none';
+
+    var tab=Rico.applyShadow(null,this.options.shadow);
+    tab.style.position='relative';
+    this.contentCell=tab.rows[0].cells[0];
+
+    if (Rico.isIE && Rico.ieVersion < 7) {
+      // create iframe shim
+      this.ifr = document.createElement('iframe');
+      this.ifr.style.position="absolute";
+      this.ifr.style.top     = '0px';
+      this.ifr.style.left    = '0px';
+      this.ifr.style.width   = '2000px';
+      this.ifr.style.height  = '2000px';
+      this.ifr.style.zIndex  = -1;
+      this.ifr.frameBorder   = 0;
+      this.ifr.src="javascript:false;";
+      this.contentCell.appendChild(this.ifr);
+    }
+    this.content=this.contentCell.appendChild(document.createElement('div'));
+    this.content.className='RicoPopupContent';
+
+    while (this.container.firstChild) {
+      this.content.appendChild(this.container.firstChild);
+    }
+    this.container.appendChild(tab);
+
+    if (this.options.hideOnClick)
+      Rico.eventBind(document,"click", Rico.eventHandle(this,'_docClick'));
+    if (this.options.hideOnEscape)
+      Rico.eventBind(document,"keyup", Rico.eventHandle(this,'_checkKey'));
+    this.dragEnabled=false;
+    this.mousedownHandler = Rico.eventHandle(this,'_startDrag');
+    this.dragHandler = Rico.eventHandle(this,'_drag');
+    this.dropHandler = Rico.eventHandle(this,'_endDrag');
+    if (this.options.canDrag) this.enableDragging();
+    if (this.options.ignoreClicks || this.options.canDrag) this.ignoreClicks();
+  },
+  
+  clearContent: function() {
+    this.content.innerHTML="";
+  },
+  
+  setContent: function(content) {
+    this.content.innerHTML=content;
+  },
+  
+  enableDragging: function() {
+    if (!this.dragEnabled && this.options.dragElement) {
+      Rico.eventBind(this.options.dragElement, "mousedown", this.mousedownHandler);
+      this.dragEnabled=true;
+    }
+    return this.dragEnabled;
+  },
+  
+  disableDragging: function() {
+    if (!this.dragEnabled) return;
+    Rico.eventUnbind(this.options.dragElement, "mousedown", this.mousedownHandler);
+    this.dragEnabled=false;
+  },
+  
+  setZ: function(zIndex) {
+    this.container.style.zIndex=zIndex;
+  },
+
+/** @private */
+  ignoreClicks: function() {
+    Rico.eventBind(this.container,"click", Rico.eventHandle(this,'_ignoreClick'));
+  },
+
+  _ignoreClick: function(e) {
+    if (e.stopPropagation)
+      e.stopPropagation();
+    else
+      e.cancelBubble = true;
+    return true;
+  },
+
+  // event handler to process keyup events (hide menu on escape key)
+  _checkKey: function(e) {
+    if (Rico.eventKey(e)!=27 || !this.visible()) return true;
+    //alert('closing popup: '+this.container.className);
+    Rico.eventStop(e);
+    this.closeFunc();
+    return false;
+  },
+
+  _docClick: function(e) {
+    this.closeFunc();
+    return true;
+  },
+
+/**
+ * Move popup to specified position
+ */
+  move: function(left,top) {
+    if (typeof left=='number') this.container.style.left=left+'px';
+    if (typeof top=='number') this.container.style.top=top+'px';
+  },
+
+  _startDrag : function(event){
+    var elem=Rico.eventElement(event);
+    this.container.style.cursor='move';
+    this.lastMouse = Rico.eventClient(event);
+    Rico.eventBind(document, "mousemove", this.dragHandler);
+    Rico.eventBind(document, "mouseup", this.dropHandler);
+    Rico.eventStop(event);
+  },
+
+  _drag : function(event){
+    var newMouse = Rico.eventClient(event);
+    var newLeft = parseInt(this.container.style.left,10) + newMouse.x - this.lastMouse.x;
+    var newTop = parseInt(this.container.style.top,10) + newMouse.y - this.lastMouse.y;
+    this.move(newLeft, newTop);
+    this.lastMouse = newMouse;
+    Rico.eventStop(event);
+  },
+
+  _endDrag : function(){
+    this.container.style.cursor='';
+    Rico.eventUnbind(document, "mousemove", this.dragHandler);
+    Rico.eventUnbind(document, "mouseup", this.dropHandler);
+  },
+
+/**
+ * Display popup at specified position
+ */
+  openPopup: function(left,top) {
+    this.container.style.display=this.position=='absolute' ? "block" : Rico.isIE && Rico.ieVersion<8 ? "inline" : "inline-block";
+    if (typeof left=='number') this.container.style.left=left+'px';
+    if (typeof top=='number') this.container.style.top=top+'px';
+    if (this.container.id) Rico.log('openPopup '+this.container.id+' at '+left+','+top);
+  },
+
+  centerPopup: function() {
+    this.openPopup();
+    var msgWidth=this.container.offsetWidth;
+    var msgHeight=this.container.offsetHeight;
+    var divwi=this.container.parentNode.offsetWidth;
+    var divht=this.container.parentNode.offsetHeight;
+    this.move(parseInt((divwi-msgWidth)/2,10), parseInt((divht-msgHeight)/2,10));
+  },
+  
+  visible: function() {
+    return Rico.visible(this.container);
+  },
+
+/**
+ * Hide popup
+ */
+  closePopup: function() {
+    if (!Rico.visible(this.container)) return;
+    if (this.container.id) Rico.log('closePopup '+this.container.id);
+    if (this.dragEnabled) this._endDrag();
+    this.container.style.display="none";
+    if (this.options.onClose) this.options.onClose();
+  }
+
+};
+
+Rico.closeButton = function(handle) {
+  var a = document.createElement('a');
+  a.className='RicoCloseAnchor';
+  if (Rico.theme.closeAnchor) Rico.addClass(a,Rico.theme.closeAnchor);
+  var span = a.appendChild(document.createElement('span'));
+  span.title=Rico.getPhraseById('close');
+  new Rico.HoverSet([a]);
+  Rico.addClass(span,Rico.theme.close || 'RicoClose');
+  Rico.eventBind(a,"click", handle);
+  return a;
+};
+
+Rico.floatButton = function(buttonName, handle, title) {
+  var a=document.createElement("a");
+  a.className='RicoButtonAnchor'
+  Rico.addClass(a,Rico.theme.buttonAnchor || 'RicoButtonAnchorNative');
+  var span=a.appendChild(document.createElement("span"));
+  if (title) span.title=title;
+  span.className=Rico.theme[buttonName.toLowerCase()] || 'Rico'+buttonName;
+  Rico.eventBind(a,"click", handle, false);
+  new Rico.HoverSet([a]);
+  return a
+}
+
+Rico.clearButton = function(handle) {
+  var span=document.createElement("span");
+  span.title=Rico.getPhraseById('clear');
+  span.className='ricoClear';
+  Rico.addClass(span, Rico.theme.clear || 'ricoClearNative');
+  span.style.display='inline-block';
+  span.style.cursor='pointer';
+  Rico.eventBind(span,"click", handle);
+  return span;
+}
+
+Rico.Window = function(title, options, contentParam) {
+  this.initialize(title, options, contentParam);
+};
+
+Rico.Window.prototype = {
+
+/**
+ * Create popup div with a title bar.
+ */
+  initialize: function(title, options, contentParam) {
+    options=options || {overflow:'auto'};
+    Rico.extend(this, new Rico.Popup());
+    
+    this.titleDiv = document.createElement('div');
+    this.options.canDrag=true;
+    this.options.dragElement=this.titleDiv;
+    this.options.hideOnClick=false;
+    this.createContainer(options);
+    this.content.appendChild(this.titleDiv);
+    contentParam=Rico.$(contentParam);
+    this.contentDiv=contentParam || document.createElement('div');
+    this.content.appendChild(this.contentDiv);
+
+    // create title area
+    this.titleDiv.className='ricoTitle';
+    if (Rico.theme.dialogTitle) Rico.addClass(this.titleDiv,Rico.theme.dialogTitle);
+    this.titleDiv.style.position='relative';
+    this.titleContent = document.createElement('span');
+    this.titleContent.className='ricoTitleSpan';
+    this.titleDiv.appendChild(this.titleContent);
+    this.titleDiv.appendChild(Rico.closeButton(Rico.eventHandle(this,'closePopup')));
+    if (!title && contentParam) {
+      title=contentParam.title;
+      contentParam.title='';
+    }
+    this.setTitle(title || '&nbsp;');
+    
+    // create content area
+    this.contentDiv.className='ricoContent';
+    if (Rico.theme.dialogContent) Rico.addClass(this.contentDiv,Rico.theme.dialogContent);
+    this.contentDiv.style.position='relative';
+    if (options.height) this.contentDiv.style.height=options.height;
+    if (options.width) this.contentDiv.style.width=options.width;
+    if (options.overflow) this.contentDiv.style.overflow=options.overflow;
+    Rico.addClass(this.content,'ricoWindow');
+    if (Rico.theme.dialog) Rico.addClass(this.content,Rico.theme.dialog);
+    if (Rico.isIE) {
+      // fix float'ed content in IE
+      this.titleDiv.style.zoom=1;
+      this.contentDiv.style.zoom=1;
+    }
+
+    this.content=this.contentDiv;
+  },
+
+  setTitle: function(title) {
+    this.titleContent.innerHTML=title;
+  }
+
+}
+
+
+Rico.Menu = function(options) {
+  this.initialize(options);
+}
+
+Rico.Menu.prototype = {
+/**
+ * @class Implements popup menus and submenus
+ * @extends Rico.Popup
+ * @constructs
+ */
+  initialize: function(options) {
+    Rico.extend(this, new Rico.Popup());
+    Rico.extend(this.options, {
+      width        : "15em",
+      showDisabled : false
+    });
+    if (typeof options=='string')
+      this.options.width=options;
+    else
+      Rico.extend(this.options, options || {});
+    this.hideFunc=null;
+    this.highlightElem=null;
+    new Image().src = Rico.imgDir+'left_b.gif';
+    new Image().src = Rico.imgDir+'right_b.gif';
+  },
+  
+  createDiv: function(parentNode) {
+    if (this.container) return;
+    var options={closeFunc:Rico.bind(this,'cancelmenu')};
+    if (parentNode) options.parent=parentNode;
+    this.createContainer(options);
+    this.content.className = Rico.isWebKit ? 'ricoMenuSafari' : 'ricoMenu';
+    this.content.style.width=this.options.width;
+    this.direction=Rico.getStyle(this.container,'direction') || 'ltr';
+    this.direction=this.direction.toLowerCase();  // ltr or rtl
+    this.hidemenu();
+    this.itemCount=0;
+  },
+  
+  showmenu: function(e,hideFunc){
+    Rico.eventStop(e);
+    this.hideFunc=hideFunc;
+    if (this.content.childNodes.length==0) {
+      this.cancelmenu();
+      return false;
+    }
+    var mousePos = Rico.eventClient(e);
+    this.openmenu(mousePos.x,mousePos.y,0,0);
+  },
+  
+  openmenu: function(x,y,clickItemWi,clickItemHt,noOffset) {
+    var newLeft=x + (noOffset ? 0 : Rico.docScrollLeft());
+    this.container.style.visibility="hidden";
+    this.container.style.display="block";
+    var w=this.container.offsetWidth;
+    var cw=this.contentCell.offsetWidth;
+    //window.status='openmenu: newLeft='+newLeft+' width='+w+' clickItemWi='+clickItemWi+' windowWi='+Rico.windowWidth();
+    if (this.direction == 'rtl') {
+      if (newLeft > w+clickItemWi) newLeft-=cw+clickItemWi;
+    } else {
+      if (x+w > Rico.windowWidth()) newLeft-=cw+clickItemWi-2;
+    }
+    var scrTop=Rico.docScrollTop();
+    var newTop=y + (noOffset ? 0 : scrTop);
+    if (y+this.container.offsetHeight-scrTop > Rico.windowHeight())
+      newTop=Math.max(newTop-this.contentCell.offsetHeight+clickItemHt,0);
+    this.openPopup(newLeft,newTop);
+    this.container.style.visibility ="visible";
+    return false;
+  },
+
+  clearMenu: function() {
+    this.clearContent();
+    this.defaultAction=null;
+    this.itemCount=0;
+  },
+
+  addMenuHeading: function(hdg) {
+    var el=document.createElement('div');
+    el.innerHTML=hdg;
+    el.className='ricoMenuHeading';
+    this.content.appendChild(el);
+  },
+
+  addMenuBreak: function() {
+    var brk=document.createElement('div');
+    brk.className="ricoMenuBreak";
+    this.content.appendChild(brk);
+  },
+
+  addSubMenuItem: function(menutext, submenu, translate) {
+    var dir=this.direction=='rtl' ? 'left' : 'right';
+    var a=this.addMenuItem(menutext,null,true,null,translate);
+    a.className='ricoSubMenu';
+    a.style.backgroundImage='url('+Rico.imgDir+dir+'_b.gif)';
+    a.style.backgroundRepeat='no-repeat';
+    a.style.backgroundPosition=dir;
+    a.RicoSubmenu=submenu;
+    Rico.eventBind(a,"mouseover", Rico.eventHandle(this,'showSubMenu'));
+    Rico.eventBind(a,"mouseout", Rico.eventHandle(this,'subMenuOut'));
+  },
+  
+  showSubMenu: function(e) {
+    if (this.openSubMenu) this.hideSubMenu();
+    var a=Rico.eventElement(e);
+    this.openSubMenu=a.RicoSubmenu;
+    this.openMenuAnchor=a;
+    if (a.className=='ricoSubMenu') a.className='ricoSubMenuOpen';
+    a.RicoSubmenu.openmenu(parseInt(this.container.style.left)+a.offsetWidth, parseInt(this.container.style.top)+a.offsetTop, a.offsetWidth-2, a.offsetHeight+2,true);
+  },
+  
+  subMenuOut: function(e) {
+    if (!this.openSubMenu) return;
+    Rico.eventStop(e);
+    var elem=Rico.eventElement(e);
+    var reltg = Rico.eventRelatedTarget(e) || e.toElement;
+    try {
+      while (reltg != null && reltg != this.openSubMenu.div)
+        reltg=reltg.parentNode;
+    } catch(err) {}
+    if (reltg == this.openSubMenu.div) return;
+    this.hideSubMenu();
+  },
+  
+  hideSubMenu: function() {
+    if (this.openMenuAnchor) {
+      this.openMenuAnchor.className='ricoSubMenu';
+      this.openMenuAnchor=null;
+    }
+    if (this.openSubMenu) {
+      this.openSubMenu.hidemenu();
+      this.openSubMenu=null;
+    }
+  },
+
+  addMenuItemId: function(phraseId,action,enabled,title,target) {
+    if ( arguments.length < 3 ) enabled=true;
+    this.addMenuItem(Rico.getPhraseById(phraseId),action,enabled,title,target);
+  },
+
+// if action is a string, then it is assumed to be a URL and the target parm can be used indicate which window gets the content
+// action can also be a function (optionally wrapped using Rico.bind),
+// action can also be a Rico.eventHandle, but set target='event' in this case
+  addMenuItem: function(menutext,action,enabled,title,target) {
+    if (arguments.length >= 3 && !enabled && !this.options.showDisabled) return null;
+    this.itemCount++;
+    var a = document.createElement(typeof action=='string' ? 'a' : 'div');
+    if ( arguments.length < 3 || enabled ) {
+      if (typeof action=='string') {
+        a.href = action; 
+        if (target) a.target = target; 
+      } else if (target=='event') {
+        Rico.eventBind(a,"click", action);
+      } else {
+        a.onclick=action;
+      }
+      a.className = 'enabled';
+      if (this.defaultAction==null) this.defaultAction=action;
+    } else {
+      a.disabled = true;
+      a.className = 'disabled';
+    }
+    a.innerHTML = menutext;
+    if (typeof title=='string')
+      a.title = title;
+    a=this.content.appendChild(a);
+    Rico.eventBind(a,"mouseover", Rico.eventHandle(this,'mouseOver'));
+    Rico.eventBind(a,"mouseout", Rico.eventHandle(this,'mouseOut'));
+    return a;
+  },
+  
+  mouseOver: function(e) {
+    if (this.highlightElem && this.highlightElem.className=='enabled-hover') {
+      // required for Safari
+      this.highlightElem.className='enabled';
+      this.highlightElem=null;
+    }
+    var elem=Rico.eventElement(e);
+    if (this.openMenuAnchor && this.openMenuAnchor!=elem)
+      this.hideSubMenu();
+    if (elem.className=='enabled') {
+      elem.className='enabled-hover';
+      this.highlightElem=elem;
+    }
+  },
+
+  mouseOut: function(e) {
+    var elem=Rico.eventElement(e);
+    if (elem.className=='enabled-hover') elem.className='enabled';
+    if (this.highlightElem==elem) this.highlightElem=null;
+  },
+
+  cancelmenu: function() {
+    if (!this.visible()) return;
+    if (this.hideFunc) this.hideFunc();
+    this.hideFunc=null;
+    this.hidemenu();
+  },
+
+  hidemenu: function() {
+    if (this.openSubMenu) this.openSubMenu.hidemenu();
+    this.closePopup();
+  }
+
+}
+
+
+Rico.SelectionSet = function(selectionSet, options) {
+  this.initialize(selectionSet, options);
+}
+
+Rico.SelectionSet.prototype = {
+/**
+ * @class
+ * @constructs
+ * @param selectionSet collection of DOM elements (or a CSS selection string)
+ * @param options object may contain any of the following:<dl>
+ *   <dt>selectedClass</dt><dd>class name to add when element is selected, default is "selected"</dd>
+ *   <dt>selectNode   </dt><dd>optional function that returns the element to be selected</dd>
+ *   <dt>onSelect     </dt><dd>optional function that gets called when element is selected</dd>
+ *   <dt>onFirstSelect</dt><dd>optional function that gets called the first time element is selected</dd>
+ *   <dt>noDefault    </dt><dd>when true, no element in the set is initially selected, default is false</dd>
+ *   <dt>selectedIndex</dt><dd>index of the element that should be initially selected, default is 0</dd>
+ *   <dt>cookieName   </dt><dd>optional name of cookie to use to remember selected element. If specified, and the cookie exists, then the cookie value overrides selectedIndex.</dd>
+ *   <dt>cookieDays   </dt><dd>specifies how long cookie should persist (in days). If unspecified, then the cookie persists for the current session.</dd>
+ *   <dt>cookiePath   </dt><dd>optional cookie path</dd>
+ *   <dt>cookieDomain </dt><dd>optional cookie domain</dd>
+ *</dl>
+ */
+  initialize: function(selectionSet, options){
+    Rico.log('SelectionSet#initialize');
+    this.options = options || {};
+    if (typeof selectionSet == 'string')
+      selectionSet = Rico.select(selectionSet);
+    this.previouslySelected = [];
+    this.selectionSet = [];
+    this.selectedClassName = this.options.selectedClass || Rico.theme.selected || "selected";
+    this.selectNode = this.options.selectNode || function(e){return e;};
+    this.onSelect = this.options.onSelect;
+    this.onFirstSelect = this.options.onFirstSelect;
+    this.clickHandler = Rico.bind(this,'selectIndex');
+    this.selectedIndex=-1;
+    for (var i=0; i<selectionSet.length; i++)
+      this.add(selectionSet[i]);
+    if (!this.options.noDefault) {
+      var cookieIndex=this.options.cookieName ? this.getCookie() : 0;
+      this.selectIndex(cookieIndex || this.options.selectedIndex || 0);
+    }
+  },
+  getCookie: function() {
+    var cookie = Rico.getCookie(this.options.cookieName);
+    if (!cookie) return 0;
+    var index = parseInt(cookie);
+    return index < this.selectionSet.length ? index : 0;
+  },
+  reset: function(){
+    this.previouslySelected = [];
+    this._notifySelected(this.selectedIndex);
+  },
+  clearSelected: function() {
+    if (this.selected)
+      Rico.removeClass(this.selectNode(this.selected), this.selectedClassName);
+  },
+  getIndex: function(element) {
+    for (var i=0; i<this.selectionSet.length; i++) {
+      if (element == this.selectionSet[i]) return i;
+    }
+    return -1;
+  },
+  select: function(element){
+    if (this.selected == element) return;
+    var i=this.getIndex(element);
+    if (i >= 0) this.selectIndex(i);
+  },
+  _notifySelected: function(index){
+    if (index < 0) return;
+    var element = this.selectionSet[index];
+    if (this.options.cookieName)
+      Rico.setCookie(this.options.cookieName, index, this.options.cookieDays, this.options.cookiePath, this.options.cookieDomain);
+    if (this.onFirstSelect && !this.previouslySelected[index]){
+      this.onFirstSelect(element, index);
+      this.previouslySelected[index] = true;
+    }
+    if (this.onSelect)
+      try{
+        this.onSelect(index);
+      } catch (e) {};
+  },
+  selectIndex: function(index){
+    if (this.selectedIndex == index || index >= this.selectionSet.length) return;
+    this.clearSelected();
+    this._notifySelected(index);
+    this.selectedIndex = index;
+    this.selected=this.selectionSet[index].element;
+    Rico.addClass(this.selectNode(this.selected), this.selectedClassName);
+  },
+  nextSelectIndex: function(){
+    return (this.selectedIndex + 1) % this.selectionSet.length;
+  },
+  nextSelectItem: function(){
+    return this.selectionSet[this.nextSelectIndex()];
+  },
+  selectNext: function(){
+    this.selectIndex(this.nextSelectIndex());
+  },
+  add: function(item){
+    var index=this.selectionSet.length;
+    this.selectionSet[index] = new Rico._SelectionItem(item,index,this.clickHandler);
+  },
+  remove: function(item){
+    if (item==this.selected) this.clearSelected();
+    var i=this.getIndex(item);
+    if (i < 0) return;
+    this.selectionSet[i].remove();
+    this.selectionSet.splice(i,1);
+  },
+  removeAll: function(){
+    this.clearSelected();
+    while (this.selectionSet.length > 0) {
+      this.selectionSet.pop().remove();
+    }
+  }
+};
+
+
+Rico._SelectionItem=function(element,index,callback) {
+  this.add(element,index,callback);
+};
+
+Rico._SelectionItem.prototype = {
+  add: function(element,index,callback) {
+    this.element=element;
+    this.index=index;
+    this.callback=callback;
+    this.handle=Rico.eventHandle(this,'click');
+    Rico.eventBind(element, "click", this.handle);
+  },
+  
+  click: function(ev) {
+    this.callback(this.index);
+  },
+
+  remove: function() {
+    Rico.eventUnbind(this.element, "click", this.handle);
+  }
+};
+
+Rico.HoverSet = function(hoverSet, options) {
+  this.initialize(hoverSet, options);
+};
+
+Rico.HoverSet.prototype = {
+/**
+ * @class
+ * @constructs
+ * @param hoverSet collection of DOM elements
+ * @param options object may contain any of the following:<dl>
+ *   <dt>hoverClass</dt><dd> class name to add when mouse is over element, default is "hover"</dd>
+ *   <dt>hoverNodes</dt><dd> optional function to select/filter which nodes are in the set</dd>
+ *</dl>
+ */
+  initialize: function(hoverSet, options){
+    Rico.log('HoverSet#initialize');
+    options = options || {};
+    this.hoverClass = options.hoverClass || Rico.theme.hover || "hover";
+    this.hoverFunc = options.hoverNodes || function(e){return [e];};
+    this.hoverSet=[];
+    if (!hoverSet) return;
+    for (var i=0; i<hoverSet.length; i++)
+      this.add(hoverSet[i]);
+  },
+  add: function(item) {
+    this.hoverSet.push(new Rico._HoverItem(item,this.hoverFunc,this.hoverClass));
+  },
+  removeAll: function(){
+    while (this.hoverSet.length > 0) {
+      this.hoverSet.pop().remove();
+    }
+  }
+};
+
+
+Rico._HoverItem=function(element,selectFunc,hoverClass) {
+  this.add(element,selectFunc,hoverClass);
+};
+
+Rico._HoverItem.prototype = {
+  add: function(element,selectFunc,hoverClass) {
+    this.element=element;
+    this.selectFunc=selectFunc;
+    this.hoverClass=hoverClass;
+    this.movehandle=Rico.eventHandle(this,'move');
+    this.outhandle=Rico.eventHandle(this,'mouseout');
+    Rico.eventBind(element, "mousemove", this.movehandle);
+    Rico.eventBind(element, "mouseout", this.outhandle);
+  },
+  
+  move: function(ev) {
+    var elems=this.selectFunc(this.element);
+    for (var i=0; i<elems.length; i++)
+      Rico.addClass(elems[i],this.hoverClass);
+  },
+
+  mouseout: function(ev) {
+    var elems=this.selectFunc(this.element);
+    for (var i=0; i<elems.length; i++)
+      Rico.removeClass(elems[i],this.hoverClass);
+  },
+
+  remove: function() {
+    Rico.eventUnbind(element, "mousemove", this.movehandle);
+    Rico.eventUnbind(element, "mouseout", this.outhandle);
+  }
+};
+
+
+/** @namespace */
+Rico.Effect = {};
+Rico.Effect.easeIn = function(step){
+  return Math.sqrt(step);
+};
+Rico.Effect.easeOut = function(step){
+  return step*step;
+};
+
+
+/** @class core methods for transition effects */
+Rico.ContentTransitionBase = function() {};
+Rico.ContentTransitionBase.prototype = {
+  initBase: function(titles, contents, options) {
+    Rico.log('ContentTransitionBase#initBase');
+    if (typeof titles == 'string')
+      titles = Rico.select(titles);
+    if (typeof contents == 'string')
+      contents = Rico.select(contents);
+
+    this.options = options || {};
+    this.titles = titles;
+    this.contents = contents;
+    this.hoverSet = new Rico.HoverSet(titles, options);
+    for (var i=0; i<contents.length; i++) {
+      if (contents[i]) Rico.hide(contents[i]);
+    }
+    this.selectionSet = new Rico.SelectionSet(titles, Rico.extend(options, {onSelect: Rico.bind(this,'_finishSelect')}));
+  },
+  reset: function(){
+    this.selectionSet.reset();
+  },
+  select: function(index) {
+    this.selectionSet.selectIndex(index);
+  },
+  _finishSelect: function(index) {
+    Rico.log('ContentTransitionBase#_finishSelect');
+    var panel = this.contents[index];
+    if (!panel) {
+      alert('Internal error: no panel @index='+index);
+      return;
+    }
+    if ( this.selected == panel) return;
+    if (this.transition){
+      if (this.selected){
+        this.transition(panel);
+      } else {
+        panel.style.display='block';
+      }
+    } else {
+      if (this.selected) Rico.hide(this.selected);
+      panel.style.display='block';
+    }
+    this.selected = panel;
+  },
+  addBase: function(title, content){
+    this.titles.push(title);
+    this.contents.push(content);
+    this.hoverSet.add(title);
+    this.selectionSet.add(title);
+    Rico.hide(content);
+    //this.selectionSet.select(title);
+  },
+  removeBase: function(title){},
+  removeAll: function(){
+    this.hoverSet.removeAll();
+    this.selectionSet.removeAll();
+  }
+};
+
+
+/**
+ * @class Implements accordion effect
+ * @see Rico.ContentTransitionBase#initialize for construction parameters
+ * @extends Rico.ContentTransitionBase
+ */
+Rico.Accordion = function(element, options) {
+  this.initialize(element, options);
+};
+
+Rico.Accordion.prototype = Rico.extend(new Rico.ContentTransitionBase(), 
+/** @lends Rico.Accordion# */
+{
+  initialize: function(element, options) {
+    element=Rico.$(element);
+    element.style.overflow='hidden';
+    element.className=options.accClass || Rico.theme.accordion || "Rico_accordion";
+    if (typeof options.panelWidth=='number') options.panelWidth+="px";
+    if (options.panelWidth) element.style.width = options.panelWidth;
+    var panels=Rico.getDirectChildrenByTag(element,'div');
+    var items,titles=[], contents=[];
+    for (var i=0; i<panels.length; i++) {
+      items=Rico.getDirectChildrenByTag(panels[i],'div');
+      if (items.length>=2) {
+        items[0].className=options.titleClass || Rico.theme.accTitle || "Rico_accTitle";
+        items[1].className=options.contentClass || Rico.theme.accContent || "Rico_accContent";
+        titles.push(items[0]);
+        contents.push(items[1]);
+        var a=Rico.wrapChildren(items[0],'','','a');
+        a.href="javascript:void(0)";
+      }
+    }
+    Rico.log('creating Rico.Accordion for '+element.id+' with '+titles.length+' panels');
+    this.initBase(titles, contents, options);
+    this.selected.style.height = this.options.panelHeight + "px";
+    this.totSteps=(typeof options.duration =='number' ? options.duration : 200)/25;
+  },
+  transition: function(p){
+    if (!this.options.noAnimate) {
+      this.closing=this.selected;
+      this.opening=p;
+      this.curStep=0;
+      this.timer=setInterval(Rico.bind(this,'step'),25);
+    } else {
+      p.style.height = this.options.panelHeight + "px";
+      if (this.selected) Rico.hide(this.selected);
+      p.style.display='block';
+    }
+  },
+  step: function() {
+    this.curStep++;
+    var oheight=Math.round(this.curStep/this.totSteps*this.options.panelHeight);
+    this.opening.style.height=oheight+'px';
+    this.closing.style.height=(this.options.panelHeight - oheight)+'px';
+    if (this.curStep==1) {
+      this.opening.style.paddingTop=this.opening.style.paddingBottom='0px';
+      this.opening.style.display='block';
+    }
+    if (this.curStep==this.totSteps) {
+      clearInterval(this.timer);
+      this.opening.style.paddingTop=this.opening.style.paddingBottom='';
+      Rico.hide(this.closing);
+    }
+  },
+  setPanelHeight: function(h) {
+    this.options.panelHeight = h;
+    this.selected.style.height = this.options.panelHeight + "px";
+  }
+});
+
+
+/**
+ * @class Implements tabbed panel effect
+ * @see Rico.ContentTransitionBase#initialize for construction parameters
+ * @extends Rico.ContentTransitionBase
+ */
+Rico.TabbedPanel = function(element, options) {
+  this.initialize(element, options);
+};
+
+Rico.TabbedPanel.prototype = Rico.extend(new Rico.ContentTransitionBase(),
+{
+  initialize: function(element, options) {
+    element=Rico.$(element);
+    options=options || {};
+    if (typeof options.panelWidth=='number') options.panelWidth+="px";
+    if (typeof options.panelHeight=='number') options.panelHeight+="px";
+    element.className=options.tabClass || Rico.theme.tabPanel || "Rico_tabPanel";
+    if (options.panelWidth) element.style.width = options.panelWidth;
+    var items = [];
+    var allKids = element.childNodes;
+    for( var i = 0 ; i < allKids.length ; i++ ) {
+      if (allKids[i] && allKids[i].tagName && allKids[i].tagName.match(/^div|ul$/i))
+        items.push(allKids[i]);
+    }
+    if (items.length < 2) return;
+    var childTag=items[0].tagName.toLowerCase()=='ul' ? 'li' : 'div';
+    items[0].className=options.navContainerClass || Rico.theme.tabNavContainer || "Rico_tabNavContainer";
+    items[0].style.listStyle='none';
+    items[1].className=options.contentContainerClass || Rico.theme.tabContentContainer || "Rico_tabContentContainer";
+    var titles=Rico.getDirectChildrenByTag(items[0], childTag);
+    var contents=Rico.getDirectChildrenByTag(items[1],'div');
+    if (!options.corners) options.corners='top';
+    for (var i=0; i<titles.length; i++) {
+      titles[i].className=options.titleClass || Rico.theme.tabTitle || "Rico_tabTitle";
+      var a=Rico.wrapChildren(titles[i],'','','a');
+      a.href="javascript:void(0)";
+      contents[i].className=options.contentClass || Rico.theme.tabContent || "Rico_tabContent";
+      if (options.panelHeight) contents[i].style.overflow='auto';
+      if (options.corners!='none') {
+        if (options.panelHdrWidth) titles[i].style.width=options.panelHdrWidth;
+        Rico.Corner.round(titles[i], Rico.theme.tabCornerOptions || options);
+      }
+    }
+    options.selectedClass=Rico.theme.tabSelected || 'selected';
+    this.initBase(titles, contents, options);
+    if (this.selected) this.transition(this.selected);
+  },
+  transition: function(p){
+    Rico.log('TabbedPanel#transition '+typeof(p));
+    if (this.selected) Rico.hide(this.selected);
+    Rico.show(p);
+    if (this.options.panelHeight) p.style.height = this.options.panelHeight;
+  }
+});
+
+
+/**
+ * @namespace
+ */
+Rico.Corner = {
+
+   round: function(e, options) {
+      e = Rico.$(e);
+      this.options = {
+         corners : "all",
+         bgColor : "fromParent",
+         compact : false,
+         nativeCorners: false  // only use native corners
+      };
+      Rico.extend(this.options, options || {});
+      if (Rico.isGecko)
+        this._roundCornersGecko(e);
+      else if (typeof(Rico.getStyle(e,'-webkit-border-radius'))=='string')
+        this._roundCornersWebKit(e);
+      else if (!this.options.nativeCorners)
+        this._roundCornersImpl(e);
+   },
+
+   _roundCornersImpl: function(e) {
+      var bgColor = this.options.bgColor == "fromParent" ? this._background(e.parentNode) : this.options.bgColor;
+      e.style.position='relative';
+      //this.options.numSlices = this.options.compact ? 2 : 4;
+      if (this._hasString(this.options.corners, "all", "top", "tl")) this._createCorner(e,'top','left',bgColor);
+      if (this._hasString(this.options.corners, "all", "top", "tr")) this._createCorner(e,'top','right',bgColor);
+      if (this._hasString(this.options.corners, "all", "bottom", "bl")) this._createCorner(e,'bottom','left',bgColor);
+      if (this._hasString(this.options.corners, "all", "bottom", "br")) this._createCorner(e,'bottom','right',bgColor);
+   },
+
+   _roundCornersGecko: function(e) {
+      var radius=this.options.compact ? '4px' : '8px';
+      if (this._hasString(this.options.corners, "all"))
+        Rico.setStyle(e, {MozBorderRadius:radius});
+      else {
+        if (this._hasString(this.options.corners, "top", "tl")) Rico.setStyle(e, {MozBorderRadiusTopleft:radius});
+        if (this._hasString(this.options.corners, "top", "tr")) Rico.setStyle(e, {MozBorderRadiusTopright:radius});
+        if (this._hasString(this.options.corners, "bottom", "bl")) Rico.setStyle(e, {MozBorderRadiusBottomleft:radius});
+        if (this._hasString(this.options.corners, "bottom", "br")) Rico.setStyle(e, {MozBorderRadiusBottomright:radius});
+      }
+   },
+
+   _roundCornersWebKit: function(e) {
+      var radius=this.options.compact ? '4px' : '8px';
+      if (this._hasString(this.options.corners, "all"))
+        Rico.setStyle(e, {WebkitBorderRadius:radius});
+      else {
+        if (this._hasString(this.options.corners, "top", "tl")) Rico.setStyle(e, {WebkitBorderTopLeftRadius:radius});
+        if (this._hasString(this.options.corners, "top", "tr")) Rico.setStyle(e, {WebkitBorderTopRightRadius:radius});
+        if (this._hasString(this.options.corners, "bottom", "bl")) Rico.setStyle(e, {WebkitBorderBottomLeftRadius:radius});
+        if (this._hasString(this.options.corners, "bottom", "br")) Rico.setStyle(e, {WebkitBorderBottomRightRadius:radius});
+      }
+   },
+   
+  _createCorner: function(elem,tb,lr,bgColor) {
+    //alert('Corner: '+tb+' '+lr+' bgColor='+typeof(bgColor));
+    var corner = document.createElement("div");
+    corner.className='ricoCorner';
+    Rico.setStyle(corner,{width:'6px', height:'5px'});
+    var borderStyle = Rico.getStyle(elem,'border-'+tb+'-style');
+    var borderColor = borderStyle=='none' ? bgColor : Rico.getStyle(elem,'border-'+tb+'-color');
+    //alert('Corner: '+tb+' '+borderStyle+borderColor+' '+);
+    var pos=borderStyle=='none' ? '0px' : '-1px';
+    corner.style[tb]=pos;
+    corner.style[lr]=Rico.isIE && Rico.ieVersion<7 && lr=='right' && borderStyle!='none' ? '-2px' : '-1px';
+    //corner.style[lr]='-1px';
+    elem.appendChild(corner);
+    var marginSizes = [ 0, 2, 3, 4, 4 ];
+    if (tb=='bottom') marginSizes.reverse();
+    var borderVal= borderStyle=='none' ? '0px none' : '1px solid '+borderColor;
+    var d= lr=='left' ? 'Right' : 'Left';
+    for (var i=0; i<marginSizes.length; i++) {
+      var slice = document.createElement("div");
+      Rico.setStyle(slice,{backgroundColor:bgColor,height:'1px'});
+      slice.style['margin'+d]=marginSizes[i]+'px';
+      slice.style['border'+d]=borderVal;
+      corner.appendChild(slice);
+    }
+  },
+
+  _background: function(elem) {
+     try {
+       var actualColor = Rico.getStyle(elem, "backgroundColor");
+
+       // if color is tranparent, check parent
+       // Safari returns "rgba(0, 0, 0, 0)", which means transparent
+       if ( actualColor.match(/^(transparent|rgba\(0,\s*0,\s*0,\s*0\))$/i) && elem.parentNode )
+          return this._background(elem.parentNode);
+
+       return actualColor == null ? "#ffffff" : actualColor;
+     } catch(err) {
+       return "#ffffff";
+     }
+   },
+
+   _hasString: function(str) {
+     for(var i=1 ; i<arguments.length ; i++) {
+       if (str.indexOf(arguments[i]) >= 0) return true;
+     }
+     return false;
+   }
+
+};
+
+Rico.toColorPart = function(c) {
+  return Rico.zFill(c, 2, 16);
+};
+
+
+Rico.Color = function(red, green, blue) {
+  this.initialize(red, green, blue);
+};
+
+Rico.Color.prototype = {
+/**
+ * @class Methods to manipulate color values.
+ * @constructs
+ * @param red integer (0-255)
+ * @param green integer (0-255)
+ * @param blue integer (0-255)
+ */
+   initialize: function(red, green, blue) {
+      this.rgb = { r: red, g : green, b : blue };
+   },
+
+   setRed: function(r) {
+      this.rgb.r = r;
+   },
+
+   setGreen: function(g) {
+      this.rgb.g = g;
+   },
+
+   setBlue: function(b) {
+      this.rgb.b = b;
+   },
+
+   setHue: function(h) {
+
+      // get an HSB model, and set the new hue...
+      var hsb = this.asHSB();
+      hsb.h = h;
+
+      // convert back to RGB...
+      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
+   },
+
+   setSaturation: function(s) {
+      // get an HSB model, and set the new hue...
+      var hsb = this.asHSB();
+      hsb.s = s;
+
+      // convert back to RGB and set values...
+      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
+   },
+
+   setBrightness: function(b) {
+      // get an HSB model, and set the new hue...
+      var hsb = this.asHSB();
+      hsb.b = b;
+
+      // convert back to RGB and set values...
+      this.rgb = Rico.Color.HSBtoRGB( hsb.h, hsb.s, hsb.b );
+   },
+
+   darken: function(percent) {
+      var hsb  = this.asHSB();
+      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.max(hsb.b - percent,0));
+   },
+
+   brighten: function(percent) {
+      var hsb  = this.asHSB();
+      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.min(hsb.b + percent,1));
+   },
+
+   blend: function(other) {
+      this.rgb.r = Math.floor((this.rgb.r + other.rgb.r)/2);
+      this.rgb.g = Math.floor((this.rgb.g + other.rgb.g)/2);
+      this.rgb.b = Math.floor((this.rgb.b + other.rgb.b)/2);
+   },
+
+   isBright: function() {
+      var hsb = this.asHSB();
+      return this.asHSB().b > 0.5;
+   },
+
+   isDark: function() {
+      return ! this.isBright();
+   },
+
+   asRGB: function() {
+      return "rgb(" + this.rgb.r + "," + this.rgb.g + "," + this.rgb.b + ")";
+   },
+
+   asHex: function() {
+      return "#" + Rico.toColorPart(this.rgb.r) + Rico.toColorPart(this.rgb.g) + Rico.toColorPart(this.rgb.b);
+   },
+
+   asHSB: function() {
+      return Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b);
+   },
+
+   toString: function() {
+      return this.asHex();
+   }
+
+};
+
+/**
+ * Factory method for creating a color from an RGB string
+ * @param hexCode a 3 or 6 digit hex string, optionally preceded by a # symbol
+ * @returns a Rico.Color object
+ */
+Rico.Color.createFromHex = function(hexCode) {
+  if(hexCode.length==4) {
+    var shortHexCode = hexCode;
+    hexCode = '#';
+    for(var i=1;i<4;i++)
+      hexCode += (shortHexCode.charAt(i) + shortHexCode.charAt(i));
+  }
+  if ( hexCode.indexOf('#') == 0 )
+    hexCode = hexCode.substring(1);
+  if (!hexCode.match(/^[0-9A-Fa-f]{6}$/)) return null;
+  var red   = hexCode.substring(0,2);
+  var green = hexCode.substring(2,4);
+  var blue  = hexCode.substring(4,6);
+  return new Rico.Color( parseInt(red,16), parseInt(green,16), parseInt(blue,16) );
+};
+
+/**
+ * Retrieves the background color of an HTML element
+ * @param elem the DOM element whose background color should be retreived
+ * @returns a Rico.Color object
+ */
+Rico.Color.createColorFromBackground = function(elem) {
+
+   if (!elem.style) return new Rico.Color(255,255,255);
+   var actualColor = Rico.getStyle(elem, "background-color");
+
+   // if color is tranparent, check parent
+   // Safari returns "rgba(0, 0, 0, 0)", which means transparent
+   if ( actualColor.match(/^(transparent|rgba\(0,\s*0,\s*0,\s*0\))$/i) && elem.parentNode )
+      return Rico.Color.createColorFromBackground(elem.parentNode);
+
+   if (actualColor == null) return new Rico.Color(255,255,255);
+
+   if ( actualColor.indexOf("rgb(") == 0 ) {
+      var colors = actualColor.substring(4, actualColor.length - 1 );
+      var colorArray = colors.split(",");
+      return new Rico.Color( parseInt( colorArray[0],10 ),
+                             parseInt( colorArray[1],10 ),
+                             parseInt( colorArray[2],10 )  );
+
+   }
+   else if ( actualColor.indexOf("#") == 0 ) {
+      return Rico.Color.createFromHex(actualColor);
+   }
+   else
+      return new Rico.Color(255,255,255);
+};
+
+/**
+ * Converts hue/saturation/brightness to RGB
+ * @returns a 3-element object: r=red, g=green, b=blue.
+ */
+Rico.Color.HSBtoRGB = function(hue, saturation, brightness) {
+
+  var red   = 0;
+  var green = 0;
+  var blue  = 0;
+
+  if (saturation == 0) {
+     red = parseInt(brightness * 255.0 + 0.5,10);
+     green = red;
+     blue = red;
+  }
+  else {
+      var h = (hue - Math.floor(hue)) * 6.0;
+      var f = h - Math.floor(h);
+      var p = brightness * (1.0 - saturation);
+      var q = brightness * (1.0 - saturation * f);
+      var t = brightness * (1.0 - (saturation * (1.0 - f)));
+
+      switch (parseInt(h,10)) {
+         case 0:
+            red   = (brightness * 255.0 + 0.5);
+            green = (t * 255.0 + 0.5);
+            blue  = (p * 255.0 + 0.5);
+            break;
+         case 1:
+            red   = (q * 255.0 + 0.5);
+            green = (brightness * 255.0 + 0.5);
+            blue  = (p * 255.0 + 0.5);
+            break;
+         case 2:
+            red   = (p * 255.0 + 0.5);
+            green = (brightness * 255.0 + 0.5);
+            blue  = (t * 255.0 + 0.5);
+            break;
+         case 3:
+            red   = (p * 255.0 + 0.5);
+            green = (q * 255.0 + 0.5);
+            blue  = (brightness * 255.0 + 0.5);
+            break;
+         case 4:
+            red   = (t * 255.0 + 0.5);
+            green = (p * 255.0 + 0.5);
+            blue  = (brightness * 255.0 + 0.5);
+            break;
+          case 5:
+            red   = (brightness * 255.0 + 0.5);
+            green = (p * 255.0 + 0.5);
+            blue  = (q * 255.0 + 0.5);
+            break;
+      }
+  }
+
+   return { r : parseInt(red,10), g : parseInt(green,10) , b : parseInt(blue,10) };
+};
+
+/**
+ * Converts RGB value to hue/saturation/brightness
+ * @param r integer (0-255)
+ * @param g integer (0-255)
+ * @param b integer (0-255)
+ * @returns a 3-element object: h=hue, s=saturation, b=brightness.
+ * (unlike some HSB documentation which states hue should be a value 0-360, this routine returns hue values from 0 to 1.0)
+ */
+Rico.Color.RGBtoHSB = function(r, g, b) {
+
+   var hue;
+   var saturation;
+   var brightness;
+
+   var cmax = (r > g) ? r : g;
+   if (b > cmax)
+      cmax = b;
+
+   var cmin = (r < g) ? r : g;
+   if (b < cmin)
+      cmin = b;
+
+   brightness = cmax / 255.0;
+   if (cmax != 0)
+      saturation = (cmax - cmin)/cmax;
+   else
+      saturation = 0;
+
+   if (saturation == 0)
+      hue = 0;
+   else {
+      var redc   = (cmax - r)/(cmax - cmin);
+      var greenc = (cmax - g)/(cmax - cmin);
+      var bluec  = (cmax - b)/(cmax - cmin);
+
+      if (r == cmax)
+         hue = bluec - greenc;
+      else if (g == cmax)
+         hue = 2.0 + redc - bluec;
+      else
+         hue = 4.0 + greenc - redc;
+
+      hue = hue / 6.0;
+      if (hue < 0)
+         hue = hue + 1.0;
+   }
+
+   return { h : hue, s : saturation, b : brightness };
+};
+
+/**
+ * Returns a new XML document object
+ */
+Rico.createXmlDocument = function() {
+  if (document.implementation && document.implementation.createDocument) {
+    var doc = document.implementation.createDocument("", "", null);
+    // some older versions of Moz did not support the readyState property
+    // and the onreadystate event so we patch it! 
+    if (doc.readyState == null) {
+      doc.readyState = 1;
+      doc.addEventListener("load", function () {
+        doc.readyState = 4;
+        if (typeof doc.onreadystatechange == "function") {
+          doc.onreadystatechange();
+        }
+      }, false);
+    }
+    return doc;
+  }
+
+  if (window.ActiveXObject)
+      return Rico.tryFunctions(
+        function() { return new ActiveXObject('MSXML2.DomDocument');   },
+        function() { return new ActiveXObject('Microsoft.DomDocument');},
+        function() { return new ActiveXObject('MSXML.DomDocument');    },
+        function() { return new ActiveXObject('MSXML3.DomDocument');   }
+      ) || false;
+  return null;
+}
+
+Rico.includeLoaded('ricoUI.js');
diff --git a/ricoClient/js/translations/ricoLocale_de.js b/ricoClient/js/translations/ricoLocale_de.js
new file mode 100644 (file)
index 0000000..bc526fe
--- /dev/null
@@ -0,0 +1,123 @@
+/*****************************************************************
+ ricoLocale_de.js - a component of Rico 2.0
+ Localization strings for German
+ Initial translator: rainer@langheiter@.com
+ May 08: minor changes by klaus
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='de';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"Zeige Einträge $1 - $2 von $3");
+Rico.addPhraseId('bookmarkAbout',"Zeige Einträge $1 - $2 von ungefähr $3");
+Rico.addPhraseId('bookmarkNoRec',"Keine Einträge");
+Rico.addPhraseId('bookmarkNoMatch',"Keine übereinstimmenden Einträge");
+Rico.addPhraseId('bookmarkLoading',"Lade...");
+Rico.addPhraseId('sorting',"Daten werden sortiert ...");
+Rico.addPhraseId('exportStatus',"Exportieren der Reihe $1");
+Rico.addPhraseId('filterAll',"(alle)");
+Rico.addPhraseId('filterBlank',"(freier Raum)");
+Rico.addPhraseId('filterEmpty',"(leer)");
+Rico.addPhraseId('filterNotEmpty',"(nicht leer)");
+Rico.addPhraseId('filterLike',"wie: $1");
+Rico.addPhraseId('filterNot',"nicht: $1");
+Rico.addPhraseId('requestError',"Die Anfrage ergab einen Fehler:\n$1");
+Rico.addPhraseId('keywordPrompt',"Schlüsselwort eintragen, nach dem gesucht werden soll (verwende * als Wildcard):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"Sortiert nach: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Aufsteigend");
+Rico.addPhraseId('gridmenuSortDesc',"Absteigend");
+Rico.addPhraseId('gridmenuFilterBy',"Gefiltert nach: $1");
+Rico.addPhraseId('gridmenuRefresh',"erneuern Sie");
+Rico.addPhraseId('gridmenuChgKeyword',"Schlüsselwort ändern...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Diesen Wert ebenfalls ausschließen");
+Rico.addPhraseId('gridmenuInclude',"Nur diesen Wert einbeziehen");
+Rico.addPhraseId('gridmenuGreaterThan',"Größer oder gleich diesem Wert");
+Rico.addPhraseId('gridmenuLessThan',"Kleiner oder gleich diesem wert");
+Rico.addPhraseId('gridmenuContains',"Enthält Schlüsselwort...");
+Rico.addPhraseId('gridmenuExclude',"Diesen Wert ausschließen");
+Rico.addPhraseId('gridmenuRemoveFilter',"Entferne Filter");
+Rico.addPhraseId('gridmenuRemoveAll',"Entfernen Sie alle Filter");
+
+Rico.addPhraseId('gridmenuExport',"Druck/Exportiert");
+Rico.addPhraseId('gridmenuExportVis2Web',"Sichtbare Zeilen auf eine Webseite");
+Rico.addPhraseId('gridmenuExportAll2Web',"Alle Zeilen auf eine Webseite");
+Rico.addPhraseId('gridmenuExportVis2SS',"Sichtbare Zeilen in einen Verteilungsbogen");
+Rico.addPhraseId('gridmenuExportAll2SS',"Alle Zeilen in einen Verteilungsbogen");
+
+Rico.addPhraseId('gridmenuHideShow',"Verbergen/Zeigen");
+Rico.addPhraseId('gridmenuChooseCols',"Wählen Sie die Spalten...");
+Rico.addPhraseId('gridmenuHide',"Verbergen: $1");
+Rico.addPhraseId('gridmenuShow',"Zeige: $1");
+Rico.addPhraseId('gridmenuShowAll',"Alle zeigen");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"Minuten bis zum Ablauf Ihrer Sitzung.");
+Rico.addPhraseId('sessionExpired',"ABGELAUFEN");
+Rico.addPhraseId('requestTimedOut',"Zeitüberschreitung");
+Rico.addPhraseId('waitForData',"Warte auf Daten ...");
+Rico.addPhraseId('httpError',"Die Anfrage ergab einen Fehler HTTP: $1");
+Rico.addPhraseId('invalidResponse',"Der Server brachte eine unzulässige Antwort zurück");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"Wählen Sie die Spalten");
+Rico.addPhraseId('exportComplete',"der Export ist komplett");
+Rico.addPhraseId('exportInProgress',"der Export läuft ...");
+Rico.addPhraseId('showFilterRow',"Filter-Reihe zeigen");
+Rico.addPhraseId('hideFilterRow',"Filter-Reile verbergen");
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(keine)");
+Rico.addPhraseId('selectNewVal',"(neuer Wert)");
+Rico.addPhraseId('record',"die Eintragung");
+Rico.addPhraseId('thisRecord',"diesen Eintrag");
+Rico.addPhraseId('confirmDelete',"Möchten Sie dies wirklich löschen $1?");
+Rico.addPhraseId('deleting',"Löschen läuft ...");
+Rico.addPhraseId('formPleaseEnter',"Geben Sie bitte einen Wert ein für $1");
+Rico.addPhraseId('formInvalidFmt',"unzulässiges Format bei $1");
+Rico.addPhraseId('formOutOfRange',"Ungültiger (zu großer) Wert bei $1");
+Rico.addPhraseId('formNewValue',"neuer Wert:");
+Rico.addPhraseId('saving',"sichere ...");
+Rico.addPhraseId('clear',"Löschtaste");
+Rico.addPhraseId('close',"Schließen");
+Rico.addPhraseId('saveRecord',"Speichere");
+Rico.addPhraseId('cancel',"Abbrechen");
+Rico.addPhraseId('editRecord',"Bearbeite Sie diesen Eintrag");
+Rico.addPhraseId('deleteRecord',"Löschen Sie diesen Eintrag");
+Rico.addPhraseId('cloneRecord',"Kopieren Sie diesen Eintrag");
+Rico.addPhraseId('addRecord',"Erstellen Sie einen neuen Eintrag");
+Rico.addPhraseId('addedSuccessfully',"$1 wurde erfolgreich addiert");
+Rico.addPhraseId('deletedSuccessfully',"$1 wurde erfolgreich gelöscht");
+Rico.addPhraseId('updatedSuccessfully',"$1 wurde erfolgreich aktualisiert");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"Auswahl speichern");
+Rico.addPhraseId('treeClear',"Alles löschen");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"Heute ist der $1 $2 $3");
+Rico.addPhraseId('calWeekHdg',"Woche");
+Rico.addPhraseId('calYearRange',"Jahr ($1-$2)");
+Rico.addPhraseId('calInvalidYear',"unzulässiges Jahr");
+
+// Date & number formats
+
+Rico.monthNames=["Januar", "Februar", "März", "April", "Mai","Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
+Rico.dayNames=["Sonntag", "Montag","Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
+Rico.monthNamesShort=['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'];
+Rico.dayNamesShort=['So','Mo','Di','Mi','Do','Fr','Sa'];
+
+Rico.thouSep="."
+Rico.decPoint=","
+Rico.dateFmt="dd.mm.yyyy"
+
+Rico.includeLoaded('ricoLocale_de.js');
diff --git a/ricoClient/js/translations/ricoLocale_en.js b/ricoClient/js/translations/ricoLocale_en.js
new file mode 100644 (file)
index 0000000..c1cf502
--- /dev/null
@@ -0,0 +1,120 @@
+/*****************************************************************
+ ricoLocale_en.js - a component of Rico 3.0
+ English localization strings
+ If you would like to include translations for another language, 
+ please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='en';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"Listing records $1 - $2 of $3");
+Rico.addPhraseId('bookmarkAbout',"Listing records $1 - $2 of more than $3");
+Rico.addPhraseId('bookmarkNoRec',"No records");
+Rico.addPhraseId('bookmarkNoMatch',"No matching records");
+Rico.addPhraseId('bookmarkLoading',"Loading...");
+Rico.addPhraseId('sorting',"Sorting...");
+Rico.addPhraseId('exportStatus',"Exporting row $1");
+Rico.addPhraseId('filterAll',"(all)");
+Rico.addPhraseId('filterBlank',"(blank)");
+Rico.addPhraseId('filterEmpty',"(empty)");
+Rico.addPhraseId('filterNotEmpty',"(not empty)");
+Rico.addPhraseId('filterLike',"contains: $1");
+Rico.addPhraseId('filterNot',"not: $1");
+Rico.addPhraseId('requestError',"The request for data returned an error:\n$1");
+Rico.addPhraseId('keywordPrompt',"Enter keyword to search for (use * as a wildcard):");
+Rico.addPhraseId('keywordTitle',"Keyword Search");
+Rico.addPhraseId('ok',"OK");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"Sort by: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Ascending");
+Rico.addPhraseId('gridmenuSortDesc',"Descending");
+Rico.addPhraseId('gridmenuFilterBy',"Filter by: $1");
+Rico.addPhraseId('gridmenuRefresh',"Refresh");
+Rico.addPhraseId('gridmenuChgKeyword',"Change keyword...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Exclude this value also");
+Rico.addPhraseId('gridmenuInclude',"Include only this value");
+Rico.addPhraseId('gridmenuGreaterThan',"Greater than or equal to this value");
+Rico.addPhraseId('gridmenuLessThan',"Less than or equal to this value");
+Rico.addPhraseId('gridmenuContains',"Contains keyword...");
+Rico.addPhraseId('gridmenuExclude',"Exclude this value");
+Rico.addPhraseId('gridmenuRemoveFilter',"Remove filter");
+Rico.addPhraseId('gridmenuRemoveAll',"Remove all filters");
+
+Rico.addPhraseId('gridmenuExport',"Print/Export");
+Rico.addPhraseId('gridmenuExportVis2Web',"Visible rows to web page");
+Rico.addPhraseId('gridmenuExportAll2Web',"All rows to web page");
+Rico.addPhraseId('gridmenuExportVis2SS',"Visible rows to spreadsheet");
+Rico.addPhraseId('gridmenuExportAll2SS',"All rows to spreadsheet");
+
+Rico.addPhraseId('gridmenuHideShow',"Hide/Show");
+Rico.addPhraseId('gridmenuChooseCols',"Choose columns...");
+Rico.addPhraseId('gridmenuHide',"Hide: $1");
+Rico.addPhraseId('gridmenuShow',"Show: $1");
+Rico.addPhraseId('gridmenuShowAll',"Show All");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"minutes before your session expires");
+Rico.addPhraseId('sessionExpired',"EXPIRED");
+Rico.addPhraseId('requestTimedOut',"Request for data timed out!");
+Rico.addPhraseId('waitForData',"Waiting for data...");
+Rico.addPhraseId('httpError',"Received HTTP error: $1");
+Rico.addPhraseId('invalidResponse',"Server returned an invalid response");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"Choose columns");
+Rico.addPhraseId('exportComplete',"Exporting complete");
+Rico.addPhraseId('exportInProgress',"Export in progress...");
+Rico.addPhraseId('disableBlocker',"You need to disable your browser's pop-up blocker before exporting.");
+Rico.addPhraseId('showFilterRow',"Show filter row");  // img alt text
+Rico.addPhraseId('hideFilterRow',"Hide filter row");  // img alt text
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(none)");
+Rico.addPhraseId('selectNewVal',"(new value)");
+Rico.addPhraseId('record',"record");
+Rico.addPhraseId('thisRecord',"this $1");
+Rico.addPhraseId('confirmDelete',"Are you sure you want to delete $1?");
+Rico.addPhraseId('deleting',"Deleting...");
+Rico.addPhraseId('formPleaseEnter',"Please enter a value for $1");
+Rico.addPhraseId('formInvalidFmt',"Invalid format for $1");
+Rico.addPhraseId('formOutOfRange',"Value is out of range for $1");
+Rico.addPhraseId('formNewValue',"new value:");
+Rico.addPhraseId('saving',"Saving...");
+Rico.addPhraseId('clear',"clear");
+Rico.addPhraseId('close',"Close");
+Rico.addPhraseId('saveRecord',"Save $1");
+Rico.addPhraseId('cancel',"Cancel");
+Rico.addPhraseId('editRecord',"Edit $1");
+Rico.addPhraseId('deleteRecord',"Delete this $1");
+Rico.addPhraseId('cloneRecord',"Clone $1");
+Rico.addPhraseId('addRecord',"Add new $1");
+Rico.addPhraseId('addedSuccessfully',"$1 added successfully");
+Rico.addPhraseId('deletedSuccessfully',"$1 deleted successfully");
+Rico.addPhraseId('updatedSuccessfully',"$1 updated successfully");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"Save Selection");
+Rico.addPhraseId('treeClear',"Clear All");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"Today is $1 $2 $3");  // $1=day, $2=monthabbr, $3=year, $4=month number
+Rico.addPhraseId('calWeekHdg',"Wk");
+Rico.addPhraseId('calYearRange',"Year ($1-$2)");
+Rico.addPhraseId('calInvalidYear',"Invalid year");
+\r
+// Date & number formats\r
+\r
+Rico.thouSep=","\r
+Rico.decPoint="."\r
+Rico.dateFmt="mm/dd/yyyy"\r
+\r
+Rico.monthNames=['January','February','March','April','May','June','July','August','September','October','November','December']\r
+Rico.dayNames=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']\r
diff --git a/ricoClient/js/translations/ricoLocale_es.js b/ricoClient/js/translations/ricoLocale_es.js
new file mode 100644 (file)
index 0000000..d717c79
--- /dev/null
@@ -0,0 +1,118 @@
+/*****************************************************************
+ ricoLocale_es.js - a component of Rico 2.0
+ Localization strings for Spanish
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='es';\r
+\r
+// used in ricoLiveGrid.js\r
+\r
+Rico.addPhraseId('bookmarkExact',"Mostrando datos $1 - $2 de $3");\r
+Rico.addPhraseId('bookmarkAbout',"Mostrando datos $1 - $2 de alrededor de $3");
+Rico.addPhraseId('bookmarkNoRec',"No hay datos");\r
+Rico.addPhraseId('bookmarkNoMatch',"No hay datos coincidentes");
+Rico.addPhraseId('bookmarkLoading',"Cargando...");\r
+Rico.addPhraseId('sorting',"La ordenación está en marcha...");\r
+Rico.addPhraseId('exportStatus',"Exportación de la fila $1");\r
+Rico.addPhraseId('filterAll',"(todo)");\r
+Rico.addPhraseId('filterBlank',"(espacio en blanco)");\r
+Rico.addPhraseId('filterEmpty',"(vacío)");\r
+Rico.addPhraseId('filterNotEmpty',"(no vacío)");
+Rico.addPhraseId('filterLike',"similar a: $1");
+Rico.addPhraseId('filterNot',"no: $1");\r
+Rico.addPhraseId('requestError',"Un error ocurrió mientras recibiendo datos:\n$1");\r
+Rico.addPhraseId('keywordPrompt',"Introduzca texto a buscar (use * como un comodín):");
+\r
+// used in ricoLiveGridMenu.js\r
+\r
+Rico.addPhraseId('gridmenuSortBy',"Ordenar por: $1");\r
+Rico.addPhraseId('gridmenuSortAsc',"Ascendente");
+Rico.addPhraseId('gridmenuSortDesc',"Descendente");\r
+Rico.addPhraseId('gridmenuFilterBy',"Filtrar por: $1");\r
+Rico.addPhraseId('gridmenuRefresh',"Actualizar");\r
+Rico.addPhraseId('gridmenuChgKeyword',"Cambiar texto...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Excluir este valor también");\r
+Rico.addPhraseId('gridmenuInclude',"Incluir solo este valor");
+Rico.addPhraseId('gridmenuGreaterThan',"Mayor o igual a este valor");
+Rico.addPhraseId('gridmenuLessThan',"Menor o igual a este valor");
+Rico.addPhraseId('gridmenuContains',"Contiene el texto...");
+Rico.addPhraseId('gridmenuExclude',"Excluir este valor");\r
+Rico.addPhraseId('gridmenuRemoveFilter',"Quitar filtro");\r
+Rico.addPhraseId('gridmenuRemoveAll',"Quitar todos los filtros");
+Rico.addPhraseId('gridmenuExport',"Imprimir/Exportar");\r
+Rico.addPhraseId('gridmenuExportVis2Web',"Filas visibles a una página web");\r
+Rico.addPhraseId('gridmenuExportAll2Web',"Todas las filas a una página web");
+Rico.addPhraseId('gridmenuExportVis2SS',"Filas visibles a una hoja de cálculo");
+Rico.addPhraseId('gridmenuExportAll2SS',"Todas las filas a una hoja de cálculo");
+Rico.addPhraseId('gridmenuHideShow',"Ocultar/Mostrar");
+Rico.addPhraseId('gridmenuChooseCols',"Elija las columnas...");
+Rico.addPhraseId('gridmenuHide',"Ocultar: $1");
+Rico.addPhraseId('gridmenuShow',"Mostrar: $1");
+Rico.addPhraseId('gridmenuShowAll',"Mostrar todo");
+\r
+// used in ricoLiveGridAjax.js\r
+\r
+Rico.addPhraseId('sessionExpireMinutes',"minutos antes de que su sesión se acabe");
+Rico.addPhraseId('sessionExpired',"EXPIRADO");
+Rico.addPhraseId('requestTimedOut',"Tiempo excedido en recibir datos");\r
+Rico.addPhraseId('waitForData',"Esperando datos...");\r
+Rico.addPhraseId('httpError',"Un error HTTP ocurrió mientras recibiendo datos: $1");\r
+Rico.addPhraseId('invalidResponse',"El servidor devolvió una respuesta inválida");\r
+\r
+// used in ricoLiveGridCommon.js\r
+\r
+Rico.addPhraseId('gridChooseCols',"Elija las columnas");
+Rico.addPhraseId('exportComplete',"La exportación está completa");
+Rico.addPhraseId('exportInProgress',"La exportación está en marcha...");\r
+Rico.addPhraseId('showFilterRow',"Mostrar la fila del filtro");
+Rico.addPhraseId('hideFilterRow',"Ocultar la fila del filtro");
+\r
+// used in ricoLiveGridForms.js\r
+\r
+Rico.addPhraseId('selectNone',"(nada)");\r
+Rico.addPhraseId('selectNewVal',"(nuevo valor)");\r
+Rico.addPhraseId('record',"el expediente");\r
+Rico.addPhraseId('thisRecord',"este expediente");\r
+Rico.addPhraseId('confirmDelete',"¿Está seguro de que quiere borrar $1?");\r
+Rico.addPhraseId('deleting',"Canceladura en marcha...");\r
+Rico.addPhraseId('formPleaseEnter',"Introduzca un valor para $1");\r
+Rico.addPhraseId('formInvalidFmt',"Formato inválido en $1");\r
+Rico.addPhraseId('formOutOfRange',"Valor fuera de la gama en $1");\r
+Rico.addPhraseId('formNewValue',"nuevo valor:");\r
+Rico.addPhraseId('saving',"Actualización en marcha...");\r
+Rico.addPhraseId('clear',"quitar");\r
+Rico.addPhraseId('close',"Cerrar");\r
+Rico.addPhraseId('saveRecord',"Guardar");\r
+Rico.addPhraseId('cancel',"Cancelar");\r
+Rico.addPhraseId('editRecord',"Editar este expediente");\r
+Rico.addPhraseId('deleteRecord',"Borrar este expediente");\r
+Rico.addPhraseId('cloneRecord',"Copiar este expediente");\r
+Rico.addPhraseId('addRecord',"Añadir expediente nuevo");\r
+Rico.addPhraseId('addedSuccessfully',"$1 fue agregado con éxito");\r
+Rico.addPhraseId('deletedSuccessfully',"$1 fue suprimido con éxito");\r
+Rico.addPhraseId('updatedSuccessfully',"$1 fue puesto al día con éxito");\r
+\r
+// used in ricoTree.js\r
+\r
+Rico.addPhraseId('treeSave',"Guardar la selección");\r
+Rico.addPhraseId('treeClear',"Quitar todo");\r
+\r
+// used in ricoCalendar.js\r
+\r
+Rico.addPhraseId('calToday',"Hoy es $1 $2 $3");\r
+Rico.addPhraseId('calWeekHdg',"Sem");\r
+Rico.addPhraseId('calYearRange',"Año ($1-$2)");\r
+Rico.addPhraseId('calInvalidYear',"Año inválido");\r
+
+// Date & number formats\r
+
+Rico.thouSep=","\r
+Rico.decPoint="."\r
+Rico.dateFmt="dd/mm/yyyy"\r
+\r
+Rico.monthNames=['Enero','Febrero', 'Marzo', 'Abril', 'Mayo','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'];\r
+Rico.dayNames=['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'];
+Rico.monthNamesShort=['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+Rico.dayNamesShort=['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'];
+\r
diff --git a/ricoClient/js/translations/ricoLocale_fr.js b/ricoClient/js/translations/ricoLocale_fr.js
new file mode 100644 (file)
index 0000000..1440e5e
--- /dev/null
@@ -0,0 +1,120 @@
+/*****************************************************************
+ ricoLocale_fr.js - a component of Rico 2.0
+ Localization strings for French
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='fr';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"Résultats $1 - $2 de $3");
+Rico.addPhraseId('bookmarkAbout',"Résultats $1 - $2 sur un total d'environ $3");
+Rico.addPhraseId('bookmarkNoRec',"Aucun article");
+Rico.addPhraseId('bookmarkNoMatch',"Aucun article ne correspond");
+Rico.addPhraseId('bookmarkLoading',"Chargement...");
+Rico.addPhraseId('sorting',"Classement...");
+Rico.addPhraseId('exportStatus',"Exportation de la rangée $1");
+Rico.addPhraseId('filterAll',"(tous)");
+Rico.addPhraseId('filterBlank',"(blanc)");
+Rico.addPhraseId('filterEmpty',"(vide)");
+Rico.addPhraseId('filterNotEmpty',"(pas vide)");
+Rico.addPhraseId('filterLike',"comme: $1");
+Rico.addPhraseId('filterNot',"pas: $1");
+Rico.addPhraseId('requestError',"La requête a retourné une erreur:\n$1");
+Rico.addPhraseId('keywordPrompt',"Écrivez le mot-clé à rechercher (utiliser * comme caractère générique):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"Trier par: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Croissant");
+Rico.addPhraseId('gridmenuSortDesc',"Décroissant");
+Rico.addPhraseId('gridmenuFilterBy',"Filtrer par: $1");
+Rico.addPhraseId('gridmenuRefresh',"Recharger");
+Rico.addPhraseId('gridmenuChgKeyword',"Changer le mot-clé...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Exclure cette valeur aussi");
+Rico.addPhraseId('gridmenuInclude',"Inclure seulement cette valeur");
+Rico.addPhraseId('gridmenuGreaterThan',"Supérieur ou égal à cette valeur");
+Rico.addPhraseId('gridmenuLessThan',"Inférieur ou égal à cette valeur");
+Rico.addPhraseId('gridmenuContains',"Contenant le mot-clé...");
+Rico.addPhraseId('gridmenuExclude',"Exclure cette valeur");
+Rico.addPhraseId('gridmenuRemoveFilter',"Enlever le filtre");
+Rico.addPhraseId('gridmenuRemoveAll',"Enlever tous les filtres");
+
+Rico.addPhraseId('gridmenuExport',"Imprimer/Exporter");
+Rico.addPhraseId('gridmenuExportVis2Web',"Rangs visibles vers une page Web");
+Rico.addPhraseId('gridmenuExportAll2Web',"Tous les rangs vers une page Web");
+Rico.addPhraseId('gridmenuExportVis2SS',"Rangs visibles vers un bilan");
+Rico.addPhraseId('gridmenuExportAll2SS',"Tous les rangs vers un bilan");
+
+Rico.addPhraseId('gridmenuHideShow',"Masquer/Afficher");
+Rico.addPhraseId('gridmenuChooseCols',"Choisissez les colonnes...");
+Rico.addPhraseId('gridmenuHide',"Masquer: $1");
+Rico.addPhraseId('gridmenuShow',"Afficher: $1");
+Rico.addPhraseId('gridmenuShowAll',"Afficher tous");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"minutes avant que votre session expire");
+Rico.addPhraseId('sessionExpired',"EXPIRÉ");
+Rico.addPhraseId('requestTimedOut',"La requête a atteint sa limite de temps");
+Rico.addPhraseId('waitForData',"En attente des données...");
+Rico.addPhraseId('httpError',"La requête a retourné une erreur HTTP: $1");
+Rico.addPhraseId('invalidResponse',"Le serveur a retourné une réponse non valide");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"Choisissez les colonnes");
+Rico.addPhraseId('exportComplete',"Exportation complete");
+Rico.addPhraseId('exportInProgress',"Exportation en marche...");
+Rico.addPhraseId('showFilterRow',"Afficher le rang de filtre");
+Rico.addPhraseId('hideFilterRow',"Masquer le rang de filtre");
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(aucun)");
+Rico.addPhraseId('selectNewVal',"(nouvelle valeur)");
+Rico.addPhraseId('record',"l'entrée");
+Rico.addPhraseId('thisRecord',"cette entrée");
+Rico.addPhraseId('confirmDelete',"Êtes-vous sûr de vouloir supprimer $1?");
+Rico.addPhraseId('deleting',"Effacement en cours...");
+Rico.addPhraseId('formPleaseEnter',"Veuillez saisir une valeur pour $1");
+Rico.addPhraseId('formInvalidFmt',"Format invalide pour $1");
+Rico.addPhraseId('formOutOfRange',"Valeur non-autorisée pour $1");
+Rico.addPhraseId('formNewValue',"Nouvelle valeur:");
+Rico.addPhraseId('saving',"Sauvegarde en cours...");
+Rico.addPhraseId('clear',"Enlever");
+Rico.addPhraseId('close',"Fermer");
+Rico.addPhraseId('saveRecord',"Sauvegarder");
+Rico.addPhraseId('cancel',"Annuler");
+Rico.addPhraseId('editRecord',"Éditer cette entrée");
+Rico.addPhraseId('deleteRecord',"Supprimer cette entrée");
+Rico.addPhraseId('cloneRecord',"Copier cette entrée");
+Rico.addPhraseId('addRecord',"Ajouter une nouvelle entrée");
+Rico.addPhraseId('addedSuccessfully',"$1 a été ajoutée avec succès");
+Rico.addPhraseId('deletedSuccessfully',"$1 a été supprimée avec succès");
+Rico.addPhraseId('updatedSuccessfully',"$1 a été mis à jour avec succès");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"Sauvegarder la selection");
+Rico.addPhraseId('treeClear',"Enlever tous");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"Aujourd'hui est le $1 $2 $3");
+Rico.addPhraseId('calWeekHdg',"Sem");
+Rico.addPhraseId('calYearRange',"Année ($1-$2)");
+Rico.addPhraseId('calInvalidYear',"Année non valide");
+
+// Date & number formats
+
+Rico.thouSep="'"
+Rico.decPoint="."
+Rico.dateFmt="dd.mm.yyyy"
+
+Rico.monthNames=['Janvier','Février', 'Mars', 'Avril', 'Mai','Juin', 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'];
+Rico.dayNames=['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'];
+Rico.monthNamesShort=['Jan','Fév','Mar','Avr','Mai','Jun','Jul','Aoû','Sep','Oct','Nov','Déc'];
+Rico.dayNamesShort=['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'];
+
diff --git a/ricoClient/js/translations/ricoLocale_it.js b/ricoClient/js/translations/ricoLocale_it.js
new file mode 100644 (file)
index 0000000..ff0834c
--- /dev/null
@@ -0,0 +1,121 @@
+/*****************************************************************
+ ricoLocale_it.js - a component of Rico 2.0
+ Localization strings for Italian
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='it';\r
+\r
+// used in ricoLiveGrid.js\r
+\r
+Rico.addPhraseId('bookmarkExact',"Risultati $1 - $2 di $3");
+Rico.addPhraseId('bookmarkAbout',"Risultati $1 - $2 di circa $3");
+Rico.addPhraseId('bookmarkNoRec',"Nessun articolo");
+Rico.addPhraseId('bookmarkNoMatch',"Nessun articolo corrispondente");
+Rico.addPhraseId('bookmarkLoading',"Caricamento...");
+Rico.addPhraseId('sorting',"L'ordinamento è in progresso...");\r
+Rico.addPhraseId('exportStatus',"Esportazione della fila $1");
+Rico.addPhraseId('filterAll',"(tutto)");
+Rico.addPhraseId('filterBlank',"(in bianco)");
+Rico.addPhraseId('filterEmpty',"(vuoto)");
+Rico.addPhraseId('filterNotEmpty',"(non vuoto)");
+Rico.addPhraseId('filterLike',"come: $1");
+Rico.addPhraseId('filterNot',"non: $1");
+Rico.addPhraseId('requestError',"La richiesta ha generato un errore:\n$1");
+Rico.addPhraseId('keywordPrompt',"Inserisci la parola chiave da cercare (usa * come \"jolly\"):");
+\r
+// used in ricoLiveGridMenu.js\r
+\r
+Rico.addPhraseId('gridmenuSortBy',"Ordina per: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Crescente");
+Rico.addPhraseId('gridmenuSortDesc',"Decrescente");
+Rico.addPhraseId('gridmenuFilterBy',"Filtra per: $1");
+Rico.addPhraseId('gridmenuRefresh',"Rinfrescarsi");
+Rico.addPhraseId('gridmenuChgKeyword',"Cambia la parola chiave...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Escludi anche questo valore");
+Rico.addPhraseId('gridmenuInclude',"Inclure seulement cette valeur");
+Rico.addPhraseId('gridmenuGreaterThan',"Superiore o uguale a questo valore");
+Rico.addPhraseId('gridmenuLessThan',"Inferiore o uguale a questo valore");
+Rico.addPhraseId('gridmenuContains',"Contiene la parola chiave...");
+Rico.addPhraseId('gridmenuExclude',"Escludi questo valore");
+Rico.addPhraseId('gridmenuRemoveFilter',"Rimuovi filtro");
+Rico.addPhraseId('gridmenuRemoveAll',"Rimuova tutti i filtri");
+\r
+Rico.addPhraseId('gridmenuExport',"Stampa/Esporta");
+Rico.addPhraseId('gridmenuExportVis2Web',"Righe visibili verso una pagina web");
+Rico.addPhraseId('gridmenuExportAll2Web',"Tutte le righe verso una pagina web");
+Rico.addPhraseId('gridmenuExportVis2SS',"Righe visibili verso un foglio elettronico");
+Rico.addPhraseId('gridmenuExportAll2SS',"Tutte le righe verso un foglio elettronico");
+\r
+Rico.addPhraseId('gridmenuHideShow',"Nascondi/Mostra");
+Rico.addPhraseId('gridmenuChooseCols',"Selezioni le colonne...");
+Rico.addPhraseId('gridmenuHide',"Nascondi: $1");
+Rico.addPhraseId('gridmenuShow',"Mostra: $1");
+Rico.addPhraseId('gridmenuShowAll',"Mostra Tutte");
+\r
+// used in ricoLiveGridAjax.js\r
+\r
+Rico.addPhraseId('sessionExpireMinutes',"minuti prima che la vostra sessione termini");
+Rico.addPhraseId('sessionExpired',"TERMINATA");
+Rico.addPhraseId('requestTimedOut',"La richiesta dei dati ha raggiunto il limite di tempo");\r
+Rico.addPhraseId('waitForData',"Attendere per i dati...");\r
+Rico.addPhraseId('httpError',"La richiesta ha generato un errore HTTP: $1");\r
+Rico.addPhraseId('invalidResponse',"Il server ha restituito una risposta non valida");\r
+\r
+// used in ricoLiveGridCommon.js\r
+\r
+Rico.addPhraseId('gridChooseCols',"Selezioni le colonne");
+Rico.addPhraseId('exportComplete',"L'esportazione è rifinita");
+Rico.addPhraseId('exportInProgress',"Esportazione in progresso...");\r
+Rico.addPhraseId('showFilterRow',"Mostra la riga del filtro");
+Rico.addPhraseId('hideFilterRow',"Nascondi la riga del filtro");
+\r
+// used in ricoLiveGridForms.js\r
+\r
+Rico.addPhraseId('selectNone',"(vuoto)");\r
+Rico.addPhraseId('selectNewVal',"(nouvelle valeur)");\r
+Rico.addPhraseId('record',"la registrazione");\r
+Rico.addPhraseId('thisRecord',"questa registrazione");\r
+Rico.addPhraseId('confirmDelete',"Siete sicuri che volete cancellare $1?");\r
+Rico.addPhraseId('deleting',"L'annullamento è in progresso...");\r
+Rico.addPhraseId('formPleaseEnter',"Per favore inserire un valore per $1");\r
+Rico.addPhraseId('formInvalidFmt',"Formato non valida a $1");\r
+Rico.addPhraseId('formOutOfRange',"Valeur fuori scala a $1");\r
+Rico.addPhraseId('formNewValue',"nouvo valore:");\r
+Rico.addPhraseId('saving',"i dati stanno conservandi...");\r
+Rico.addPhraseId('clear',"cancella");\r
+Rico.addPhraseId('close',"Chiudi");\r
+Rico.addPhraseId('saveRecord',"Salva");\r
+Rico.addPhraseId('cancel',"Annulla");\r
+Rico.addPhraseId('editRecord',"Modifica questa registrazione");\r
+Rico.addPhraseId('deleteRecord',"Cancella questa registrazione");\r
+Rico.addPhraseId('cloneRecord',"Clona questa registrazione");\r
+Rico.addPhraseId('addRecord',"Aggiungi una nuova registrazione");\r
+Rico.addPhraseId('addedSuccessfully',"$1 ha aggiunto con successo");\r
+Rico.addPhraseId('deletedSuccessfully',"$1 ha cancellato con successo");\r
+Rico.addPhraseId('updatedSuccessfully',"$1 aggiornata con successo");\r
+\r
+// used in ricoTree.js\r
+\r
+Rico.addPhraseId('treeSave',"Salva la selezione");\r
+Rico.addPhraseId('treeClear',"Deselezioni tutti");\r
+\r
+// used in ricoCalendar.js\r
+\r
+Rico.addPhraseId('calToday',"L'oggi è $1 $2 $3");\r
+Rico.addPhraseId('calWeekHdg',"Set");\r
+Rico.addPhraseId('calYearRange',"Anno ($1-$2)");\r
+Rico.addPhraseId('calInvalidYear',"Anno non valida");\r
+
+// Date & number formats
+
+Rico.thouSep=".";
+Rico.decPoint=",";
+Rico.dateFmt="dd/mm/yyyy";
+
+Rico.monthNames=["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"];
+Rico.dayNames=["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"];
+Rico.monthNamesShort=['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'];
+Rico.dayNamesShort=['Dom','Lun','Mar','Mer','Gio','Ven','Sab'];
+\r
+Rico.includeLoaded('ricoLocale_it.js');
diff --git a/ricoClient/js/translations/ricoLocale_ja.js b/ricoClient/js/translations/ricoLocale_ja.js
new file mode 100644 (file)
index 0000000..e98d6b2
--- /dev/null
@@ -0,0 +1,120 @@
+/*****************************************************************
+ ricoLocale_ja.js - a component of Rico 2.0
+ Localization strings for Japanese
+ Initial translator: Nobuhito Takeuchi
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='ja';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"リストのレコードは $3 件中 $1 - $2 件目です");
+Rico.addPhraseId('bookmarkAbout',"リストのレコードは少なくとも $3 件中 $1 - $2 件目です");
+Rico.addPhraseId('bookmarkNoRec',"レコードがありません");
+Rico.addPhraseId('bookmarkNoMatch',"一致するレコードがありません");
+Rico.addPhraseId('bookmarkLoading',"ロード中です...");
+Rico.addPhraseId('sorting',"並べ替え中です...");
+Rico.addPhraseId('exportStatus',"$1 行目をエクスポート中です");
+Rico.addPhraseId('filterAll',"(すべて)");
+Rico.addPhraseId('filterBlank',"(空白)");
+Rico.addPhraseId('filterEmpty',"(空の)");
+Rico.addPhraseId('filterNotEmpty',"(空では無い)");
+Rico.addPhraseId('filterLike',"$1 を含む");
+Rico.addPhraseId('filterNot',"$1 を含まない");
+Rico.addPhraseId('requestError',"そのリクエストはエラーを返しました:\n$1");
+Rico.addPhraseId('keywordPrompt',"検索するキーワードを入力して下さい ( * はワイルドカードとして利用されます):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"$1 を並べ替え");
+Rico.addPhraseId('gridmenuSortAsc',"昇順");
+Rico.addPhraseId('gridmenuSortDesc',"降順");
+Rico.addPhraseId('gridmenuFilterBy',"$1 をフィルタ");
+Rico.addPhraseId('gridmenuRefresh',"再描画");
+Rico.addPhraseId('gridmenuChgKeyword',"キーワードの変更...");
+Rico.addPhraseId('gridmenuExcludeAlso',"この値も含まない");
+Rico.addPhraseId('gridmenuInclude',"この値のみを含む");
+Rico.addPhraseId('gridmenuGreaterThan',"この値以上");
+Rico.addPhraseId('gridmenuLessThan',"この値以下");
+Rico.addPhraseId('gridmenuContains',"このキーワードを含む...");
+Rico.addPhraseId('gridmenuExclude',"この値を含まない");
+Rico.addPhraseId('gridmenuRemoveFilter',"フィルタを取り除く");
+Rico.addPhraseId('gridmenuRemoveAll',"すべてのフィルタを取り除く");
+
+Rico.addPhraseId('gridmenuExport',"インポート/エクスポート");
+Rico.addPhraseId('gridmenuExportVis2Web',"表示されている行をウェブページへ");
+Rico.addPhraseId('gridmenuExportAll2Web',"すべての行をウェブページへ");
+Rico.addPhraseId('gridmenuExportVis2SS',"表示されている行をスプレッドシートへ");
+Rico.addPhraseId('gridmenuExportAll2SS',"すべての行をスプレッドシートへ");
+
+Rico.addPhraseId('gridmenuHideShow',"非表示/表示");
+Rico.addPhraseId('gridmenuChooseCols',"列を選択...");
+Rico.addPhraseId('gridmenuHide',"$1 を非表示");
+Rico.addPhraseId('gridmenuShow',"$1 を表示");
+Rico.addPhraseId('gridmenuShowAll',"すべて表示");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"セッションが終了するまでの分数");
+Rico.addPhraseId('sessionExpired',"終了");
+Rico.addPhraseId('requestTimedOut',"データのリクエストが終了しました");
+Rico.addPhraseId('waitForData',"データを待っています...");
+Rico.addPhraseId('httpError',"HTTP エラーを受け取りました: $1");
+Rico.addPhraseId('invalidResponse',"サーバは無効なレスポンスを返しました");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"列を選択して下さい");
+Rico.addPhraseId('exportComplete',"エクスポートが完了しました");
+Rico.addPhraseId('exportInProgress',"エクスポートの実行中です...");
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(無し)");
+Rico.addPhraseId('selectNewVal',"(新しい値)");
+Rico.addPhraseId('record',"レコード");
+Rico.addPhraseId('thisRecord',"この $1");
+Rico.addPhraseId('confirmDelete',"$1 を本当に削除してよろしいですか?");
+Rico.addPhraseId('deleting',"削除しています...");
+Rico.addPhraseId('formPleaseEnter',"$1 を入力して下さい");
+Rico.addPhraseId('formInvalidFmt',"$1 は無効なフォーマットです");
+Rico.addPhraseId('formOutOfRange',"$1 は範囲外です");
+Rico.addPhraseId('formNewValue',"新しい値:");
+Rico.addPhraseId('saving',"保存しています...");
+Rico.addPhraseId('clear',"消去");
+Rico.addPhraseId('close',"閉じる");
+Rico.addPhraseId('saveRecord',"$1 の保存");
+Rico.addPhraseId('cancel',"キャンセル");
+Rico.addPhraseId('editRecord',"$1 を編集します");
+Rico.addPhraseId('deleteRecord',"$1 を削除します");
+Rico.addPhraseId('cloneRecord',"$1 の複製を作成します");
+Rico.addPhraseId('addRecord',"$1 を追加します");
+Rico.addPhraseId('addedSuccessfully',"$1 の追加に成功しました");
+Rico.addPhraseId('deletedSuccessfully',"$1 の削除に成功しました");
+Rico.addPhraseId('updatedSuccessfully',"$1 の更新に成功しました");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"選択項目を保存");
+Rico.addPhraseId('treeClear',"すべて消去");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"今日は $3 年 $4 月 $1 日です");
+Rico.addPhraseId('calWeekHdg',"曜日");
+Rico.addPhraseId('calYearRange',"$1 年 - $2 年"); 
+Rico.addPhraseId('calInvalidYear',"無効な年です");
+
+// Date & number formats
+
+Rico.thouSep=","
+Rico.decPoint="."
+Rico.dateFmt="yyyy年mm月dd日"
+
+Rico.monthNames=['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'];
+Rico.monthNamesShort=['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'];
+Rico.dayNames=['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'];
+Rico.dayNamesShort=['日','月','火','水','木','金','土'];
+
+Rico.includeLoaded('ricoLocale_ja.js');
diff --git a/ricoClient/js/translations/ricoLocale_ko.js b/ricoClient/js/translations/ricoLocale_ko.js
new file mode 100644 (file)
index 0000000..e19b6ae
--- /dev/null
@@ -0,0 +1,118 @@
+/*****************************************************************
+ ricoLocale_ko.js - a component of Rico 2.0
+ Localization strings for Korean
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='ko';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"ÃÑ $3 Áß $1 ~ $2");
+Rico.addPhraseId('bookmarkAbout',"ÃÑ ¾à $3 Áß $1 ~ $2");
+Rico.addPhraseId('bookmarkNoRec',"ÀÚ·á°¡ ¾ø½À´Ï´Ù.");
+Rico.addPhraseId('bookmarkNoMatch',"Á¶°Ç¿¡ ÀÏÄ¡Çϴ ÀÚ·á°¡ ¾ø½À´Ï´Ù.");
+Rico.addPhraseId('bookmarkLoading',"ºÒ·¯¿À´Â Áß......");
+Rico.addPhraseId('sorting',"Á¤·Ä Áß......");
+Rico.addPhraseId('exportStatus',"$1 ¹ø° ¿­À» Àü´ÞÇÏ°í ÀÖ½À´Ï´Ù.");
+Rico.addPhraseId('filterAll',"(¸ðµÎ)");
+Rico.addPhraseId('filterBlank',"(¾ø½¿)");
+Rico.addPhraseId('filterEmpty',"(ºó)");
+Rico.addPhraseId('filterNotEmpty',"(ºñÁö ¾ÊÀº)");
+Rico.addPhraseId('filterLike',"$1 °ú À¯»çÇÑ");
+Rico.addPhraseId('filterNot',"$1 ÀÌ ¾Æ´Ñ");
+Rico.addPhraseId('requestError',"ÀÔ·ÂÇϽŠ¿äûÀÌ ¿À·ù¸¦ ¹ÝȯÇß½À´Ï´Ù:\n$1");
+Rico.addPhraseId('keywordPrompt',"ªOÀ¸½Ã·Á´Â Å°¿öµå¸¦ ÀÔ·ÂÇϽʽÿÀ. ( * Å°µµ »ç¿ëÇϽǠ¼ö ÀÖ½À´Ï´Ù.):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"$1 À¸·Î Á¤·Ä");
+Rico.addPhraseId('gridmenuSortAsc',"¿À¸§Â÷¼ø");
+Rico.addPhraseId('gridmenuSortDesc',"³»¸²Â÷¼ø");
+Rico.addPhraseId('gridmenuFilterBy',"$1 À¸·Î Ã£±â");
+Rico.addPhraseId('gridmenuRefresh',"´Ù½Ãº¸±â");
+Rico.addPhraseId('gridmenuChgKeyword',"Å°¿öµå ¹Ù²Ù±â...");
+Rico.addPhraseId('gridmenuExcludeAlso',"ÀÌ °ªµµ Á¦¿Ü");
+Rico.addPhraseId('gridmenuInclude',"ÀÌ °ª¸¸ Æ÷ÇÔ");
+Rico.addPhraseId('gridmenuGreaterThan',"ÀÌ °ªº¸´Ù Å©°Å³ª °°´Ù.");
+Rico.addPhraseId('gridmenuLessThan',"ÀÌ °ªº¸´Ù À۰ųª °°´Ù.");
+Rico.addPhraseId('gridmenuContains',"°ª(Å°¿öµå)À» Æ÷ÇÔ.");
+Rico.addPhraseId('gridmenuExclude',"ÀÌ °ªÀº Á¦¿Ü.");
+Rico.addPhraseId('gridmenuRemoveFilter',"ÇÊÅÍ ¾ø¾Ö±â");
+Rico.addPhraseId('gridmenuRemoveAll',"¸ðµç ÇÊÅÍ ¾ø¾Ö±â");
+
+Rico.addPhraseId('gridmenuExport',"Àμâ/³»º¸³»±â");
+Rico.addPhraseId('gridmenuExportVis2Web',"º¸À̴ Çà À¥ÆäÀÌÁö·Î");
+Rico.addPhraseId('gridmenuExportAll2Web',"¸ðµç Çà À¥ÆäÀÌÁö·Î");
+Rico.addPhraseId('gridmenuExportVis2SS',"º¸À̴ Çà °è»êÆÇÀ¸·Î(¿¢¼¿)·Î");
+Rico.addPhraseId('gridmenuExportAll2SS',"¸ðµç Çà °è»êÆÇÀ¸·Î(¿¢¼¿)·Î");
+
+Rico.addPhraseId('gridmenuHideShow',"¼û±â±â/º¸À̱â");
+Rico.addPhraseId('gridmenuChooseCols',"¿­ ¼±ÅÃ...");
+Rico.addPhraseId('gridmenuHide',"$1 ¼û±â±â");
+Rico.addPhraseId('gridmenuShow',"$1 º¸À̱â");
+Rico.addPhraseId('gridmenuShowAll',"¸ðµÎ º¸À̱â");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"ºÐ ³²¾Ò½À´Ï´Ù. (¼¼¼Ç)");
+//could you please, change the above format in this way? $1 minutes before ........
+Rico.addPhraseId('sessionExpired',"³¡³µ½À´Ï´Ù.");
+Rico.addPhraseId('requestTimedOut',"ÀÚ·á¿äûÀÌ Á¦ÇÑ ½Ã°£À» ÃÊ°úÇß½À´Ï´Ù!");
+Rico.addPhraseId('waitForData',"ÀڷḦ ±â´Ù¸®°í ÀÖ½À´Ï´Ù......");
+Rico.addPhraseId('httpError',"HTTP ¿À·ù¸¦ ¹Þ¾Ò½À´Ï´Ù: $1");
+Rico.addPhraseId('invalidResponse',"¼­¹ö°¡ ºÎÀûÀýÇÑ ´äº¯À» º¸³Â½À´Ï´Ù.");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"¿­ ¼±ÅÃ");
+Rico.addPhraseId('exportComplete',"³»º¸³»±â ¿Ï·á.");
+Rico.addPhraseId('exportInProgress',"³»º¸³»´Â ÁßÀÔ´Ï´Ù.");
+Rico.addPhraseId('showFilterRow',"ÇÊÅÍ Çà º¸À̱â");  // img alt text
+Rico.addPhraseId('hideFilterRow',"ÇÊÅÍ Çà ¼û±â±â");  // img alt text
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(¼±Åþø½¿)");
+Rico.addPhraseId('selectNewVal',"(»õ °ª)");
+Rico.addPhraseId('record',"record");
+Rico.addPhraseId('thisRecord',"ÀÌ $1");
+Rico.addPhraseId('confirmDelete',"$1À» »èÁ¦ÇϽðڽÀ´Ï±î?");
+Rico.addPhraseId('deleting',"»èÁ¦ Áß......");
+Rico.addPhraseId('formPleaseEnter',"$1 ¿¡ ÀûÀýÇÑ °ªÀ» ÀÔ·ÂÇϽʽÿÀ.");
+Rico.addPhraseId('formInvalidFmt',"$1 ¿¡°Ô ÀûÀýÇÑ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.");
+Rico.addPhraseId('formOutOfRange',"$1 ¿¡ ÀûÀýÇÑ ¹üÀ§¸¦ ¹þ¾î³µ½À´Ï´Ù.");
+Rico.addPhraseId('formNewValue',"»õ °ª");
+Rico.addPhraseId('saving',"ÀúÀå Áß......");
+Rico.addPhraseId('clear',"ºñ¿ì±â");
+Rico.addPhraseId('close',"´Ý±â");
+Rico.addPhraseId('saveRecord',"$1 ÀúÀå");
+Rico.addPhraseId('cancel',"Ãë¼Ò");
+Rico.addPhraseId('editRecord',"$1 ¼öÁ¤");
+Rico.addPhraseId('deleteRecord',"$1 »èÁ¦");
+Rico.addPhraseId('cloneRecord',"$1 º¹Á¦");
+Rico.addPhraseId('addRecord',"»õ $1 Ãß°¡");
+Rico.addPhraseId('addedSuccessfully',"$1 Àº ¼º°øÀûÀ¸·Î Ãß°¡µÇ¾ú½À´Ï´Ù.");
+Rico.addPhraseId('deletedSuccessfully',"$1 Àº ¼º°øÀûÀ¸·Î »èÁ¦µÇ¾ú½À´Ï´Ù.");
+Rico.addPhraseId('updatedSuccessfully',"$1 Àº ¼º°øÀûÀ¸·Î ¼öÁ¤µÇ¾ú½À´Ï´Ù.");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"¼±Åÿµ¿ª ÀúÀå");
+Rico.addPhraseId('treeClear',"¸ðµÎ ºñ¿ì±â/¿ø»óÅ·Î");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"¿À´ÃÀº $3³â $4¿ù $1ÀÏ ÀÔ´Ï´Ù.");  // $1=day, $2=monthabbr, $3=year, $4=month number
+Rico.addPhraseId('calWeekHdg',"Wk");
+Rico.addPhraseId('calYearRange',"$1³â ºÎÅÍ $2³â ±îÁö)");
+Rico.addPhraseId('calInvalidYear',"³âµµ°¡ ÀûÀýÇÏÁö ¾Ê½À´Ï´Ù.");
+
+
+// Date & number formats
+Rico.thouSep=","
+Rico.decPoint="."
+Rico.dateFmt="yyyy/mm/dd"
+
+Rico.monthNames=['1¿ù','2¿ù', '3¿ù', '4¿ù', '5¿ù','6¿ù', '7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù']
+Rico.dayNames=['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä']
diff --git a/ricoClient/js/translations/ricoLocale_pt.js b/ricoClient/js/translations/ricoLocale_pt.js
new file mode 100644 (file)
index 0000000..faca24f
--- /dev/null
@@ -0,0 +1,121 @@
+/*****************************************************************
+ ricoLocale_pt.js - a component of Rico 2.0
+ Localization strings for Portugese
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='pt';\r
+\r
+// used in ricoLiveGrid.js\r
+\r
+Rico.addPhraseId('bookmarkExact',"Listar registros $1 - $2 de $3");
+Rico.addPhraseId('bookmarkAbout',"Listar registros $1 - $2 de aproximadamente $3");
+Rico.addPhraseId('bookmarkNoRec',"Nenhum registro");
+Rico.addPhraseId('bookmarkNoMatch',"Nenhum registro encontrado");
+Rico.addPhraseId('bookmarkLoading',"Carregamento...");
+Rico.addPhraseId('sorting',"Classificar é em andamento...");\r
+Rico.addPhraseId('exportStatus',"Exportando a fileira $1");
+Rico.addPhraseId('filterAll',"(tudo)");
+Rico.addPhraseId('filterBlank',"(espaço em branco)");
+Rico.addPhraseId('filterEmpty',"(vazio)");
+Rico.addPhraseId('filterNotEmpty',"(nao vazio)");
+Rico.addPhraseId('filterLike',"como: $1");
+Rico.addPhraseId('filterNot',"nao: $1");
+Rico.addPhraseId('requestError',"O pedido para dados retornou um erro:\n$1");
+Rico.addPhraseId('keywordPrompt',"Informe texto a ser pesquisado (use * como 'coringa'):");
+\r
+// used in ricoLiveGridMenu.js\r
+\r
+Rico.addPhraseId('gridmenuSortBy',"Ordenar por: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Ascendente");
+Rico.addPhraseId('gridmenuSortDesc',"Descendente");
+Rico.addPhraseId('gridmenuFilterBy',"Filtrar por: $1");
+Rico.addPhraseId('gridmenuRefresh',"Actualizar");
+Rico.addPhraseId('gridmenuChgKeyword',"Alterar texto...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Excluir este valor também");
+Rico.addPhraseId('gridmenuInclude',"Incluir apenas este valor");
+Rico.addPhraseId('gridmenuGreaterThan',"Maior ou igual a este valor");
+Rico.addPhraseId('gridmenuLessThan',"Menor ou igual a este valor");
+Rico.addPhraseId('gridmenuContains',"Contém texto...");
+Rico.addPhraseId('gridmenuExclude',"Excluir este valor");
+Rico.addPhraseId('gridmenuRemoveFilter',"Remover filtro");
+Rico.addPhraseId('gridmenuRemoveAll',"Remova todos os filtros");
+\r
+Rico.addPhraseId('gridmenuExport',"Imprimir/Exportar");
+Rico.addPhraseId('gridmenuExportVis2Web',"Fileiras visíveis para uma página da Web");
+Rico.addPhraseId('gridmenuExportAll2Web',"Todas as fileiras para uma página da Web");
+Rico.addPhraseId('gridmenuExportVis2SS',"Fileiras visíveis para um spreadsheet");
+Rico.addPhraseId('gridmenuExportAll2SS',"Todas as fileiras para um spreadsheet");
+\r
+Rico.addPhraseId('gridmenuHideShow',"Ocultar/Exibir");
+Rico.addPhraseId('gridmenuChooseCols',"Escolha as colunas...");
+Rico.addPhraseId('gridmenuHide',"Ocultar: $1");
+Rico.addPhraseId('gridmenuShow',"Exibir: $1");
+Rico.addPhraseId('gridmenuShowAll',"Exibir tudo");
+\r
+// used in ricoLiveGridAjax.js\r
+\r
+Rico.addPhraseId('sessionExpireMinutes',"minutos antes de sua sessão expiram");
+Rico.addPhraseId('sessionExpired',"EXPIRADO");
+Rico.addPhraseId('requestTimedOut',"Tempo esgotado para espera de dados");\r
+Rico.addPhraseId('waitForData',"Aguardando dados...");\r
+Rico.addPhraseId('httpError',"Um erro do HTTP foi recebido: $1");\r
+Rico.addPhraseId('invalidResponse',"O servidor retornou uma resposta inválida");\r
+\r
+// used in ricoLiveGridCommon.js\r
+\r
+Rico.addPhraseId('gridChooseCols',"Escolha as colunas");
+Rico.addPhraseId('exportComplete',"A exportação está completa");
+Rico.addPhraseId('exportInProgress',"A exportação é em andamento...");\r
+Rico.addPhraseId('showFilterRow',"Exibir a fileira do filtro");
+Rico.addPhraseId('hideFilterRow',"Ocultar a fileira do filtro");
+\r
+// used in ricoLiveGridForms.js\r
+\r
+Rico.addPhraseId('selectNone',"(nenhuns)");\r
+Rico.addPhraseId('selectNewVal',"(valor novo)");\r
+Rico.addPhraseId('record',"o registro");\r
+Rico.addPhraseId('thisRecord',"este registro");\r
+Rico.addPhraseId('confirmDelete',"É você certo você quer suprimir $1?");\r
+Rico.addPhraseId('deleting',"O apagamento é em andamento...");\r
+Rico.addPhraseId('formPleaseEnter',"Registe um valor para $1");\r
+Rico.addPhraseId('formInvalidFmt',"Formato inválido em $1");\r
+Rico.addPhraseId('formOutOfRange',"Valor fora da escala em $1");\r
+Rico.addPhraseId('formNewValue',"valor novo:");\r
+Rico.addPhraseId('saving',"Salvar em andamento...");\r
+Rico.addPhraseId('clear',"remover");\r
+Rico.addPhraseId('close',"Fechar");\r
+Rico.addPhraseId('saveRecord',"Salvar");\r
+Rico.addPhraseId('cancel',"Cancelar");\r
+Rico.addPhraseId('editRecord',"Editar este registro");\r
+Rico.addPhraseId('deleteRecord',"Apagar este registro");\r
+Rico.addPhraseId('cloneRecord',"Copiar este registro");\r
+Rico.addPhraseId('addRecord',"Criar um registro novo");\r
+Rico.addPhraseId('addedSuccessfully',"$1 foi adicionado com sucesso");\r
+Rico.addPhraseId('deletedSuccessfully',"$1 foi apagado com sucesso");\r
+Rico.addPhraseId('updatedSuccessfully',"$1 foi atualizado com sucesso");\r
+\r
+// used in ricoTree.js\r
+\r
+Rico.addPhraseId('treeSave',"Salvar a seleção");\r
+Rico.addPhraseId('treeClear',"Cancele tudo");\r
+\r
+// used in ricoCalendar.js\r
+\r
+Rico.addPhraseId('calToday',"Hoje é $1 $2 $3");\r
+Rico.addPhraseId('calWeekHdg',"Sem");\r
+Rico.addPhraseId('calYearRange',"Ano ($1-$2)");\r
+Rico.addPhraseId('calInvalidYear',"Ano inválido");\r
+
+// Date & number formats
+
+Rico.thouSep=".";\r
+Rico.decPoint=",";\r
+Rico.dateFmt="dd/mm/yyyy";\r
+\r
+Rico.monthNames=["Janeiro", "Fevereiro", "Março", "Abril", "Maio","Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];\r
+Rico.dayNames=["Domingo", "Segunda","Terça", "Quarta", "Quinta", "Sexta", "Sábado"];\r
+Rico.monthNamesShort=['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'];
+Rico.dayNamesShort=['Dom','Seg','Ter','Qua','Qui','Sex','Sab'];
+\r
+Rico.includeLoaded('ricoLocale_pt.js');
diff --git a/ricoClient/js/translations/ricoLocale_ru.js b/ricoClient/js/translations/ricoLocale_ru.js
new file mode 100644 (file)
index 0000000..b7c61f2
--- /dev/null
@@ -0,0 +1,121 @@
+/*****************************************************************
+ Page : ricoLocale_ru.js
+ Description : russian localization strings
+ Version 0.1 (revisions by Alexey Uvarov,Illiya Gannitskiy)
+ If you would like to include translations for another language, 
+ please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='ru';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"Просмотр записей $1 - $2 из $3");
+Rico.addPhraseId('bookmarkAbout',"Просмотр записей $1 - $2 из более чем $3");
+Rico.addPhraseId('bookmarkNoRec',"Нет записей");
+Rico.addPhraseId('bookmarkNoMatch',"Нет совпадений");
+Rico.addPhraseId('bookmarkLoading',"Загрузка...");
+Rico.addPhraseId('sorting',"Сортировка...");
+Rico.addPhraseId('exportStatus',"Экспортируется запись $1");
+Rico.addPhraseId('filterAll',"(все)");
+Rico.addPhraseId('filterBlank',"(чистый)");
+Rico.addPhraseId('filterEmpty',"(пустой)");
+Rico.addPhraseId('filterNotEmpty',"(не пустой)");
+Rico.addPhraseId('filterLike',"как: $1");
+Rico.addPhraseId('filterNot',"не: $1");
+Rico.addPhraseId('requestError',"Запрос данных возвратил ошибку:\n$1");
+Rico.addPhraseId('keywordPrompt',"Искать по ключу (Используйте * для всех записей):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"Сортировка по: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Возрастающая");
+Rico.addPhraseId('gridmenuSortDesc',"Убывающая");
+Rico.addPhraseId('gridmenuFilterBy',"Фильтрация по: $1");
+Rico.addPhraseId('gridmenuRefresh',"Обновить");
+Rico.addPhraseId('gridmenuChgKeyword',"Изменить ключевое слово...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Исключить также это значение");
+Rico.addPhraseId('gridmenuInclude',"Включить только это значение");
+Rico.addPhraseId('gridmenuGreaterThan',"Больше либо равно данному значению");
+Rico.addPhraseId('gridmenuLessThan',"Меньше либо равно данному значению");
+Rico.addPhraseId('gridmenuContains',"Содержит значение...");
+Rico.addPhraseId('gridmenuExclude',"Исключить это значение");
+Rico.addPhraseId('gridmenuRemoveFilter',"Удалить фильтр");
+Rico.addPhraseId('gridmenuRemoveAll',"Удалить все фильтры");
+
+Rico.addPhraseId('gridmenuExport',"Печать/Экспорт");
+Rico.addPhraseId('gridmenuExportVis2Web',"Видимые записи на вэб-страницу");
+Rico.addPhraseId('gridmenuExportAll2Web',"Все записи на вэб-страницу");
+Rico.addPhraseId('gridmenuExportVis2SS',"Видимые записи в лист excel");
+Rico.addPhraseId('gridmenuExportAll2SS',"Все записи в лист excel");
+
+Rico.addPhraseId('gridmenuHideShow',"Скрыть/Показать");
+Rico.addPhraseId('gridmenuChooseCols',"Выберите столбец...");
+Rico.addPhraseId('gridmenuHide',"Скрыть: $1");
+Rico.addPhraseId('gridmenuShow',"Показать: $1");
+Rico.addPhraseId('gridmenuShowAll',"Показать все");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"минут до истечения сессии");
+Rico.addPhraseId('sessionExpired',"ИСТЕКЛА");
+Rico.addPhraseId('requestTimedOut',"Превышен интервал ожидания данных!");
+Rico.addPhraseId('waitForData',"Ожидание данных...");
+Rico.addPhraseId('httpError',"Получена HTTP ошибка: $1");
+Rico.addPhraseId('invalidResponse',"Сервер возвратил неправильный ответ");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"Выбрать столбец");
+Rico.addPhraseId('exportComplete',"Экспорт завершен");
+Rico.addPhraseId('exportInProgress',"Экспортирование...");
+Rico.addPhraseId('showFilterRow',"Показать отфильтрованные записи");  // img alt text
+Rico.addPhraseId('hideFilterRow',"Спрятать отфильтрованные записи");  // img alt text
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(ничего)");
+Rico.addPhraseId('selectNewVal',"(новое значение)");
+Rico.addPhraseId('record',"запись");
+Rico.addPhraseId('thisRecord',"эта $1");
+Rico.addPhraseId('confirmDelete',"Вы уверенны, что хотите удалить $1?");
+Rico.addPhraseId('deleting',"Удаление...");
+Rico.addPhraseId('formPleaseEnter',"Пожалуйста, введите значение для $1");
+Rico.addPhraseId('formInvalidFmt',"Неправильный формат для $1");
+Rico.addPhraseId('formOutOfRange',"Значение находится вне диапазона для $1");
+Rico.addPhraseId('formNewValue',"новое значение:");
+Rico.addPhraseId('saving',"Сохранение...");
+Rico.addPhraseId('clear',"очистить");
+Rico.addPhraseId('close',"Закрыть");
+Rico.addPhraseId('saveRecord',"Сохранить $1");
+Rico.addPhraseId('cancel',"Отмена");
+Rico.addPhraseId('editRecord',"Редактировать эту $1");
+Rico.addPhraseId('deleteRecord',"Удалить эту $1");
+Rico.addPhraseId('cloneRecord',"Копировать эту $1");
+Rico.addPhraseId('addRecord',"Добавить новую $1");
+Rico.addPhraseId('addedSuccessfully',"$1 добавлена успешно");
+Rico.addPhraseId('deletedSuccessfully',"$1 удалена успешно");
+Rico.addPhraseId('updatedSuccessfully',"$1 обновлена успешно");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"Сохранить выделение");
+Rico.addPhraseId('treeClear',"Очистить все");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"Сегодня $1 $2 $3");  // $1=day, $2=monthabbr, $3=year, $4=month number
+Rico.addPhraseId('calWeekHdg',"Нд");
+Rico.addPhraseId('calYearRange',"Год ($1-$2)");
+Rico.addPhraseId('calInvalidYear',"Неправильный год");
+
+// Date & number formats
+
+Rico.thouSep=",";
+Rico.decPoint=".";
+Rico.dateFmt="mm/dd/yyyy";
+
+Rico.monthNames=['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'];
+Rico.dayNames=['Воскресенье','Понедельник','Вторник','Среда','Четверг','Пятница','Суббота'];
+Rico.monthNamesShort=['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'];
+Rico.dayNamesShort=['вск','пнд','втр','срд','чтв','птн','сбт'];
+
diff --git a/ricoClient/js/translations/ricoLocale_uk.js b/ricoClient/js/translations/ricoLocale_uk.js
new file mode 100644 (file)
index 0000000..f076645
--- /dev/null
@@ -0,0 +1,120 @@
+/*****************************************************************
+ Page : ricoLocale_uk.js
+ Description : ukrainian localization strings
+ Version 0.1 (revisions by Alexey Uvarov,Illiya Gannitskiy)
+ If you would like to include translations for another language, 
+ please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='ua';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"Перегляд записів $1 - $2 з $3");
+Rico.addPhraseId('bookmarkAbout',"Перегляд записів $1 - $2 з більш ніж $3");
+Rico.addPhraseId('bookmarkNoRec',"Немає записів");
+Rico.addPhraseId('bookmarkNoMatch',"Немає збігів");
+Rico.addPhraseId('bookmarkLoading',"Завантаження...");
+Rico.addPhraseId('sorting',"Сортування...");
+Rico.addPhraseId('exportStatus',"Експортується запис $1");
+Rico.addPhraseId('filterAll',"(всі)");
+Rico.addPhraseId('filterBlank',"(чистий)");
+Rico.addPhraseId('filterEmpty',"(порожній)");
+Rico.addPhraseId('filterNotEmpty',"(не порожній)");
+Rico.addPhraseId('filterLike',"як: $1");
+Rico.addPhraseId('filterNot',"не: $1");
+Rico.addPhraseId('requestError',"Запит даних повернув помилку:\n$1");
+Rico.addPhraseId('keywordPrompt',"Шукати по ключу (Використовуйте * для всіх записів):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"Сортування по: $1");
+Rico.addPhraseId('gridmenuSortAsc',"Зростаюча");
+Rico.addPhraseId('gridmenuSortDesc',"Убутна");
+Rico.addPhraseId('gridmenuFilterBy',"Фільтрація по: $1");
+Rico.addPhraseId('gridmenuRefresh',"Обновити");
+Rico.addPhraseId('gridmenuChgKeyword',"Змінити ключове слово...");
+Rico.addPhraseId('gridmenuExcludeAlso',"Виключити також це значення");
+Rico.addPhraseId('gridmenuInclude',"Включити тільки це значення");
+Rico.addPhraseId('gridmenuGreaterThan',"Більше або дорівнює даному значенню");
+Rico.addPhraseId('gridmenuLessThan',"Менше або дорівнює даному значенню");
+Rico.addPhraseId('gridmenuContains',"Містить значення...");
+Rico.addPhraseId('gridmenuExclude',"Виключити це значення");
+Rico.addPhraseId('gridmenuRemoveFilter',"Вилучити фільтр");
+Rico.addPhraseId('gridmenuRemoveAll',"Вилучити всі фільтри");
+
+Rico.addPhraseId('gridmenuExport',"Друк/Експорт");
+Rico.addPhraseId('gridmenuExportVis2Web',"Видимі записи на веб-сторінку");
+Rico.addPhraseId('gridmenuExportAll2Web',"Усі записи на веб-сторінку");
+Rico.addPhraseId('gridmenuExportVis2SS',"Видимі записи в аркуш excel");
+Rico.addPhraseId('gridmenuExportAll2SS',"Усі записи в аркуш excel");
+
+Rico.addPhraseId('gridmenuHideShow',"Сховати/Показати");
+Rico.addPhraseId('gridmenuChooseCols',"Виберіть колонку...");
+Rico.addPhraseId('gridmenuHide',"Сховати: $1");
+Rico.addPhraseId('gridmenuShow',"Показати: $1");
+Rico.addPhraseId('gridmenuShowAll',"Показати всі");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"хвилин до закінчення сесії");
+Rico.addPhraseId('sessionExpired',"МИНУЛА");
+Rico.addPhraseId('requestTimedOut',"Перевищений інтервал очікування даних!");
+Rico.addPhraseId('waitForData',"Очікування даних...");
+Rico.addPhraseId('httpError',"Отримана HTTP помилка: $1");
+Rico.addPhraseId('invalidResponse',"Сервер повернув неправильну відповідь");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"Вибрати колонку");
+Rico.addPhraseId('exportComplete',"Експорт завершений");
+Rico.addPhraseId('exportInProgress',"Експортування...");
+Rico.addPhraseId('showFilterRow',"Показати відфільтровані записи");  // img alt text
+Rico.addPhraseId('hideFilterRow',"Сховати відфільтровані записи");  // img alt text
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(нічого)");
+Rico.addPhraseId('selectNewVal',"(нове значення)");
+Rico.addPhraseId('record',"запис");
+Rico.addPhraseId('thisRecord',"ця $1");
+Rico.addPhraseId('confirmDelete',"Ви впевнені,що бажаєте видалити $1?");
+Rico.addPhraseId('deleting',"Видалення...");
+Rico.addPhraseId('formPleaseEnter',"Будь ласка, введіть значення для $1");
+Rico.addPhraseId('formInvalidFmt',"Неправильний формат для $1");
+Rico.addPhraseId('formOutOfRange',"Значення знаходиться поза діапазоном для $1");
+Rico.addPhraseId('formNewValue',"нове значення:");
+Rico.addPhraseId('saving',"Збереження...");
+Rico.addPhraseId('clear',"очистити");
+Rico.addPhraseId('close',"Закрити");
+Rico.addPhraseId('saveRecord',"Зберегти $1");
+Rico.addPhraseId('cancel',"Скасування");
+Rico.addPhraseId('editRecord',"Редагувати цю $1");
+Rico.addPhraseId('deleteRecord',"Вилучити цю $1");
+Rico.addPhraseId('cloneRecord',"Копіювати цю $1");
+Rico.addPhraseId('addRecord',"Додати нову $1");
+Rico.addPhraseId('addedSuccessfully',"$1 додана успішно");
+Rico.addPhraseId('deletedSuccessfully',"$1 вилучена успішно");
+Rico.addPhraseId('updatedSuccessfully',"$1 оновлена успішно");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"Зберегти виділення");
+Rico.addPhraseId('treeClear',"Очистити все");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"Сьогодні $1 $2 $3");  // $1=day, $2=monthabbr, $3=year, $4=month number
+Rico.addPhraseId('calWeekHdg',"Тд");
+Rico.addPhraseId('calYearRange',"Рік ($1-$2)");
+Rico.addPhraseId('calInvalidYear',"Неправильний рік");
+
+// Date & number formats
+
+Rico.thouSep=",";
+Rico.decPoint=".";
+Rico.dateFmt="dd/mm/yyyy";
+
+Rico.monthNames=['Січень','Лютий','Березень','Квітень','Травень','Червень','Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'];
+Rico.monthNamesShort=['Січ','Лют','Бер','Кві','Тра','Чер','Лип','Сер','Вер','Жов','Лис','Гру'];
+Rico.dayNames=['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'];
+Rico.dayNamesShort=['нед','пнд','вів','срд','чтв','птн','сбт'];
diff --git a/ricoClient/js/translations/ricoLocale_zh.js b/ricoClient/js/translations/ricoLocale_zh.js
new file mode 100644 (file)
index 0000000..d8daa09
--- /dev/null
@@ -0,0 +1,122 @@
+/*****************************************************************
+ ricoLocale_zh.js - a component of Rico 2.0
+ Localization strings for Simplified Chinese
+ Initial translator: Xinjun Liu
+ If you have better translations, or would like to include
+ translations for another language, please send them to dowdybrown@yahoo.com
+******************************************************************/
+Rico.langCode='zh';
+
+// used in ricoLiveGrid.js
+
+Rico.addPhraseId('bookmarkExact',"第 $1 - $2 条记录(总计$3条)");
+Rico.addPhraseId('bookmarkAbout',"第 $1 - $2 条记录(总数超过$3条)");
+Rico.addPhraseId('bookmarkNoRec',"未发现记录");
+Rico.addPhraseId('bookmarkNoMatch',"未找到匹配的记录");
+Rico.addPhraseId('bookmarkLoading',"正在加载...");
+Rico.addPhraseId('sorting',"正在排序...");
+Rico.addPhraseId('exportStatus',"导出第 $1 行");
+Rico.addPhraseId('filterAll',"(所有)");
+Rico.addPhraseId('filterBlank',"(空白)");
+Rico.addPhraseId('filterEmpty',"(空值)");
+Rico.addPhraseId('filterNotEmpty',"(非空)");
+Rico.addPhraseId('filterLike',"类似于: $1");
+Rico.addPhraseId('filterNot',"非: $1");
+Rico.addPhraseId('requestError',"该请求返回一个错误:\n$1");
+Rico.addPhraseId('keywordPrompt',"请输入搜索词(可使用通配符*):");
+
+// used in ricoLiveGridMenu.js
+
+Rico.addPhraseId('gridmenuSortBy',"排序 依据:$1");
+Rico.addPhraseId('gridmenuSortAsc',"升序");
+Rico.addPhraseId('gridmenuSortDesc',"降序");
+Rico.addPhraseId('gridmenuFilterBy',"过滤 依据:     $1");
+Rico.addPhraseId('gridmenuRefresh',"刷新");
+Rico.addPhraseId('gridmenuChgKeyword',"更改搜索词...");
+Rico.addPhraseId('gridmenuExcludeAlso',"不包括此值");
+Rico.addPhraseId('gridmenuInclude',"只包括此值");
+Rico.addPhraseId('gridmenuGreaterThan',"大于或等于此值");
+Rico.addPhraseId('gridmenuLessThan',"小于或等于此值");
+Rico.addPhraseId('gridmenuContains',"包含关键字...");
+Rico.addPhraseId('gridmenuExclude',"不包括此值");
+Rico.addPhraseId('gridmenuRemoveFilter',"移除过滤器");
+Rico.addPhraseId('gridmenuRemoveAll',"移除所有过滤器");
+
+Rico.addPhraseId('gridmenuExport',"打印/输出");
+Rico.addPhraseId('gridmenuExportVis2Web',"输出可见行至网页");
+Rico.addPhraseId('gridmenuExportAll2Web',"输出所有行至网页");
+Rico.addPhraseId('gridmenuExportVis2SS',"输出可见行至表格");
+Rico.addPhraseId('gridmenuExportAll2SS',"输出所有行至表格");
+
+Rico.addPhraseId('gridmenuHideShow',"隐藏/显示");
+Rico.addPhraseId('gridmenuChooseCols',"选择以下列...");
+Rico.addPhraseId('gridmenuHide',"隐藏: $1");
+Rico.addPhraseId('gridmenuShow',"显示: $1");
+Rico.addPhraseId('gridmenuShowAll',"显示所有");
+
+// used in ricoLiveGridAjax.js
+
+Rico.addPhraseId('sessionExpireMinutes',"分钟后您的会话将过期");
+Rico.addPhraseId('sessionExpired',"已过期");
+Rico.addPhraseId('requestTimedOut',"数据传输超时!");
+Rico.addPhraseId('waitForData',"正在加载数据...");
+Rico.addPhraseId('httpError',"接收到HTTP错误: $1");
+Rico.addPhraseId('invalidResponse',"服务器返回一个无效的响应");
+
+// used in ricoLiveGridCommon.js
+
+Rico.addPhraseId('gridChooseCols',"选择以下列...");
+Rico.addPhraseId('exportComplete',"输出完成!");
+Rico.addPhraseId('exportInProgress',"正在输出...");
+Rico.addPhraseId('showFilterRow',"显示被过滤的行");  // img alt text
+Rico.addPhraseId('hideFilterRow',"隐藏被过滤的行");  // img alt text
+
+// used in ricoLiveGridForms.js
+
+Rico.addPhraseId('selectNone',"(无)");
+Rico.addPhraseId('selectNewVal',"(新值)");
+Rico.addPhraseId('record',"记录");
+Rico.addPhraseId('thisRecord',"该 $1");
+Rico.addPhraseId('confirmDelete',"您确定要删除 $1 吗?");
+Rico.addPhraseId('deleting',"正在删除...");
+Rico.addPhraseId('formPleaseEnter',"请输入 $1 的值");
+Rico.addPhraseId('formInvalidFmt',"不符合 $1 的格式");
+Rico.addPhraseId('formOutOfRange',"值超出 $1 的范围");
+Rico.addPhraseId('formNewValue',"新值:");
+Rico.addPhraseId('saving',"正在保存...");
+Rico.addPhraseId('clear',"清除");
+Rico.addPhraseId('close',"关闭");
+Rico.addPhraseId('saveRecord',"保存");
+Rico.addPhraseId('cancel',"撤销");
+Rico.addPhraseId('editRecord',"编辑"); //$1 ommited
+Rico.addPhraseId('deleteRecord',"删除"); //$1 ommited
+Rico.addPhraseId('cloneRecord',"克隆");//$1 ommited
+Rico.addPhraseId('addRecord',"添加");   //$1 ommited
+Rico.addPhraseId('addedSuccessfully',"$1 添加成功");
+Rico.addPhraseId('deletedSuccessfully',"$1 删除成功");
+Rico.addPhraseId('updatedSuccessfully',"$1 更新成功");
+
+// used in ricoTree.js
+
+Rico.addPhraseId('treeSave',"保存选择");
+Rico.addPhraseId('treeClear',"全部清除");
+
+// used in ricoCalendar.js
+
+Rico.addPhraseId('calToday',"今天是 $3 年 $4 月 $1 日");  // $1=day, $2=monthabbr, $3=year, $4=month number
+Rico.addPhraseId('calWeekHdg',"星期");
+Rico.addPhraseId('calYearRange',"$1年 - $2年");
+Rico.addPhraseId('calInvalidYear',"无效的年份");
+
+// Date & number formats
+
+Rico.thouSep=",";
+Rico.decPoint=".";
+Rico.dateFmt="yyyy年mm月dd日";
+
+Rico.monthNames=['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
+Rico.monthNamesShort=['一','二','三','四','五','六','七','八','九','十','十一','十二'];
+Rico.dayNames=['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
+Rico.dayNamesShort=['周日','周一','周二','周三','周四','周五','周六'];
+
+Rico.includeLoaded('ricoLocale_zh.js');