Fixed Rico.Corner.round to be compatible with latest browsers/CSS3 - in both Rico2...
authorMatt Brown <dowdybrown@yahoo.com>
Sat, 30 Apr 2011 17:50:12 +0000 (17:50 +0000)
committerMatt Brown <dowdybrown@yahoo.com>
Sat, 30 Apr 2011 17:50:12 +0000 (17:50 +0000)
Rico3:

Eliminated Rico.loadModule. Rico must now be loaded using the minimized version. Scripts that get minimized were moved to js/minsrc.

Elimiated Rico.bind. All calls to Rico.bind were replaced with closures. This eliminates any potential conflict with Ecmascript 5's bind.

Fixes to calendar to make it work better with jQuery themes.

Rico.Shadow changed to a pure CSS solution. Shadow images removed.

LoadRicoClient.asp made generic and moved to plugins directory.

git-svn-id: svn://svn.code.sf.net/p/openrico/code/trunk/rico3@74 53df2df2-7ab5-4331-af62-ea79255fa4e2

90 files changed:
examples/asp/LoadRicoClient.asp [deleted file]
examples/asp/RicoDbViewerDetail.asp
examples/asp/ShipperEdit.asp
examples/asp/ex1.asp
examples/asp/ex2editfilter.asp
examples/asp/ex2editfilterKW.asp
examples/asp/ex2json.asp
examples/asp/ex2nosession.asp
examples/asp/ex2xml.asp
examples/asp/menu.html
examples/asp/simplegrid.asp
examples/asp/tree1.asp
examples/asp/widgets.asp
examples/dotnet/LoadRicoClient.ascx [deleted file]
examples/dotnet/ex1.aspx
examples/dotnet/index.html
examples/dotnet/menu.aspx [new file with mode: 0644]
examples/dotnet/menu.html [deleted file]
examples/html/LoadRicoClient.js
examples/html/accordion-grid.html
examples/html/accordion0.html
examples/html/accordion3.html
examples/html/accordion4.html
examples/html/controls.html
examples/html/corners.html
examples/html/corners2.html
examples/html/drag-and-drop-dyn.html
examples/html/drag-and-drop-grid.html
examples/html/drag-and-drop-log.html
examples/html/drag-and-drop-simple.html
examples/html/drag-and-drop-zones.html
examples/html/gridFromJSarray.html
examples/html/gridFromTable.html
examples/html/gridFromTableResize.html
examples/html/gridJSbuffer.html
examples/html/gridJSbuffer2.html
examples/html/menu.html
examples/html/panel1.html
examples/html/panel2.html
examples/menu.js
examples/php/LoadRicoClient.php
examples/php/RicoDbViewerDetail.php
examples/php/ShipperEdit.php
examples/php/ex1.php
examples/php/ex2editfilter.php
examples/php/ex2json.php
examples/php/ex2nosession.php
examples/php/ex2xml.php
examples/php/menu.html
examples/php/photos.php
examples/php/simplegrid.php
examples/php/tree1.php
examples/php/widgets.php
plugins/asp/LoadRicoClient.asp [new file with mode: 0644]
plugins/asp/dbClass3.vbs
ricoClient/css/rico.css
ricoClient/images/aline.gif [deleted file]
ricoClient/images/shadow_l.png [deleted file]
ricoClient/images/shadow_ll.png [deleted file]
ricoClient/images/shadow_lr.png [deleted file]
ricoClient/images/shadow_r.png [deleted file]
ricoClient/js/baselibs/prototype.js
ricoClient/js/export-owc.html [deleted file]
ricoClient/js/export-plain.html [deleted file]
ricoClient/js/export_owc.html [new file with mode: 0644]
ricoClient/js/export_plain.html [new file with mode: 0644]
ricoClient/js/glow_min.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoCalendar.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoColorPicker.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoDragDrop.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoGridCommon.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoLiveGrid.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoLiveGridAjax.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoLiveGridControls.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoLiveGridForms.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoLiveGridMenu.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoSearch.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoSimpleGrid.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoTree.js [new file with mode: 0644]
ricoClient/js/minsrc/ricoUI.js [new file with mode: 0644]
ricoClient/js/proto_min.js [new file with mode: 0644]
ricoClient/js/rico.js
ricoClient/js/rico2doj.js
ricoClient/js/rico2ext.js
ricoClient/js/rico2glo.js
ricoClient/js/rico2jqu.js
ricoClient/js/rico2moo.js
ricoClient/js/rico2pro.js
ricoClient/js/ricoThemeroller.js
ricoClient/js/rico_min.js [new file with mode: 0644]

diff --git a/examples/asp/LoadRicoClient.asp b/examples/asp/LoadRicoClient.asp
deleted file mode 100644 (file)
index 54a9dde..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<%\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.8.5/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="prototype-1.6"     ' base library\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
-  if baseLoadFlag then\r
-    if InStr(baseLib,"/") > 0 then\r
-      Response.Write vbLf & "<script src='http://ajax.googleapis.com/ajax/libs/" & baseLib & "' type='text/javascript'></script>"\r
-    else\r
-      Response.Write vbLf & "<script src='" & baselibsDir & baseLib & ".js' type='text/javascript'></script>"\r
-    end if\r
-  end if\r
-  requireRicoJS ""\r
-  requireRicoJS "2" & left(baseLib,3)\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
index 0f6f709..be33278 100644 (file)
@@ -7,7 +7,15 @@
 <link href="../demo.css" type="text/css" rel="stylesheet" />\r
 \r
 <!-- #INCLUDE FILE = "dbConnect.asp" --> \r
-<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
 \r
 <%\r
 \r
@@ -35,8 +43,6 @@ session.contents(id)="select " & columnlist & " from [" & id & "] order by " & a
 %>\r
 \r
 <script type='text/javascript'>\r
-Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
-\r
 Rico.onLoad( function() {\r
   var opts = {  \r
     useUnformattedColWidth: false,\r
index 5c4eab1..6bc4b72 100644 (file)
@@ -8,12 +8,16 @@
 <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
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
 \r
 <link href="../demo.css" type="text/css" rel="stylesheet" />\r
 <style type="text/css">
index e4a96dc..b76df86 100644 (file)
@@ -4,13 +4,19 @@
 <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
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\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
index 52bcdbb..e4f1600 100644 (file)
@@ -8,12 +8,20 @@
 <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
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
+\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
index 3bc2f1c..6f74943 100644 (file)
@@ -8,12 +8,20 @@
 <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
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
+\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
index ce2f704..d148b39 100644 (file)
@@ -4,7 +4,15 @@
 <head>\r
 <title>Rico LiveGrid-Example 2</title>\r
 \r
-<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
 \r
 <%\r
 Session.Timeout=60\r
@@ -17,7 +25,6 @@ session.contents("ex2")=sqltext
 \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
index 975a1d0..9200846 100644 (file)
@@ -37,11 +37,18 @@ if OpenGridForm(empty,"Orders") then
 end if\r
 %>\r
 \r
-<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\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
index 0c2e198..e35ba7c 100644 (file)
@@ -4,7 +4,15 @@
 <head>\r
 <title>Rico LiveGrid-Example 2</title>\r
 \r
-<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
 \r
 <%\r
 Session.Timeout=60\r
@@ -17,7 +25,6 @@ session.contents("ex2")=sqltext
 \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
index 90b3f2f..8c8d988 100644 (file)
@@ -5,10 +5,10 @@
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
 <base target="content">\r
 \r
-<script src="../../ricoClient/js/baselibs/prototype-1.6.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/proto_min.js" type="text/javascript"></script>\r
 <script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
 <script src="../../ricoClient/js/rico2pro.js" type="text/javascript"></script>\r
-<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico_min.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
@@ -174,7 +174,7 @@ ul li {
   <div>Choose the Base Library</div>\r
   <div>\r
 <ul>\r
-<li><a id='lib_prototype-1.6'>Prototype 1.6</a>\r
+<li><a id='lib_prototype/1.6/prototype.js'>Prototype 1.6</a>\r
 <li><a id='lib_prototype/1.7/prototype.js'>Prototype 1.7</a>\r
 <li><a id='lib_jquery/1.3/jquery.min.js'>jQuery 1.3</a>\r
 <li><a id='lib_jquery/1.4/jquery.min.js'>jQuery 1.4</a>\r
@@ -185,7 +185,7 @@ ul li {
 <li><a id='lib_dojo/1.5/dojo/dojo.xd.js'>dojo 1.5</a>\r
 <li><a id='lib_ext-core/3.0/ext-core.js'>Ext 3.0</a>\r
 <li><a id='lib_ext-core/3.1/ext-core.js'>Ext 3.1</a>\r
-<li><a id='lib_glow.core-1.7'>Glow 1.7</a>\r
+<li><a id='lib_glow_min.js'>Glow 1.7</a>\r
 </ul>\r
   </div>\r
 </div>\r
index 0716139..221cfde 100644 (file)
@@ -5,14 +5,20 @@
 <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
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\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
index ba3d6dd..a1187a9 100644 (file)
@@ -4,12 +4,19 @@
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
 <title>Rico-Tree Control</title>\r
 
-<!-- #INCLUDE FILE = "LoadRicoClient.asp" --> \r
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\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
index b9de437..df4160b 100644 (file)
@@ -4,11 +4,17 @@
 <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
+<!-- #INCLUDE FILE = "../../plugins/asp/LoadRicoClient.asp" -->\r
+<%\r
+Dim RicoClient\r
+set RicoClient = new LoadRicoClient\r
+RicoClient.SetRicoClientParentPath "../../ricoClient/"\r
+RicoClient.CheckQueryString   ' just for demo\r
+RicoClient.CreateLinks\r
+set RicoClient = Nothing\r
+%>\r
 \r
 <script>\r
-Rico.loadModule('LiveGridBasic','LiveGridMenu','Calendar');\r
-\r
 var dialog;\r
 \r
 Rico.onLoad( function() {\r
diff --git a/examples/dotnet/LoadRicoClient.ascx b/examples/dotnet/LoadRicoClient.ascx
deleted file mode 100644 (file)
index a4d43c0..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-<%@ 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 = "prototype-1.6"   ' base library\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.8.5/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
-' disable themes\r
-' -------------------------------------------------------------\r
-Public WriteOnly Property noTheme() As String\r
-  Set(ByVal ThemeName As String)\r
-    theme=""\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
-  if LoadBaseLib then\r
-    if InStr(baseLib,"/") > 0 then\r
-      writer.Write(vbLf & "<script src='http://ajax.googleapis.com/ajax/libs/" & baseLib & "' type='text/javascript'></" & "script>")\r
-    else\r
-      writer.Write(vbLf & "<script src='" & baselibsDir & baseLib & ".js' type='text/javascript'></" & "script>")\r
-    end if\r
-  end if\r
-  requireRicoJS(writer, "")\r
-  requireRicoJS(writer, "2" & left(baseLib,3))\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
index ec90684..796cfd0 100644 (file)
@@ -1,12 +1,12 @@
 <%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
-<%@ Register TagPrefix="My" TagName="LoadRicoClient" Src="LoadRicoClient.ascx" %>\r
+<%@ Register TagPrefix="Rico" Assembly="Rico" NameSpace="Rico" %>\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
+<Rico:LoadClient checkQueryString='true' runat='server' />\r
 <link href="../demo.css" type="text/css" rel="stylesheet" />\r
 \r
 <script type='text/javascript'>\r
index 4be0eea..c234d05 100644 (file)
@@ -5,7 +5,7 @@
 <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="menu" src="menu.aspx">\r
   <frame name="content" src="../welcome.html" scrolling="yes">\r
 </frameset>\r
 </html>\r
diff --git a/examples/dotnet/menu.aspx b/examples/dotnet/menu.aspx
new file mode 100644 (file)
index 0000000..e505bd3
--- /dev/null
@@ -0,0 +1,190 @@
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" Debug="true" validateRequest="false" %>\r
+<%@ Register TagPrefix="Rico" Assembly="Rico" NameSpace="Rico" %>\r
+<!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
+<Rico:LoadClient noTheme='' runat='server' />\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_prototype/1.6/prototype.js'>Prototype 1.6</a>\r
+<li><a id='lib_prototype/1.7/prototype.js'>Prototype 1.7</a>\r
+<li><a id='lib_jquery/1.3/jquery.min.js'>jQuery 1.3</a>\r
+<li><a id='lib_jquery/1.4/jquery.min.js'>jQuery 1.4</a>\r
+<li><a id='lib_jquery/1.5/jquery.min.js'>jQuery 1.5</a>\r
+<li><a id='lib_mootools/1.2/mootools-yui-compressed.js'>MooTools 1.2</a>\r
+<li><a id='lib_mootools/1.3/mootools-yui-compressed.js'>MooTools 1.3</a>\r
+<li><a id='lib_dojo/1.4/dojo/dojo.xd.js'>dojo 1.4</a>\r
+<li><a id='lib_dojo/1.5/dojo/dojo.xd.js'>dojo 1.5</a>\r
+<li><a id='lib_ext-core/3.0/ext-core.js'>Ext 3.0</a>\r
+<li><a id='lib_ext-core/3.1/ext-core.js'>Ext 3.1</a>\r
+<li><a id='lib_glow.core-1.7'>Glow 1.7</a>\r
+</ul>\r
+  </div>\r
+</div>\r
+\r
+</div>\r
+</body></html>\r
diff --git a/examples/dotnet/menu.html b/examples/dotnet/menu.html
deleted file mode 100644 (file)
index dc3ca1b..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-<!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-1.6.js" type="text/javascript"></script>\r
-<script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
-<script src="../../ricoClient/js/rico2pro.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_prototype-1.6'>Prototype 1.6</a>\r
-<li><a id='lib_prototype/1.7/prototype.js'>Prototype 1.7</a>\r
-<li><a id='lib_jquery/1.3/jquery.min.js'>jQuery 1.3</a>\r
-<li><a id='lib_jquery/1.4/jquery.min.js'>jQuery 1.4</a>\r
-<li><a id='lib_jquery/1.5/jquery.min.js'>jQuery 1.5</a>\r
-<li><a id='lib_mootools/1.2/mootools-yui-compressed.js'>MooTools 1.2</a>\r
-<li><a id='lib_mootools/1.3/mootools-yui-compressed.js'>MooTools 1.3</a>\r
-<li><a id='lib_dojo/1.4/dojo/dojo.xd.js'>dojo 1.4</a>\r
-<li><a id='lib_dojo/1.5/dojo/dojo.xd.js'>dojo 1.5</a>\r
-<li><a id='lib_ext-core/3.0/ext-core.js'>Ext 3.0</a>\r
-<li><a id='lib_ext-core/3.1/ext-core.js'>Ext 3.1</a>\r
-<li><a id='lib_glow.core-1.7'>Glow 1.7</a>\r
-</ul>\r
-  </div>\r
-</div>\r
-\r
-</div>\r
-</body></html>\r
index 2d01c93..ef0f8c5 100644 (file)
@@ -9,7 +9,6 @@ Rico_CONFIG = {
 \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
@@ -25,7 +24,7 @@ Rico_CONFIG = {
       }\r
     } else {\r
       // set your production values here\r
-      lib="prototype-1.6";    // base library\r
+      lib="proto_min";         // base library\r
       theme="j-ui-lightness";  // jquery themes start with j-, rico themes start with r-\r
     }\r
     if (lib) this.LoadLib(lib);\r
@@ -38,15 +37,13 @@ Rico_CONFIG = {
         // load from googleapis\r
         document.write("<script src='http://ajax.googleapis.com/ajax/libs/"+baseLib+"' type='text/javascript'></script>");\r
       } else {\r
-        // load from Rico baselibs dir\r
-        document.write("<script src='"+this.baselibsDir+baseLib+".js' type='text/javascript'></script>");\r
+        document.write("<script src='"+this.jsDir+baseLib+"' type='text/javascript'></script>");\r
       }\r
     }\r
     this.requireRicoJS("");\r
     this.requireRicoJS("2" + baseLib.substr(0,3));\r
-    document.write("<script src='"+this.transDir+"ricoLocale_en.js' type='text/javascript'></script>");\r
+    this.requireRicoJS("_min");\r
     this.requireRicoCSS("rico");\r
-    this.requireRicoJS("UI");\r
   },\r
 \r
   // set theme\r
index 8546416..f79f049 100644 (file)
@@ -8,8 +8,6 @@
 <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
index 42f5990..4fd976d 100644 (file)
@@ -6,9 +6,6 @@
 \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
index 51cc9b4..bd37ae6 100644 (file)
@@ -6,9 +6,6 @@
 \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
index ff32e32..0ef5fe9 100644 (file)
@@ -6,9 +6,6 @@
 \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
index b589433..64b72a7 100644 (file)
@@ -7,7 +7,6 @@
 <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
index 104a059..0945d5a 100644 (file)
@@ -7,8 +7,6 @@
 \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
index d48436a..5b04679 100644 (file)
@@ -7,8 +7,6 @@
 \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
index b01acb5..2640110 100644 (file)
@@ -8,8 +8,6 @@
 <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
index ffde2f4..68bedbb 100644 (file)
@@ -8,8 +8,6 @@
 <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
index 72a0163..9aba6c4 100644 (file)
@@ -8,8 +8,6 @@
 <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
index 027b3d9..c9e4378 100644 (file)
@@ -8,7 +8,6 @@
 <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
index 02e25f4..1ec4753 100644 (file)
@@ -8,8 +8,6 @@
 <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
index 6b99209..59a17a3 100644 (file)
@@ -7,8 +7,6 @@
 <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
index 1fda2b2..96cf20b 100644 (file)
@@ -7,8 +7,6 @@
 <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
index 014cb5b..2667e1a 100644 (file)
@@ -7,8 +7,6 @@
 <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
index aca717d..980a2ba 100644 (file)
@@ -7,8 +7,6 @@
 <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
index 8e7f2cf..4d97a09 100644 (file)
@@ -7,8 +7,6 @@
 <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
index 036c93e..6d7efc5 100644 (file)
@@ -5,10 +5,10 @@
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
 <base target="content">\r
 \r
-<script src="../../ricoClient/js/baselibs/prototype-1.6.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/proto_min.js" type="text/javascript"></script>\r
 <script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
 <script src="../../ricoClient/js/rico2pro.js" type="text/javascript"></script>\r
-<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico_min.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
@@ -204,7 +204,7 @@ ul li {
   <div>Choose the Base Library</div>\r
   <div>\r
 <ul>\r
-<li><a id='lib_prototype-1.6'>Prototype 1.6</a>\r
+<li><a id='lib_prototype/1.6/prototype.js'>Prototype 1.6</a>\r
 <li><a id='lib_prototype/1.7/prototype.js'>Prototype 1.7</a>\r
 <li><a id='lib_jquery/1.3/jquery.min.js'>jQuery 1.3</a>\r
 <li><a id='lib_jquery/1.4/jquery.min.js'>jQuery 1.4</a>\r
@@ -215,7 +215,7 @@ ul li {
 <li><a id='lib_dojo/1.5/dojo/dojo.xd.js'>dojo 1.5</a>\r
 <li><a id='lib_ext-core/3.0/ext-core.js'>Ext 3.0</a>\r
 <li><a id='lib_ext-core/3.1/ext-core.js'>Ext 3.1</a>\r
-<li><a id='lib_glow.core-1.7'>Glow 1.7</a>\r
+<li><a id='lib_glow_min.js'>Glow 1.7</a>\r
 </ul>\r
   </div>\r
 </div>\r
index bb9d054..581cb4a 100644 (file)
@@ -8,7 +8,6 @@
 <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
index ceea670..fbd0ce4 100644 (file)
@@ -8,7 +8,6 @@
 <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
index d2786ad..d7b5c2e 100644 (file)
@@ -1,13 +1,13 @@
 var acc;\r
 Rico.onLoad( function() {\r
-  $('RicoVersion').innerHTML=Rico.Version;\r
+  Rico.$('RicoVersion').innerHTML=Rico.Version;\r
   arPath=location.pathname.split('/');\r
-  $('RicoDir').innerHTML=arPath[arPath.length-2].toUpperCase().replace(/DOT/,'.');\r
+  Rico.$('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_prototype-1.6'));\r
+  setParm(Rico.$('lib_prototype/1.7/prototype.js'));\r
   setParm(Rico.$('theme_j-ui-lightness'));\r
   setTimeout(WinResize,5);\r
   setTimeout(function() {Event.observe(top, "resize", WinResize, false);},100);\r
@@ -22,7 +22,7 @@ function setLinks(links) {
 \r
 function CalcAccHt() {\r
   var winht=Rico.windowHeight();\r
-  var txtht=$('accordion1').offsetTop;\r
+  var txtht=Rico.$('accordion1').offsetTop;\r
   var titleht=acc.titles.length * (acc.titles[0].offsetHeight + 5);\r
   return Math.max(winht-txtht-titleht-35,60);\r
 }\r
@@ -44,14 +44,17 @@ function processClick(e) {
 }\r
 \r
 function setParm(elem) {\r
-  var parms=elem.id.split(/_/);\r
-  //alert(parms.join(' * '));\r
+  var idx=elem.id.indexOf('_');\r
+  if (idx < 0) return;\r
+  var prefix=elem.id.substr(0,idx);\r
+  var suffix=elem.id.substr(idx+1);\r
+  //alert(prefix+' * '+suffix);\r
   var form=document.forms[0];\r
-  if (parms[0]=='demo') {\r
-    form.action=parms[1];\r
+  if (prefix=='demo') {\r
+    form.action=suffix;\r
   } else {\r
-    Rico.$(parms[0]).value=parms[1];\r
+    Rico.$(prefix).value=suffix;\r
   }\r
-  var spanid=parms[0]+'span';\r
+  var spanid=prefix+'span';\r
   Rico.$(spanid).innerHTML=Rico.stripTags(elem.innerHTML);\r
 }\r
index ae580b0..6d21f00 100644 (file)
@@ -4,11 +4,10 @@ $jsDir="../../ricoClient/js/";       // directory containing Rico's javascript f
 $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.8.5/themes/";\r
+$LoadBaseLib = true;       // load base Javascript library (prototype, jQuery, etc)?\r
+$jQuery_theme_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/";\r
 \r
 if ($checkQueryString) {\r
   $ricoLib=$_GET['lib'];\r
@@ -16,7 +15,7 @@ if ($checkQueryString) {
   $ricoLogging=isset($_GET["log"]);\r
 } else {\r
   // set your production values here\r
-  $ricoLib="prototype-1.6";     // base library\r
+  $ricoLib="prototype";         // base library\r
   $ricoTheme="j-ui-lightness";  // jquery themes start with j-, rico themes start with r-\r
   $ricoLogging=false;\r
 }\r
@@ -42,19 +41,18 @@ function SetConfig() {
 \r
 \r
 function LoadLib($baseLib, $baseLoadFlag) {\r
-  global $baselibsDir,$transDir;\r
+  global $jsDir;\r
   if ($baseLoadFlag) {\r
     if (strpos($baseLib,"/") === false) {\r
-      echo "<script src='".$baselibsDir.$baseLib.".js' type='text/javascript'></script>\n";\r
+      echo "<script src='".$jsDir.$baseLib."' type='text/javascript'></script>\n";\r
     } else {\r
       echo "<script src='http://ajax.googleapis.com/ajax/libs/".$baseLib."' type='text/javascript'></script>\n";\r
     }\r
   }\r
   requireRicoJS("");\r
   requireRicoJS("2" . substr($baseLib,0,3));\r
-  echo "<script src='".$transDir."ricoLocale_en.js' type='text/javascript'></script>\n";\r
+  requireRicoJS("_min");\r
   requireRicoCSS("rico");\r
-  requireRicoJS("UI");\r
 }\r
 \r
 \r
index 235ab25..2de2648 100644 (file)
@@ -41,8 +41,6 @@ if (isset($_GET["id"]) && OpenDB()) {
 \r
 \r
 <script type='text/javascript'>\r
-Rico.loadModule('LiveGridAjax','LiveGridMenu');\r
-\r
 Rico.onLoad( function() {\r
   var opts = {  \r
     useUnformattedColWidth: false,\r
index ad57326..257adad 100644 (file)
@@ -16,9 +16,6 @@ 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">
index 4ea7d55..5f8c7da 100644 (file)
@@ -10,8 +10,6 @@ require "LoadRicoClient.php";
 <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
index 4654f51..dee9e32 100644 (file)
@@ -17,7 +17,6 @@ require "../../plugins/php/ricoLiveGridForms.php";
 ?>
 
 <script type='text/javascript'>
-Rico.loadModule('LiveGridForms','Calendar','Tree');
 
 // ricoLiveGridForms will call orders_FormInit right before grid & form initialization.
 
index b0c0dce..685e030 100644 (file)
@@ -23,7 +23,6 @@ $_SESSION['ex2']=$sqltext;
 <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
index 564f6ed..64b7631 100644 (file)
@@ -47,7 +47,6 @@ require "LoadRicoClient.php";
 ?>
 
 <script type='text/javascript'>
-Rico.loadModule('LiveGridForms','Calendar','Tree');
 
 // ricoLiveGridForms will call orders_FormInit right before grid & form initialization.
 
index 1893ed2..95eddbd 100644 (file)
@@ -23,8 +23,6 @@ $_SESSION['ex2']=$sqltext;
 <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
index 9ee1dbc..3d0da6c 100644 (file)
@@ -5,10 +5,10 @@
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">\r
 <base target="content">\r
 \r
-<script src="../../ricoClient/js/baselibs/prototype-1.6.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/proto_min.js" type="text/javascript"></script>\r
 <script src="../../ricoClient/js/rico.js" type="text/javascript"></script>\r
 <script src="../../ricoClient/js/rico2pro.js" type="text/javascript"></script>\r
-<script src="../../ricoClient/js/ricoUI.js" type="text/javascript"></script>\r
+<script src="../../ricoClient/js/rico_min.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
@@ -169,7 +169,7 @@ ul li {
   <div>Choose the Base Library</div>\r
   <div>\r
 <ul>\r
-<li><a id='lib_prototype-1.6'>Prototype 1.6</a>\r
+<li><a id='lib_prototype/1.6/prototype.js'>Prototype 1.6</a>\r
 <li><a id='lib_prototype/1.7/prototype.js'>Prototype 1.7</a>\r
 <li><a id='lib_jquery/1.3/jquery.min.js'>jQuery 1.3</a>\r
 <li><a id='lib_jquery/1.4/jquery.min.js'>jQuery 1.4</a>\r
@@ -180,7 +180,7 @@ ul li {
 <li><a id='lib_dojo/1.5/dojo/dojo.xd.js'>dojo 1.5</a>\r
 <li><a id='lib_ext-core/3.0/ext-core.js'>Ext 3.0</a>\r
 <li><a id='lib_ext-core/3.1/ext-core.js'>Ext 3.1</a>\r
-<li><a id='lib_glow.core-1.7'>Glow 1.7</a>\r
+<li><a id='lib_glow_min.js'>Glow 1.7</a>\r
 </ul>\r
   </div>\r
 </div>\r
index c74f62e..b142113 100644 (file)
@@ -9,7 +9,6 @@ require "LoadRicoClient.php";
 <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
index ef85bd3..9d9e3ce 100644 (file)
@@ -15,8 +15,6 @@ require "../../plugins/php/SimpleGrid.php";
 <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
index cf293ab..89a2b28 100644 (file)
@@ -11,7 +11,6 @@ require "LoadRicoClient.php";
 <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
index 034e45d..8264817 100644 (file)
@@ -8,7 +8,6 @@ require "LoadRicoClient.php";
 ?>\r
 \r
 <script>\r
-Rico.loadModule('LiveGridBasic','LiveGridMenu','Calendar');\r
 \r
 var dialog;\r
 \r
diff --git a/plugins/asp/LoadRicoClient.asp b/plugins/asp/LoadRicoClient.asp
new file mode 100644 (file)
index 0000000..0a835da
--- /dev/null
@@ -0,0 +1,155 @@
+<%\r
+\r
+' ----------------------------------------------------------------------\r
+'\r
+' Page        : LoadRicoClient.asp\r
+' Description : Class to load Rico client-side Javascript and CSS\r
+' Author      : Matt Brown (dowdybrown@yahoo.com)\r
+' Copyright (C) 2006-2011 Matt Brown\r
+'\r
+' Rico is 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
+' http://www.apache.org/licenses/LICENSE-2.0\r
+'\r
+' ----------------------------------------------------------------------\r
+\r
+class LoadRicoClient\r
+\r
+' Properties\r
+\r
+Public jsDir     ' directory containing Rico's javascript files\r
+Public cssDir    ' directory containing Rico's css files\r
+Public imgDir    ' directory containing Rico's image files\r
+Public transDir\r
+Public ricoLib,ricoTheme,ricoLogging\r
+Public grid_striping     ' apply row striping to LiveGrids?\r
+Public LoadBaseLib       ' load base Javascript library (prototype, jQuery, etc)?\r
+Public jQuery_theme_path\r
+Public SupportedLangs    ' comma-separated list of 2-character codes, representing the files that can be found in js/translations directory\r
+\r
+' Constructor\r
+\r
+Private Sub Class_Initialize\r
+  ricoLib="proto_min"         ' default base library\r
+  ricoTheme="j-ui-lightness"  ' jquery themes start with j-, rico themes start with r-\r
+  ricoLogging=false\r
+  grid_striping = true\r
+  LoadBaseLib = true\r
+  SupportedLangs = "de,es,fr,it,ja,ko,pt,ru,uk,zh"\r
+  jQuery_theme_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/"\r
+End Sub\r
+\r
+\r
+Public Sub SetRicoClientPaths(ByVal jsPath, cssPath, imgPath)\r
+  jsDir = jsPath\r
+  cssDir= cssPath\r
+  imgDir= imgPath\r
+  transDir=jsDir & "translations/"\r
+End Sub\r
+\r
+\r
+Public Sub SetRicoClientParentPath(ByVal clientDir)\r
+  if mid(clientDir,len(clientDir),1) <> "/" then clientDir=clientDir & "/"\r
+  SetRicoClientPaths clientDir & "js/", clientDir & "css/", clientDir & "images/"\r
+End Sub\r
+\r
+\r
+' Used by demo to switch libraries & themes\r
+' Do no call in production\r
+Public Sub CheckQueryString()\r
+  ricoLib=LCase(Request.QueryString("lib"))\r
+  ricoTheme=trim(Request.QueryString("theme"))\r
+  ricoLogging=CBool(trim(Request.QueryString("log")) <> "")\r
+end Sub\r
+\r
+\r
+' This is the main method, which creates the Javscript and CSS links\r
+Public Sub CreateLinks()\r
+  SetConfig\r
+  LoadLib ricoLib, LoadBaseLib\r
+  setLang\r
+  if ricoTheme<>"" then\r
+    LoadTheme ricoTheme\r
+  end if\r
+End sub\r
+\r
+\r
+' Create Rico client initialization object\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
+  if baseLoadFlag then\r
+    if InStr(baseLib,"/") > 0 then\r
+      Response.Write vbLf & "<script src='http://ajax.googleapis.com/ajax/libs/" & baseLib & "' type='text/javascript'></script>"\r
+    else\r
+      Response.Write vbLf & "<script src='" & jsDir & baseLib & "' type='text/javascript'></script>"\r
+    end if\r
+  end if\r
+  requireRicoJS ""\r
+  requireRicoJS "2" & left(baseLib,3)\r
+  requireRicoCSS "rico"\r
+  requireRicoJS "_min"\r
+end sub\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
+  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
+    If InStr(SupportedLangs, lang2) > 0 Then\r
+      fname=transDir & "ricoLocale_" & lang2 & ".js"\r
+      Response.Write "<script src='" & fname & "' type='text/javascript'></script>"\r
+      exit for\r
+    end if\r
+  next\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='" & 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
+End Class\r
+\r
+%>\r
index df10625..d7e237a 100644 (file)
@@ -2,10 +2,10 @@
 \r
 ' ----------------------------------------------------------------------\r
 '\r
-' Page        : dbClass2.vbs\r
+' Page        : dbClass3.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
+' Copyright (C) 2006-2011 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
index 46586ed..cb14a1d 100644 (file)
@@ -322,6 +322,17 @@ form .ricoEditLabel {
 }\r
 \r
 \r
+/* shadows */\r
+.ricoShadow {\r
+  -moz-box-shadow: 3px 3px 4px #888;\r
+  -webkit-box-shadow: 3px 3px 4px #888;\r
+  box-shadow: 3px 3px 4px #888;\r
+  /* For IE 8 */\r
+  -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";\r
+  /* For IE 5.5 - 7 */\r
+  filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');\r
+}\r
+\r
 \r
 /* ricoMenu */\r
 \r
diff --git a/ricoClient/images/aline.gif b/ricoClient/images/aline.gif
deleted file mode 100644 (file)
index 7f5cb43..0000000
Binary files a/ricoClient/images/aline.gif and /dev/null differ
diff --git a/ricoClient/images/shadow_l.png b/ricoClient/images/shadow_l.png
deleted file mode 100644 (file)
index e113dfd..0000000
Binary files a/ricoClient/images/shadow_l.png and /dev/null differ
diff --git a/ricoClient/images/shadow_ll.png b/ricoClient/images/shadow_ll.png
deleted file mode 100644 (file)
index cc0665b..0000000
Binary files a/ricoClient/images/shadow_ll.png and /dev/null differ
diff --git a/ricoClient/images/shadow_lr.png b/ricoClient/images/shadow_lr.png
deleted file mode 100644 (file)
index 27e3b4b..0000000
Binary files a/ricoClient/images/shadow_lr.png and /dev/null differ
diff --git a/ricoClient/images/shadow_r.png b/ricoClient/images/shadow_r.png
deleted file mode 100644 (file)
index 77f877d..0000000
Binary files a/ricoClient/images/shadow_r.png and /dev/null differ
index 9fe6e12..474b223 100644 (file)
@@ -1,5 +1,5 @@
-/*  Prototype JavaScript framework, version 1.6.1
- *  (c) 2005-2009 Sam Stephenson
+/*  Prototype JavaScript framework, version 1.7
+ *  (c) 2005-2010 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/
@@ -7,7 +7,8 @@
  *--------------------------------------------------------------------------*/
 
 var Prototype = {
-  Version: '1.6.1',
+
+  Version: '1.7',
 
   Browser: (function(){
     var ua = navigator.userAgent;
@@ -17,13 +18,15 @@ var Prototype = {
       Opera:          isOpera,
       WebKit:         ua.indexOf('AppleWebKit/') > -1,
       Gecko:          ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
-      MobileSafari:   /Apple.*Mobile.*Safari/.test(ua)
+      MobileSafari:   /Apple.*Mobile/.test(ua)
     }
   })(),
 
   BrowserFeatures: {
     XPath: !!document.evaluate,
+
     SelectorsAPI: !!document.querySelector,
+
     ElementExtensions: (function() {
       var constructor = window.Element || window.HTMLElement;
       return !!(constructor && constructor.prototype);
@@ -32,9 +35,9 @@ var Prototype = {
       if (typeof window.HTMLDivElement !== 'undefined')
         return true;
 
-      var div = document.createElement('div');
-      var form = document.createElement('form');
-      var isSupported = false;
+      var div = document.createElement('div'),
+          form = document.createElement('form'),
+          isSupported = false;
 
       if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
         isSupported = true;
@@ -50,6 +53,7 @@ var Prototype = {
   JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
 
   emptyFunction: function() { },
+
   K: function(x) { return x }
 };
 
@@ -79,6 +83,14 @@ var Try = {
 /* Based on Alex Arnell's inheritance implementation. */
 
 var Class = (function() {
+
+  var IS_DONTENUM_BUGGY = (function(){
+    for (var p in { toString: 1 }) {
+      if (p === 'toString') return false;
+    }
+    return true;
+  })();
+
   function subclass() {};
   function create() {
     var parent = null, properties = $A(arguments);
@@ -99,7 +111,7 @@ var Class = (function() {
       parent.subclasses.push(klass);
     }
 
-    for (var i = 0; i < properties.length; i++)
+    for (var i = 0, length = properties.length; i < length; i++)
       klass.addMethods(properties[i]);
 
     if (!klass.prototype.initialize)
@@ -110,10 +122,10 @@ var Class = (function() {
   }
 
   function addMethods(source) {
-    var ancestor   = this.superclass && this.superclass.prototype;
-    var properties = Object.keys(source);
+    var ancestor   = this.superclass && this.superclass.prototype,
+        properties = Object.keys(source);
 
-    if (!Object.keys({ toString: true }).length) {
+    if (IS_DONTENUM_BUGGY) {
       if (source.toString != Object.prototype.toString)
         properties.push("toString");
       if (source.valueOf != Object.prototype.valueOf)
@@ -123,7 +135,7 @@ var Class = (function() {
     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") {
+          value.argumentNames()[0] == "$super") {
         var method = value;
         value = (function(m) {
           return function() { return ancestor[m].apply(this, arguments); };
@@ -147,7 +159,37 @@ var Class = (function() {
 })();
 (function() {
 
-  var _toString = Object.prototype.toString;
+  var _toString = Object.prototype.toString,
+      NULL_TYPE = 'Null',
+      UNDEFINED_TYPE = 'Undefined',
+      BOOLEAN_TYPE = 'Boolean',
+      NUMBER_TYPE = 'Number',
+      STRING_TYPE = 'String',
+      OBJECT_TYPE = 'Object',
+      FUNCTION_CLASS = '[object Function]',
+      BOOLEAN_CLASS = '[object Boolean]',
+      NUMBER_CLASS = '[object Number]',
+      STRING_CLASS = '[object String]',
+      ARRAY_CLASS = '[object Array]',
+      DATE_CLASS = '[object Date]',
+      NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON &&
+        typeof JSON.stringify === 'function' &&
+        JSON.stringify(0) === '0' &&
+        typeof JSON.stringify(Prototype.K) === 'undefined';
+
+  function Type(o) {
+    switch(o) {
+      case null: return NULL_TYPE;
+      case (void 0): return UNDEFINED_TYPE;
+    }
+    var type = typeof o;
+    switch(type) {
+      case 'boolean': return BOOLEAN_TYPE;
+      case 'number':  return NUMBER_TYPE;
+      case 'string':  return STRING_TYPE;
+    }
+    return OBJECT_TYPE;
+  }
 
   function extend(destination, source) {
     for (var property in source)
@@ -166,27 +208,70 @@ var Class = (function() {
     }
   }
 
-  function toJSON(object) {
-    var type = typeof object;
-    switch (type) {
-      case 'undefined':
-      case 'function':
-      case 'unknown': return;
-      case 'boolean': return object.toString();
+  function toJSON(value) {
+    return Str('', { '': value }, []);
+  }
+
+  function Str(key, holder, stack) {
+    var value = holder[key],
+        type = typeof value;
+
+    if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
+      value = value.toJSON(key);
     }
 
-    if (object === null) return 'null';
-    if (object.toJSON) return object.toJSON();
-    if (isElement(object)) return;
+    var _class = _toString.call(value);
 
-    var results = [];
-    for (var property in object) {
-      var value = toJSON(object[property]);
-      if (!isUndefined(value))
-        results.push(property.toJSON() + ': ' + value);
+    switch (_class) {
+      case NUMBER_CLASS:
+      case BOOLEAN_CLASS:
+      case STRING_CLASS:
+        value = value.valueOf();
+    }
+
+    switch (value) {
+      case null: return 'null';
+      case true: return 'true';
+      case false: return 'false';
+    }
+
+    type = typeof value;
+    switch (type) {
+      case 'string':
+        return value.inspect(true);
+      case 'number':
+        return isFinite(value) ? String(value) : 'null';
+      case 'object':
+
+        for (var i = 0, length = stack.length; i < length; i++) {
+          if (stack[i] === value) { throw new TypeError(); }
+        }
+        stack.push(value);
+
+        var partial = [];
+        if (_class === ARRAY_CLASS) {
+          for (var i = 0, length = value.length; i < length; i++) {
+            var str = Str(i, value, stack);
+            partial.push(typeof str === 'undefined' ? 'null' : str);
+          }
+          partial = '[' + partial.join(',') + ']';
+        } else {
+          var keys = Object.keys(value);
+          for (var i = 0, length = keys.length; i < length; i++) {
+            var key = keys[i], str = Str(key, value, stack);
+            if (typeof str !== "undefined") {
+               partial.push(key.inspect(true)+ ':' + str);
+             }
+          }
+          partial = '{' + partial.join(',') + '}';
+        }
+        stack.pop();
+        return partial;
     }
+  }
 
-    return '{' + results.join(', ') + '}';
+  function stringify(object) {
+    return JSON.stringify(object);
   }
 
   function toQueryString(object) {
@@ -198,9 +283,13 @@ var Class = (function() {
   }
 
   function keys(object) {
+    if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
     var results = [];
-    for (var property in object)
-      results.push(property);
+    for (var property in object) {
+      if (object.hasOwnProperty(property)) {
+        results.push(property);
+      }
+    }
     return results;
   }
 
@@ -220,24 +309,34 @@ var Class = (function() {
   }
 
   function isArray(object) {
-    return _toString.call(object) == "[object Array]";
+    return _toString.call(object) === ARRAY_CLASS;
   }
 
+  var hasNativeIsArray = (typeof Array.isArray == 'function')
+    && Array.isArray([]) && !Array.isArray({});
+
+  if (hasNativeIsArray) {
+    isArray = Array.isArray;
+  }
 
   function isHash(object) {
     return object instanceof Hash;
   }
 
   function isFunction(object) {
-    return typeof object === "function";
+    return _toString.call(object) === FUNCTION_CLASS;
   }
 
   function isString(object) {
-    return _toString.call(object) == "[object String]";
+    return _toString.call(object) === STRING_CLASS;
   }
 
   function isNumber(object) {
-    return _toString.call(object) == "[object Number]";
+    return _toString.call(object) === NUMBER_CLASS;
+  }
+
+  function isDate(object) {
+    return _toString.call(object) === DATE_CLASS;
   }
 
   function isUndefined(object) {
@@ -247,10 +346,10 @@ var Class = (function() {
   extend(Object, {
     extend:        extend,
     inspect:       inspect,
-    toJSON:        toJSON,
+    toJSON:        NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
     toQueryString: toQueryString,
     toHTML:        toHTML,
-    keys:          keys,
+    keys:          Object.keys || keys,
     values:        values,
     clone:         clone,
     isElement:     isElement,
@@ -259,6 +358,7 @@ var Class = (function() {
     isFunction:    isFunction,
     isString:      isString,
     isNumber:      isNumber,
+    isDate:        isDate,
     isUndefined:   isUndefined
   });
 })();
@@ -311,7 +411,7 @@ Object.extend(Function.prototype, (function() {
 
   function delay(timeout) {
     var __method = this, args = slice.call(arguments, 1);
-    timeout = timeout * 1000
+    timeout = timeout * 1000;
     return window.setTimeout(function() {
       return __method.apply(__method, args);
     }, timeout);
@@ -352,14 +452,28 @@ Object.extend(Function.prototype, (function() {
 })());
 
 
-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"';
-};
+
+(function(proto) {
+
+
+  function toISOString() {
+    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';
+  }
+
+
+  function toJSON() {
+    return this.toISOString();
+  }
+
+  if (!proto.toISOString) proto.toISOString = toISOString;
+  if (!proto.toJSON) proto.toJSON = toJSON;
+
+})(Date.prototype);
 
 
 RegExp.prototype.match = RegExp.prototype.test;
@@ -418,6 +532,9 @@ Object.extend(String, {
 });
 
 Object.extend(String.prototype, (function() {
+  var NATIVE_JSON_PARSE_SUPPORT = window.JSON &&
+    typeof JSON.parse === 'function' &&
+    JSON.parse('{"test": true}').test;
 
   function prepareReplacement(replacement) {
     if (Object.isFunction(replacement)) return replacement;
@@ -484,8 +601,8 @@ Object.extend(String.prototype, (function() {
   }
 
   function extractScripts() {
-    var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
-    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+    var matchAll = new RegExp(Prototype.ScriptFragment, 'img'),
+        matchOne = new RegExp(Prototype.ScriptFragment, 'im');
     return (this.match(matchAll) || []).map(function(scriptTag) {
       return (scriptTag.match(matchOne) || ['', ''])[1];
     });
@@ -510,8 +627,9 @@ Object.extend(String.prototype, (function() {
 
     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];
+        var key = decodeURIComponent(pair.shift()),
+            value = pair.length > 1 ? pair.join('=') : pair[0];
+
         if (value != undefined) value = decodeURIComponent(value);
 
         if (key in hash) {
@@ -538,17 +656,9 @@ Object.extend(String.prototype, (function() {
   }
 
   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;
+    return this.replace(/-+(.)?/g, function(match, chr) {
+      return chr ? chr.toUpperCase() : '';
+    });
   }
 
   function capitalize() {
@@ -578,10 +688,6 @@ Object.extend(String.prototype, (function() {
     return "'" + escapedString.replace(/'/g, '\\\'') + "'";
   }
 
-  function toJSON() {
-    return this.inspect(true);
-  }
-
   function unfilterJSON(filter) {
     return this.replace(filter || Prototype.JSONFilter, '$1');
   }
@@ -589,29 +695,42 @@ Object.extend(String.prototype, (function() {
   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);
+    str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
+    str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
+    str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
+    return (/^[\],:{}\s]*$/).test(str);
   }
 
   function evalJSON(sanitize) {
-    var json = this.unfilterJSON();
+    var json = this.unfilterJSON(),
+        cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
+    if (cx.test(json)) {
+      json = json.replace(cx, function (a) {
+        return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+      });
+    }
     try {
       if (!sanitize || json.isJSON()) return eval('(' + json + ')');
     } catch (e) { }
     throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
   }
 
+  function parseJSON() {
+    var json = this.unfilterJSON();
+    return JSON.parse(json);
+  }
+
   function include(pattern) {
     return this.indexOf(pattern) > -1;
   }
 
   function startsWith(pattern) {
-    return this.indexOf(pattern) === 0;
+    return this.lastIndexOf(pattern, 0) === 0;
   }
 
   function endsWith(pattern) {
     var d = this.length - pattern.length;
-    return d >= 0 && this.lastIndexOf(pattern) === d;
+    return d >= 0 && this.indexOf(pattern, d) === d;
   }
 
   function empty() {
@@ -631,7 +750,7 @@ Object.extend(String.prototype, (function() {
     sub:            sub,
     scan:           scan,
     truncate:       truncate,
-    strip:          String.prototype.trim ? String.prototype.trim : strip,
+    strip:          String.prototype.trim || strip,
     stripTags:      stripTags,
     stripScripts:   stripScripts,
     extractScripts: extractScripts,
@@ -648,10 +767,9 @@ Object.extend(String.prototype, (function() {
     underscore:     underscore,
     dasherize:      dasherize,
     inspect:        inspect,
-    toJSON:         toJSON,
     unfilterJSON:   unfilterJSON,
     isJSON:         isJSON,
-    evalJSON:       evalJSON,
+    evalJSON:       NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
     include:        include,
     startsWith:     startsWith,
     endsWith:       endsWith,
@@ -677,8 +795,9 @@ var Template = Class.create({
       var before = match[1] || '';
       if (before == '\\') return match[2];
 
-      var ctx = object, expr = match[3];
-      var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+      var ctx = object, expr = match[3],
+          pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+
       match = pattern.exec(expr);
       if (match == null) return before;
 
@@ -943,6 +1062,7 @@ var Enumerable = (function() {
     find:       detect
   };
 })();
+
 function $A(iterable) {
   if (!iterable) return [];
   if ('toArray' in Object(iterable)) return iterable.toArray();
@@ -951,6 +1071,7 @@ function $A(iterable) {
   return results;
 }
 
+
 function $w(string) {
   if (!Object.isString(string)) return [];
   string = string.strip();
@@ -965,9 +1086,10 @@ Array.from = $A;
       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]);
+  function each(iterator, context) {
+    for (var i = 0, length = this.length >>> 0; i < length; i++) {
+      if (i in this) iterator.call(context, this[i], i, this);
+    }
   }
   if (!_each) _each = each;
 
@@ -1007,7 +1129,7 @@ Array.from = $A;
   }
 
   function reverse(inline) {
-    return (inline !== false ? this : this.toArray())._reverse();
+    return (inline === false ? this.toArray() : this)._reverse();
   }
 
   function uniq(sorted) {
@@ -1037,15 +1159,6 @@ Array.from = $A;
     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;
@@ -1094,8 +1207,7 @@ Array.from = $A;
     clone:     clone,
     toArray:   clone,
     size:      size,
-    inspect:   inspect,
-    toJSON:    toJSON
+    inspect:   inspect
   });
 
   var CONCAT_ARGUMENTS_BUGGY = (function() {
@@ -1116,6 +1228,7 @@ var Hash = Class.create(Enumerable, (function() {
     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];
@@ -1144,6 +1257,8 @@ var Hash = Class.create(Enumerable, (function() {
     return Object.clone(this._object);
   }
 
+
+
   function keys() {
     return this.pluck('key');
   }
@@ -1180,8 +1295,14 @@ var Hash = Class.create(Enumerable, (function() {
       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)));
+        if (Object.isArray(values)) {
+          var queryValues = [];
+          for (var i = 0, len = values.length, value; i < len; i++) {
+            value = values[i];
+            queryValues.push(toQueryPair(key, value));
+          }
+          return results.concat(queryValues);
+        }
       } else results.push(toQueryPair(key, values));
       return results;
     }).join('&');
@@ -1193,10 +1314,6 @@ var Hash = Class.create(Enumerable, (function() {
     }).join(', ') + '}>';
   }
 
-  function toJSON() {
-    return Object.toJSON(this.toObject());
-  }
-
   function clone() {
     return new Hash(this);
   }
@@ -1216,7 +1333,7 @@ var Hash = Class.create(Enumerable, (function() {
     update:                 update,
     toQueryString:          toQueryString,
     inspect:                inspect,
-    toJSON:                 toJSON,
+    toJSON:                 toObject,
     clone:                  clone
   };
 })());
@@ -1241,10 +1358,6 @@ Object.extend(Number.prototype, (function() {
     return '0'.times(length - string.length) + string;
   }
 
-  function toJSON() {
-    return isFinite(this) ? this.toString() : 'null';
-  }
-
   function abs() {
     return Math.abs(this);
   }
@@ -1266,7 +1379,6 @@ Object.extend(Number.prototype, (function() {
     succ:           succ,
     times:          times,
     toPaddedString: toPaddedString,
-    toJSON:         toJSON,
     abs:            abs,
     round:          round,
     ceil:           ceil,
@@ -1370,9 +1482,7 @@ Ajax.Base = Class.create({
 
     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))
+    if (Object.isHash(this.options.parameters))
       this.options.parameters = this.options.parameters.toObject();
   }
 });
@@ -1388,22 +1498,21 @@ Ajax.Request = Class.create(Ajax.Base, {
   request: function(url) {
     this.url = url;
     this.method = this.options.method;
-    var params = Object.clone(this.options.parameters);
+    var params = Object.isString(this.options.parameters) ?
+          this.options.parameters :
+          Object.toQueryString(this.options.parameters);
 
     if (!['get', 'post'].include(this.method)) {
-      params['_method'] = this.method;
+      params += (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 += '&_=';
+    if (params && this.method === 'get') {
+      this.url += (this.url.include('?') ? '&' : '?') + params;
     }
 
+    this.parameters = params.toQueryParams();
+
     try {
       var response = new Ajax.Response(this);
       if (this.options.onCreate) this.options.onCreate(response);
@@ -1472,11 +1581,12 @@ Ajax.Request = Class.create(Ajax.Base, {
 
   success: function() {
     var status = this.getStatus();
-    return !status || (status >= 200 && status < 300);
+    return !status || (status >= 200 && status < 300) || status == 304;
   },
 
   getStatus: function() {
     try {
+      if (this.transport.status === 1223) return 204;
       return this.transport.status || 0;
     } catch (e) { return 0 }
   },
@@ -1558,14 +1668,14 @@ Ajax.Response = Class.create({
     var transport  = this.transport  = request.transport,
         readyState = this.readyState = transport.readyState;
 
-    if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+    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) {
+    if (readyState == 4) {
       var xml = transport.responseXML;
       this.responseXML  = Object.isUndefined(xml) ? null : xml;
       this.responseJSON = this._getResponseJSON();
@@ -1705,7 +1815,6 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
 });
 
 
-
 function $(element) {
   if (arguments.length > 1) {
     for (var i = 0, elements = [], length = arguments.length; i < length; i++)
@@ -1730,7 +1839,7 @@ if (Prototype.BrowserFeatures.XPath) {
 
 /*--------------------------------------------------------------------------*/
 
-if (!window.Node) var Node = { };
+if (!Node) var Node = { };
 
 if (!Node.ELEMENT_NODE) {
   Object.extend(Node, {
@@ -1750,42 +1859,61 @@ if (!Node.ELEMENT_NODE) {
 }
 
 
+
 (function(global) {
+  function shouldUseCache(tagName, attributes) {
+    if (tagName === 'select') return false;
+    if ('type' in attributes) return false;
+    return true;
+  }
 
-  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 HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){
+    try {
+      var el = document.createElement('<input name="x">');
+      return el.tagName.toLowerCase() === 'input' && el.name === 'x';
+    }
+    catch(err) {
+      return false;
+    }
   })();
 
   var element = global.Element;
+
   global.Element = function(tagName, attributes) {
     attributes = attributes || { };
     tagName = tagName.toLowerCase();
     var cache = Element.cache;
-    if (SETATTRIBUTE_IGNORES_NAME && attributes.name) {
+
+    if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && 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);
+
+    var node = shouldUseCache(tagName, attributes) ?
+     cache[tagName].cloneNode(false) : document.createElement(tagName);
+
+    return Element.writeAttribute(node, attributes);
   };
+
   Object.extend(global.Element, element || { });
   if (element) global.Element.prototype = element.prototype;
+
 })(this);
 
-Element.cache = { };
 Element.idCounter = 1;
+Element.cache = { };
+
+Element._purgeElement = function(element) {
+  var uid = element._prototypeUID;
+  if (uid) {
+    Element.stopObserving(element);
+    element._prototypeUID = void 0;
+    delete Element.Storage[uid];
+  }
+}
 
 Element.Methods = {
   visible: function(element) {
@@ -1798,7 +1926,6 @@ Element.Methods = {
     return element;
   },
 
-
   hide: function(element) {
     element = $(element);
     element.style.display = 'none';
@@ -1844,6 +1971,21 @@ Element.Methods = {
       }
     })();
 
+    var LINK_ELEMENT_INNERHTML_BUGGY = (function() {
+      try {
+        var el = document.createElement('div');
+        el.innerHTML = "<link>";
+        var isBuggy = (el.childNodes.length === 0);
+        el = null;
+        return isBuggy;
+      } catch(e) {
+        return true;
+      }
+    })();
+
+    var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY ||
+     TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY;
+
     var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
       var s = document.createElement("script"),
           isBuggy = false;
@@ -1858,8 +2000,14 @@ Element.Methods = {
       return isBuggy;
     })();
 
+
     function update(element, content) {
       element = $(element);
+      var purgeElement = Element._purgeElement;
+
+      var descendants = element.getElementsByTagName('*'),
+       i = descendants.length;
+      while (i--) purgeElement(descendants[i]);
 
       if (content && content.toElement)
         content = content.toElement();
@@ -1876,7 +2024,7 @@ Element.Methods = {
         return element;
       }
 
-      if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) {
+      if (ANY_INNERHTML_BUGGY) {
         if (tagName in Element._insertionTranslations.tags) {
           while (element.firstChild) {
             element.removeChild(element.firstChild);
@@ -1885,6 +2033,12 @@ Element.Methods = {
             .each(function(node) {
               element.appendChild(node)
             });
+        } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
+          while (element.firstChild) {
+            element.removeChild(element.firstChild);
+          }
+          var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
+          nodes.each(function(node) { element.appendChild(node) });
         }
         else {
           element.innerHTML = content.stripScripts();
@@ -1967,19 +2121,26 @@ Element.Methods = {
     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();
+      var property = pair.first(),
+          attribute = pair.last(),
+          value = (element[property] || '').toString();
       if (value) result += ' ' + attribute + '=' + value.inspect(true);
     });
     return result + '>';
   },
 
-  recursivelyCollect: function(element, property) {
+  recursivelyCollect: function(element, property, maximumLength) {
     element = $(element);
+    maximumLength = maximumLength || -1;
     var elements = [];
-    while (element = element[property])
+
+    while (element = element[property]) {
       if (element.nodeType == 1)
         elements.push(Element.extend(element));
+      if (elements.length == maximumLength)
+        break;
+    }
+
     return elements;
   },
 
@@ -1998,13 +2159,17 @@ Element.Methods = {
   },
 
   immediateDescendants: function(element) {
-    if (!(element = $(element).firstChild)) return [];
-    while (element && element.nodeType != 1) element = element.nextSibling;
-    if (element) return [element].concat($(element).nextSiblings());
-    return [];
+    var results = [], child = $(element).firstChild;
+    while (child) {
+      if (child.nodeType === 1) {
+        results.push(Element.extend(child));
+      }
+      child = child.nextSibling;
+    }
+    return results;
   },
 
-  previousSiblings: function(element) {
+  previousSiblings: function(element, maximumLength) {
     return Element.recursivelyCollect(element, 'previousSibling');
   },
 
@@ -2019,9 +2184,10 @@ Element.Methods = {
   },
 
   match: function(element, selector) {
+    element = $(element);
     if (Object.isString(selector))
-      selector = new Selector(selector);
-    return selector.match($(element));
+      return Prototype.Selector.match(element, selector);
+    return selector.match(element);
   },
 
   up: function(element, expression, index) {
@@ -2029,7 +2195,7 @@ Element.Methods = {
     if (arguments.length == 1) return $(element.parentNode);
     var ancestors = Element.ancestors(element);
     return Object.isNumber(expression) ? ancestors[expression] :
-      Selector.findElement(ancestors, expression, index);
+      Prototype.Selector.find(ancestors, expression, index);
   },
 
   down: function(element, expression, index) {
@@ -2041,29 +2207,40 @@ Element.Methods = {
 
   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);
+    if (Object.isNumber(expression)) index = expression, expression = false;
+    if (!Object.isNumber(index)) index = 0;
+
+    if (expression) {
+      return Prototype.Selector.find(element.previousSiblings(), expression, index);
+    } else {
+      return element.recursivelyCollect("previousSibling", index + 1)[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);
+    if (Object.isNumber(expression)) index = expression, expression = false;
+    if (!Object.isNumber(index)) index = 0;
+
+    if (expression) {
+      return Prototype.Selector.find(element.nextSiblings(), expression, index);
+    } else {
+      var maximumLength = Object.isNumber(index) ? index + 1 : 1;
+      return element.recursivelyCollect("nextSibling", index + 1)[index];
+    }
   },
 
 
   select: function(element) {
-    var args = Array.prototype.slice.call(arguments, 1);
-    return Selector.findChildElements(element, args);
+    element = $(element);
+    var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
+    return Prototype.Selector.select(expressions, element);
   },
 
   adjacent: function(element) {
-    var args = Array.prototype.slice.call(arguments, 1);
-    return Selector.findChildElements(element.parentNode, args).without(element);
+    element = $(element);
+    var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
+    return Prototype.Selector.select(expressions, element.parentNode).without(element);
   },
 
   identify: function(element) {
@@ -2227,28 +2404,6 @@ Element.Methods = {
     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');
@@ -2293,114 +2448,6 @@ Element.Methods = {
     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,
@@ -2412,11 +2459,10 @@ Element.Methods = {
     }, arguments[2] || { });
 
     source = $(source);
-    var p = Element.viewportOffset(source);
+    var p = Element.viewportOffset(source), delta = [0, 0], parent = null;
 
     element = $(element);
-    var delta = [0, 0];
-    var parent = null;
+
     if (Element.getStyle(element, 'position') == 'absolute') {
       parent = Element.getOffsetParent(element);
       delta = Element.viewportOffset(parent);
@@ -2455,8 +2501,6 @@ 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;
 
@@ -2492,47 +2536,6 @@ if (Prototype.Browser.Opera) {
 }
 
 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();
@@ -2576,10 +2579,9 @@ else if (Prototype.Browser.IE) {
 
   Element._attributeTranslations = (function(){
 
-    var classProp = 'className';
-    var forProp = 'for';
-
-    var el = document.createElement('div');
+    var classProp = 'className',
+        forProp = 'for',
+        el = document.createElement('div');
 
     el.setAttribute(classProp, 'x');
 
@@ -2622,10 +2624,9 @@ else if (Prototype.Browser.IE) {
           },
           _getEv: (function(){
 
-            var el = document.createElement('div');
+            var el = document.createElement('div'), f;
             el.onclick = Prototype.emptyFunction;
             var value = el.getAttribute('onclick');
-            var f;
 
             if (String(value).indexOf('{') > -1) {
               f = function(element, attribute) {
@@ -2753,7 +2754,7 @@ else if (Prototype.Browser.WebKit) {
       (value < 0.00001) ? 0 : value;
 
     if (value == 1)
-      if(element.tagName.toUpperCase() == 'IMG' && element.width) {
+      if (element.tagName.toUpperCase() == 'IMG' && element.width) {
         element.width++; element.width--;
       } else try {
         var n = document.createTextNode(' ');
@@ -2763,20 +2764,6 @@ else if (Prototype.Browser.WebKit) {
 
     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) {
@@ -2793,8 +2780,8 @@ if ('outerHTML' in document.documentElement) {
     var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
 
     if (Element._insertionTranslations.tags[tagName]) {
-      var nextSibling = element.next();
-      var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+      var nextSibling = element.next(),
+          fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
       parent.removeChild(element);
       if (nextSibling)
         fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
@@ -2815,12 +2802,27 @@ Element._returnOffset = function(l, 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;
+Element._getContentFromAnonymousElement = function(tagName, html, force) {
+  var div = new Element('div'),
+      t = Element._insertionTranslations.tags[tagName];
+
+  var workaround = false;
+  if (t) workaround = true;
+  else if (force) {
+    workaround = true;
+    t = ['', '', 0];
+  }
+
+  if (workaround) {
+    div.innerHTML = '&nbsp;' + t[0] + html + t[1];
+    div.removeChild(div.firstChild);
+    for (var i = t[2]; i--; ) {
+      div = div.firstChild;
+    }
+  }
+  else {
+    div.innerHTML = html;
+  }
   return $A(div.childNodes);
 };
 
@@ -2877,7 +2879,7 @@ Object.extend(Element, Element.Methods);
 
   div = null;
 
-})(document.createElement('div'))
+})(document.createElement('div'));
 
 Element.extend = (function() {
 
@@ -2885,8 +2887,8 @@ Element.extend = (function() {
     if (typeof window.Element != 'undefined') {
       var proto = window.Element.prototype;
       if (proto) {
-        var id = '_' + (Math.random()+'').slice(2);
-        var el = document.createElement(tagName);
+        var id = '_' + (Math.random()+'').slice(2),
+            el = document.createElement(tagName);
         proto[id] = 'x';
         var isBuggy = (el[id] !== 'x');
         delete proto[id];
@@ -2953,10 +2955,14 @@ Element.extend = (function() {
   return extend;
 })();
 
-Element.hasAttribute = function(element, attribute) {
-  if (element.hasAttribute) return element.hasAttribute(attribute);
-  return Element.Methods.Simulated.hasAttribute(element, attribute);
-};
+if (document.documentElement.hasAttribute) {
+  Element.hasAttribute = function(element, attribute) {
+    return element.hasAttribute(attribute);
+  };
+}
+else {
+  Element.hasAttribute = Element.Methods.Simulated.hasAttribute;
+}
 
 Element.addMethods = function(methods) {
   var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
@@ -2968,7 +2974,8 @@ Element.addMethods = function(methods) {
       "FORM":     Object.clone(Form.Methods),
       "INPUT":    Object.clone(Form.Element.Methods),
       "SELECT":   Object.clone(Form.Element.Methods),
-      "TEXTAREA": Object.clone(Form.Element.Methods)
+      "TEXTAREA": Object.clone(Form.Element.Methods),
+      "BUTTON":   Object.clone(Form.Element.Methods)
     });
   }
 
@@ -3020,8 +3027,9 @@ Element.addMethods = function(methods) {
     klass = 'HTML' + tagName.capitalize() + 'Element';
     if (window[klass]) return window[klass];
 
-    var element = document.createElement(tagName);
-    var proto = element['__proto__'] || element.constructor.prototype;
+    var element = document.createElement(tagName),
+        proto = element['__proto__'] || element.constructor.prototype;
+
     element = null;
     return proto;
   }
@@ -3104,8 +3112,8 @@ Element.addMethods({
       uid = 0;
     } else {
       if (typeof element._prototypeUID === "undefined")
-        element._prototypeUID = [Element.Storage.UID++];
-      uid = element._prototypeUID[0];
+        element._prototypeUID = Element.Storage.UID++;
+      uid = element._prototypeUID;
     }
 
     if (!Element.Storage[uid])
@@ -3150,769 +3158,1807 @@ Element.addMethods({
       }
     }
     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);
+  purge: function(element) {
+    if (!(element = $(element))) return;
+    var purgeElement = Element._purgeElement;
 
-        isBuggy = (result.snapshotLength !== 2);
-        el = null;
-      }
-      return isBuggy;
-    })();
+    purgeElement(element);
 
-    return function() {
-      if (!Prototype.BrowserFeatures.XPath) return false;
+    var descendants = element.getElementsByTagName('*'),
+     i = descendants.length;
 
-      var e = this.expression;
+    while (i--) purgeElement(descendants[i]);
 
-      if (Prototype.Browser.WebKit &&
-       (e.include("-of-type") || e.include(":empty")))
-        return false;
+    return null;
+  }
+});
 
-      if ((/(\[[\w-]*?:|:checked)/).test(e))
-        return false;
+(function() {
 
-      if (IS_DESCENDANT_SELECTOR_BUGGY) return false;
+  function toDecimal(pctString) {
+    var match = pctString.match(/^(\d+)%?$/i);
+    if (!match) return null;
+    return (Number(match[1]) / 100);
+  }
 
-      return true;
+  function getPixelValue(value, property, context) {
+    var element = null;
+    if (Object.isElement(value)) {
+      element = value;
+      value = element.getStyle(property);
     }
 
-  })(),
+    if (value === null) {
+      return null;
+    }
 
-  shouldUseSelectorsAPI: function() {
-    if (!Prototype.BrowserFeatures.SelectorsAPI) return false;
+    if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) {
+      return window.parseFloat(value);
+    }
 
-    if (Selector.CASE_INSENSITIVE_CLASS_NAMES) return false;
+    var isPercentage = value.include('%'), isViewport = (context === document.viewport);
 
-    if (!Selector._div) Selector._div = new Element('div');
+    if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
+      var style = element.style.left, rStyle = element.runtimeStyle.left;
+      element.runtimeStyle.left = element.currentStyle.left;
+      element.style.left = value || 0;
+      value = element.style.pixelLeft;
+      element.style.left = style;
+      element.runtimeStyle.left = rStyle;
 
-    try {
-      Selector._div.querySelector(this.expression);
-    } catch(e) {
-      return false;
+      return value;
     }
 
-    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 (element && isPercentage) {
+      context = context || element.parentNode;
+      var decimal = toDecimal(value);
+      var whole = null;
+      var position = element.getStyle('position');
 
-    if (Selector._cache[e]) {
-      this.matcher = Selector._cache[e];
-      return;
-    }
+      var isHorizontal = property.include('left') || property.include('right') ||
+       property.include('width');
 
-    this.matcher = ["this.matcher = function(root) {",
-                    "var r = root, h = Selector.handlers, c = false, n;"];
+      var isVertical =  property.include('top') || property.include('bottom') ||
+        property.include('height');
 
-    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;
+      if (context === document.viewport) {
+        if (isHorizontal) {
+          whole = document.viewport.getWidth();
+        } else if (isVertical) {
+          whole = document.viewport.getHeight();
+        }
+      } else {
+        if (isHorizontal) {
+          whole = $(context).measure('width');
+        } else if (isVertical) {
+          whole = $(context).measure('height');
         }
       }
-    }
 
-    this.matcher.push("return h.unique(n);\n}");
-    eval(this.matcher.join('\n'));
-    Selector._cache[this.expression] = this.matcher;
-  },
+      return (whole === null) ? 0 : whole * decimal;
+    }
 
-  compileXPathMatcher: function() {
-    var e = this.expression, ps = Selector.patterns,
-        x = Selector.xpath, le, m, len = ps.length, name;
+    return 0;
+  }
 
-    if (Selector._cache[e]) {
-      this.xpath = Selector._cache[e]; return;
+  function toCSSPixels(number) {
+    if (Object.isString(number) && number.endsWith('px')) {
+      return number;
     }
+    return number + 'px';
+  }
 
-    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;
-        }
+  function isDisplayed(element) {
+    var originalElement = element;
+    while (element && element.parentNode) {
+      var display = element.getStyle('display');
+      if (display === 'none') {
+        return false;
       }
+      element = $(element.parentNode);
     }
+    return true;
+  }
 
-    this.xpath = this.matcher.join('');
-    Selector._cache[this.expression] = this.xpath;
-  },
+  var hasLayout = Prototype.K;
+  if ('currentStyle' in document.documentElement) {
+    hasLayout = function(element) {
+      if (!element.currentStyle.hasLayout) {
+        element.style.zoom = 1;
+      }
+      return element;
+    };
+  }
 
-  findElements: function(root) {
-    root = root || document;
-    var e = this.expression, results;
+  function cssNameFor(key) {
+    if (key.include('border')) key = key + '-width';
+    return key.camelize();
+  }
 
-    switch (this.mode) {
-      case 'selectorsAPI':
-        if (root !== document) {
-          var oldId = root.id, id = $(root).identify();
-          id = id.replace(/([\.:])/g, "\\$1");
-          e = "#" + id + " " + e;
-        }
+  Element.Layout = Class.create(Hash, {
+    initialize: function($super, element, preCompute) {
+      $super();
+      this.element = $(element);
 
-        results = $A(root.querySelectorAll(e)).map(Element.extend);
-        root.id = oldId;
+      Element.Layout.PROPERTIES.each( function(property) {
+        this._set(property, null);
+      }, this);
 
-        return results;
-      case 'xpath':
-        return document._getElementsByXPath(this.xpath, root);
-      default:
-       return this.matcher(root);
-    }
-  },
+      if (preCompute) {
+        this._preComputing = true;
+        this._begin();
+        Element.Layout.PROPERTIES.each( this._compute, this );
+        this._end();
+        this._preComputing = false;
+      }
+    },
 
-  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);
-          }
-        }
+    _set: function(property, value) {
+      return Hash.prototype.set.call(this, property, value);
+    },
+
+    set: function(property, value) {
+      throw "Properties of Element.Layout are read-only.";
+    },
+
+    get: function($super, property) {
+      var value = $super(property);
+      return value === null ? this._compute(property) : value;
+    },
+
+    _begin: function() {
+      if (this._prepared) return;
+
+      var element = this.element;
+      if (isDisplayed(element)) {
+        this._prepared = true;
+        return;
       }
-    }
 
-    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;
+      var originalStyles = {
+        position:   element.style.position   || '',
+        width:      element.style.width      || '',
+        visibility: element.style.visibility || '',
+        display:    element.style.display    || ''
+      };
+
+      element.store('prototype_original_styles', originalStyles);
+
+      var position = element.getStyle('position'),
+       width = element.getStyle('width');
+
+      if (width === "0px" || width === null) {
+        element.style.display = 'block';
+        width = element.getStyle('width');
       }
-    }
 
-    return match;
-  },
+      var context = (position === 'fixed') ? document.viewport :
+       element.parentNode;
 
-  toString: function() {
-    return this.expression;
-  },
+      element.setStyle({
+        position:   'absolute',
+        visibility: 'hidden',
+        display:    'block'
+      });
 
-  inspect: function() {
-    return "#<Selector:" + this.expression.inspect() + ">";
-  }
-});
+      var positionedWidth = element.getStyle('width');
 
-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;
-  })();
-}
+      var newWidth;
+      if (width && (positionedWidth === width)) {
+        newWidth = getPixelValue(element, 'width', context);
+      } else if (position === 'absolute' || position === 'fixed') {
+        newWidth = getPixelValue(element, 'width', context);
+      } else {
+        var parent = element.parentNode, pLayout = $(parent).getLayout();
+
+        newWidth = pLayout.get('width') -
+         this.get('margin-left') -
+         this.get('border-left') -
+         this.get('padding-left') -
+         this.get('padding-right') -
+         this.get('border-right') -
+         this.get('margin-right');
+      }
 
-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() + "']";
+      element.setStyle({ width: newWidth + 'px' });
+
+      this._prepared = true;
     },
-    className:    "[contains(concat(' ', @class, ' '), ' #{1} ')]",
-    id:           "[@id='#{1}']",
-    attrPresence: function(m) {
-      m[1] = m[1].toLowerCase();
-      return new Template("[@#{1}]").evaluate(m);
+
+    _end: function() {
+      var element = this.element;
+      var originalStyles = element.retrieve('prototype_original_styles');
+      element.store('prototype_original_styles', null);
+      element.setStyle(originalStyles);
+      this._prepared = false;
     },
-    attr: function(m) {
-      m[1] = m[1].toLowerCase();
-      m[3] = m[5] || m[6];
-      return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+
+    _compute: function(property) {
+      var COMPUTATIONS = Element.Layout.COMPUTATIONS;
+      if (!(property in COMPUTATIONS)) {
+        throw "Property not found.";
+      }
+
+      return this._set(property, COMPUTATIONS[property].call(this, this.element));
     },
-    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);
+
+    toObject: function() {
+      var args = $A(arguments);
+      var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+       args.join(' ').split(' ');
+      var obj = {};
+      keys.each( function(key) {
+        if (!Element.Layout.PROPERTIES.include(key)) return;
+        var value = this.get(key);
+        if (value != null) obj[key] = value;
+      }, this);
+      return obj;
     },
-    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}-')]"
+
+    toHash: function() {
+      var obj = this.toObject.apply(this, arguments);
+      return new Hash(obj);
     },
-    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;
-            }
-          }
+
+    toCSS: function() {
+      var args = $A(arguments);
+      var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+       args.join(' ').split(' ');
+      var css = {};
+
+      keys.each( function(key) {
+        if (!Element.Layout.PROPERTIES.include(key)) return;
+        if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return;
+
+        var value = this.get(key);
+        if (value != null) css[cssNameFor(key)] = value + 'px';
+      }, this);
+      return css;
+    },
+
+    inspect: function() {
+      return "#<Element.Layout>";
+    }
+  });
+
+  Object.extend(Element.Layout, {
+    PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'),
+
+    COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),
+
+    COMPUTATIONS: {
+      'height': function(element) {
+        if (!this._preComputing) this._begin();
+
+        var bHeight = this.get('border-box-height');
+        if (bHeight <= 0) {
+          if (!this._preComputing) this._end();
+          return 0;
         }
-        return "[not(" + exclusion.join(" and ") + ")]";
+
+        var bTop = this.get('border-top'),
+         bBottom = this.get('border-bottom');
+
+        var pTop = this.get('padding-top'),
+         pBottom = this.get('padding-bottom');
+
+        if (!this._preComputing) this._end();
+
+        return bHeight - bTop - bBottom - pTop - pBottom;
       },
-      'nth-child':      function(m) {
-        return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+
+      'width': function(element) {
+        if (!this._preComputing) this._begin();
+
+        var bWidth = this.get('border-box-width');
+        if (bWidth <= 0) {
+          if (!this._preComputing) this._end();
+          return 0;
+        }
+
+        var bLeft = this.get('border-left'),
+         bRight = this.get('border-right');
+
+        var pLeft = this.get('padding-left'),
+         pRight = this.get('padding-right');
+
+        if (!this._preComputing) this._end();
+
+        return bWidth - bLeft - bRight - pLeft - pRight;
       },
-      'nth-last-child': function(m) {
-        return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+
+      'padding-box-height': function(element) {
+        var height = this.get('height'),
+         pTop = this.get('padding-top'),
+         pBottom = this.get('padding-bottom');
+
+        return height + pTop + pBottom;
       },
-      'nth-of-type':    function(m) {
-        return Selector.xpath.pseudos.nth("position() ", m);
+
+      'padding-box-width': function(element) {
+        var width = this.get('width'),
+         pLeft = this.get('padding-left'),
+         pRight = this.get('padding-right');
+
+        return width + pLeft + pRight;
       },
-      'nth-last-of-type': function(m) {
-        return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+
+      'border-box-height': function(element) {
+        if (!this._preComputing) this._begin();
+        var height = element.offsetHeight;
+        if (!this._preComputing) this._end();
+        return height;
       },
-      'first-of-type':  function(m) {
-        m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
+
+      'border-box-width': function(element) {
+        if (!this._preComputing) this._begin();
+        var width = element.offsetWidth;
+        if (!this._preComputing) this._end();
+        return width;
       },
-      'last-of-type':   function(m) {
-        m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
+
+      'margin-box-height': function(element) {
+        var bHeight = this.get('border-box-height'),
+         mTop = this.get('margin-top'),
+         mBottom = this.get('margin-bottom');
+
+        if (bHeight <= 0) return 0;
+
+        return bHeight + mTop + mBottom;
       },
-      'only-of-type':   function(m) {
-        var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
+
+      'margin-box-width': function(element) {
+        var bWidth = this.get('border-box-width'),
+         mLeft = this.get('margin-left'),
+         mRight = this.get('margin-right');
+
+        if (bWidth <= 0) return 0;
+
+        return bWidth + mLeft + mRight;
       },
-      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 });
-        }
+
+      'top': function(element) {
+        var offset = element.positionedOffset();
+        return offset.top;
+      },
+
+      'bottom': function(element) {
+        var offset = element.positionedOffset(),
+         parent = element.getOffsetParent(),
+         pHeight = parent.measure('height');
+
+        var mHeight = this.get('border-box-height');
+
+        return pHeight - mHeight - offset.top;
+      },
+
+      'left': function(element) {
+        var offset = element.positionedOffset();
+        return offset.left;
+      },
+
+      'right': function(element) {
+        var offset = element.positionedOffset(),
+         parent = element.getOffsetParent(),
+         pWidth = parent.measure('width');
+
+        var mWidth = this.get('border-box-width');
+
+        return pWidth - mWidth - offset.left;
+      },
+
+      'padding-top': function(element) {
+        return getPixelValue(element, 'paddingTop');
+      },
+
+      'padding-bottom': function(element) {
+        return getPixelValue(element, 'paddingBottom');
+      },
+
+      'padding-left': function(element) {
+        return getPixelValue(element, 'paddingLeft');
+      },
+
+      'padding-right': function(element) {
+        return getPixelValue(element, 'paddingRight');
+      },
+
+      'border-top': function(element) {
+        return getPixelValue(element, 'borderTopWidth');
+      },
+
+      'border-bottom': function(element) {
+        return getPixelValue(element, 'borderBottomWidth');
+      },
+
+      'border-left': function(element) {
+        return getPixelValue(element, 'borderLeftWidth');
+      },
+
+      'border-right': function(element) {
+        return getPixelValue(element, 'borderRightWidth');
+      },
+
+      'margin-top': function(element) {
+        return getPixelValue(element, 'marginTop');
+      },
+
+      'margin-bottom': function(element) {
+        return getPixelValue(element, 'marginBottom');
+      },
+
+      'margin-left': function(element) {
+        return getPixelValue(element, 'marginLeft');
+      },
+
+      'margin-right': function(element) {
+        return getPixelValue(element, 'marginRight');
       }
     }
-  },
+  });
+
+  if ('getBoundingClientRect' in document.documentElement) {
+    Object.extend(Element.Layout.COMPUTATIONS, {
+      'right': function(element) {
+        var parent = hasLayout(element.getOffsetParent());
+        var rect = element.getBoundingClientRect(),
+         pRect = parent.getBoundingClientRect();
+
+        return (pRect.right - rect.right).round();
+      },
+
+      'bottom': function(element) {
+        var parent = hasLayout(element.getOffsetParent());
+        var rect = element.getBoundingClientRect(),
+         pRect = parent.getBoundingClientRect();
+
+        return (pRect.bottom - rect.bottom).round();
+      }
+    });
+  }
+
+  Element.Offset = Class.create({
+    initialize: function(left, top) {
+      this.left = left.round();
+      this.top  = top.round();
+
+      this[0] = this.left;
+      this[1] = this.top;
+    },
+
+    relativeTo: function(offset) {
+      return new Element.Offset(
+        this.left - offset.left,
+        this.top  - offset.top
+      );
+    },
+
+    inspect: function() {
+      return "#<Element.Offset left: #{left} top: #{top}>".interpolate(this);
+    },
+
+    toString: function() {
+      return "[#{left}, #{top}]".interpolate(this);
+    },
+
+    toArray: function() {
+      return [this.left, this.top];
+    }
+  });
+
+  function getLayout(element, preCompute) {
+    return new Element.Layout(element, preCompute);
+  }
+
+  function measure(element, property) {
+    return $(element).getLayout().get(property);
+  }
+
+  function getDimensions(element) {
+    element = $(element);
+    var display = Element.getStyle(element, 'display');
+
+    if (display && display !== 'none') {
+      return { width: element.offsetWidth, height: element.offsetHeight };
+    }
+
+    var style = element.style;
+    var originalStyles = {
+      visibility: style.visibility,
+      position:   style.position,
+      display:    style.display
+    };
+
+    var newStyles = {
+      visibility: 'hidden',
+      display:    'block'
+    };
+
+    if (originalStyles.position !== 'fixed')
+      newStyles.position = 'absolute';
+
+    Element.setStyle(element, newStyles);
+
+    var dimensions = {
+      width:  element.offsetWidth,
+      height: element.offsetHeight
+    };
+
+    Element.setStyle(element, originalStyles);
+
+    return dimensions;
+  }
+
+  function getOffsetParent(element) {
+    element = $(element);
+
+    if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+      return $(document.body);
+
+    var isInline = (Element.getStyle(element, 'display') === 'inline');
+    if (!isInline && element.offsetParent) return $(element.offsetParent);
+
+    while ((element = element.parentNode) && element !== document.body) {
+      if (Element.getStyle(element, 'position') !== 'static') {
+        return isHtml(element) ? $(document.body) : $(element);
+      }
+    }
+
+    return $(document.body);
+  }
+
+
+  function cumulativeOffset(element) {
+    element = $(element);
+    var valueT = 0, valueL = 0;
+    if (element.parentNode) {
+      do {
+        valueT += element.offsetTop  || 0;
+        valueL += element.offsetLeft || 0;
+        element = element.offsetParent;
+      } while (element);
+    }
+    return new Element.Offset(valueL, valueT);
+  }
+
+  function positionedOffset(element) {
+    element = $(element);
+
+    var layout = element.getLayout();
+
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      element = element.offsetParent;
+      if (element) {
+        if (isBody(element)) break;
+        var p = Element.getStyle(element, 'position');
+        if (p !== 'static') break;
+      }
+    } while (element);
+
+    valueL -= layout.get('margin-top');
+    valueT -= layout.get('margin-left');
+
+    return new Element.Offset(valueL, valueT);
+  }
+
+  function cumulativeScrollOffset(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.scrollTop  || 0;
+      valueL += element.scrollLeft || 0;
+      element = element.parentNode;
+    } while (element);
+    return new Element.Offset(valueL, valueT);
+  }
+
+  function viewportOffset(forElement) {
+    element = $(element);
+    var valueT = 0, valueL = 0, docBody = document.body;
+
+    var element = forElement;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      if (element.offsetParent == docBody &&
+        Element.getStyle(element, 'position') == 'absolute') break;
+    } while (element = element.offsetParent);
+
+    element = forElement;
+    do {
+      if (element != docBody) {
+        valueT -= element.scrollTop  || 0;
+        valueL -= element.scrollLeft || 0;
+      }
+    } while (element = element.parentNode);
+    return new Element.Offset(valueL, valueT);
+  }
+
+  function absolutize(element) {
+    element = $(element);
+
+    if (Element.getStyle(element, 'position') === 'absolute') {
+      return element;
+    }
+
+    var offsetParent = getOffsetParent(element);
+    var eOffset = element.viewportOffset(),
+     pOffset = offsetParent.viewportOffset();
+
+    var offset = eOffset.relativeTo(pOffset);
+    var layout = element.getLayout();
+
+    element.store('prototype_absolutize_original_styles', {
+      left:   element.getStyle('left'),
+      top:    element.getStyle('top'),
+      width:  element.getStyle('width'),
+      height: element.getStyle('height')
+    });
+
+    element.setStyle({
+      position: 'absolute',
+      top:    offset.top + 'px',
+      left:   offset.left + 'px',
+      width:  layout.get('width') + 'px',
+      height: layout.get('height') + 'px'
+    });
+
+    return element;
+  }
+
+  function relativize(element) {
+    element = $(element);
+    if (Element.getStyle(element, 'position') === 'relative') {
+      return element;
+    }
+
+    var originalStyles =
+     element.retrieve('prototype_absolutize_original_styles');
+
+    if (originalStyles) element.setStyle(originalStyles);
+    return element;
+  }
+
+  if (Prototype.Browser.IE) {
+    getOffsetParent = getOffsetParent.wrap(
+      function(proceed, element) {
+        element = $(element);
+
+        if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+          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;
+      }
+    );
+
+    positionedOffset = positionedOffset.wrap(function(proceed, element) {
+      element = $(element);
+      if (!element.parentNode) return new Element.Offset(0, 0);
+      var position = element.getStyle('position');
+      if (position !== 'static') return proceed(element);
+
+      var offsetParent = element.getOffsetParent();
+      if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+        hasLayout(offsetParent);
+
+      element.setStyle({ position: 'relative' });
+      var value = proceed(element);
+      element.setStyle({ position: position });
+      return value;
+    });
+  } else if (Prototype.Browser.Webkit) {
+    cumulativeOffset = function(element) {
+      element = $(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 new Element.Offset(valueL, valueT);
+    };
+  }
+
+
+  Element.addMethods({
+    getLayout:              getLayout,
+    measure:                measure,
+    getDimensions:          getDimensions,
+    getOffsetParent:        getOffsetParent,
+    cumulativeOffset:       cumulativeOffset,
+    positionedOffset:       positionedOffset,
+    cumulativeScrollOffset: cumulativeScrollOffset,
+    viewportOffset:         viewportOffset,
+    absolutize:             absolutize,
+    relativize:             relativize
+  });
+
+  function isBody(element) {
+    return element.nodeName.toUpperCase() === 'BODY';
+  }
+
+  function isHtml(element) {
+    return element.nodeName.toUpperCase() === 'HTML';
+  }
+
+  function isDocument(element) {
+    return element.nodeType === Node.DOCUMENT_NODE;
+  }
+
+  function isDetached(element) {
+    return element !== document.body &&
+     !Element.descendantOf(element, document.body);
+  }
+
+  if ('getBoundingClientRect' in document.documentElement) {
+    Element.addMethods({
+      viewportOffset: function(element) {
+        element = $(element);
+        if (isDetached(element)) return new Element.Offset(0, 0);
+
+        var rect = element.getBoundingClientRect(),
+         docEl = document.documentElement;
+        return new Element.Offset(rect.left - docEl.clientLeft,
+         rect.top - docEl.clientTop);
+      }
+    });
+  }
+})();
+window.$$ = function() {
+  var expression = $A(arguments).join(', ');
+  return Prototype.Selector.select(expression, document);
+};
+
+Prototype.Selector = (function() {
+
+  function select() {
+    throw new Error('Method "Prototype.Selector.select" must be defined.');
+  }
+
+  function match() {
+    throw new Error('Method "Prototype.Selector.match" must be defined.');
+  }
+
+  function find(elements, expression, index) {
+    index = index || 0;
+    var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i;
+
+    for (i = 0; i < length; i++) {
+      if (match(elements[i], expression) && index == matchIndex++) {
+        return Element.extend(elements[i]);
+      }
+    }
+  }
+
+  function extendElements(elements) {
+    for (var i = 0, length = elements.length; i < length; i++) {
+      Element.extend(elements[i]);
+    }
+    return elements;
+  }
+
+
+  var K = Prototype.K;
+
+  return {
+    select: select,
+    match: match,
+    find: find,
+    extendElements: (Element.extend === K) ? K : extendElements,
+    extendElement: Element.extend
+  };
+})();
+Prototype._original_property = window.Sizzle;
+/*!
+ * 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;
+
+[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, check, mode, extra, prune = true, contextXML = isXML(context),
+               soFar = selector;
+
+       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 {
+               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.match[ type ].exec( expr )) != null ) {
+                               var filter = Expr.filter[ type ], found, item;
+                               anyFound = false;
+
+                               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;
+                               }
+                       }
+               }
+
+               if ( expr == old ) {
+                       if ( anyFound == null ) {
+                               throw "Syntax error, unrecognized expression: " + expr;
+                       } else {
+                               break;
+                       }
+               }
+
+               old = expr;
+       }
+
+       return curLoop;
+};
 
-  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";'
-  },
+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\(\)]*)+)\2\))?/
+       },
+       leftMatch: {},
+       attrMap: {
+               "class": "className",
+               "for": "htmlFor"
+       },
+       attrHandle: {
+               href: function(elem){
+                       return elem.getAttribute("href");
+               }
+       },
+       relative: {
+               "+": function(checkSet, part, isXML){
+                       var isPartStr = typeof part === "string",
+                               isTag = isPartStr && !/\W/.test(part),
+                               isPartStrNotTag = isPartStr && !isTag;
+
+                       if ( isTag && !isXML ) {
+                               part = part.toUpperCase();
+                       }
+
+                       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 === part ?
+                                               elem || false :
+                                               elem === part;
+                               }
+                       }
+
+                       if ( isPartStrNotTag ) {
+                               Sizzle.filter( part, checkSet, true );
+                       }
+               },
+               ">": function(checkSet, part, isXML){
+                       var isPartStr = typeof part === "string";
+
+                       if ( isPartStr && !/\W/.test(part) ) {
+                               part = isXML ? part : part.toUpperCase();
+
+                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+                                       var elem = checkSet[i];
+                                       if ( elem ) {
+                                               var parent = elem.parentNode;
+                                               checkSet[i] = parent.nodeName === 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 ( !/\W/.test(part) ) {
+                               var nodeCheck = part = isXML ? part : part.toUpperCase();
+                               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 = isXML ? part : part.toUpperCase();
+                               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, isXML){
+                       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 + " ").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){
+                       for ( var i = 0; curLoop[i] === false; i++ ){}
+                       return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
+               },
+               CHILD: function(match){
+                       if ( match[1] == "nth" ) {
+                               var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+                                       match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
+                                       !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+                               match[2] = (test[1] + (test[2] || 1)) - 0;
+                               match[3] = test[3] - 0;
+                       }
+
+                       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 ( ( 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){
+                       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.toUpperCase() === "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 || "").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;
+                       }
+               },
+               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 === 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 );
+                       }
+               }
+       }
+};
 
-  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();
-    },
+var origPOS = Expr.match.POS;
 
-    className: function(element, matches) {
-      return Element.hasClassName(element, matches[1]);
-    },
+for ( var type in Expr.match ) {
+       Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+       Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source );
+}
 
-    id: function(element, matches) {
-      return element.id === matches[1];
-    },
+var makeArray = function(array, results) {
+       array = Array.prototype.slice.call( array, 0 );
 
-    attrPresence: function(element, matches) {
-      return Element.hasAttribute(element, matches[1]);
-    },
+       if ( results ) {
+               results.push.apply( results, array );
+               return results;
+       }
 
-    attr: function(element, matches) {
-      var nodeValue = Element.readAttribute(element, matches[1]);
-      return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]);
-    }
-  },
+       return array;
+};
 
-  handlers: {
-    concat: function(a, b) {
-      for (var i = 0, node; node = b[i]; i++)
-        a.push(node);
-      return a;
-    },
+try {
+       Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+} 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;
+       };
+}
 
-    mark: function(nodes) {
-      var _true = Prototype.emptyFunction;
-      for (var i = 0, node; node = nodes[i]; i++)
-        node._countedByPrototype = _true;
-      return nodes;
-    },
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+       sortOrder = function( a, b ) {
+               if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+                       if ( a == b ) {
+                               hasDuplicate = true;
+                       }
+                       return 0;
+               }
+
+               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 0;
+               }
+
+               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 0;
+               }
+
+               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;
+       };
+}
 
-    unmark: (function(){
+(function(){
+       var form = document.createElement("div"),
+               id = "script" + (new Date).getTime();
+       form.innerHTML = "<a name='" + id + "'/>";
+
+       var root = document.documentElement;
+       root.insertBefore( form, root.firstChild );
+
+       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
+})();
 
-      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;
-        }
-    })(),
+(function(){
 
-    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++;
-      }
-    },
+       var div = document.createElement("div");
+       div.appendChild( document.createComment("") );
 
-    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);
-    },
+       if ( div.getElementsByTagName("*").length > 0 ) {
+               Expr.find.TAG = function(match, context){
+                       var results = context.getElementsByTagName(match[1]);
 
-    descendant: function(nodes) {
-      var h = Selector.handlers;
-      for (var i = 0, results = [], node; node = nodes[i]; i++)
-        h.concat(results, node.getElementsByTagName('*'));
-      return results;
-    },
+                       if ( match[1] === "*" ) {
+                               var tmp = [];
 
-    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;
-    },
+                               for ( var i = 0; results[i]; i++ ) {
+                                       if ( results[i].nodeType === 1 ) {
+                                               tmp.push( results[i] );
+                                       }
+                               }
 
-    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;
-    },
+                               results = tmp;
+                       }
 
-    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;
-    },
+                       return results;
+               };
+       }
 
-    nextElementSibling: function(node) {
-      while (node = node.nextSibling)
-        if (node.nodeType == 1) return node;
-      return null;
-    },
+       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);
+               };
+       }
 
-    previousElementSibling: function(node) {
-      while (node = node.previousSibling)
-        if (node.nodeType == 1) return node;
-      return null;
-    },
+       div = null; // release memory in IE
+})();
 
-    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);
-    },
+if ( document.querySelectorAll ) (function(){
+       var oldSizzle = Sizzle, div = document.createElement("div");
+       div.innerHTML = "<p class='TEST'></p>";
 
-    id: function(nodes, root, id, combinator) {
-      var targetNode = $(id), h = Selector.handlers;
+       if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+               return;
+       }
 
-      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];
-          }
-        }
-      }
+       Sizzle = function(query, context, extra, seed){
+               context = context || document;
 
-      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] : [];
-    },
+               if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+                       try {
+                               return makeArray( context.querySelectorAll(query), extra );
+                       } catch(e){}
+               }
 
-    className: function(nodes, root, className, combinator) {
-      if (nodes && combinator) nodes = this[combinator](nodes);
-      return Selector.handlers.byClassName(nodes, root, className);
-    },
+               return oldSizzle(query, context, extra, seed);
+       };
 
-    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;
-    },
+       for ( var prop in oldSizzle ) {
+               Sizzle[ prop ] = oldSizzle[ prop ];
+       }
 
-    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;
-    },
+       div = null; // release memory in IE
+})();
 
-    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;
-    },
+if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
+       var div = document.createElement("div");
+       div.innerHTML = "<div class='test e'></div><div class='test'></div>";
 
-    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);
-    }
-  },
+       if ( div.getElementsByClassName("e").length === 0 )
+               return;
 
-  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);
-    },
+       div.lastChild.className = "e";
 
-    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;
-      });
-    },
+       if ( div.getElementsByClassName("e").length === 1 )
+               return;
 
-    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;
-    },
+       Expr.order.splice(1, 0, "CLASS");
+       Expr.find.CLASS = function(match, context, isXML) {
+               if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+                       return context.getElementsByClassName(match[1]);
+               }
+       };
 
-    '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;
-    },
+       div = null; // release memory in IE
+})();
 
-    '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;
-    },
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+       var sibDir = dir == "previousSibling" && !isXML;
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+               var elem = checkSet[i];
+               if ( elem ) {
+                       if ( sibDir && elem.nodeType === 1 ){
+                               elem.sizcache = doneName;
+                               elem.sizset = i;
+                       }
+                       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 === cur ) {
+                                       match = elem;
+                                       break;
+                               }
+
+                               elem = elem[dir];
+                       }
+
+                       checkSet[i] = match;
+               }
+       }
+}
 
-    '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;
-    },
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+       var sibDir = dir == "previousSibling" && !isXML;
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+               var elem = checkSet[i];
+               if ( elem ) {
+                       if ( sibDir && elem.nodeType === 1 ) {
+                               elem.sizcache = doneName;
+                               elem.sizset = i;
+                       }
+                       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;
+               }
+       }
+}
 
-    'disabled': function(nodes, value, root) {
-      for (var i = 0, results = [], node; node = nodes[i]; i++)
-        if (node.disabled) results.push(node);
-      return results;
-    },
+var contains = document.compareDocumentPosition ?  function(a, b){
+       return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+       return a !== b && (a.contains ? a.contains(b) : true);
+};
 
-    'checked': function(nodes, value, root) {
-      for (var i = 0, results = [], node; node = nodes[i]; i++)
-        if (node.checked) results.push(node);
-      return results;
-    }
-  },
+var isXML = function(elem){
+       return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+               !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
+};
 
-  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() + '-'); }
-  },
+var posProcess = function(selector, context){
+       var tmpSet = [], later = "", match,
+               root = context.nodeType ? [context] : context;
 
-  split: function(expression) {
-    var expressions = [];
-    expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
-      expressions.push(m[1].strip());
-    });
-    return expressions;
-  },
+       while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+               later += match[0];
+               selector = selector.replace( Expr.match.PSEUDO, "" );
+       }
 
-  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;
-  },
+       selector = Expr.relative[selector] ? selector + "*" : selector;
 
-  findElement: function(elements, expression, index) {
-    if (Object.isNumber(expression)) {
-      index = expression; expression = false;
-    }
-    return Selector.matchElements(elements, expression || '*')[index || 0];
-  },
+       for ( var i = 0, l = root.length; i < l; i++ ) {
+               Sizzle( selector, root[i], tmpSet );
+       }
 
-  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;
+       return Sizzle.filter( later, tmpSet );
+};
+
+
+window.Sizzle = Sizzle;
+
+})();
+
+;(function(engine) {
+  var extendElements = Prototype.Selector.extendElements;
+
+  function select(selector, scope) {
+    return extendElements(engine(selector, scope || document));
   }
-});
 
-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 match(element, selector) {
+    return engine.matches(selector, [element]).length == 1;
+  }
 
-function $$() {
-  return Selector.findChildElements(document, $A(arguments));
-}
+  Prototype.Selector.engine = engine;
+  Prototype.Selector.select = select;
+  Prototype.Selector.match = match;
+})(Sizzle);
+
+window.Sizzle = Prototype._original_property;
+delete Prototype._original_property;
 
 var Form = {
   reset: function(form) {
@@ -3924,24 +4970,34 @@ var 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 key, value, submitted = false, submit = options.submit, accumulator, initial;
+
+    if (options.hash) {
+      initial = {};
+      accumulator = function(result, key, value) {
+        if (key in result) {
+          if (!Object.isArray(result[key])) result[key] = [result[key]];
+          result[key].push(value);
+        } else result[key] = value;
+        return result;
+      };
+    } else {
+      initial = '';
+      accumulator = function(result, key, value) {
+        return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
+      }
+    }
 
-    var data = elements.inject({ }, function(result, element) {
+    return elements.inject(initial, 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;
+          result = accumulator(result, key, value);
         }
       }
       return result;
     });
-
-    return options.hash ? data : Object.toQueryString(data);
   }
 };
 
@@ -4008,7 +5064,8 @@ Form.Methods = {
 
   focusFirstElement: function(form) {
     form = $(form);
-    form.findFirstElement().activate();
+    var element = form.findFirstElement();
+    if (element) element.activate();
     return form;
   },
 
@@ -4115,67 +5172,77 @@ var $F = Form.Element.Methods.getValue;
 
 /*--------------------------------------------------------------------------*/
 
-Form.Element.Serializers = {
-  input: function(element, value) {
+Form.Element.Serializers = (function() {
+  function input(element, value) {
     switch (element.type.toLowerCase()) {
       case 'checkbox':
       case 'radio':
-        return Form.Element.Serializers.inputSelector(element, value);
+        return inputSelector(element, value);
       default:
-        return Form.Element.Serializers.textarea(element, value);
+        return valueSelector(element, value);
     }
-  },
+  }
 
-  inputSelector: function(element, value) {
-    if (Object.isUndefined(value)) return element.checked ? element.value : null;
+  function inputSelector(element, value) {
+    if (Object.isUndefined(value))
+      return element.checked ? element.value : null;
     else element.checked = !!value;
-  },
+  }
 
-  textarea: function(element, value) {
+  function valueSelector(element, value) {
     if (Object.isUndefined(value)) return element.value;
     else element.value = value;
-  },
+  }
 
-  select: function(element, value) {
+  function select(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;
-          }
+      return (element.type === 'select-one' ? selectOne : selectMany)(element);
+
+    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);
       }
+      else opt.selected = value.include(currentValue);
     }
-  },
+  }
 
-  selectOne: function(element) {
+  function selectOne(element) {
     var index = element.selectedIndex;
-    return index >= 0 ? this.optionValue(element.options[index]) : null;
-  },
+    return index >= 0 ? optionValue(element.options[index]) : null;
+  }
 
-  selectMany: function(element) {
+  function selectMany(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));
+      if (opt.selected) values.push(optionValue(opt));
     }
     return values;
-  },
+  }
 
-  optionValue: function(opt) {
-    return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+  function optionValue(opt) {
+    return Element.hasAttribute(opt, 'value') ? opt.value : opt.text;
   }
-};
+
+  return {
+    input:         input,
+    inputSelector: inputSelector,
+    textarea:      valueSelector,
+    select:        select,
+    selectOne:     selectOne,
+    selectMany:    selectMany,
+    optionValue:   optionValue,
+    button:        valueSelector
+  };
+})();
 
 /*--------------------------------------------------------------------------*/
 
@@ -4286,24 +5353,53 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
   var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
     && 'onmouseleave' in docEl;
 
+
+
+  var isIELegacyEvent = function(event) { return false; };
+
+  if (window.attachEvent) {
+    if (window.addEventListener) {
+      isIELegacyEvent = function(event) {
+        return !(event instanceof window.Event);
+      };
+    } else {
+      isIELegacyEvent = function(event) { return true; };
+    }
+  }
+
   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;
+
+  function _isButtonForDOMEvents(event, code) {
+    return event.which ? (event.which === code + 1) : (event.button === code);
+  }
+
+  var legacyButtonMap = { 0: 1, 1: 4, 2: 2 };
+  function _isButtonForLegacyEvents(event, code) {
+    return event.button === legacyButtonMap[code];
+  }
+
+  function _isButtonForWebKit(event, code) {
+    switch (code) {
+      case 0: return event.which == 1 && !event.metaKey;
+      case 1: return event.which == 2 || (event.which == 1 && event.metaKey);
+      case 2: return event.which == 3;
+      default: return false;
+    }
+  }
+
+  if (window.attachEvent) {
+    if (!window.addEventListener) {
+      _isButton = _isButtonForLegacyEvents;
+    } else {
+      _isButton = function(event, code) {
+        return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
+         _isButtonForDOMEvents(event, code);
       }
-    };
+    }
+  } else if (Prototype.Browser.WebKit) {
+    _isButton = _isButtonForWebKit;
   } else {
-    _isButton = function(event, code) {
-      return event.which ? (event.which === code + 1) : (event.button === code);
-    };
+    _isButton = _isButtonForDOMEvents;
   }
 
   function isLeftClick(event)   { return _isButton(event, 0) }
@@ -4333,9 +5429,14 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
 
   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);
+    while (element) {
+      if (Object.isElement(element) && Prototype.Selector.match(element, expression)) {
+        return Element.extend(element);
+      }
+      element = element.parentNode;
+    }
   }
 
   function pointer(event) {
@@ -4369,49 +5470,59 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
     event.stopped = true;
   }
 
+
   Event.Methods = {
-    isLeftClick: isLeftClick,
+    isLeftClick:   isLeftClick,
     isMiddleClick: isMiddleClick,
-    isRightClick: isRightClick,
+    isRightClick:  isRightClick,
 
-    element: element,
+    element:     element,
     findElement: findElement,
 
-    pointer: pointer,
+    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) {
+  if (window.attachEvent) {
     function _relatedTarget(event) {
       var element;
       switch (event.type) {
-        case 'mouseover': element = event.fromElement; break;
-        case 'mouseout':  element = event.toElement;   break;
-        default: return null;
+        case 'mouseover':
+        case 'mouseenter':
+          element = event.fromElement;
+          break;
+        case 'mouseout':
+        case 'mouseleave':
+          element = event.toElement;
+          break;
+        default:
+          return null;
       }
       return Element.extend(element);
     }
 
-    Object.extend(methods, {
+    var additionalMethods = {
       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;
 
+      if (!isIELegacyEvent(event)) return event;
+
+      if (event._extendedByPrototype) return event;
       event._extendedByPrototype = Prototype.emptyFunction;
+
       var pointer = Event.pointer(event);
 
       Object.extend(event, {
@@ -4421,12 +5532,18 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
         pageY:  pointer.y
       });
 
-      return Object.extend(event, methods);
+      Object.extend(event, methods);
+      Object.extend(event, additionalMethods);
+
+      return event;
     };
   } else {
+    Event.extend = Prototype.K;
+  }
+
+  if (window.addEventListener) {
     Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
     Object.extend(Event.prototype, methods);
-    Event.extend = Prototype.K;
   }
 
   function _createResponder(element, eventName, handler) {
@@ -4504,12 +5621,12 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
     window.addEventListener('unload', Prototype.emptyFunction, false);
 
 
-  var _getDOMEventName = Prototype.K;
+  var _getDOMEventName = Prototype.K,
+      translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
 
   if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
     _getDOMEventName = function(eventName) {
-      var translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
-      return eventName in translations ? translations[eventName] : eventName;
+      return (translations[eventName] || eventName);
     };
   }
 
@@ -4525,7 +5642,7 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
         element.addEventListener("dataavailable", responder, false);
       else {
         element.attachEvent("ondataavailable", responder);
-        element.attachEvent("onfilterchange", responder);
+        element.attachEvent("onlosecapture", responder);
       }
     } else {
       var actualEventName = _getDOMEventName(eventName);
@@ -4543,46 +5660,44 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
     element = $(element);
 
     var registry = Element.retrieve(element, 'prototype_event_registry');
+    if (!registry) return element;
 
-    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) {
+    if (!eventName) {
       registry.each( function(pair) {
-        var eventName = pair.key, responders = pair.value;
-
-        responders.each( function(r) {
-          Element.stopObserving(element, eventName, r.handler);
-        });
+        var eventName = pair.key;
+        stopObserving(element, eventName);
       });
       return element;
     }
 
     var responders = registry.get(eventName);
+    if (!responders) return element;
 
-    if (!responders) return;
+    if (!handler) {
+      responders.each(function(r) {
+        stopObserving(element, eventName, r.handler);
+      });
+      return element;
+    }
 
-    var responder = responders.find( function(r) { return r.handler === handler; });
+    var i = responders.length, responder;
+    while (i--) {
+      if (responders[i].handler === handler) {
+        responder = responders[i];
+        break;
+      }
+    }
     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);
+        element.detachEvent("onlosecapture", responder);
       }
     } else {
+      var actualEventName = _getDOMEventName(eventName);
       if (element.removeEventListener)
         element.removeEventListener(actualEventName, responder, false);
       else
@@ -4606,10 +5721,10 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
     var event;
     if (document.createEvent) {
       event = document.createEvent('HTMLEvents');
-      event.initEvent('dataavailable', true, true);
+      event.initEvent('dataavailable', bubble, true);
     } else {
       event = document.createEventObject();
-      event.eventType = bubble ? 'ondataavailable' : 'onfilterchange';
+      event.eventType = bubble ? 'ondataavailable' : 'onlosecapture';
     }
 
     event.eventName = eventName;
@@ -4623,13 +5738,47 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
     return Event.extend(event);
   }
 
+  Event.Handler = Class.create({
+    initialize: function(element, eventName, selector, callback) {
+      this.element   = $(element);
+      this.eventName = eventName;
+      this.selector  = selector;
+      this.callback  = callback;
+      this.handler   = this.handleEvent.bind(this);
+    },
+
+    start: function() {
+      Event.observe(this.element, this.eventName, this.handler);
+      return this;
+    },
+
+    stop: function() {
+      Event.stopObserving(this.element, this.eventName, this.handler);
+      return this;
+    },
+
+    handleEvent: function(event) {
+      var element = Event.findElement(event, this.selector);
+      if (element) this.callback.call(this.element, event, element);
+    }
+  });
+
+  function on(element, eventName, selector, callback) {
+    element = $(element);
+    if (Object.isFunction(selector) && Object.isUndefined(callback)) {
+      callback = selector, selector = null;
+    }
+
+    return new Event.Handler(element, eventName, selector, callback).start();
+  }
 
   Object.extend(Event, Event.Methods);
 
   Object.extend(Event, {
     fire:          fire,
     observe:       observe,
-    stopObserving: stopObserving
+    stopObserving: stopObserving,
+    on:            on
   });
 
   Element.addMethods({
@@ -4637,7 +5786,9 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
 
     observe:       observe,
 
-    stopObserving: stopObserving
+    stopObserving: stopObserving,
+
+    on:            on
   });
 
   Object.extend(document, {
@@ -4647,6 +5798,8 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
 
     stopObserving: stopObserving.methodize(),
 
+    on:            on.methodize(),
+
     loaded:        false
   });
 
@@ -4872,3 +6025,58 @@ Element.ClassNames.prototype = {
 Object.extend(Element.ClassNames.prototype, Enumerable);
 
 /*--------------------------------------------------------------------------*/
+
+(function() {
+  window.Selector = Class.create({
+    initialize: function(expression) {
+      this.expression = expression.strip();
+    },
+
+    findElements: function(rootElement) {
+      return Prototype.Selector.select(this.expression, rootElement);
+    },
+
+    match: function(element) {
+      return Prototype.Selector.match(element, this.expression);
+    },
+
+    toString: function() {
+      return this.expression;
+    },
+
+    inspect: function() {
+      return "#<Selector: " + this.expression + ">";
+    }
+  });
+
+  Object.extend(Selector, {
+    matchElements: function(elements, expression) {
+      var match = Prototype.Selector.match,
+          results = [];
+
+      for (var i = 0, length = elements.length; i < length; i++) {
+        var element = elements[i];
+        if (match(element, expression)) {
+          results.push(Element.extend(element));
+        }
+      }
+      return results;
+    },
+
+    findElement: function(elements, expression, index) {
+      index = index || 0;
+      var matchIndex = 0, element;
+      for (var i = 0, length = elements.length; i < length; i++) {
+        element = elements[i];
+        if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
+          return Element.extend(element);
+        }
+      }
+    },
+
+    findChildElements: function(element, expressions) {
+      var selector = expressions.toArray().join(', ');
+      return Prototype.Selector.select(selector, element || document);
+    }
+  });
+})();
diff --git a/ricoClient/js/export-owc.html b/ricoClient/js/export-owc.html
deleted file mode 100644 (file)
index 4cde157..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<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
deleted file mode 100644 (file)
index de8a617..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<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/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/glow_min.js b/ricoClient/js/glow_min.js
new file mode 100644 (file)
index 0000000..e0879ad
--- /dev/null
@@ -0,0 +1,5 @@
+(function(){var C={glow:true},E=/([$^\\\/()|?+*\[\]{}.-])/g,F=navigator.userAgent.toLowerCase(),y="1.7.3",d=0,B=[],w=0,e=[],u=0,G=false,v={VERSION:y,UID:"glow"+Math.floor(Math.random()*(1<<30)),isDomReady:window.gloader&&gloader.isReady,isReady:window.gloader&&gloader.isReady,env:function(){var f=[0,NaN],j=(/opera[\s\/]([\w\.]+)/.exec(F)||f)[1],c=j?NaN:(/msie ([\w\.]+)/.exec(F)||f)[1],a=(/rv:([\w\.]+).*gecko\//.exec(F)||f)[1],h=(/applewebkit\/([\w\.]+)/.exec(F)||f)[1],g=(/khtml\/([\w\.]+)/.exec(F)||f)[1],b=parseFloat;return{gecko:b(a),ie:b(c),opera:b(j),webkit:b(h),khtml:b(g),version:c||a||h||j||g,standardsMode:document.compatMode!="BackCompat"&&(!c||c>=6)}}(),module:function(c){var f=2,a=c.depends[0]||[],h=a.length,g=c.name,b=window.glow;if(c.library[1]!=v.VERSION){throw new Error("Cannot register "+g+": Version mismatch")}if(a[2]){for(;f<h;f++){if(!C[a[f]]){throw new Error("Module "+a[f]+" required before "+g)}}}c.builder(v);C[g]=true;return v},ready:function(a){if(this.isReady){a()}else{e[u++]=a}return this},_readyBlockers:{},_addReadyBlock:function(a){if(!v._readyBlockers[a]){v._readyBlockers[a]=true;v.isReady=false;d++}return v},_removeReadyBlock:function(a){if(v._readyBlockers[a]){v._readyBlockers[a]=false;d--;if(!d){v.isReady=true;t()}}return v},onDomReady:function(a){if(this.isDomReady){a()}else{B[w++]=a}},lang:{trim:function(a){return a.replace(/^\s*((?:[\S\s]*\S)?)\s*$/,"$1")},toArray:function(c){if(c.constructor==Array){return c}var a=[],b=0,f=c.length;for(;b<f;b++){a[b]=c[b]}return a},apply:function(c,a){for(var b in a){c[b]=a[b]}return c},map:function(h,a,b){if(Array.prototype.map){return Array.prototype.map.call(h,a,b||h)}if(!a.call){throw new TypeError()}var j=h.length,c=[],f=b||h,g=0;for(;g<j;g++){if(g in h){c[g]=a.call(f,h[g],g,h)}}return c},replace:(function(){var b="g".replace(/g/,function(){return"l"})!="l",a=String.prototype.replace;return function(l,f,j){var k,g,c,h;if(!b||typeof(j)!="function"){return a.call(l,f,j)}if(!(f instanceof RegExp)){k=l.indexOf(f);return k==-1?l:a.call(l,f,j.call(null,f,k,l))}h=[];c=f.lastIndex=0;while((g=f.exec(l))!=null){k=g.index;h[h.length]=l.slice(c,k);h[h.length]=j.apply(null,g);if(f.global){c=f.lastIndex}else{c=k+g[0].length;break}}h[h.length]=l.slice(c);return h.join("")}})(),interpolate:function(g,b,f){var j,c,h,a;f=f||{};if(f.escapeHtml){if(!v.dom){throw new Error("glow.lang.interpolate - glow.dom is needed for escapeHtml")}a=v.dom.create("<div></div>")}if(f.delimiter==undefined){j=/\{[^{}]+\}/g}else{c=f.delimiter.substr(0,1).replace(E,"\\$1");h=f.delimiter.substr(1,1).replace(E,"\\$1")||c;j=new RegExp(c+"[^"+c+h+"]+"+h,"g")}return g.replace(j,function(l){var k=l.slice(1,-1),n=k.split("."),p,m=0,o=n.length;if(k in b){p=b[k]}else{p=b;for(;m<o;m++){if(n[m] in p){p=p[n[m]]}else{return l}}}if(f.escapeHtml){p=a.text(p).html()}return p})},hasOwnProperty:{}.hasOwnProperty?function(b,a){return b.hasOwnProperty(a)}:function(a,k){var f=a[k],b=a.__proto__,g=b?b[k]:{};if(f!==g){return true}var h=v.lang.hasOwnProperty(b,k),j=b[k]={},c=(a[k]!==j);delete b[k];if(h){b[name]=j}return c},extend:function(f,b,g){var c=function(){},a;c.prototype=b.prototype;a=new c();f.prototype=a;a.constructor=f;f.base=b;if(g){v.lang.apply(f.prototype,g)}},clone:function(b){var f,a,c;b=b.valueOf();if(typeof b!=="object"){return b}else{if(b[0]||b.concat){c=[];f=b.length;while(f--){c[f]=arguments.callee(b[f])}}else{c={};for(f in b){c[f]=arguments.callee(b[f])}}return c}}}},A=v.env,x=document;function D(){v.isDomReady=true;for(var a=0;a<w;a++){B[a]()}}function t(){if(G){return}G=true;for(var a=0;a<u;){e[a]();a++;if(d){break}}e=e.slice(a);u=u-a;G=false}(function(){if(v.isDomReady){return}v._addReadyBlock("glow_domReady");if(A.ie){if(typeof window.frameElement!="undefined"){x.attachEvent("onreadystatechange",function(){if(x.readyState=="complete"){x.detachEvent("onreadystatechange",arguments.callee);D();v._removeReadyBlock("glow_domReady")}})}else{(function(){try{x.documentElement.doScroll("left")}catch(f){setTimeout(arguments.callee,0);return}D();v._removeReadyBlock("glow_domReady")})()}}else{if(v.env.webkit<525.13&&typeof x.readyState!="undefined"){var b=function(){if(/loaded|complete/.test(x.readyState)){D();v._removeReadyBlock("glow_domReady")}else{setTimeout(b,0)}};b()}else{var a=function(){if(a.fired){return}a.fired=true;D();v._removeReadyBlock("glow_domReady")};if(x.addEventListener){x.addEventListener("DOMContentLoaded",a,false)}var c=window.onload;window.onload=function(){if(c){c()}a()}}}})();v.isSupported=!(A.ie<6||(A.gecko<1.9&&!/^1\.8\.1/.test(A.version))||A.opera<9||A.webkit<412);if(!v.isSupported){v._addReadyBlock("glow_browserSupport")}if(window.gloader){gloader.library({name:"glow",version:"1.7.3",builder:function(){return v}})}else{if(window.glow){throw new Error("Glow global object already exists")}else{window.glow=v}}if(v.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(z){}}})();
+/*@cc_on @*/
+/*@if (@_jscript_version > 5.5)@*/
+(window.gloader||glow).module({name:"glow.i18n",library:["glow","1.7.3"],depends:[["glow","1.7.3"]],builder:function(Y){var ab;var U={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 W=1,ah=2,ag=4,ai=8,ac=W+ah+ag+ai,al=W+ag+ai,M=W+ah+ai,ao=W+ai,K=W+ah+ag,am=W+ag,an=W+ah;var af={l:W,s:ah,r:ag,v:ai},L=["l","s","r","v"],S={l:0,s:1,r:2,v:3};var X={};var ap={};var ad=O(document.documentElement.lang||"en")||O("en");function V(a){for(var b in U){if(U[b].test(a)){return b}}return""}function O(a){if(!a.split){a=""}var j=a.split("-"),f=j.length,e=[],m={l:"",s:"",r:"",v:""},n=0,h=n,b=0,g,d;for(var k=0,c=L.length;k<c;k++){h=n;g=L[k];d=S[g];while((V(j[h]).indexOf(g)==-1)&&(h<f)){h++}if(h<f){e[d]=j[h];b+=af[g];m[g]=j[h];j[h]="*";n=h}}var l=e.join("-").replace(/-+/g,"-");if((l=="")||(l.substring(0,1)=="-")){return false}else{return{canonical:l,mask:b,subtags:m}}}function ak(b,d,c){var a;if((c&~b.mask)==0){a=b.subtags.l;if(ah&c){a=a+"-"+b.subtags.s}if(ag&c){a=a+"-"+b.subtags.r}if(ai&c){a=a+"-"+b.subtags.v}if(d(a)){return a}}return false}function aq(b,d,c,a){var e;switch(b.mask){case al:if((e=ak(b,d,al))){break}case am:if((e=ak(b,d,am))){break}case ac:if((e=ak(b,d,ac))){break}case K:if((e=ak(b,d,K))){break}case M:if((e=ak(b,d,M))){break}case an:if((e=ak(b,d,an))){break}case ao:if((e=ak(b,d,ao))){break}case W:if((e=ak(b,d,W))){break}default:if(d("en")){e="en"}else{e=null}}if(e==null){a()}else{c(e)}}function Q(a){var c=ad,b=O(a);if(b){ad=b;ad.next=c}return ab}function N(){ad=ad.next||ad;return ab}function aa(){return ad.canonical}function aj(h,a,d){var c=O(a),e,f,b;if(c){e=X[c.canonical]=X[c.canonical]||{};f=e[h]=e[h]||{};b=ap[h]=ap[h]||{};for(var g in d){f[g]=d[g];b[g]=1}}return ab}function T(k,l){var j={},b=l||{},g=ap[k]||{},f=ad,a,d;function e(m){if(X[m]&&X[m][k]&&X[m][k][d]){return true}else{return false}}function c(m){j[d]=X[m][k][d]}function h(){j[d]="[Error! No "+k+"."+d+" on "+f.canonical+"]"}if(b.locale!=undefined){a=O(b.locale);if(a){f=a}}for(d in g){aq(f,e,c,h)}return j}function P(b,a){for(var c in a){aj(c,b,a[c])}return ab}function R(a,d){var b=d||{},c=O(a);if(b.module){if(b.label){return Z(c,b.module,b.label)}else{return ae(c,b.module)}}else{return J(c)}return null}function Z(a,f,g){var c;function d(h){if(X[h]&&X[h][f]&&X[h][f][g]){return true}else{return false}}function e(h){c=h}function b(){c="**error** - no negotiated value exists"}aq(a,d,e,b);return c}function ae(a,f){var b=ap[f]||{},g={},h;function d(j){if(X[j]&&X[j][f]&&X[j][f][h]){return true}else{return false}}function e(j){g[h]=j}function c(){g[h]="**error** - no negotiated value exists"}for(h in b){aq(a,d,e,c)}return g}function J(b){var f={},g,a;function d(h){if(X[h]&&X[h][g]&&X[h][g][a]){return true}else{return false}}function e(h){f[g][a]=h}function c(){f[g][a]="**error** - no negotiated value exists"}for(g in ap){f[g]={};for(a in ap[g]){aq(b,d,e,c)}}return f}Y.i18n=ab={setLocale:Q,revertLocale:N,getLocale:aa,addLocaleModule:aj,getLocaleModule:T,addLocalePack:P,checkLocale:R};P("en",{PROPERTIES:{LANGUAGE:"English",DIR:"ltr"}})}});(window.gloader||glow).module({name:"glow.dom",library:["glow","1.7.3"],depends:[],builder:function(aX){var a3=aX.env,a6=aX.lang,aZ={tagName:/^(\w+|\*)/,combinator:/^\s*([>]?)\s*/,classNameOrId:(a3.webkit<417)?new RegExp("^([\\.#])((?:(?![\\.#\\[:\\s\\\\]).|\\\\.)+)"):/^([\.#])((?:[^\.#\[:\\\s]+|\\.)+)/},ak=/([$^\\\/()|?+*\[\]{}.-])/g,aO={},aq={checked:"checked","class":"className",disabled:"disabled","for":"htmlFor",maxlength:"maxLength"},bd={checked:true,disabled:true},aD={maxlength:function(a){return a.toString()=="2147483647"?undefined:a}},aL=1,aU="_unique"+aX.UID,aB="_uniqueData"+aX.UID,aG=1,ax=[],aA={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},aK=/height|top/,aY=/^rgb\(([\d\.]+)(%?),\s*([\d\.]+)(%?),\s*([\d\.]+)(%?)/i,aQ=/^(?:(width|height)|(border-(top|bottom|left|right)-width))$/,aM=/width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,ao,bc,ay,aC,aR=window,a5=document,am,aE,aV,at=a5.createElement("div"),aT=[1,"<table>","</table>"],aP=[0,"",""],au=a3.webkit<526?[0,"","</div>",true]:[1,"b<div>","</div>"],bf=[3,"<table><tbody><tr>","</tr></tbody></table>"],aI={caption:aT,thead:aT,th:bf,colgroup:aT,tbody:aT,tr:[2,"<table><tbody>","</tbody></table>"],td:bf,tfoot:aT,option:[1,"<select>","</select>"],legend:[1,"<fieldset>","</fieldset>"],link:au,script:au,style:au};if(a3.ie){window.attachEvent("onunload",function(){at=null})}aX.ready(function(){am=a5.body;aE=a5.documentElement});(function(){var a=a5.createElement("div");a.a=1;aV=!!a.cloneNode(true).a})();function aH(a){for(var b=a.firstChild;b;b=b.nextSibling){if(b.nodeType==1){return b}}return null}function aW(a){return new RegExp(["(^|\\s)",a.replace(ak,"\\$1"),"($|\\s)"].join(""),"g")}function av(a){var b=[],e=(/^\s*<([^\s>]+)/.exec(a)||[,"div"])[1],g=aI[e]||aP,d,f,c=0;at.innerHTML=(g[1]+a+g[2]);f=at;d=g[0];while(d--){f=f.lastChild}while(f.firstChild){b[c++]=f.removeChild(f.firstChild)}f=null;return b}function a1(a){var b=[],c=0;for(;a[c];c++){b[c]=a[c]}return b}function bb(b,e){for(var c=this,a=0,d=c.length;a<d;a++){e.call(c[a],b.call?b.call(c[a],a):b)}return c}if(document.all){ao=function(d,e){var c=0,a=d.length,b=e.length;if(typeof e.length=="number"){for(;c<b;c++){d[a++]=e[c]}}else{for(;e[c];c++){d[a++]=e[c]}}}}else{ao=function(c,d){var b=0,a=c.length;for(;d[b];b++){c[a++]=d[b]}}}function aw(a){return(a.ownerDocument&&!a.ownerDocument.body)||(a.documentElement&&!a.documentElement.body)}if(a3.ie){bc=function(c){if(c.length==1){return c}var a=[],d=0,b=0;for(;c[b];b++){if(c[b].getAttribute(aU)!=aL&&c[b].nodeType==1){a[d++]=c[b]}c[b].setAttribute(aU,aL)}for(b=0;c[b];b++){c[b].removeAttribute(aU)}aL++;return a}}else{bc=function(c){if(c.length==1){return c}var a=[],d=0,b=0;for(;c[b];b++){if(c[b][aU]!=aL&&c[b].nodeType==1){a[d++]=c[b]}c[b][aU]=aL}aL++;return a}}if(document.all){aC=function(d,b){var a=[],c=0;for(;b[c];c++){if(d=="*"&&b[c].all&&!aw(b[c])){ao(a,b[c].all)}else{ao(a,b[c].getElementsByTagName(d))}}return a}}else{aC=function(d,b){var a=[],c=0,e=b.length;for(;c<e;c++){ao(a,b[c].getElementsByTagName(d))}return a}}function be(b){var c=[],a=b.childNodes,d=0,e=0;for(;a[d];d++){if(a[d].nodeType==1&&a[d].nodeName!="!"){c[e++]=a[d]}}return c}var an=["border-left-width","border-right-width","padding-left","padding-right"],ar=["border-top-width","border-bottom-width","padding-top","padding-bottom"];function ba(a,c){var d,g=a3.standardsMode?aE:am,b=(c=="width"),f=b?"Width":"Height",e;if(a.window){d=a3.webkit<522.11?(b?a.innerWidth:a.innerHeight):a3.webkit?(b?am.clientWidth:a.innerHeight):a3.opera<9.5?(b?am.clientWidth:am.clientHeight):(b?g.clientWidth:g.clientHeight)}else{if(a.getElementById){d=Math.max(am["scroll"+f],aE["scroll"+f])}else{e=b?an:ar;d=a["offset"+f]-parseInt(r(a,e))}}return d}function aJ(a){if(a3.ie<6){return a.document.body}else{return a.ownerDocument.body}}function a7(c,b,d){if(typeof b=="number"||/\d$/.test(b)){b+="px"}for(var e=0,a=c.length;e<a;e++){c[e].style[d]=b}}function al(a){if(a=="float"){return a3.ie?"styleFloat":"cssFloat"}return a6.replace(a,/-(\w)/g,function(c,b){return b.toUpperCase()})}function aS(a,c){var d,b=a.style,e=b.display,g=b.visibility,f=b.position;b.visibility="hidden";b.position="absolute";b.display="block";if(!a8(a)){b.position=f;d=aS(a.parentNode,c);b.display=e;b.visibility=g}else{d=c();b.display=e;b.position=f;b.visibility=g}return d}function a8(a){return a.offsetWidth||a.offsetHeight}function r(c,j){var k,a=0,e=0,f=j.length,g=a5.defaultView&&(a5.defaultView.getComputedStyle(c,null)||a5.defaultView.getComputedStyle),h=c.currentStyle,b,d,l=j.push||aQ.exec(j)||[];if(j.push){for(;e<f;e++){a+=parseInt(r(c,j[e]),10)||0}return a+"px"}if(l[1]){if(!a8(c)){return aS(c,function(){return ba(c,l[1])+"px"})}return ba(c,l[1])+"px"}else{if(l[2]&&aX.env.ie&&r(c,"border-"+l[3]+"-style")=="none"){return"0"}else{if(g){if(typeof g=="function"){b=c.style.display;k=aS(c,function(){if(j=="display"){c.style.display=b;if(!a5.defaultView.getComputedStyle(c,null)){return"none"}c.style.display="block"}return r(c,j)})}else{if(a3.webkit>500&&a3.webkit<526&&j=="margin-right"&&g.getPropertyValue("position")!="absolute"){j="margin-left"}k=g.getPropertyValue(j)}}else{if(h){if(j=="opacity"){d=/alpha\(opacity=([^\)]+)\)/.exec(h.filter);return d?String(parseInt(d[1],10)/100):"1"}k=String(h[al(j)]);if(/^-?[\d\.]+(?!px)[%a-z]+$/i.test(k)&&j!="font-size"){k=az(c,k,aK.test(j))+"px"}}}}}if(j.indexOf("color")!=-1){k=ap(k).toString()}else{if(k.indexOf("url")==0){k=k.replace(/\"/g,"")}}return k}function az(d,b,f){var h=f?"top":"left",e=f?"Top":"Left",a=d.style,g=a[h],c=d.runtimeStyle[h],j;d.runtimeStyle[h]=d.currentStyle[h];a[h]=b;j=a["pixel"+e];a[h]=g;d.runtimeStyle[h]=c;return j}function ap(h){if(/^(transparent|rgba\(0, ?0, ?0, ?0\))$/.test(h)){return"transparent"}var d,j,c,b,g,e=Math.round,a=parseInt,f=parseFloat;if(d=aY.exec(h)){j=d[2]?e(((f(d[1])/100)*255)):a(d[1]);c=d[4]?e(((f(d[3])/100)*255)):a(d[3]);b=d[6]?e(((f(d[5])/100)*255)):a(d[5])}else{if(typeof h=="number"){g=h}else{if(h.charAt(0)=="#"){if(h.length=="4"){h="#"+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2)+h.charAt(3)+h.charAt(3)}g=a(h.slice(1),16)}else{g=aA[h]}}j=(g)>>16;c=(g&65280)>>8;b=(g&255)}h=new String("rgb("+j+", "+c+", "+b+")");h.r=j;h.g=c;h.b=b;return h}function a4(a){var b="",d=a.childNodes,c=0,e=d.length;for(;c<e;c++){if(d[c].nodeType==3){b+=d[c].nodeValue}else{if(d[c].nodeType==1){b+=a4(d[c])}}}return b}function a0(a,e){var f=[],g=0,c,d=0,b=a.length;for(;d<b;d++){c=a[d];while(c=c[e+"Sibling"]){if(c.nodeType==1&&c.nodeName!="!"){f[g++]=c;break}}}return aj.get(f)}function aF(b){var a=b.offsetParent;while(a&&aj.get(a).css("position")=="static"){a=a.offsetParent}if(!a&&aj.get(aE).css("position")!="static"){a=aE}return a||null}function aN(a,b){var c,d="scroll"+(b?"Left":"Top");if(a.window){c=a.document.documentElement[d]||(b?a.pageXOffset:a.pageYOffset)||0}else{c=a[d]}return c}function a2(b,c,a){if(b.window){b.scrollTo(c?a:aN(b,true),!c?a:aN(b,false))}else{b["scroll"+(c?"Left":"Top")]=a}}function a9(a,b,c){var d=a.length;if(c!==undefined){while(d--){a2(a[d],b,c)}return a}else{return aN(a[0],b)}}var aj={};aj.get=function(){var a=new aX.dom.NodeList(),b=0,c=arguments,d=c.length;for(;b<d;b++){if(typeof c[b]=="string"){a.push(new aX.dom.NodeList().push(a5).get(c[b]))}else{a.push(c[b])}}return a};aj.create=function(b,c){var a=[],f=0,d=0,e;c=aX.lang.apply({interpolate:null,escapeHtml:false},c||{});if(c.interpolate){b=a6.interpolate(b,c.interpolate,{escapeHtml:c.escapeHtml})}e=av(b);for(;e[f];f++){if(e[f].nodeType==1&&e[f].nodeName!="!"){a[d++]=e[f]}else{if(e[f].nodeType==3&&a6.trim(e[f].nodeValue)!==""){throw new Error("glow.dom.create - Text must be wrapped in an element")}}}return new aj.NodeList().push(a)};aj.parseCssColor=function(a){var b=ap(a);return{r:b.r,g:b.g,b:b.b}};aj.NodeList=function(){this.length=0};aj.NodeList.prototype={item:function(a){return this[a]},push:function(){var f=arguments,g=f.length,e=0,a,c,d=this,b=Array.prototype.push;for(;e<g;e++){if(!f[e]){continue}else{if(f[e].nodeType==1||f[e].nodeType==9||f[e].document){b.call(d,f[e])}else{if(f[e][0]){for(a=0,c=f[e].length;a<c;a++){b.call(d,f[e][a])}}}}}return d},each:function(b){for(var a=0,c=this,d=c.length;a<d;a++){b.call(c[a],a,c)}return c},eq:function(b){var c=this,a=0,d=c.length;if(!b.push){b=[b]}if(b.length!=c.length){return false}for(;a<d;a++){if(c[a]!=b[a]){return false}}return true},isWithin:function(c){if(c.push){c=c[0]}if(!c||!this.length){return false}var d=this,a=0,e=d.length,b;if(c.contains&&a3.webkit>=521){for(;a<e;a++){if(!(c.contains(d[a])&&d[a]!=c)){return false}}}else{if(d[0].compareDocumentPosition){for(;a<e;a++){if(!(d[a].compareDocumentPosition(c)&8)){return false}}}else{for(;a<e;a++){b=d[a];while(b=b.parentNode){if(b==c){break}}if(!b){return false}}}}return true},attr:function(e){var c=this,f=arguments,b=f.length,d,a;if(c.length===0){return b>1?c:undefined}if(typeof e=="object"){for(d in e){if(a6.hasOwnProperty(e,d)){c.attr(d,e[d])}}return c}if(a3.ie&&aq[e]){if(b>1){bb.call(c,f[1],function(g){this[aq[e]]=g});return c}a=c[0][aq[e]];if(bd[e]){return a?e:undefined}else{if(aD[e]){return aD[e](a)}}return a}if(b>1){bb.call(c,f[1],function(g){this.setAttribute(e,g)});return c}return aw(c[0])?c[0].getAttribute(e):c[0].getAttribute(e,2)},removeAttr:function(e){var a=a3.ie&&aq[e],b=this,d=0,c=b.length;for(;d<c;d++){if(a){b[d][a]=""}else{b[d].removeAttribute(e)}}return b},hasAttr:function(d){var b=this[0],e=b.attributes;if(aw(b)&&a3.ie){var e=b.attributes,c=0,f=e.length;for(;c<f;c++){if(e[c].nodeName==d){return e[c].specified}}return false}else{if(this[0].getAttributeNode){var a=this[0].getAttributeNode(d);return a?a.specified:false}}return typeof e[a]!="undefined"},prop:function(a,b){if(a.constructor===Object){var c=a,d;for(d in c){this.prop(d,c[d])}return this}if(b!==undefined){var e=this.length;while(e--){this[e][a]=b}return this}if(!this[0]){return undefined}return this[0][a]},hasClass:function(a){for(var c=0,b=this.length;c<b;c++){if((" "+this[c].className+" ").indexOf(" "+a+" ")!=-1){return true}}return false},addClass:function(a){for(var c=0,b=this.length;c<b;c++){if((" "+this[c].className+" ").indexOf(" "+a+" ")==-1){this[c].className+=((this[c].className)?" ":"")+a}}return this},removeClass:function(a){var d=aW(a),b=this,e=0,c=b.length;for(;e<c;e++){b[e].className=b[e].className.replace(d," ")}return b},toggleClass:function(d){var b=this.length,c,a=" "+d+" ";while(b--){c=" "+this[b].className+" ";if(c.indexOf(a)!=-1){this[b].className=c.replace(a," ")}else{this[b].className+=" "+d}}return this},val:function(){function b(h){var l=h.type,k=h.checked,f=h.value,e=[],j=0;if(l=="radio"){return k?f:""}else{if(l=="checkbox"){return k?f:""}else{if(l=="select-one"){return h.selectedIndex>-1?h.options[h.selectedIndex].value:""}else{if(l=="select-multiple"){for(var g=h.options.length;j<g;j++){if(h.options[j].selected){e[e.length]=h.options[j].value}}return e}else{return f}}}}}function d(o){var g={},h={},l=o.elements,j=0,m=l.length,p,e,k,n,f;for(;j<m;j++){e=l[j];f=e.nodeName.toLowerCase();p=e.name;if(f=="fieldset"||f=="object"||!p){continue}if(e.type=="checkbox"&&!e.checked){if(!p in g){g[p]=undefined}}else{if(e.type=="radio"){if(h[p]){h[p][h[p].length]=e}else{h[p]=[e]}}else{var q=b(e);if(p in g){if(g[p].push){g[p][g[p].length]=q}else{g[p]=[g[p],q]}}else{g[p]=q}}}}for(j in h){k=0;for(m=h[j].length;k<m;k++){n=h[j][k];p=n.name;if(n.checked){g[n.name]=n.value;break}}if(!p in g){g[p]=undefined}}return g}function a(o,f){var p,e,j={},l,k=0,n,h,g,m;for(p in f){e=o[p];if(e&&e[0]&&!e.options){f[p]=f[p]&&f[p].push?f[p]:[f[p]];j.radios=[];j.checkboxesSelects=[];j.multiSelects=[];j.other=[];for(k=0;e[k];k++){m=e[k].type;if(m=="radio"){l="radios"}else{if(m=="select-one"||m=="checkbox"){l="checkboxesSelects"}else{if(m=="select-multiple"){l="multiSelects"}else{l="other"}}}j[l][j[l].length]=e[k]}for(k=0;j.multiSelects[k];k++){f[p]=c(j.multiSelects[k],f[p])}for(k=0;j.checkboxesSelects[k];k++){c(j.checkboxesSelects[k],"");for(n=0,h=f[p].length;n<h;n++){if(c(j.checkboxesSelects[k],f[p][n])){f[p].slice(n,1);break}}}for(k=0;j.radios[k];k++){j.radios[k].checked=false;g=false;for(n=0,h=f[p].length;n<h;n++){if(c(j.radios[k],f[p][n])){f[p].slice(n,1);g=true;break}if(g){break}}}for(k=0;j.other[k]&&f[p][k]!==undefined;k++){c(j.other[k],f[p][k])}}else{if(e&&e.nodeName){c(e,f[p])}}}}function c(l,j){var h=0,m,k=0,e,n,f;if(l.type=="select-one"){for(m=l.options.length;h<m;h++){if(l.options[h].value==j){l.selectedIndex=h;return true}}return false}else{if(l.type=="select-multiple"){var g=!!j.push;for(h=0,m=l.options.length;h<m;h++){n=l.options[h];f=n.value;if(g){n.selected=false;for(e=j.length;k<e;k++){if(f==j[k]){n.selected=true;j.splice(k,1);break}}}else{return n.selected=j==f}}return false}else{if(l.type=="radio"||l.type=="checkbox"){l.checked=j==l.value;return j==l.value}else{l.value=j;return true}}}}return function(){var j=arguments,e=j[0],f=this,h=0,g=f.length;if(j.length===0){return f[0].nodeName=="FORM"?d(f[0]):b(f[0])}if(f[0].nodeName=="FORM"){if(!typeof e=="object"){throw"value for FORM must be object"}a(f[0],e)}else{for(;h<g;h++){c(f[h],e)}}return f}}(),slice:function(){return new aj.NodeList().push(Array.prototype.slice.apply(this,arguments))},sort:function(b){var c=this,d=0,a;if(!c.length){return c}if(!b){if(typeof c[0].sourceIndex=="number"){b=function(e,f){return e.sourceIndex-f.sourceIndex}}else{if(c[0].compareDocumentPosition){b=function(e,f){return 3-(e.compareDocumentPosition(f)&6)}}else{a=aC("*",[a5]);for(;a[d];d++){a[d]._sourceIndex=d}b=function(e,f){return e._sourceIndex-f._sourceIndex}}}}return aj.get([].sort.call(c,b))},filter:function(b){var e=[],a=0,d=0,c=this.length;for(;d<c;d++){if(b.apply(this[d],[d])){e[a++]=this[d]}}return aj.get(e)},children:function(){var f=[],b=0,e=0,a=0,c=this.length,d;for(;e<c;e++){f=f.concat(be(this[e]))}return aj.get(f)},parent:function(){var d=[],a=0,c=0,b=this.length;for(;c<b;c++){d[a++]=this[c].parentNode}return aj.get(bc(d))},ancestors:function(){var e=[],a=0,d=0,c=this.length,b;while(d<c){b=this[d].parentNode;while(b&&b.nodeType==1){e[a++]=b;b=b.parentNode}d++}return aj.get(bc(e))},wrap:function(b){var c=this.length,a,d,e;if(typeof b=="string"){e=aj.create(b)}else{e=aj.get(b)}for(i=0;i<c;i++){d=e[0];while(d){a=aH(d);if(a){d=a}else{break}}if(this[i].parentNode){e.insertBefore(this[i])}if(i!=c-1){e=e.clone()}d.appendChild(this[i])}return this},unwrap:function(){var c,a=this.parent(),b=a.length;for(i=0;i<b;i++){c=a.slice(i,i+1);if(!c[0].parentNode){c.children().remove();c.destroy()}else{c.children().insertBefore(c);c.destroy()}}return this},next:function(){return a0(this,"next")},prev:function(){return a0(this,"previous")},is:function(f){var e=aX.dom.get(f),c=0,b=this.length,d,a;node:for(;c<b;c++){for(d=0,a=e.length;d<a;d++){if(this[c]==e[d]){continue node}}return false}return true},text:function(){var a=arguments,d=0,b=this,c=b.length;if(a.length>0){for(;d<c;d++){b[d].innerHTML="";b[d].appendChild(a5.createTextNode(a[0]))}return b}return b[0].innerText||b[0].textContent==undefined?a4(b[0]):b[0].textContent},empty:function(){var b=0,a=this.length;for(;b<a;b++){while(this[b].firstChild){this[b].removeChild(this[b].firstChild)}}return this},remove:function(){for(var b=this,d=0,c=b.length,a;d<c;d++){if(a=b[d].parentNode){a.removeChild(b[d])}}return b},destroy:function(){this.get("*").push(this).removeData();this.appendTo(at);at.innerHTML="";Array.prototype.splice.call(this,0,this.length);return this},clone:function(b){var e=[],c=this.length,a,d;eventIdProp="__eventId"+aX.UID;if(c===0){return new aj.NodeList()}while(c--){e[c]=this[c].cloneNode(true)}a=aj.get(e).get("*").push(e);if(aV&&!aw(e[0])){c=a.length;while(c--){a[c][eventIdProp]=null}}d=this.get("*").push(this);c=a.length;while(c--){a[c].removeAttribute(aB);aX.dom.get(a[c]).data(aX.dom.get(d[c]).data())}if(b){if(!aX.events){throw"glow.events required to clone event listeners"}aX.events._copyListeners(this.get("*").push(this),a||aj.get(e).get("*").push(e))}return aj.get(e)},html:function(a){var c=0,b=this.length;if(a!==undefined){return this.empty().append(a.toString())}return this[0]?this[0].innerHTML:""},width:function(a){if(a==undefined){return ba(this[0],"width")}a7(this,a,"width");return this},height:function(a){if(a==undefined){return ba(this[0],"height")}a7(this,a,"height");return this},scrollLeft:function(a){return a9(this,true,a)},scrollTop:function(a){return a9(this,false,a)},show:function(){var c=0,d=this.length,a,b;for(;c<d;c++){a=aj.get(this[c]);b=a[0].style;if(a.css("display")=="none"){b.display="";b.visibility="visible";if(a.css("display")=="none"){b.display="block"}}}return this},hide:function(){return this.css("display","none").css("visibility","hidden")},css:function(a,e){var f=this,c,g=0,b=f.length,d=a;if(a.constructor===Object){for(style in a){this.css(style,a[style])}return f}else{if(e!=undefined){a=al(a);for(;g<b;g++){c=f[g].style;if(typeof e=="number"&&aM.test(d)){e=e.toString()+"px"}if(a=="opacity"&&a3.ie){c.zoom="1";if(e===""){c.filter=""}else{c.filter="alpha(opacity="+Math.round(Number(e,10)*100)+")"}}else{c[a]=e}}return f}else{if(!b){return}return r(f[0],a)}}},offset:function(){var e=this[0],g={x:aN(window,true),y:aN(window,false)};if(!aX.env.webkit&&e.getBoundingClientRect){var c=e.getBoundingClientRect();return{top:c.top+g.y-aE.clientTop,left:c.left+g.x-aE.clientLeft}}else{var d=e.offsetTop,a=e.offsetLeft,j=e,b,f=false,h=e;while(e=e.offsetParent){a+=e.offsetLeft;d+=e.offsetTop;if(r(e,"position")=="fixed"){f=true}if(a3.gecko||a3.webkit>500){a+=parseInt(r(e,"border-left-width"))||0;d+=parseInt(r(e,"border-top-width"))||0}if(e.nodeName.toLowerCase()!="body"){h=e}}e=j;while((e=e.parentNode)&&(e!=am)&&(e!=aE)){a-=e.scrollLeft;d-=e.scrollTop;if(a3.gecko&&r(e,"overflow")!="visible"){a+=parseInt(r(e,"border-left-width"));d+=parseInt(r(e,"border-top-width"))}}if(f){a+=g.x;d+=g.y}if((a3.webkit<500&&(f||r(h,"position")=="absolute"))||(a3.gecko&&r(h,"position")!="absolute")){a-=am.offsetLeft;d-=am.offsetTop}return{left:a,top:d}}},position:function(){var h=aj.get(aF(this[0])),b=!!h[0],d=parseInt(this.css("margin-left"))||0,e=parseInt(this.css("margin-top"))||0,f=(b&&parseInt(h.css("border-left-width")))||0,c=(b&&parseInt(h.css("border-top-width")))||0,a=this.offset(),g=b?h.offset():{top:0,left:0};return{left:a.left-g.left-d-f,top:a.top-g.top-e-c}},append:function(b){var c=this,f=0,e=1,d=c.length,a;if(d==0){return c}a=typeof b=="string"?a1(av(b)):b.nodeType?[b]:a1(b);for(;a[f];f++){c[0].appendChild(a[f])}for(;e<d;e++){for(f=0;a[f];f++){c[e].appendChild(a[f].cloneNode(true))}}return c},prepend:function(a){var d=this,g=0,f=1,e=d.length,c,b;if(e==0){return d}c=typeof a=="string"?a1(av(a)):a.nodeType?[a]:a1(a);b=d[0].firstChild;for(;c[g];g++){d[0].insertBefore(c[g],b)}for(;f<e;f++){b=d[f].firstChild;for(g=0;c[g];g++){d[f].insertBefore(c[g].cloneNode(true),b)}}return d},appendTo:function(a){if(!(a instanceof aj.NodeList)){a=aj.get(a)}a.append(this);return this},prependTo:function(a){if(!(a instanceof aj.NodeList)){a=aj.get(a)}a.prepend(this);return this},after:function(a){var b=this,d=b.length,g,h,f,e=1,c;if(d==0){return b}g=typeof a=="string"?aj.create(a):a instanceof aj.NodeList?a:aj.get(a);h=g.length;for(f=h-1;f>=0;f--){b[0].parentNode.insertBefore(g[f],b[0].nextSibling)}for(;e<d;e++){c=g.clone();for(f=h-1;f>=0;f--){b[e].parentNode.insertBefore(c[f],b[e].nextSibling)}}return b},before:function(a){var b=this,d=b.length,f=0,e=1,g,h,c;if(d==0){return b}g=typeof a=="string"?aj.create(a):a instanceof aj.NodeList?a:aj.get(a);h=g.length;for(;f<h;f++){b[0].parentNode.insertBefore(g[f],b[0])}for(;e<d;e++){c=g.clone();for(f=0;f<h;f++){b[e].parentNode.insertBefore(c[f],b[e])}}return b},insertAfter:function(a){if(!(a instanceof aj.NodeList)){a=aj.get(a)}a.after(this);return this},insertBefore:function(a){if(!(a instanceof aj.NodeList)){a=aj.get(a)}a.before(this);return this},replaceWith:function(a){if(a3.webkit<500){this.after(ay).remove();aj.get("u.glow-placeholder").after(a).remove()}else{this.after(a).remove()}return this},data:function(e,d){if(typeof e==="object"){for(var b in e){this.data(b,e[b])}return this}var a,c;switch(arguments.length){case 0:if(this[0]===undefined){return undefined}a=this[0][aB]||aG++;return ax[a]||(ax[a]={});case 1:if(this[0]===undefined){return undefined}a=this[0][aB];return a?ax[a][e]:undefined;case 2:for(var f=this.length;f--;){c=this[f];if(!(a=c[aB])){a=aG++;c[aB]=a;ax[a]={}}ax[a][e]=d}return this;default:throw new Error("glow.dom.NodeList#data expects 2 or less arguments, not "+arguments.length+".")}},removeData:function(d){var b,e=this.length,a;while(e--){b=this[e];a=b[aB];if(a!==undefined){switch(arguments.length){case 0:ax[a]=undefined;b[aB]=undefined;try{delete b[aB]}catch(c){b.removeAttribute&&b.removeAttribute(aB)}break;case 1:ax[a][d]=undefined;delete ax[a][d];break;default:throw new Error("glow.dom.NodeList#removeData expects 1 or less arguments, not "+arguments.length+".")}}}return this},get:function(){function h(u){if(aO[u]){return aO[u]}var p=[],q=0,o,t,m,k,s,v,n=true,l=u;while(u&&u!=v){t="";m="";v=u;if(k=aZ.combinator.exec(u)){o=k[1];u=u.slice(k[0].length)}if(k=aZ.tagName.exec(u)){t=k[1];u=u.slice(k[0].length)}if(k=aZ.classNameOrId.exec(u)){if(k[1]=="#"){m=k[2];u=u.slice(k[0].length)}}if(!o){if(m&&n){p[q++]=[f,[m.replace(/\\/g,""),t||"*",null]]}else{p[q++]=[aC,[t||"*",null]];if(m){p[q++]=[c,[m.replace(/\\/g,""),null]]}}}else{if(o==">"){p[q++]=[g,[null]];if(m){p[q++]=[c,[m.replace(/\\/g,""),null]]}if(t&&t!="*"){p[q++]=[b,[t,null]]}}}s=true;while(s){if(u.charAt(0)=="#"||u.charAt(0)=="."){if(k=aZ.classNameOrId.exec(u)){if(u.charAt(0)=="#"){p[q++]=[c,[k[2].replace(/\\/g,""),null]]}else{p[q++]=[d,[k[2].replace(/\\/g,""),null]]}u=u.slice(k[0].length)}else{throw new Error("Invalid Selector "+l)}}else{s=false}}n=false}if(u!==""){throw new Error("Invalid Selector "+l)}return aO[u]=p}function e(l,n){var o=n;for(var k=0,m=l.length;k<m;k++){l[k][1][l[k][1].length-1]=o;o=l[k][0].apply(this,l[k][1])}return o}function f(o,k,n){var p=[],q=0,l=[],s=0,u;for(var t=0,m=n.length;t<m;t++){if(n[t].getElementById){u=n[t].getElementById(o);if(u&&(u.tagName==k.toUpperCase()||k=="*"||u.tagName==k)){p[q++]=u}}else{l[s++]=n[t]}}if(l[0]){l=aC(k,l);l=c(o,l)}return p.concat(l)}function g(n){var m=[],k=0,l=n.length;for(;k<l;k++){ao(m,be(n[k]))}return m}function c(m,k){for(var l=0,n=k.length;l<n;l++){if(k[l].id==m){return[k[l]]}}return[]}function b(o,p){var m=[],l=0;for(var k=0,n=p.length;k<n;k++){if(p[k].tagName==o.toUpperCase()||p[k].tagName==o){m[l++]=p[k]}}return m}function d(o,p){var m=[],l=0;for(var k=0,n=p.length;k<n;k++){if((" "+p[k].className+" ").indexOf(" "+o+" ")!=-1){m[l++]=p[k]}}return m}function j(m,q){var p;var n=[];var o=m.split(",");for(var k=0,l=o.length;k<l;k++){p=h(aX.lang.trim(o[k]));n=n.concat(e(p,q))}return n}function a(k,o){k=k.length?k:[k];var n=[];var l;for(var p=0;k[p];p++){l=aX.dom.get(k[p]);for(var m=0;o[m];m++){if(l.isWithin(o[m])){n[n.length]=l[0];break}}}return n}return function(m){if(!this.length){return this}var n=[];for(var k=0,l=arguments.length;k<l;k++){if(typeof arguments[k]=="string"){n=n.concat(j(arguments[k],this))}else{n=n.concat(a(arguments[k],this))}}return aX.dom.get(bc(n))}}()};ay=aj.create('<u class="glow-placeholder"></u>');aX.dom=aj}});(window.gloader||glow).module({name:"glow.events",library:["glow","1.7.3"],depends:[["glow","1.7.3","glow.dom"]],builder:function(af){var aj=af.dom.get;var aa={};var P=1;var ah=1;var ag={};var ar={};var ae={};var ai="__eventId"+af.UID;var am=ai+"PreventDefault";var V=ai+"StopPropagation";var X={};var an=1;var ac={};var L={};var T=1;var ap=2;var Z=4;var al={TAB:"\t",SPACE:" ",ENTER:"\n",BACKTICK:"`"};var r={"96":223};var W={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 O={};for(var R in W){O[""+W[R]]=R}var N="0123456789=;'\\/#,.-";function Y(c){var d=L[c];if(!d){return false}var e=ac[d];if(!e){return false}for(var a=0,b=e.length;a<b;a++){if(e[a][0]==c){e.splice(a,1);return true}}return false}function ad(a){X[a]=aa.addListener(document,"key"+a,function(d){var f=0;if(d.ctrlKey){f+=T}if(d.altKey){f+=ap}if(d.shiftKey){f+=Z}var e=d.chr?d.chr.toLowerCase():d.key?d.key.toLowerCase():d.keyCode;var h=f+":"+e+":"+a;var g=ac[h]?ac[h].slice(0):[];if(d.shiftKey){var c=(f&~Z)+":"+e+":"+a;if(ac[c]){for(var j=0,b=ac[c].length;j<b;j++){g[g.length]=ac[c][j]}}}if(!g){return}for(var j=0,b=g.length;j<b;j++){if(g[j][2].call(g[j][3]||this,d)===false){d.preventDefault()}}return !d.defaultPrevented()})}function Q(){var a;for(a in ar){aa.removeListener(a)}}var ab;var M,ao;function U(e,f,a){var c;a=!!a;if(af.env.opera){if(f.toLowerCase()=="resize"&&!M&&e==window){M=aa.addListener(window.document.body,"resize",function(h){aa.fire(window,"resize",h)})}else{if(f.toLowerCase()=="scroll"&&!ao&&e==window){ao=aa.addListener(window.document,"scroll",function(h){aa.fire(window,"scroll",h)})}}}var b=function(h){if(!h){h=window.event}var j=new aa.Event(),k=f.toLowerCase();j.nativeEvent=h;j.source=h.target||h.srcElement;j.relatedTarget=h.relatedTarget||(k=="mouseover"?h.fromElement:h.toElement);j.button=af.env.ie?(h.button&1?0:h.button&2?2:1):h.button;if(h.pageX||h.pageY){j.pageX=h.pageX;j.pageY=h.pageY}else{if(h.clientX||h.clientY){j.pageX=h.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;j.pageY=h.clientY+document.body.scrollTop+document.documentElement.scrollTop}}if(k=="mousewheel"){j.wheelDelta=h.wheelDelta?h.wheelDelta/120:h.detail?-h.detail/3:0;if(j.wheelDelta==0){return}}if(k.indexOf("key")!=-1){j.altKey=!!h.altKey;j.ctrlKey=!!h.ctrlKey;j.shiftKey=!!h.shiftKey;if(f=="keydown"){ab=h.keyCode}j.charCode=h.keyCode&&h.charCode!==0?undefined:h.charCode;if(k=="keypress"){if(typeof(j.charCode)=="undefined"){j.charCode=h.keyCode}if(af.env.opera&&j.charCode&&j.charCode==ab&&N.indexOf(String.fromCharCode(j.charCode))==-1){j.charCode=undefined;j.keyCode=ab}}if(j.charCode&&j.charCode<=49){j.charCode=undefined}if(j.charCode){j.chr=String.fromCharCode(j.charCode)}else{if(h.keyCode){j.charCode=undefined;j.keyCode=r[h.keyCode.toString()]||h.keyCode;j.key=O[j.keyCode];if(al[j.key]){j.chr=al[j.key];j.charCode=j.chr.charCodeAt(0)}}}if(j.chr){j.capsLock=j.chr.toUpperCase()!=j.chr?j.shiftKey:j.chr.toLowerCase()!=j.chr?!j.shiftKey:undefined}}aa.fire(this,f,j);if(j.defaultPrevented()){return false}};if(e.addEventListener&&(!af.env.webkit||af.env.webkit>418)){if((f=="focus"||f=="blur")&&(af.env.opera)){e.parentNode.addEventListener(f,function(){},true)}e.addEventListener(f.toLowerCase()=="mousewheel"&&af.env.gecko?"DOMMouseScroll":f,b,a)}else{var g="on"+f;var d=e[g];if(d){e[g]=function(){var j=d.apply(this,arguments),h=b.apply(this,arguments);return(j!==false)&&(h!==false)}}else{e[g]=b}}e=null}function at(e,d){var c=aj(e),b=d?"mouseout":"mouseover",a=d?"mouseleave":"mouseenter";aa.addListener(e,b,function(f){var g=aj(f.relatedTarget);if(!g.eq(c)&&!g.isWithin(c)){return !aa.fire(c[0],a,f).defaultPrevented()}})}aa._copyListeners=function(b,d){var h=b.length,e,c,a,f,g;while(h--){if(b[h][ai]){e=ag[b[h][ai]];for(c in e){a=0;f=e[c].length;for(;a<f;a++){g=e[c][a];aa.addListener(d[h],c,g[2],g[3])}}}}};aa.addListener=function(e,l,b,j){var d=false;if(!e){throw"no attachTo paramter passed to addListener"}if(typeof e=="string"){if(!af.dom){throw"glow.dom must be loaded to use a selector as the first argument to glow.events.addListener"}e=aj(e)}if(af.dom&&e instanceof af.dom.NodeList){var c=[],f=e.length;while(f--){c[f]=aa.addListener(e[f],l,b,j)}return c}var k;if(!(k=e[ai])){k=e[ai]=ah++}var g=P++;var h=[k,l,b,j,g];ar[g]=h;var a=ag[k];if(!a){a=ag[k]={}}var m=a[l];if(!m){m=a[l]=[]}m[m.length]=h;if((e.addEventListener||e.attachEvent)&&!ae[k+":"+l]){switch(l){case"mouseenter":at(e,false);return g;case"mouseleave":at(e,true);return g;case"focus":if(af.env.ie){aq(e,true);return g}else{d=true}break;case"blur":if(af.env.ie){aq(e,false);return g}else{d=true}break}U(e,l,d);ae[k+":"+l]=true}return g};function aq(d,c){var b=c?"focusin":"focusout",a=c?"focus":"blur";aa.addListener(d,b,function(e){return !aa.fire(d,a,e).defaultPrevented()})}aa.removeListener=function(d){if(d&&d.toString().indexOf("k:")!=-1){return Y(d)}if(d instanceof Array){var a=d.length;while(a--){aa.removeListener(d[a])}return true}var e=ar[d];if(!e){return false}delete ar[d];var f=ag[e[0]][e[1]];for(var a=0,b=f.length;a<b;a++){if(f[a]==e){f.splice(a,1);break}}if(!f.length){delete ag[e[0]][e[1]]}var c=false;for(var a in ag[e[0]]){c=true;break}if(!c){delete ag[e[0]]}return true};aa.removeAllListeners=function(c){var f,g,d=[],e=0,b,a;if(typeof c=="string"){c=aj(c)}if(c instanceof Array||c instanceof af.dom.NodeList){f=c.length;while(f--){aa.removeAllListeners(c[f])}return aa}g=c[ai];if(!g){return aa}a=ag[g];for(b in a){f=a[b].length;while(f--){d[e++]=a[b][f][4]}}if(d.length){aa.removeListener(d)}return aa};aa.fire=function(b,a,c){if(!b){throw"glow.events.fire: required parameter attachedTo not passed (name: "+a+")"}if(!a){throw"glow.events.fire: required parameter name not passed"}if(!c){c=new aa.Event()}if(c.constructor===Object){c=new aa.Event(c)}if(typeof b=="string"){if(!af.dom){throw"glow.dom must be loaded to use a selector as the first argument to glow.events.addListener"}b=aj(b)}c.type=a;c.attachedTo=b;if(!c.source){c.source=b}if(b instanceof af.dom.NodeList){b.each(function(d){S(b[d],c)})}else{S(b,c)}return c};function S(c,d){var j,a,h=a&&a[d.type];(j=c[ai])&&(a=ag[j])&&(h=a[d.type]);if(!h){return d}var g;var b=h.slice(0);for(var f=0,e=b.length;f<e;f++){g=b[f];if(g[2].call(g[3]||c,d)===false){d.preventDefault()}}}var ak=/^((?:(?:ctrl|alt|shift)\+)*)(?:(\w+|.)|[\n\r])$/i;aa.addKeyListener=function(e,f,d,k){f.replace(/^key/i,"");f=f.toLowerCase();if(!(f=="press"||f=="down"||f=="up")){throw"event type must be press, down or up"}if(!X[f]){ad(f)}var h=e.match(ak),c=0,b;if(!h){throw"key format not recognised"}if(h[1].toLowerCase().indexOf("ctrl")!=-1){c+=T}if(h[1].toLowerCase().indexOf("alt")!=-1){c+=ap}if(h[1].toLowerCase().indexOf("shift")!=-1){c+=Z}var a=c+":"+(h[2]?h[2].toLowerCase():"\n")+":"+f;var j="k:"+an++;L[j]=a;var g=ac[a];if(!g){g=ac[a]=[]}g[g.length]=[j,f,d,k];return j};aa.Event=function(a){if(a){af.lang.apply(this,a)}};aa.Event.prototype.preventDefault=function(){if(this[am]){return}this[am]=true;if(this.nativeEvent&&this.nativeEvent.preventDefault){this.nativeEvent.preventDefault();this.nativeEvent.returnValue=false}};aa.Event.prototype.defaultPrevented=function(){return !!this[am]};aa.Event.prototype.stopPropagation=function(){if(this[V]){return}this[V]=true;var a=this.nativeEvent;if(a){a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}};aa.Event.prototype.propagationStopped=function(){return !!this[V]};if(af.env.ie<8||af.env.webkit<500){aa.addListener(window,"unload",Q)}af.events=aa;af.events.listenersByObjId=ag}});(window.gloader||glow).module({name:"glow.data",library:["glow","1.7.3"],depends:[["glow","1.7.3","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.3"],depends:[["glow","1.7.3","glow.data","glow.events"]],builder:function(H){var x={XML_ERR:"Cannot get response as XML, check the mime type of the data",POST_DEFAULT_CONTENT_TYPE:"application/x-www-form-urlencoded;"},w=/\+xml$/,A=[],K="c",B="_"+H.UID+"loadScriptCbs",I=H.dom.get,M=H.events,J=function(){},F=1;function y(){if(window.ActiveXObject){return(y=function(){return new ActiveXObject("Microsoft.XMLHTTP")})()}else{return(y=function(){return new XMLHttpRequest()})()}}function L(a){var b=H.lang.apply({onLoad:J,onError:J,onAbort:J,headers:{},async:true,useCache:false,data:null,defer:false,forceXml:false},a||{});if(!("X-Requested-With" in b.headers)){b.headers["X-Requested-With"]="XMLHttpRequest"}return b}function r(a){return[a,(/\?/.test(a)?"&":"?"),"a",new Date().getTime(),parseInt(Math.random()*100000)].join("")}function G(f,d,e){var h=y(),b=e.data&&(typeof e.data=="string"?e.data:H.data.encodeUrl(e.data)),c,a=new z(h,e);if(!e.useCache){d=r(d)}h.open(f,d,e.async);for(c in e.headers){h.setRequestHeader(c,e.headers[c])}function g(){a.send=J;if(e.async){if(e.timeout){a._timeout=setTimeout(function(){O(a);var k=new N(h,true,a);M.fire(a,"error",k)},e.timeout*1000)}h.onreadystatechange=function(){if(h.readyState==4){a._timeout&&clearTimeout(a._timeout);a.completed=true;var k=new N(h,false,a);if(k.wasSuccessful){M.fire(a,"load",k)}else{M.fire(a,"error",k)}h.onreadystatechange=new Function()}};h.send(b);return a}else{h.send(b);a.completed=true;var j=new N(h,false,a);if(j.wasSuccessful){M.fire(a,"load",j)}else{M.fire(a,"error",j)}return j}}a.send=g;return e.defer?a:g()}var D={};D.get=function(b,a){a=L(a);return G("GET",b,a)};D.post=function(c,b,a){a=L(a);a.data=b;if(!a.headers["Content-Type"]){a.headers["Content-Type"]=x.POST_DEFAULT_CONTENT_TYPE}return G("POST",c,a)};D.send=function(d,c,b,a){b=b||"";a=L(a);a.data=b;return G(d,c,a)};D.put=function(c,b,a){a=L(a);a.data=b;if(!a.headers["Content-Type"]){a.headers["Content-Type"]=x.POST_DEFAULT_CONTENT_TYPE}return G("PUT",c,a)};D.del=function(b,a){a=L(a);return G("DELETE",b,a)};D.loadScript=function(c,e){var b=A.length,d,a=K+b,e=L(e),g=new z(b,e),c=e.useCache?c:r(c),f=window[B]||(window[B]={});if(e.onLoad!=J){f[a]=function(){g._timeout&&clearTimeout(g._timeout);g.completed=true;e.onLoad.apply(this,arguments);g.destroy();d=f[a]=undefined;delete f[a]};c=H.lang.interpolate(c,{callback:B+"."+a})}d=A[b]=document.createElement("script");if(e.charset){d.charset=e.charset}M.addListener(g,"abort",e.onAbort);H.ready(function(){if(e.timeout){g._timeout=setTimeout(function(){O(g);e.onError()},e.timeout*1000)}if(H.env.opera){setTimeout(function(){if(d){d.src=c}},0)}else{d.src=c}document.body.appendChild(d)});return g};function O(b){var c=b.nativeRequest,a=b._callbackIndex;b._timeout&&clearTimeout(b._timeout);if(c){c.onreadystatechange=new Function();c.abort()}else{if(a){window[B][K+a]=J;H.dom.get(A[a]).destroy()}}}function z(d,b){this._timeout=null;this._forceXml=b.forceXml;if(b.forceXml&&d.overrideMimeType){d.overrideMimeType("application/xml")}this.complete=false;if(typeof d=="number"){this._callbackIndex=d}else{this.nativeRequest=d}var a=["Load","Error","Abort"],c=0;for(;c<3;c++){M.addListener(this,a[c].toLowerCase(),b["on"+a[c]])}}z.prototype={send:function(){},abort:function(){if(!this.completed&&!M.fire(this,"abort").defaultPrevented()){O(this)}return this},destroy:function(){var a=this;if(this._callbackIndex!==undefined){setTimeout(function(){I(A[a._callbackIndex]).destroy();A[a._callbackIndex]=undefined;delete A[a._callbackIndex]},0)}return this}};function N(a,c,b){M.Event.call(this);this._request=b;this.nativeResponse=a;this.status=c?408:a.status==1223?204:a.status;this.timedOut=!!c;this.wasSuccessful=(this.status>=200&&this.status<300)||this.status==304||(this.status==0&&a.responseText)}function E(){var a=this.header("Content-Type");return w.test(a)||a===""}H.lang.extend(N,M.Event,{text:function(){return this.nativeResponse.responseText},xml:function(){var a=this.nativeResponse;if((H.env.ie&&E.call(this))||(this._request._forceXml&&!this._request.nativeRequest.overrideMimeType&&window.ActiveXObject)){var b=new ActiveXObject("Microsoft.XMLDOM");b.loadXML(a.responseText);return b}else{if(!a.responseXML){throw new Error(x.XML_ERR)}return a.responseXML}},json:function(a){return H.data.decodeJson(this.text(),{safeMode:a})},header:function(a){return this.nativeResponse.getResponseHeader(a)},statusText:function(){return this.timedOut?"Request Timeout":this.nativeResponse.statusText}});var C=function(c,a,d,b){this.url=c;this.data=a;this.isGet=d;this.opts=b};C.prototype={_send:function(){this._addIframe();this._addForm();this._addTimeout();this.onLoad=this._handleResponse;this._submitForm()},_addIframe:function(){this.iframe=H.dom.create('<iframe style="visibility: hidden; position: absolute; height: 0;"></iframe>');var c=this.iframe[0],b=this,a=function(){if(b.onLoad){b.onLoad()}};if(c.attachEvent){c.attachEvent("onload",a)}else{c.onload=a}I("body").append(this.iframe)},_addForm:function(){var a=this._window().document;if(H.env.ie){a.open();a.write("<html><body></body></html>");a.close()}var b=this.form=a.createElement("form");b.setAttribute("action",this.url);b.setAttribute("method",this.isGet?"GET":"POST");var c=a.getElementsByTagName("body")[0];c.appendChild(b);this._addFormData()},_addFormData:function(){for(var a in this.data){if(!this.data.hasOwnProperty(a)){continue}if(this.data[a] instanceof Array){var c=this.data[a].length;for(var b=0;b<c;b++){this._addHiddenInput(a,this.data[a][b])}}else{this._addHiddenInput(a,this.data[a])}}},_addHiddenInput:function(b,a){var c=this._window().document.createElement("input");c.type="hidden";c.name=b;c.value=a;this.form.appendChild(c)},_window:function(){var a=this.iframe[0];if(a.contentWindow){return a.contentWindow}throw new Error("could not get contentWindow from iframe")},_addTimeout:function(){var a=this;this.timeout=setTimeout(function(){var c;if(a.opts.hasOwnProperty("onTimeout")){try{a.opts.onTimeout()}catch(b){c=b}}a._cleanup();if(c){throw new Error("error in xDomainPost onTimeout callback: "+c)}},(this.opts.timeout||10)*1000)},_handleResponse:function(){var b,c,d=this._window();try{c=d.location.href}catch(a){b=a}if(c!="about:blank"||b){clearTimeout(this.timeout);this.onLoad=this._readHandler;if("_fullBlankUrl" in this.opts){d.location=this.opts._fullBlankUrl}else{d.location=window.location.protocol+"//"+window.location.host+(this.opts.blankUrl||"/favicon.ico")}}},_readHandler:function(){var b;if(this.opts.hasOwnProperty("onLoad")){try{this.opts.onLoad(this._window().name)}catch(a){b=a}}this._cleanup();if(b){throw new Error("error in xDomainPost onLoad callback: "+b)}},_cleanup:function(){this.iframe.remove()},_submitForm:function(){var a=this;this._window().setTimeout(function(){a.form.submit()},0)}};D.xDomainPost=function(c,d,a){var b=new C(c,d,false,a);b._send()};D.xDomainGet=function(c,a){var b=new C(c,{},true,a);b._send()};H.net=D}});(window.gloader||glow).module({name:"glow.tweens",library:["glow","1.7.3"],depends:[],builder:function(c){function d(a){return function(b){return 1-a(1-b)}}c.tweens={linear:function(){return function(a){return a}},easeIn:function(a){a=a||2;return function(b){return Math.pow(1,a-1)*Math.pow(b,a)}},easeOut:function(a){return d(this.easeIn(a))},easeBoth:function(a){return this.combine(this.easeIn(a),this.easeOut(a))},overshootIn:function(a){return d(this.overshootOut(a))},overshootOut:function(a){a=a||1.70158;return function(b){if(b==0||b==1){return b}return((b-=1)*b*((a+1)*b+a)+1)}},overshootBoth:function(a){return this.combine(this.overshootIn(a),this.overshootOut(a))},bounceIn:function(){return d(this.bounceOut())},bounceOut:function(){return function(a){if(a<(1/2.75)){return 7.5625*a*a}else{if(a<(2/2.75)){return(7.5625*(a-=(1.5/2.75))*a+0.75)}else{if(a<(2.5/2.75)){return(7.5625*(a-=(2.25/2.75))*a+0.9375)}else{return(7.5625*(a-=(2.625/2.75))*a+0.984375)}}}}},bounceBoth:function(){return this.combine(this.bounceIn(),this.bounceOut())},elasticIn:function(b,a){return d(this.elasticOut(b,a))},elasticOut:function(b,a){return function(h){if(h==0||h==1){return h}if(!a){a=0.3}if(!b||b<1){b=1;var g=a/4}else{var g=a/(2*Math.PI)*Math.asin(1/b)}return b*Math.pow(2,-10*h)*Math.sin((h-g)*(2*Math.PI)/a)+1}},elasticBoth:function(b,a){a=a||0.45;return this.combine(this.elasticIn(b,a),this.elasticOut(b,a))},combine:function(a,b){return function(f){if(f<0.5){return a(f*2)/2}else{return b((f-0.5)*2)/2+0.5}}}}}});(window.gloader||glow).module({name:"glow.anim",library:["glow","1.7.3"],depends:[["glow","1.7.3","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=13,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="";completeHeight=element.slice(i,i+1).height();if(completeHeight===0){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.slice(0,1)!="0"){this.style.height="";if(glow.dom.get(this).height()===0){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){return 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.3"],depends:[["glow","1.7.3","glow.dom","glow.events","glow.anim","glow.net","glow.i18n"]],builder:function(k){var h=k.i18n,l=k.lang.interpolate;h.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}"});k.forms={};k.forms.Form=function(a,b){this.formNode=k.dom.get(a);if(!this.formNode[0]){throw"Could not find form. Possibly run before DOM ready."}this._fields=[];this._result=null;this.opts=b||{};k.events.addListener(this,"validate",this.opts.onValidate||j.defaultFeedback);this._idleTimer=null;this._localeModule=h.getLocaleModule("GLOW_FORMS");var c=this;k.events.addListener(this.formNode,"submit",function(){c.validate("submit");return false})};k.forms.Form.prototype.validate=function(b,a){this.eventName=b||"submit";this._result=new k.forms.ValidateResult(this.eventName);this._result.form=this;this._fieldCur=0;this._testCur=-1;this._fieldName=a;o.call(this)};var o=function(){this._testCur++;if(this._testCur>=this._fields[this._fieldCur]._tests.length){if(!n.call(this)){return}}var b=this._fields[this._fieldCur]._tests[this._testCur];var c;if(b.opts.field){c=this.formNode.val()[b.opts.field]||"";b.isConditional=true}else{c=this.formNode.val()[this._fields[this._fieldCur].name]||""}if(!c.join){c=[c]}var a=function(d){return function(){m.apply(d,arguments)}}(this);b.opts.on=b.opts.on||"submit";if(this._result.eventName&&(" "+b.opts.on+" ").indexOf(" "+this._result.eventName+" ")!=-1){if(this._fieldName&&this._fieldName!=b.name){o.call(this);return}if(typeof k.forms.tests[b.type]!="function"){throw"Unimplemented test: no test exists of type '"+b.type+"'."}b.opts._localeModule=this._localeModule;k.forms.tests[b.type](c,b.opts,a,this.formNode.val())}else{o.call(this)}};var n=function(){this._fieldCur++;this._testCur=0;if(this._fieldCur>=this._fields.length){this._fieldCur=0;k.events.fire(this,"validate",this._result);if(this.eventName=="submit"&&this._result&&!this._result.defaultPrevented()){try{this.formNode[0].submit()}catch(a){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 m=function(b,a){if(typeof b=="boolean"){b=(b)?k.forms.PASS:k.forms.FAIL}if(this._fields[this._fieldCur]._tests[this._testCur].isConditional&&b===k.forms.FAIL){b=k.forms.SKIP}this._result.fields.push({name:this._fields[this._fieldCur].name,result:b,message:a});if(b!==k.forms.PASS){if(b===k.forms.FAIL){this._result.errorCount++}this._testCur=this._fields[this._fieldCur]._tests.length}o.call(this)};k.forms.Form.prototype.addTests=function(a){var b={name:a,_tests:[]};var t=function(p){return function(){p.validate.apply(p,["change",a])}}(this);var e=function(p){return function(){p.validate.apply(p,["click",a])}}(this);var d=function(p){return function(){p.validate.apply(p,["idle",a])}}(this);for(var g=1;g<arguments.length;g++){var s=arguments[g][0];var c=(arguments[g].length>1)?arguments[g][1]:{};b._tests.push({name:a,type:s,opts:c});if(!t.added&&(" "+c.on+" ").indexOf(" change ")!=-1){var f=this.formNode.get("*").each(function(p){if(this.name==a){k.events.addListener(this,"change",t);t.added=true}})}if(!e.added&&(" "+c.on+" ").indexOf(" click ")!=-1){var f=this.formNode.get("*").each(function(p){if(this.name==a){k.events.addListener(this,"click",e);e.added=true}})}if(!d.added&&(" "+c.on+" ").indexOf(" idle ")!=-1){var u=(typeof c.delay!="undefined")?parseInt(c.delay):1000;var f=this.formNode.get("*").each(function(p){if(this.name==a){k.events.addListener(this,"keyup",function(q){return function(){window.clearTimeout(this.idleTimeoutID);if(this.value){this.idleTimeoutID=window.setTimeout(d,q)}}}(u));k.events.addListener(this,"blur",function(){window.clearTimeout(this.idleTimeoutID)});d.added=true}})}}this._fields.push(b);return this};k.forms.ValidateResult=function(a){k.events.Event.apply(this);this.eventName=a;this.errorCount=0;this.value=undefined;this.fields=[]};k.lang.extend(k.forms.ValidateResult,k.events.Event);k.forms.PASS=1;k.forms.FAIL=0;k.forms.SKIP=-1;k.forms.tests={required:function(d,a,f){var b=a.message||a._localeModule.TEST_MESSAGE_REQUIRED;for(var c=0,e=d.length;c<e;c++){if(/^\s*$/.test(d[c])){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},isNumber:function(d,a,f){var b=a.message||a._localeModule.TEST_MESSAGE_IS_NUMBER;for(var c=0,e=d.length;c<e;c++){if(d[c]==""||isNaN(d[c])){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},min:function(d,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_MIN,{arg:a.arg});for(var c=0,e=d.length;c<e;c++){if(Number(d[c])<Number(a.arg)){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},max:function(d,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_MAX,{arg:a.arg});for(var c=0,e=d.length;c<e;c++){if(Number(d[c])>Number(a.arg)){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},range:function(c,g,f){var q=g.arg.split("..");if(typeof q[0]=="undefined"||typeof q[1]=="undefined"){throw"Range test requires a parameter like 0..10."}var a=g.message||l(g._localeModule.TEST_MESSAGE_RANGE,{min:q[0],max:q[1]});q[0]*=1;q[1]*=1;if(q[0]>q[1]){var d=q[0];q[0]=q[1];q[1]=d}for(var b=0,e=c.length;b<e;b++){if(c[b]<q[0]||c[b]>q[1]){f(k.forms.FAIL,a);return}}f(k.forms.PASS,a)},minCount:function(e,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_MIN_COUNT,{arg:a.arg});var c=0;for(var d=0;d<e.length;d++){if(e[d]!=""){c++}}if(c<a.arg){f(k.forms.FAIL,b);return}f(k.forms.PASS,b)},maxCount:function(e,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_MAX_COUNT,{arg:a.arg});var c=0;for(var d=0;d<e.length;d++){if(e[d]!=""){c++}}if(c>a.arg){f(k.forms.FAIL,b);return}f(k.forms.PASS,b)},count:function(e,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_COUNT,{arg:a.arg});var c=0;for(var d=0;d<e.length;d++){if(e[d]!=""){c++}}if(c!=a.arg){f(k.forms.FAIL,b);return}f(k.forms.PASS,b)},regex:function(d,g,f){var a=g.message||g._localeModule.TEST_MESSAGE_REGEX;var b=(typeof g.arg=="string")?new RegExp(g.arg):g.arg;for(var c=0,e=d.length;c<e;c++){if(!b.test(d[c])){f(k.forms.FAIL,a);return}}f(k.forms.PASS,a)},minLen:function(d,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_MIN_LEN,{arg:a.arg});for(var c=0,e=d.length;c<e;c++){if(d[c].length<a.arg){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},maxLen:function(d,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_MAX_LEN,{arg:a.arg});for(var c=0,e=d.length;c<e;c++){if(d[c].length>a.arg){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},isEmail:function(d,a,f){var b=a.message||a._localeModule.TEST_MESSAGE_IS_EMAIL;for(var c=0,e=d.length;c<e;c++){if(!/^\s*[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\s*$/i.test(d[c])){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},sameAs:function(d,q,f,g){var a=q.message||l(q._localeModule.TEST_MESSAGE_SAME_AS,{arg:q.arg});var c=g[q.arg];for(var b=0,e=d.length;b<e;b++){if(d[b]!=c){f(k.forms.FAIL,a);return}}f(k.forms.PASS,a)},ajax:function(c,s,b,d){var e={},a=(s.message||s._localeModule.TEST_MESSAGE_AJAX);for(var g in d){if(typeof d[g]=="string"){e[g]=escape(d[g])}else{if(typeof d[g].push!="undefined"){e[g]=k.lang.map(d[g],function(q){return escape(q)}).join(",")}}}var p=k.lang.interpolate(s.url,e);var f=k.net.get(p,{onLoad:function(r){var q=s.arg(r);if(typeof q.push=="undefined"){q=[q,a]}b(q[0],q[1])},onError:function(q){alert("Error getting file: "+p)}})},custom:function(c,b,a){b.arg.apply(this,arguments)},is:function(d,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_IS,{arg:a.arg});for(var c=0,e=d.length;c<e;c++){if(d[c]!=a.arg){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)},isNot:function(d,a,f){var b=a.message||l(a._localeModule.TEST_MESSAGE_IS_NOT,{arg:a.arg});for(var c=0,e=d.length;c<e;c++){if(d[c]==a.arg){f(k.forms.FAIL,b);return}}f(k.forms.PASS,b)}};var j=k.forms.feedback={};j.defaultFeedback=(function(){var d;function a(){if(!d){d=k.dom.create('<input type="hidden" value="0" name="1.7.3" id="1.7.3" />').appendTo(document.body)}d[0].value++}function b(v){var w=v.fields,g,t,f,u,e;for(u=0,e=w.length;u<e;u++){g=k.dom.get(v.form.formNode[0].elements[w[u].name]);t=k.dom.get("."+w[u].name.replace(/(\W)/g,"\\$1")+"-msgContainer");if(!t[0]&&g.length==1){t=v.form.formNode.get("label").filter(function(){return this.htmlFor==g[0].id})}f=t.get("span.glow-errorMsg");if(w[u].result){f.remove();g.removeClass("glow-invalid")}else{if(t.length){if(!f[0]){t.append((f=k.dom.create('<span class="glow-errorMsg"></span>')))}f.text(w[u].message);g.addClass("glow-invalid")}}}}function c(g){var C=g.fields,z,x,w,e,y,f,B;g.form.formNode.get("div.glow-errorSummary").remove();x=k.dom.create('<div class="glow-errorSummary" tabindex="-1"><ul></ul></div>');w=x.get("ul");for(f=0,B=C.length;f<B;f++){z=k.dom.get(g.form.formNode[0].elements[C[f].name]);e=k.dom.get("."+C[f].name.replace(/(\W)/g,"\\$1")+"-prompt");if(!e[0]&&z.length==1){e=g.form.formNode.get("label").filter(function(){return this.htmlFor==z[0].id})}if(e[0]){e.get("span.glow-errorMsg").remove();y=k.lang.trim(e.text());if(y.slice(-1)==":"){y=y.slice(0,-1)}}else{y=C[f].name.replace(/^\w/,function(p){return p.toUpperCase()})}if(!C[f].result){w.append(k.dom.create("<li></li>").text(y+": "+C[f].message))}}g.form.formNode.prepend(x.css("opacity","0"));k.anim.css(x,"0.5",{opacity:{from:0,to:1}},{tween:k.tweens.easeOut()}).start();try{x[0].focus()}catch(A){}a()}return function(e){if(e.eventName=="submit"){if(!e.errorCount){e.form.formNode.get("div.glow-errorSummary").remove();return}c(e)}setTimeout(function(){b(e)},0);return false}}())}});(window.gloader||glow).module({name:"glow.embed",library:["glow","1.7.3"],depends:[["glow","1.7.3","glow.dom","glow.data","glow.i18n"]],builder:function(u){var t=u.i18n;t.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 F(b){var c="";for(var a in b){if(a.toLowerCase()=="flashvars"&&typeof b[a]=="object"){c+=' FlashVars="'+u.data.encodeUrl(b[a])+'"'}else{c+=" "+a+'="'+b[a]+'"'}}return c}function r(d){var b="",c,a;for(c in d){if(c.toLowerCase()=="flashvars"&&typeof d[c]=="object"){a=u.data.encodeUrl(d[c])}else{a=d[c]}b+='<param name="'+c+'" value="'+a+'" />\n'}return b}function z(b,c){b=b||{};for(var a in c){if(typeof b[a]=="undefined"){b[a]=c[a]}else{if(typeof c[a]=="object"){b[a]=z(b[a],c[a])}}}return b}function E(){var a=(navigator.platform||navigator.userAgent);return a.match(/win/i)?"win":a.match(/mac/i)?"mac":"other"}function w(c){var a=/^WIN (\d+),(\d+),(\d+),\d+$/;var b=c.GetVariable("$version");if($match=a.exec(b)){return{major:parseInt($match[1]),minor:parseInt($match[2]),release:parseInt($match[3]),actual:b}}else{}}function x(){var e,c,b={major:0,minor:0,release:0},f=b;if(u.env.ie){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=w(c)}catch(a){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{c.AllowScriptAccess="always";f=w(c)}catch(a){f={major:6,minor:0,release:29}}}catch(a){}}}else{var d=/^Shockwave Flash\s*(\d+)\.(\d+)\s*\w(\d+)$/;if((c=navigator.plugins["Shockwave Flash"])&&(e=d.exec(c.description))){f={major:parseInt(e[1]),minor:parseInt(e[2]),release:parseInt(e[3]),actual:c.description}}}f.toString=function(){return this.major?[this.major,this.minor,this.release].join("."):t.getLocaleModule("GLOW_EMBED").NO_PLAYER_MESSAGE};return f}var v=x();function B(b){if(typeof b!="object"){var c=String(b).match(/^(\d+)(?:\.(\d+)(?:\.(\d+))?)?$/);if(!c){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')}b={major:parseInt(c[1],10),minor:parseInt(c[2]||0,10),release:parseInt(c[3]||0,10)}}var d=v,a=b;return(d.major>a.major||(d.major==a.major&&d.minor>a.minor)||(d.major==a.major&&d.minor==a.minor&&d.release>=a.release))}var C=u.env.ie?y:A;function A(a,c,b){return'<embed type="application/x-shockwave-flash" src="'+a+'"'+F(c)+F(b)+"></embed>"}function y(a,c,b){return'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+F(c)+'><param name="movie" value="'+a+'" />'+r(b)+"</object>"}var G={},s=0;function D(){return u.UID+"FlashEmbed"+(s++)}G.Flash=function(a,g,b,c){c=z(c,{width:"100%",height:"100%",params:{allowscriptaccess:"always",allowfullscreen:"true",quality:"high"},attributes:{},message:u.lang.interpolate(t.getLocaleModule("GLOW_EMBED").FLASH_MESSAGE,{min:b,installed:v}),id:(c&&c.attributes&&c.attributes.id)||D()});g=u.dom.get(g);if(!g.length){throw new Error("glow.embed.Flash unable to locate container")}this.container=g;this.movie=null;this._displayErrorMessage=typeof c.message=="function"?c.message:function(){return c.message};this.isSupported;if(this.isSupported=B(b)){var f=c.attributes,d=["id","width","height"],e=d.length;while(e--){if(c[d[e]]){f[d[e]]=c[d[e]]}}if(c.className){f["class"]=c.className}this._embed_tag=C(a,f,c.params)}};G.Flash.version=function(){return v};G.Flash.prototype.embed=function(){var a=this.container[0];if(this.isSupported){a.innerHTML=this._embed_tag;this.movie=a.firstChild}else{var b=this._displayErrorMessage();if(b){a.innerHTML=b}}return this};u.embed=G}});(window.gloader||glow).module({name:"glow.dragdrop",library:["glow","1.7.3"],depends:[["glow","1.7.3","glow.tweens","glow.events","glow.dom","glow.anim"]],builder:function(K){var Q=K.events,J=Q.addListener,z=Q.fire,M=Q.removeListener,D=K.dom,L=D.get,H=D.create;var G={},y=1000,S=(document.compatMode=="CSS1Compat"&&K.env.ie>=5)?true:false,r=(document.compatMode!="CSS1Compat"&&K.env.ie>=5)?true:false,P=K.env.ie>=5,C=["top","right","bottom","left"];function R(b,c){var a=b.prototype[c];var d="cached_"+c;b.prototype[c]=function(){if(d in this){return this[d]}return this[d]=a.apply(this,arguments)}}function A(a,c){var b=C.length,d;while(b--){d="margin-"+C[b];a.css(d,c.css(d))}}function N(b,d){var a=b.prototype[d];var c="cached_"+d;b.prototype[d]=function(e){if(!this[c]){this[c]={}}if(e in this[c]){return this[c][e]}return this[c][e]=a.apply(this,arguments)}}function B(a,c){for(var d=0,b=c.length;d<b;d++){delete a["cached_"+c[d]]}}var F=function(a){this.el=a};F.prototype={val:function(a){var b=parseInt(this.el.css(a));return b||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 a=this.el[0],b,c;while(a=a.offsetParent){if(L(a).css("position")!="static"){break}}return a?L(a).offset().top:0},offsetTop:function(){return this.el.position().top},offsetLeft:function(){return this.el.position().left},borderWidth:function(){var a=this.el[0].offsetWidth;if(K.env.khtml){a-=this.val("margin-left")+this.val("margin-right")+this.val("border-left-width")+this.val("border-right-width")}return a},borderHeight:function(){if(this._logicalBottom){return this._logicalBottom-this.offsetTop()}var a=this.el[0].offsetHeight;if(K.env.khtml){a-=this.val("margin-top")+this.val("margin-bottom")+this.val("border-top-width")+this.val("border-bottom-width")}return a},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 E in F.prototype){if(E=="val"){N(F,E)}else{R(F,E)}}K.lang.apply(F.prototype,{resetPosition:function(){B(this,["offsetTop","offsetLeft","borderTopPos","borderLeftPos","innerTopPos","innerLeftPos","verticalCenter","horizontalCenter"])},setLogicalBottom:function(a){this._logicalBottom=a},boundsFor:function(c){var d,b,a=this.el.css("position");if(a!="static"){d=b=0}else{d=this.innerTopPos();b=this.innerLeftPos()}return[d,b+this.width()-c.outerWidth(),d+this.height()-c.outerHeight(),b]},outerBounds:function(){var b=this.el.offset(),c=b.left,a=b.top;return[a,c+this.borderWidth(),a+this.borderHeight(),c]},intersectSize:function(c,a){var d=this.outerBounds(),b=c.outerBounds();if(a){d[1]++;b[1]++;d[2]++;b[2]++}return(d[2]<b[0]?0:b[2]<d[0]?0:d[0]<b[0]?(d[2]<b[2]?d[2]-b[0]:b[2]-b[0]):b[2]<d[2]?b[2]-d[0]:d[2]-d[0])*(d[1]<b[3]?0:b[1]<d[3]?0:d[3]<b[3]?(d[1]<b[1]?d[1]-b[3]:b[1]-b[3]):b[1]<d[1]?b[1]-d[3]:d[1]-d[3])},sizePlaceholder:function(e,c,a,g){var f=new F(e),d=this.el,b=c||d.css("position");e.css("display","none");d.after(e);e.css("width",(d[0].offsetWidth-f.surroundWidth())+"px").css("height",(d[0].offsetHeight-f.surroundHeight())+"px");A(e,d);e.remove();e.css("display","block");if(b!="static"){e.css("left",a+"px");e.css("top",g+"px")}e.css("position",b)},contains:function(c){var e=this.boundsFor(c),b=c.el.position(),d=b.top,a=b.left;return d>=e[0]&&a<=e[1]&&d<=e[2]&&a>=e[3]},containsPoint:function(b){var a=this.el.offset();return b.x>=a.left&&b.y>=a.top&&b.x<=a.left+this.borderWidth()&&b.y<=a.top+this.borderHeight()},positionedAncestorBox:function(){var a=this.el.parent(),b;while(a[0]){b=a.css("position")||"static";if(b=="relative"||b=="absolute"||b=="fixed"){return new F(a)}a=a.parent()}return null}});function O(c){var a=c[0].tagName.toLowerCase()=="li"?"li":"div";var b=H("<"+a+"></"+a+">");if(a=="li"){b.css("list-style-type","none")}return b}G.Draggable=function(a,e){this.element=L(a);this._opts=e=K.lang.apply({dragPrevention:["input","textarea","button","select","option","a"],placeholder:"spacer",placeholderClass:"glow-dragdrop-placeholder",step:{x:1,y:1}},e||{});if(typeof e.step=="number"){e.step={x:e.step,y:e.step}}else{e.step.x=e.step.x||1;e.step.y=e.step.y||1}this._preventDrag=[];for(var d=0,b=e.dragPrevention.length;d<b;d++){this._preventDrag[d]=e.dragPrevention[d].toLowerCase()}if(e.container){this.container=L(e.container)}this._handle=e.handle&&this.element.get(e.handle)||this.element;if(e.dropTargets){this.dropTargets=L(e.dropTargets)}var c=this._listeners=[],d=0;if(e.onDrag){c[d++]=J(this,"drag",this._opts.onDrag,this)}if(e.onEnter){c[d++]=J(this,"enter",this._opts.onEnter,this)}if(e.onLeave){c[d++]=J(this,"leave",this._opts.onLeave,this)}if(e.onDrop){c[d++]=J(this,"drop",this._opts.onDrop,this)}if(e.onAfterDrop){c[d++]=J(this,"afterDrop",this._opts.onAfterDrop,this)}this._dragListener=J(this._handle,"mousedown",this._startDragMouse,this);return};G.Draggable.prototype={_createPlaceholder:function(){var a=this.element,b,c=this._box;if(this._opts.placeholder=="clone"){b=a.clone()}else{b=O(a)}if(this._opts.placeholderClass){b.addClass(this._opts.placeholderClass)}c.sizePlaceholder(b,null,this._startLeft,this._startTop);a.after(b);this._placeholder=b},_removePlaceholder:function(){this._placeholder.remove()},_resetPosition:function(){var h=this._preDragPosition,b=this.element,f=this._box,d=this._startOffset,a=b.css("position"),j,c;f.resetPosition();var e=f.el.position(),g={x:e.left,y:e.top};if(this._placeholder||this._dropIndicator){b.remove()}if(h=="static"&&g.y==d.y&&g.x==d.x){b.css("position","static");b.css("left","");b.css("top","")}else{b.css("z-index",this._preDragZIndex);b.css("position",h=="static"?"relative":h);if(h=="static"){j=g.x-d.x;c=g.y-d.y}else{if(h=="relative"&&a!="relative"){j=this._startLeft+(g.x-d.x);c=this._startTop+(g.y-d.y)}}if(a!=h){b.css("left",j?j+"px":"");b.css("top",c?c+"px":"")}}if(this._dropIndicator){var k=this._dropIndicator.parent()[0];if(k){k.replaceChild(b[0],this._dropIndicator[0])}delete this._dropIndicator;if(this._placeholder){this._placeholder.remove();delete this._placeholder}b.css("position",h);if(h=="relative"&&a!="relative"){b.css("left",this._startLeft);b.css("top",this._startTop)}}else{if(this._placeholder){var k=this._placeholder.parent()[0];if(k){k.replaceChild(b[0],this._placeholder[0])}delete this._placeholder}}},_startDragMouse:function(m){var b=this._preventDrag,k=m.source,f=k.tagName.toLowerCase();for(var p=0,q=b.length;p<q;p++){if(b[p]==f){return}}if(z(this,"drag").defaultPrevented()){return}if(this._dragging==1){return this.endDrag()}else{if(this._dragging){return}}this._dragging=1;var d=this.element,e=this.container,a=this._opts,n=this._box=new F(d),c=a.step;this._preDragPosition=d.css("position");var o=n.el.position(),l=this._startOffset={x:o.left,y:o.top};if(e){this._containerBox=new F(e);this._bounds=this._containerBox.boundsFor(n);if(c.x!=1){this._bounds[3]-=(this._bounds[3]-l.x)%c.x;this._bounds[1]-=(this._bounds[1]-l.x)%c.x}if(c.y!=1){this._bounds[0]-=(this._bounds[0]-l.y)%c.y;this._bounds[2]-=(this._bounds[2]-l.y)%c.y}}else{delete this._bounds}this._mouseStart={x:m.pageX,y:m.pageY};this._preDragStyle=d.attr("style");this._preDragZIndex=d.css("z-index");d.css("z-index",y++);this._startLeft=d[0].style.left?parseInt(d[0].style.left):0;this._startTop=d[0].style.top?parseInt(d[0].style.top):0;if(a.placeholder&&a.placeholder!="none"){this._createPlaceholder()}d.css("position","absolute");d.css("left",l.x+"px");d.css("top",l.y+"px");if(S){this._scrollY=document.documentElement.scrollTop;this._innerHeight=document.documentElement.clientHeight}else{if(r){this._scrollY=document.body.scrollTop;this._innerHeight=document.body.clientHeight}else{this._scrollY=window.scrollY;this._innerHeight=window.innerHeight}}var j=function(){return false},h=document.documentElement;if(this.dropTargets){var g=new Q.Event();g.draggable=this;for(var p=0,q=this.dropTargets.length;p<q;p++){z(this.dropTargets[p],"active",g)}this._mousePos={x:m.pageX,y:m.pageY};this._testForDropTargets()}this._dragListeners=[J(h,"selectstart",j),J(h,"dragstart",j),J(h,"mousedown",j),J(h,"mousemove",this._dragMouse,this),J(h,"mouseup",this._releaseElement,this)];return false},_dragMouse:function(e){var b=this.element,g=this._opts.axis,c=g=="y"?this._startOffset.x:(this._startOffset.x+e.pageX-this._mouseStart.x),f=g=="x"?this._startOffset.y:(this._startOffset.y+e.pageY-this._mouseStart.y),a=this._bounds,d=this._opts.step;if(d.x!=1){c=Math.round((c-this._startOffset.x)/d.x)*d.x+this._startOffset.x}if(d.y!=1){f=Math.round((f-this._startOffset.y)/d.y)*d.y+this._startOffset.y}if(a){if(g!="y"){c=c<a[3]?a[3]:c>a[1]?a[1]:c}if(g!="x"){f=f<a[0]?a[0]:f>a[2]?a[2]:f}}b[0].style.left=c+"px";b[0].style.top=f+"px";if(this.dropTargets){this._mousePos={x:e.pageX,y:e.pageY}}if(P&&e.nativeEvent.button==0){this._releaseElement(e);return false}return false},_testForDropTargets:function(p){if(!this._lock){this._lock=0}if(p){this._lock--}else{if(this.lock){return}}if(this._dragging!=1){return}var l=this.activeTarget,n,c=this.dropTargets,b,v,s=this._box,k=this._mousePos;s.resetPosition();var u=0;for(var j=0,m=c.length;j<m;j++){b=c[j];v=b._box;if(b._opts.tolerance=="contained"){if(v.contains(s)){n=b;break}}else{if(b._opts.tolerance=="cursor"){if(v.containsPoint(k)){n=b;break}}else{var h=v.intersectSize(s,true);if(h>u){u=h;n=b}}}}this.activeTarget=n;if(n!==l){if(n){var o=new Q.Event();o.draggable=this;z(n,"enter",o);var w=new Q.Event();w.dropTarget=n;z(this,"enter",w)}if(l){var t=new Q.Event();t.draggable=this;z(l,"leave",t);var q=new Q.Event();q.dropTarget=l;z(this,"leave",q)}}if(n&&n._opts.dropIndicator!="none"){var e,g=n._childBoxes,U=n._children;s.resetPosition();var d=n._box.innerTopPos();var a=k.y-s.offsetParentPageTop();var f=0;for(var j=0,m=g.length;j<m;j++){if(U[j]==this.element[0]){continue}e=g[j];d+=e.outerHeight();if(a<=d){if(n._dropIndicatorAt!=j){L(e.el).before(n._dropIndicator);n._dropIndicatorAt=j}f=1;break}}if(!f){if(e){L(e.el).after(n._dropIndicator);n._dropIndicatorAt=j+1}else{n.element.append(n._dropIndicator);n._dropIndicatorAt=0}}}this._lock++;var x=this;setTimeout(function(){x._testForDropTargets(1)},100)},_releaseElement:function(){if(this._dragging!=1){return}this._dragging=2;var e,b;var c=this.dropTargets,d=this.activeTarget;if(c){for(e=0,b=c.length;e<b;e++){var g=new Q.Event();g.draggable=this;g.droppedOnThis=d&&d==c[e];z(c[e],"inactive",g)}}if(d){var g=new Q.Event();g.draggable=this;z(d,"drop",g)}var f=this._dragListeners;for(e=0,b=f.length;e<b;e++){Q.removeListener(f[e])}var a=z(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;z(this,"afterDrop")},returnHome:function(h){var f=(h)?h:K.tweens.linear(),c,b,e=this.element,k=this._box.el.position(),g=Math.pow(Math.pow(this._startOffset.x-k.left,2)+Math.pow(this._startOffset.y-k.top,2),0.5),d=0.3+(g/1000);var a=[[K.anim.css(e,d,{left:this._startOffset.x,top:this._startOffset.y},{tween:f})]];if(this._dropIndicator){a.push([K.anim.css(this._dropIndicator,d-0.1,{opacity:{to:0}})])}var j=new K.anim.Timeline(a);J(j,"complete",function(){this.endDrag()},this);j.start();return}};var I=0;G.DropTarget=function(a,b){a=this.element=L(a);if(!a.length){throw"no element passed into DropTarget constuctor"}if(a.length>1){throw"more than one element passed into DropTarget constructor"}this._id=++I;this._opts=b=K.lang.apply({dropIndicator:"none",dropIndicatorClass:"glow-dragdrop-dropindicator",tolerance:"intersect"},b||{});if(b.onActive){J(this,"active",b.onActive)}if(b.onInactive){J(this,"inactive",b.onInactive)}if(b.onEnter){J(this,"enter",b.onEnter)}if(b.onLeave){J(this,"leave",b.onLeave)}if(b.onDrop){J(this,"drop",b.onDrop)}J(this,"active",this._onActive);J(this,"inactive",this._onInactive);return this};G.DropTarget.prototype={setLogicalBottom:function(a){this._logicalBottom=a},_onActive:function(a){var d=a.draggable;this._box=new F(this.element);if(this._logicalBottom){this._box.setLogicalBottom(this._logicalBottom)}if(this._opts.dropIndicator=="none"){return}this._onEnterListener=J(this,"enter",this._onEnter);this._onLeaveListener=J(this,"leave",this._onLeave);this._dropIndicator=O(d.element);if(this._opts.dropIndicatorClass){this._dropIndicator.addClass(this._opts.dropIndicatorClass)}d._box.sizePlaceholder(this._dropIndicator,"relative",0,0);var c=this._children=L(this.element.children()).filter(function(){var e=L(this);return(!a.draggable._placeholder||!e.eq(a.draggable._placeholder))&&(!this._dropIndicator||!e.eq(this._dropIndicator))});var b=this._childBoxes=[];c.each(function(e){b[e]=new F(L(c[e]))})},_onInactive:function(a){M(this._onEnterListener);M(this._onLeaveListener);delete this._box;if(this._opts.dropIndicator=="none"){return}if(!a.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(f){var d=this._dropIndicator,c=new F(d);var e=parseInt(d.css("margin-left"))||0,a=parseInt(d.css("margin-top"))||0,b=c.el.position();f._startOffset={x:b.left,y:b.top};f._dropIndicator=d;delete this._dropIndicator}};K.dragdrop=G}});
+/*@end @*/
diff --git a/ricoClient/js/minsrc/ricoCalendar.js b/ricoClient/js/minsrc/ricoCalendar.js
new file mode 100644 (file)
index 0000000..7978ca1
--- /dev/null
@@ -0,0 +1,549 @@
+/*
+ *  (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
+ *
+ *         h